cancel
Showing results for 
Search instead for 
Did you mean: 

perform syntax in script

Former Member
0 Kudos

Hi all,

I want to display user name using subroutines in script..my code is not working.. pls check and let me know the correct way.

/: PERFORM get_user IN PROGRAM ZTEST USING &UNAME&

/: ENDPERFORM.

/: &UNAME&.

REPORT ZTEST.

FORM GET_USER USING UNAME.

UNAME = SY-UNAME.

ENDFORM.

thanks

mallika

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If FROM_OBJ is the form being called then it should look like:

FORM get_obj TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

Since you know the parameters you are passing, use that as an index to retrieve/update the corresponding value of the variable.

e..g READ TABLE in_tab Index 1.

Similarly use 'Modify' to update the value of the variable you are interested in out_tab.

I hope this helps,

Regards

Raju Chitale

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

try like below in FORM and PROGRAM...

/: PERFORM get_user IN PROGRAM ZTEST

/: CHANGING &UNAME&

/: ENDPERFORM.

/: &UNAME&.

In Program:

FORM get_user outtab STRUCTURE itcsy.

READ TABLE outtab with key name = 'UNAME'.

outtab-value = sy-uname.

MODIFY OUTTAB transporting ...

ENDFORM.

Hope it helps!!

Regards,

Pavan

Former Member
0 Kudos

hi ,

the is a problem with the syntax, the correct syntax is

/: PERFORM get_user IN PROGRAM ZTEST

/: USING &UNAME&

/: ENDPERFORM.

/: &UNAME&.

this will resolve your problem

Regard,

Jaya ramkumar