Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Coding at script form side

Former Member
0 Likes
737

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.

5 REPLIES 5
Read only

varma_narayana
Active Contributor
0 Likes
720

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>

Read only

0 Likes
720

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.

Read only

0 Likes
720

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>

Read only

Former Member
0 Likes
720

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.

Read only

Former Member
0 Likes
720

Any more answers, please tell me the way how can I write code in script forms...

Thanks.