cancel
Showing results for 
Search instead for 
Did you mean: 

Very strange statement in SAPScript

Former Member
0 Kudos

I see this all through different scripts and reports and I want to know if it is just done as a way to comment out a line or if there is another reason. To me this looks very confusing and is poor programming.

IF &VBDKR-VTWEG& NE &VBDKR-VTWEG&
INCLUDE &TVKO-TXNAM_KOP& OBJECT TEXT ID ADRS
ENDIF

I am assuming that the if statement was constructed as a way to comment out the include. However why would you want to do that rather than just commenting it out (using /*)?

Davis

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi!

In SAPScript, commenting is complicated and the lazy programmers like to use statements like this

/: IF 1 = 2

...

/: ENDIF

What you wrote is the same. If it not a mistype, you can comment it out, or remove it from the source code.

Regards

Tamá

Former Member
0 Kudos

Tamas, thanks for the help. I see this all over the place, even in reports. I assumed that this programmer was just lazy and decided to use comments that way. There is no reason for it, in my opinion, especially when you are writing a report. It would be much easier to code (and read) if they just used an * at the beginning of the line.

Thanks again!

Davis

Nick, thanks for the reply also. I am converting this SAPScript into a SmartForm so I will just be leaving that statement out. This is one of many that I have found in this particular form.

Message was edited by:

Davis

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Davis,

It does look a bit strange I admit. The only benfit of this I can see is that

/: INCLUDE &TVKO-TXNAM_KOP& OBJECT TEXT ID ADRS

and

/* INCLUDE &TVKO-TXNAM_KOP& OBJECT TEXT ID ADRS

look quite similar, and the editor doesn't highlight the comment as such. I personally like as little clutter as possible in the SAPscript text editor and would delete the line rather than comment it out.

Regards,

Nick