cancel
Showing results for 
Search instead for 
Did you mean: 

Sapscript - condition wont work

Former Member
0 Kudos

Hi all,

I appreciate anyone who could help me

We have a sapscript and we have some conde on its 'Page' Windows.

Somehow everytime we execute the report the content of the condition and of the else statement are printed:

C9 Example

/: IF &REGUH-WEFAE& IS INITIAL

C9 ,, &reguh-AUSFD&,,,, &SY-DATUM&,,

/: ELSE

C9 ,, &reguh-WEFAE&,,,, &SY-DATUM&,,

/: ENDIF

Any idea why both lines (the one with reguh-ausfd and wefae) are being printed?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

naimesh_patel
Active Contributor
0 Kudos

Try like this:

/: DEFINE &L_WEFAE& = ' '
C9 Example
/: IF &REGUH-WEFAE& = &L_WEFAE&
C9 ,, &reguh-AUSFD&,,,, &SY-DATUM&,, 
/: ELSE 
C9 ,, &reguh-WEFAE&,,,, &SY-DATUM&,, 
/: ENDIF

Regards,

Naimesh Patel

Answers (1)

Answers (1)

Former Member
0 Kudos

Is this piece of text in the MAIN window? It may be that this text element is being called twice by the print program, the first time REGUH-WEFAE is initial, the second time it is populated.

Regards,

Nick