cancel
Showing results for 
Search instead for 
Did you mean: 

Include Text in SAP Scripts

Former Member
0 Kudos

Hi All,

if we create standard text like

ZRFKORDA0S,ZRFKORDA0H,
ZRFKORDA1S,ZRFKORDA1H,
ZRFKORDA2S,ZRFKORDA2H,
ZRFKORDE0S,ZRFKORDE0H,
ZRFKORDE1S,ZRFKORDE1H.

based on condition we need to print the value from the above standard texts .

suppose if the user have added some other Standard text like

ZRFKORDE2S,ZRFKORDE2H

than we need to change same in our SAP Script

but how to write the logic to print dynamically the standard text.

i write like this but it is not giving results , below code will work for dynamically change text??

I_BSEG-MWSKZ will contain eithher A0 or A1 or E1 ect

I_BSEG-SHKZG. will contain either S or H

define insert_footer_text.

include ZRFKORD&1&2 OBJECT TEXT ID ST LANGUAGE EN.

end-of-definition.

insert_footer_text &I_BSEG-MWSKZ& &I_BSEG-SHKZG&.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Solved by Self

Former Member
0 Kudos

hi,

Use PERFORM..ENDPERFORM statements in script and pass the values of MWSKZ,SKHZH to driver progarm ..in program concatenate the value as desierd and pass it to script. Now use directly INCLUDE text to display the text.

PERFORM get_text in progarm 'name'

using mwskz

using skzh

chanign text_name

ENDPERFORM.

Former Member
0 Kudos

Hi Hari Krishna,

Thanks for ur reply

can u please explain briefly

Sandra_Rossi
Active Contributor
0 Kudos

[SAP Library - SAPscript - Control commands - PERFORM|http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/803279454211d189710000e8322d00/frameset.htm]

Former Member
0 Kudos

Hi Suri,

You can not do like this, "include ZRFKORD&1&2 OBJECT TEXT ID ST LANGUAGE EN."

you shouldn't use the variable &1 &2 in sapscript form itself.. you have to send the variables using perform statement. And you need to write the subroutine (FORM... ENDFORM) in driver program and there you have to concatenate the standard text name and pass this to the form and use it with include statement.

Sample coding will look like this. Jus a prototype

SAPscript form:

PERFORM "formname" in program "pgmname".

using &var1&

changing &var2&

ENDPERFORM.

include &var2& OBJECT TEXT ID ST LANGUAGE EN. " Use like this.

Driver program: "pgmname"

FORM "formname" structure i_tab ITCSY o_tab ITCSY.

read i_tab with key = 'var1'.

concatanate var1....

read o_tab with key 'var2'

modify o_tab.

ENFORM.

Please develop from this prototype.

Feel free to ask if u have any queries..

Don't forget to rewards if it is helpful...!!!

Former Member
0 Kudos

I think you will have to call a perform and pass the variables to it and in this perform you will build up the name of the include dynamicaly.

Then you can store this in a variable and use this as the name of the include to use.