cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Perform Statement in SAP Script

Former Member
0 Likes
2,577

how can i use Perform Statement in SAP Script?

i want to pass one value from Script to a subroutine in another program and to receive one result back?

pls tell me the solution.........

<MOVED TO CORRECT FORUM BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jun 20, 2008 9:25 AM

View Entire Topic
Former Member
0 Likes

Hi Babu,

You can do this :

Code to be written in the Form Editor:

/:DEFINE &CUST& = '00000021'.

/:PERFORM GET_NAME IN PROGRAM Z_BC460_EX4_HF

/: USING &CUST&

/: CHANGING &NAME&

/:ENDPERFORM.

Code to be written in the Program :

REPORT Z_HENRIKF_SCRIPT_FORM .

TABLES scustom.

FORM get_name tables in_tab structure itcsy out_tab structure itcsy.

read table in_tab index 1.

select single * from scustom

where id = in_tab-value.

if sy-subrc = 0.

read table out_tab index 1.

move scustom-name to out_tab-value.

modify out_tab index sy-tabix.

else.

read table out_tab index 1.

move 'No name' to out_tab-value.

modify out_tab index sy-tabix.

endif.

    • You could also fill the ouput parameter table this way

  • READ TABLE out_par WITH KEY 'NAME1'.

  • out_par-value = l_name1.

  • MODIFY out_par INDEX sy-tabix.

ENDFORM.

reward points if usefull.

Regards,

Najmuddin