Calling a Method
Sander van der Wijngaart
Sander.vanderWijngaart at avelon.nl
Tue Aug 13 18:11:49 EDT 2002
Chavi,
Try this example:
Call (fictitious) method Print of object type VBAK (sales document).=20
The method receives the parameters Paperformat and Printertype as input.
***************************************************
* Call method Print of object type VBAK
***************************************************
* Data declarations
***************************************************
DATA: VBAK_REF TYPE SWC_OBJECT.
SWC_CONTAINER CONTAINER.
* Create object reference to sales document
*************************************************
SWC_CREATE_OBJECT VBAK_REF 'VBAK' <KeySalesDoc>
* Fill input parameters
***************************************************
SWC_CREATE_CONTAINER CONTAINER.
SWC_SET_ELEMENT CONTAINER 'Paperformat' 'A4'.
SWC_SET_ELEMENT CONTAINER 'Printertype' 'Lineprinter'.
* Call Print method
***************************************************
SWC_CALL_METHOD VBAK_REF 'Print' CONTAINER.
* Error handling
IF SY-SUBRC NE 0.
.....=20
ENDIF.
***************************************************
Regards,
Sander van der Wijngaart=20
Avelon B.V.=20
Visit us at www.avelon.nl=20
Mobile: +31(0)6-15013150=20
-----Original Message-----
From: casdhir at att.net [mailto:casdhir at att.net]=20
Sent: dinsdag 13 augustus 2002 23:52
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Calling a Method
Hi All,
I am struggling to call a method from another method or
from a function module. Anybody has an example. I try to
follow the sap doc but not very successful.
Thanks.
Chavi.
More information about the SAP-WUG
mailing list