cancel
Showing results for 
Search instead for 
Did you mean: 

SAPScript - problem with If statement

Former Member
0 Kudos

I have the following statement in a SAPScript but it isn't acting as I envisioned.

/: IF &NAST-KSCHL& EQ 'AN00' OR &NAST-KSCHL& EQ 'ZN01' OR &NAST-KSCHL& EQ 'ZN02'
/: INCLUDE &VBDKA-TDNAME& OBJECT VBBK ID Z006 PARAGRAPH HT
/: ENDIF

What happens is if I have output type AN00 I see the following:

<b>Item | Material Description</b>

AN00 | EQ 'ZN02'

<i>Quotation header text</i>

What I should be seeing is the following:

<b>Item | Material Description</b>

<i>Quotation header text</i>

Why is the AN00 printing as an item number (line number) and EQ 'ZN02' displaying? If preview ZN01 I see the same thing except is has ZN01 instead of AN00 for the item number. If I use output type ZN02 I do not get any output (it does not go into the if statement).

Davis

Message was edited by:

Davis

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Well I have figured out that part of the trouble is the transport is not changing the code in Test. I just did three transports (one right after the other) and none of them did anything to the code in Test although the transport log looks good. At first I thought that it wasn't transporting because I had the form opened in the test system but I just tried it again (this time I was out of the Test system) and it still doesn't make any changes.

Alright now I changed it so I have three if statements and it is working; I am not sure why the code wouldn't change.

Davis

TuncayKaraca
Active Contributor
0 Kudos

@Davis,

I think the code should be like that:

/:IF &NAST-KSCHL& = 'AN00' OR &NAST-KSCHL& = 'ZN01' OR &NAST-KSCHL& = 'AN02'
/:INCLUDE &VBDKA-TDNAME& OBJECT VBBK ID Z006 PARAGRAPH HT
/:ENDIF

Former Member
0 Kudos

Tuncay,

Sorry I wasn't complete in my first post. I have edited it to reflect what the code really looks like. I believe I have figured out the error though; I will know in a few minutes.

Davis