on 05-28-2009 6:41 AM
Hi all,
I am writing a sapscript form to call a subrountine by passing the hardcode parameter 'ZXX_TSI_SHIPMENTS_FROM' shown as below: -
PERFORM GET_STANDARD_TEXT IN PROGRAM ZPXX_SHIP_INST
USING 'ZXX_TSI_SHIPMENTS_FROM'
CHANGING &ZXX_TSI_SHIPMENTS_FROM&
ENDPERFORM
My problem now is when I debugged in program ZPXX_SHIP_INST, the passing parameter is empty.
Could someone help me?
Thanks in advance.
Hi,
Refer the below link for passing parameters with simple example program :
http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
BR,
Rajani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Put a debugg point in program ZPXX_SHIP_INST and check it.
Insted of this u can directly fetch the standard text by using 'INCLUDE TEXT'.
/: INCLUDE &OBJNAM& OBJECT 'EKPO' ID 'F03' LANGUAGE 'E' PARAGRAPH M3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
In program ZPXX_SHIP_INST write like this.
FORM GET_STANDARD_TEXT TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
READ TABLE in_tab WITH KEY name = 'INVAR_1'
IF sy-subrc = c_zero. "check for subrc
lv_ebeln = in_tab-value.
ENDIF.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = p_lc_f01
language = sy-langu
name = p_lv_ebeln
object = text-t28 "EKKO
TABLES
lines = it_tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> c_zero. "checking for subrc
"to avoid epc error
ENDIF. "IF sy-subrc <> c_zero
in it_tline[] u can get the text.
cocatenate this text into one variable and pass this to script.
Hi Wong,
Syntax in a form window:
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
......
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
......
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
So those parameters should be only the symbols, hard coded text should not be considered by perform statement in scripts.
Regards,
Vineel.
you need to declare one variable and assign it the value and then pass this as parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Declare a variable in Script window using DEFINE
Ex : DEFINE &VAR1& = ' '
Before passing variables to Subroutine in Script those are declared in Script window code using Define statement.
But in your case you are sending direct variable from print program. so it is not necessary to declare variable in that case. To get the value debug the print program before assign to script otherwise debug the Script by active debugger in Utilities of SE71.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.