on 07-10-2009 7:53 AM
Hi,
I have a requierement of cheque printing for which i have created a z-sapscript with std driver routine attached to it. Now the thing is that i have to assign value of structure field REGUD-SWENES to some variable . How can i do it as i can't write any code in SAPSCRIPT? Please provide me with syntax alongwith proper guidelines as i am new to this type of requirement.
Thanks
Parag
Hi Parag,
Could you please say in brief why do you want to pass it to variable what is your exact requirement?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
My requirement is like this . There are total 7 windows in script and in main window there are 4-5 elements. In one of element
i am geeting the correct value which is to be printed in variable REGUD-SWENES on cheque but in another element the same field is again getting modified as it is adding TDS to this value. for example
in main window
MAIN WINDOW
/E ELEMENT 1
value of REGUD-SWENES : 1200
/E ELEMENT 2
value of REGUD-SWENES : 1204 as it is adding TDS here
and because of this there is one window CHEQUE where i am getting wrong value
CHEQUE WINDOW
value of REGUD-SWENES : 1204
Please provide me some solution
Hi Parag Gavkar,
This could be easy way:
MAIN WINDOW
/E ELEMENT 1
value of REGUD-SWENES : 1200
After this ....in script do like this
/: PERFORM GET_SWENES IN PROGRAM Z_TEST
/: USING ®UD-SWENES&
/: CHANGING &V_SWENES&
/: ENDPERFORM.
Use/Print the value like this in script
P1 &V_SWENES&
Then create a z_test program of type sub routine pool program.
FORM get_sbgrp TABLES input_tab STRUCTURE itcsy
output_tab STRUCTURE itcsy.
DATA: V_SWENES TYPE REGUD-SWENES.
READ TABLE input_tab WITH KEY name = 'REGUD-SWENES'.
IF sy-subrc = 0.
V_SWENES = input_tab-value.
ENDIF.
READ TABLE output_tab WITH KEY name = 'V_SWENES'.
IF SY-SUBRC = 0.
output_tab-value = V_SWENES.
MODIFY output_tab TRANSPORTING value
WHERE name = 'V_SWENES'.
ENDIF.
ENDFORM.
Regards,
Suneel G
Hi,
U can do it in 2 ways, either by using 'DEFINE' in the Script form or Using 'PERFORM'..
1. 😕 DEFINE &gv_swenes& = ®UD-SWENES&.
2. PERFORM get_var IN PROGRAM Z_TEST using ®UD-SWENES&
changing &gv_swenes&.
call the PERFORM like above in the script, then define the same in Z_TEST.
FORM get_var int_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
READ TABLE int_tab index 1.
IF sy-subrc EQ 0.
READ TABLE out_tab index 1.
out_tab-value = int_tab-value.
MODIFY out_tab TRANSPORTING value index sy-index.
ENDIF.
ENDFORM.
Hope it helps!!
Rgds,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just do it like
😕 DEFINE &var1& = ®UD-SWENES&.
Thanks
Venkat.O
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 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.