08-22-2005 4:56 PM
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.
08-22-2005 5:37 PM
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.
08-22-2005 5:39 PM
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
08-22-2005 5:49 PM
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