‎2007 Oct 03 7:39 AM
Hi all,
I see some forms that have code in them...
The syntax is like that:
/: PERFORM GET_ITEM_PACK IN PROGRAM ZEXPORTSALESFORM
/: USING &VBDKA-VBELN&
/: USING &VBDPA-POSNR&
/: USING &VBDPA-VRKME&
/: CHANGING &PACKING1&
/: CHANGING &PACKING2&
/: CHANGING &KIMYASAL&
/: ENDPERFORM
What is the logic of writing code inside script forms...
Do we need it really?
Thanks.
Deniz.
‎2007 Oct 03 7:51 AM
Hi Deniz..
We can call subroutines in Script Layout set using this PERFORM command.
This is used to perform any operations from the Layout set. Bcoz we cannot directly write any code in a Script Layout set.
**These are Text symbols for storing some values
/: DEFINE &PACKING1& = ''
/: DEFINE &PACKING2& = ''
/: DEFINE &KIMYASAL& = ''
**Calling subroutine
/: PERFORM GET_ITEM_PACK IN PROGRAM ZEXPORTSALESFORM
/: USING &VBDKA-VBELN& "Using parameters are like Read-Only in subroutine
/: USING &VBDPA-POSNR&
/: USING &VBDPA-VRKME&
/: CHANGING &PACKING1& "Using parameters can be modified in subroutine
/: CHANGING &PACKING2&
/: CHANGING &KIMYASAL&
/: ENDPERFORM
This subroutine must be defined in the program ZEXPORTSALESFORM
FORM GET_ITEM_PACK TABLES
INTAB STRUCTURE ITCSY "Contains all USING parameters
OUTTAB STRUCTURE ITCSY " Contains all CHANGING parameters
**implement the logic here
ENDFORM.
<b>REWARD IF HELPFUL.</b>
‎2007 Oct 03 8:15 AM
Thank you Varma@infyTree, your answer is really good for me to understand the background of the work.
However I am not clear at whether we have to define the using variables of the perform statement, that is &VBDPA-POSNR& and USING &VBDPA-VRKME&, must be defined beforehand or not..
Also changing variables need to be defined in advance?
Thanks.
‎2007 Oct 03 8:22 AM
Hi.. Deniz..
here the Using Parameters like &VBDPA-POSNR& and USING &VBDPA-VRKME& are the Variable in the print program. So they need not to be defined.
But the Changing parameters are the Temporary variables to be created additionally. So they can be declared thru DEFINE.
<b>REWARD IF HELPFUL.</b>
‎2007 Oct 03 9:00 AM
Thanks firstly.
I have debugged the form and saw that the vbdka-vbeln field was full of data. When it has been assigned to this variable.
Thanks.
‎2007 Oct 03 11:54 AM
Any more answers, please tell me the way how can I write code in script forms...
Thanks.