on 07-01-2008 9:58 AM
Hi experts,
I have a structure LFA1, in the script, I need to use this in the subroutine pool and do some calicultaion.
How can i pass the this structure form script to my program
Iam trying to use the syntax in the script
perform f_getdetails in program z_test
using &lfa1&
endperform
but it doesnt work
Hi,
You should pass data to subroutine in this way LFA1-LIFNR .
So try this:
perform f_getdetails in program z_test
using &lfa1-lifnr&
endperform.
Then in the subroutine, you can get further data from LFA1 from LIFNR by using a select statement.
I hope you know how to read the data passed from script to the subroutine.
Anyway here is the sample code:
********************
FORM F_get_details IN_TAB STRUCTURE itcsy
OUT_TAB STRUCTURE itcsy.
DATA: V_LIFNR LIKE LFA1-LIFNR.
READ TABLE IN_TAB WITH KEY NAME = 'LFA1-LIFNR'.
MOVE IN_TAB-VALUE TO V_LIFNR.
SELECT * FROM LFA1 WHERE LIFNR = V_LIFNR.
*********************
Hope this helps.
Thanks & Regards,
Fawaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In this case, if you dont want to use select statement then
pass all the values from LFA1 that you need from script to the subroutine.
For Ex:
/:PERFORM GET_CREATED_BY IN PROGRAM yxz
/: USING &LFA1-LIFNR&
/: USING &LFA1-NAME1&
/: USING &........&
/: CHANGING &CREATED_BY&
/: CHANGING &DI&
/:ENDPERFORM
Regards,
Fawaz
Hi,
Inside the program apply a loop on input structure.
Then all the fields will come.For getting values in script use changing also.
Refer this:
https://forums.sdn.sap.com/click.jspa?searchID=13516478&messageID=3239606
Regards,
Shiva Kumar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.