This website is not affiliated with, sponsored by, or approved by SAP AG.

Syntax check deletes all code - resolved

Basis (Basis Technology Modules: Basis Component/System Administration, GUIs)

Moderators: Snowy, thx4allthefish

Syntax check deletes all code - resolved

Postby Eggy » Tue Nov 20, 2012 10:17 am

I've been working on a custom function module for data conversion from a table to an idoc. Yesterday everything worked fine and I'm getting close to the final version.

Now whenever I change a single character and press the syntax check button, almost all code is being deleted and an error message popups up. No way to go back other than leaving the function and not saving.

Image

I've tried removing these lines, adding the expected ',' and other tricks I thought that might help. Unfortunately so far no luck. If I open the function and press the syntax check, it's all ok. If I remove a character and re-enter it (so in the end no real change), it's all gone again.

I realize that this being a 46c system isn't helping, but that's not going to change in the near future. There is no way I can continue development like this, never knowing when your work will be gone. Help!
Last edited by Eggy on Thu Nov 29, 2012 4:00 am, edited 1 time in total.
Eggy
 
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Syntax check deletes all code

Postby Gothmog » Tue Nov 20, 2012 10:44 am

I'll shadow this in Basis, in case someone can help you there, but... :?
Is it occuring for this function module only, or always, or only for function module, or at random ?
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Syntax check deletes all code

Postby Eggy » Fri Nov 23, 2012 9:44 am

Thanks :) it is indeed very strange behavior.

This happens every time now for more functions. I've created a copy of my current one, checked it and activated... no problems. I change and undo, check and everything is gone again.
Eggy
 
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Syntax check deletes all code

Postby Gothmog » Fri Nov 23, 2012 10:31 am

Has some part of the code been copy/pasted from word?
I've seen some word tabulation characters cause problems when executing a program (the line of code was ignored), but never lost all the code as you do.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Syntax check deletes all code

Postby blueteeth » Fri Nov 23, 2012 10:38 am

Intriguing. I'd sit with ABAP guy and try to understand and extend BASIS help. Mails, IMs makes that much difficult for intriguing problems. How about involving your BASIS person? Or perhaps raise a message with SAP?

Cheers,
BT
blueteeth
 
Posts: 499
Joined: Sat Apr 05, 2008 12:22 pm

Re: Syntax check deletes all code

Postby Eggy » Fri Nov 23, 2012 12:46 pm

Nothing was copied, all code is freshly typed by yours truly.

In the end, an OSS message might be the last resort, but I expect the first response to be 'upgrade your d*mn system' ;)
Eggy
 
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Syntax check deletes all code

Postby Eggy » Mon Nov 26, 2012 2:01 am

Fed up with not being able to continue, I made a copy/paste backup into notepad (no chance of shifty coding there) and removed everything related with the entire function group. Created it from scratch again, copied the code back and everything seems to be working again :?

Of course nice to know things are back the way they should, but I'd better save every few minutes to make sure the damage isn't too extensive if it happens again. If it does, I'll let you (and SAP) know :)
Eggy
 
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Syntax check deletes all code

Postby Eggy » Tue Nov 27, 2012 6:10 am

With my functions done, it is time to call them from an older custom program. And surprise surprise, the same kind of error pops up again. This time it's about the character 'E', with which SAP apparently has a problem ;) It's almost as if a new standard for ABAP programs has been introduced to the system without checking/converting the existing programs.

Image
Very old program, comments are in Dutch.

When opening and checking, all is fine. When I change a single character and check, it returns this error. Then when I leave the program and display it again, all coding except for the first REPORT statement is gone. Scared the hell outta me! Luckily the original is in the version history, so I can always revert to the original.

Update:
Trying to figure out exactly what 'E' is the problem, I started messing around with the REPORT statement. It does have something to do with character placement:

Code: Select all
REPORT AQZZ10BA LINE-SIZE 120 NO STANDARD PAGE HEADING
Error is: E

REPORT  AQZZ10BA LINE-SIZE 120 NO STANDARD PAGE HEADING
Error is: ZE

REPORT          AQZZ10BA LINE-SIZE 120 NO STANDARD PAGE HEADING
Error is: LINE-SIZE


This leads me to believe that there indeed has been some change in the system since the creation of the program that invalidates it. As long as there's no change, the system detects it and automatically verifies that the report is ok. As soon as you make a change, the program is reviewed and this error pops up.
Eggy
 
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Syntax check deletes all code

Postby Sharpshooter » Tue Nov 27, 2012 7:57 am

Reports in the "AQxxx" namespace are generated from SAP Query and have some very special checks done on them to detect unforeseen problems that can be introduced by the code generation algorithm. If you wish to modify them, the code should be copied to a program in the customer namespace. Even comment lines can throw errors in the SAP query arena.
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark

Re: Syntax check deletes all code

Postby Eggy » Tue Nov 27, 2012 8:11 am

The REPORT line indeed contains AQZZ10BA, but the report really is ZZZZ10BA. I just checked what happens if I correct that in the statement (just in case SAP checks some query reference), but the error remains.
Eggy
 
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Syntax check deletes all code

Postby thx4allthefish » Tue Nov 27, 2012 9:53 am

Sharpshooter is correct. Reports in the namespace AQ* are treated in a special way by SAP. Every manual intervention will lead to an error on check or generation. If you don't insert your changes via SQ00/01, the outcome can be quite unpredictable.

Also, the AQ-"namespace" is reserved:

Calling a generated query source code (AQ* report) from transaction SE38 or using transaction SE93 can result in errors if the query was not generated after a change or the corresponding program was not found. Calling via the function modules described in Note 393160 avoids these errors or generates the query before the call.
curiousorange wrote:I give up. Humanity isn't worth saving. Why is there never a Vogon Constructor Fleet around when you really need one?
thx4allthefish
 
Posts: 5694
Joined: Sat Oct 26, 2002 6:18 pm
Location: barolo barrel

Re: Syntax check deletes all code

Postby Gothmog » Tue Nov 27, 2012 10:16 am

However, what's written after REPORT seems to have absolutely no effect in SAP nowadays, what matters is the program name in its properties.
I can't count the copied/renamed programs I've seen guilty of identity theft...
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Syntax check deletes all code

Postby Eggy » Tue Nov 27, 2012 10:36 am

The case here is that query AQZZ10BA has been created many years ago. The resulting program has been copied to ZZZZ10BA to be able to make subtle changes in the ABAP. This program has been the basis for AQZZ10BB, AQZZ10BC and several other copies that contain more specific changes. Very nasty, wouldn't have been my choice, but I'm the one who now has to deal with it.

By copying the code to a new custom report, I assume (very tricky thing to do) all links to the original query are broken. Changing the generated query program would result in strange behavior, I get that.
Eggy
 
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Syntax check deletes all code

Postby Eggy » Thu Nov 29, 2012 3:59 am

SAPGui 730 seems to be the source of the problem. I've created a new virtual environment with SAPGui 720 and the error does not occur there. Apparently 730 can not handle all kinds of report from 46c. Strange, but it seems to be so.

Hooray, I can continue working :) Thanks everyone for the help and suggestions!
Eggy
 
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am


Return to Basis

Who is online

Users browsing this forum: No registered users and 5 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.