cancel
Showing results for 
Search instead for 
Did you mean: 

CONDITION WITH INCLUDE

Former Member
0 Kudos

Hello all,

i have a urgent requirement. I need to use a conditional statement along with the include.

if there is text in my include statement then it should print the text other wise i need to pass a default value.

in otherwords

/: if include &----& object vbbk id z01 language en is initial

  • 'print this text'.

/: else

/: include &----& object vbbk id z01 language en is initial

/:endif.

this is how the logic is...., can any onse suggest me how to deal with this kind of problem,

help is appreciated and rewarded.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sachin.

See this if useful.

<b>The INCLUDE command returns a status code in the SAPSCRIPT-SUBRC symbol:

0: the text include was successful.

1: the command could not be executed because it contained syntax errors.

2: the rules governing the text to be included were not followed (see above).

This value cannot occur if the command is used in a SAPscript form.

4: the specified text could not be found.</b>

INCLUDE statment

if SAPSCRIPT-SUBRC =2.

'own text'.

endif.

plz reward points if helpful.

Thanks,

Suma.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the reply,

i have given the condiiton

if sapscript-subrc ne 0.

then print the standard text.

but when sapscript-subrc eq 0.

then also it is entering into the loop

please help me with this,

Former Member
0 Kudos

Hi Sachin,

check for SAPSCRIPT-SUBRC = 4 not 2