Show TOC

Programmed Method CallLocate this document in the navigation structure

Use

Call (fictitious) method Print of object type VBAK (sales document). The method receives the parameters Paper Format and Printer Type as input.

* Aufruf der Methode Print des Objekttyps VBAK
***************************************************
* Datendeklarationen
***************************************************
DATA: VBAK_REF TYPE SWC_OBJECT. SWC_CONTAINER CONTAINER.
* Objektreferenz auf Verkaufsbeleg erzeugen
*************************************************
SWC_CREATE_OBJECT VBAK_REF 'VBAK' <SchlüsselVerkaufsbeleg>
* Eingabeparameter füllen
***************************************************
SWC_CREATE_CONTAINER CONTAINER.
SWC_SET_ELEMENT CONTAINER 'Paperformat' 'A4'.
SWC_SET_ELEMENT CONTAINER 'Printertype' 'Lineprinter'.

* Aufruf der Print-Methode
***************************************************
SWC_CALL_METHOD VBAK_REF 'Print' CONTAINER.
* Fehlerbehandlung
IF SY-SUBRC NE 0.
   .....
ENDIF.