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: 

Problems with tha sapscript-command 'perform'

Former Member
0 Kudos

Hello,

I want to call a subprogram in a modulpool from a textelement in SAPScript with the command 'perform'. The subprogram has one parameter. But I get a dump, which says that I "give 4 actual parameters to a subprogram with only 1 formal parameter". I don't know why this problem arises, because I overgive only 1 actual parameter. Thanks.

Regards, Lars.

-


SAPScript:

/: DEFINE &CHECK1& = ' '

/: PERFORM TESTDRUCK IN PROGRAM ZSD_TESTDRUCK_POOL

/: CHANGING &CHECK1&

/: ENDPERFORM

/: IF &CHECK1& NE 'x'

/: INCLUDE ZTESTBITMAP OBJECT GRAPHICS ID BCOL LANGUAGE DE

/:ENDIF

-


ABAP:

REPORT ZSD_TESTDRUCK_POOL .

TABLES: ZQM_TESTDRUCK.

FORM TESTDRUCK CHANGING check TYPE c.

  • DATA check(1) TYPE c.

check = ' '.

SELECT * FROM ZQM_TESTDRUCK.

IF sy-sysid = ZQM_TESTDRUCK-SAPSYSTEM.

check = 'x'.

ENDIF.

ENDSELECT.

ENDFORM.

3 REPLIES 3

Former Member
0 Kudos

Hello,

I found a good article in the sap-help. Link:

http://help.sap.com/saphelp_webas630/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

Regards, Lars.

Former Member
0 Kudos

Hi Lars,

The problem is with the way subroutine is define. It can be defined in on particular way only. Please see following link for details -

http://help.sap.com/search/highlightContent.jsp

Cheers,

Sanjeev

0 Kudos

When doing PERFORM inside of a sapscript form, you need to handle the FORM a certain way. In your case, it would look something like this.




form  layout_form1 tables co_sym_using   structure itcsy
                          co_set_symbols structure itcsy.

* DATA check(1) TYPE c.
  check = ' '.

  select * from zqm_testdruck.

    if sy-sysid = zqm_testdruck-sapsystem.
      check = 'x'.
      read table co_set_symbols index 1.
      co_set_symbols-value = check.
      modify co_set_symbols index 1.

    endif.

  endselect.


endform.

The values are passed in internal tables, you can manuipulate this tables to get the desired functionality.

Regards,

Rich Heilman