on 05-26-2010 1:29 PM
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&.
Solved by Self
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...!!!
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.