Application Development 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: 

Reg: Perform in script..

former_member623843
Participant
0 Kudos

HI all,

In the script(SE71) i want write perform statement. How to write..Can any one give me an example..

8 REPLIES 8

Former Member
0 Kudos

Hi,

[Search the SCN|] before posting the question.

Former Member
0 Kudos

Hi,

You can write Perform in script

as

/:PERFORM GET_QUANT_CHAR IN PROGRAM ZTRANSFER_ITCSY

/:USING &REGUH-HKTID&

/:USING &REGUH-HBKID&

E/:CHANGING &V_BANKL&

/:CHANGING &V_BANKN& .

/:ENDPERFORM.

Regards,

Vijay

awin_prabhu
Active Contributor
0 Kudos

Hi,

Try like below,

In format select /: command line.

PERFORM GET_TAX_DETAILS IN PROGRAM ZZTEST

USING &KNUMV&

USING &LNNUM&

CHANGING &TAX&

CHANGING &TOTTAX&

ENDPERFORM

Former Member
0 Kudos

Hi,

In script:


DEFINE &MARA-MATNR& = '000000000000000038'
PERFORM DISP_NAME IN PROGRAM ZPRK_SCRIPTS_PERFORM
USING &MARA-MATNR&
CHANGING &MARA-MATKL&
ENDPERFORM

and in program


FORM DISP_NAME TABLES IN_TAB  STRUCTURE ITCSY
                      OUT_TAB STRUCTURE ITCSY.

DATA: LV_V1 TYPE MARA-MATNR,
      LV_V2 TYPE MARA-MATKL.

CLEAR IN_TAB.
READ TABLE IN_TAB INDEX 1.
if sy-subrc = 0.
LV_V1 = IN_TAB-VALUE.
endif.

SELECT SINGLE MATKL FROM MARA INTO LV_V2
WHERE MATNR EQ LV_V1.

read table out_tab with key name = 'MARA-MATKL'.
if sy-subrc = 0.
OUT_TAB-VALUE = LV_V2.
modify out_tab index sy-tabix.
CLEAR OUT_TAB.
endif.
ENDFORM.

Regards,

R K.

0 Kudos

THANKS TO EVERY ONE...MY PROBLEM IS SOLVED..

Former Member
0 Kudos

Hi Mahaboob,

In the main window please use this syntax:

/:Perfom Z_GET_XXX IN PROGRAM Z_ XXX

/:USING &VAR_1&

/:USING &VAR_2&

/:USING &VAR_&

/:CHANGING &VAR_BLA_1&

/:CHANGING &VAR_BLAB_2&

/:ENDPERFORM

Then create program Z_XXX and FORM Z_GET_XXX.

Blacky.

Former Member
0 Kudos

Hi,

In SCRIPT we nedd to give name of the Include Program in

the PERFORM statement.

e,g. PERFORM F_GET_ADDRESS IN PROGRAM ZRETURNORDER.

....

ENDPERFORM

In script we need to write command PERFORM....ENDPERFORM

In script the PERORM ...ENDPERFORM will be in window of

script (SE71)and there is separate INCLUDE prorame(SE38)

sample code for routines in script.

/: PERFORM FORM_TEST IN PROGRAM ZTEST

/: USING &VAR1&

/: USING &VAR2&

/: USING &VAR3&

/: .............

/: USING &VARN&

/: CHANGING &VAR_OUT1&

/: ................

/: CHANGING &VAR_OUTN&

in the program ZTEST...

FORM FORM_TEST tables in_tab structure itcsy

out_tab structure itcsy.

  • Get value of VARN

data: varn like ....

read table in_tab with key name = 'VARN'.

if sy-subrc = 0.

move in_tab-value to varn.

endif.

  • Update the value of VAR_OUTN

read table out_tab with key name = 'VAR_OUTN'.

if sy-subrc = 0.

move <value> to out_tab-value.

modify out_tab index sy-tabix.

endif.

ENDFORM.

with regards,

Mamta Kumari

Former Member
0 Kudos

Hi Try this,

/: PERFORM GET_DATA IN PROGRAM ZGETDATA " define a zprogram of type subroutine and write your logic to get the value

/: USING &v1&

/: changing &v2&

/: Endperform

In your subroutine program zgetdata

FORM get_equi TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

data: v1(10).

in_tab will have the data that your are passing from script.

READ TABLE in_tab INDEX 1.

v1 = intab-value.

out_tab will hold the values you are passing to the script

read table out_tab with key 'v2'

v2 = 'TEST'.

MODIFY out_tab INDEX sy-tabix.

endform.

Regards,

Satish