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

SAPScript dump while calling PERFORM subroutine?

Former Member
0 Likes
2,149

Hi,

  • NAME: &UNAME&
In SAPScript... /: DEFINE &UNAME& = '' /: PERFORM GETNAME IN PROGRAM ZNAME /: CHANGING &UNAME& /: ENDPERFORM In program ZNAME REPORT ZNAME. FORM GETNAME TABLES OUT_TAB STRUCTURE ITCSY. READ TABLE OUT_TAB WITH KEY NAME = 'UNAME'. MOVE SY-UNAME TO OUT_TAB-VALUE. MODIFY OUT_TAB INDEX SY-TABIX. ENDFORM.

Now, when i run my SAPScript printing test, its giving dump.

The dump message is....

ShrtText Too many parameters specified with PERFORM. What happened? In a subroutine call, there were more parameters than in the routine definition. Error in ABAP application program. The current ABAP program "SAPLSTXC" had to be terminated because one of the statements could not be executed. This is probably due to an error in the ABAP program. Error analysis An exception occurred. This exception is dealt with in more detail below . The exception, which is assigned to the class 'CX_SY_DYN_CALL_PARAM_NOT_FOUND', was neither caught nor passed along using a RAISING clause, in the procedure "CO_ENDPERFORM" "(FORM)" . Since the caller of the procedure could not have expected this exception to occur, the running program was terminated. The reason for the exception is: A PERFORM was used to call the routine "GETNAME" of the program "ZNAME". This routine contains 2 formal parameters, but the current call contains 4 actual parameters. parameters.

Here i am passing only one parameter in perform, but its showing like 4 actual parameters are passing. What i understand from this dump its taking that IN PROGRAM ZNAME also as parameters.

Any ideas plz......

Regards,

Shree.

10 REPLIES 10
Read only

Former Member
0 Likes
1,399

Hi,

while calling the perform stmt.. the actual parameters are not same in formal parameters.

like

form SUB using p1 p2 p3.

perform SUB using p1 p2. ..try to check the paramters declaration.

regads,

Rama reddy

Read only

0 Likes
1,399

Hi,

Here i am doing in SAPScript.

I am passing only one parameter. that to CHANGING <p1> from sapscript.

And in my program i did...

FORM GETNAME TABLES OUT_TAB STRUCTURE ITCSY.

READ TABLE OUT_TAB WITH KEY = 'UNAME'.
MOVE SY-UNAME TO OUT_TAB-VALUE.
MODIFY OUT_TAB INDEX 1.

ENDFORM.

here, FORM TABLES OUT_TAB STRUCTURE ITCSY is the syntax for SAPScript perform statements handling in program.

Read only

0 Likes
1,399

Please format ur first POST...

Its difficult to undrstand....

Read only

0 Likes
1,399

Hi,

In SAPScript

/: DEFINE &UNAME& = ''
/: PERFORM GETNAME IN PROGRAM ZNAME
/: CHANGING &UNAME&
/: ENDPERFORM
* NAME : &UNAME

In Program

REPORT  ZSH_NAME.

FORM GETNAME TABLES OUT_TAB STRUCTURE ITCSY.

READ TABLE OUT_TAB WITH KEY NAME = 'UNAME'.
MOVE SY-UNAME TO OUT_TAB-VALUE.
MODIFY OUT_TAB INDEX 1.

ENDFORM.

When i did printing test this SAPScript form its giving dump

A PERFORM was used to call the routine "GETNAME" of the program "ZSH_NAME".

This routine contains 2 formal parameters, but the current call

contains 4 actual parameters.

Read only

Former Member
0 Likes
1,399

FORM GETNAME --- for this form, u dont have parameters...

But while calling using PERFORM u r passing parameter &UNAME& as CHANGING....

Is this syntax correct??

Read only

Former Member
0 Likes
1,399

HI,

in your program use

FORM GET_SLNO TABLES ITAB STRUCTURE ITCSY

OTAB STRUCTURE ITCSY.

instead of

FORM GETNAME TABLES OUT_TAB STRUCTURE ITCSY.

also

READ TABLE OTAB INDEX 1.

in place of

READ TABLE OUT_TAB WITH KEY NAME = 'UNAME'.

and then try.

Regds,

Anil

Read only

Former Member
0 Likes
1,399

You must have two parameters in your subroutine-

FORM GETNAME TABLES INTAB STRUCTURE ITCSY

OUTTAB STRUCTURE ITCSY.

READ TABLE INTAB WITH KEY NAME = 'UNAME'.

IF SY-SUBRC EQ 0.

OUTTAB-NAME = 'UNAME'.

  • modify the value here then append to OUTTAB

ENDIF.

ENDFORM.

Then in your SAPSCRIPT, do it like this-

/: PERFORM GETNAME IN PROGRAM ZNAME

/: USING &UNAME&

/: CHANGING *UNAME&

/: ENDPERFORM

This will work.

Read only

0 Likes
1,399

Hi,

I already tried in this way, but no result, same dump its giving...

Read only

Former Member
0 Likes
1,399

Solved

Read only

0 Likes
1,399

I have the same problem and can't understand why it says there are 4 parameters needed.

You solved you problem. Can you tell us how? Thanks

Marty