Code: Alles auswählen.
* XBAPIADDR2 = YBAPIADDR2 = I_BAPIADDR2. ms/4.6A
CLEAR: YBAPIADDR2-ADDR_NO, YBAPIADDR2-PERS_NO.
* Wenn in BAPIADDR2 nur Adreß- und Personennummer mitgegeben wurden,
* Daten aus ZAV lesen
IF YBAPIADDR2 IS INITIAL.
* Hole Adreßdaten (Typ 2) aus der ZAV
CALL FUNCTION 'ADDR_PERSONAL_GET_COMPLETE'
EXPORTING
ADDRNUMBER = XBAPIADDR2-ADDR_NO
PERSNUMBER = XBAPIADDR2-PERS_NO
IMPORTING
ADDR2_COMPLETE = PERS_COMPLETE
EXCEPTIONS
PARAMETER_ERROR = 1
ADDRESS_NOT_EXIST = 2
PERSON_NOT_EXIST = 3
INTERNAL_ERROR = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
RAISING CAM_ERROR.
ENDIF.
CONVERT_TO_BAPI_STRUCTURE = 'X'.
ENDIF.
ENDIF.