Dieses Programm öffnen direkt den Infotypen 0002
REPORT z_anschrift.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,
session,
messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
ctumode LIKE ctu_params-dismode VALUE 'A', "oder 'N'
cupdate LIKE ctu_params-updmode VALUE 'S'.
PARAMETERS: pernr TYPE p_pernr,
nachn TYPE nachn.
START-OF-SELECTION.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'. "Funktionscodes Gelb Grün Rot ... Button
PERFORM bdc_field USING 'RP50G-PERNR' pernr.
PERFORM bdc_field USING 'RP50G-TIMR6' 'X'.
*perform bdc_field using 'BDC_CURSOR' 'RP50G-CHOIC'. "braucht man nicht " wenn man in ein Feld rein klickt
PERFORM bdc_field USING 'RP50G-CHOIC' '2'.
PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.
*perform bdc_field using 'BDC_CURSOR' 'RP50G-PERNR'.
PERFORM bdc_field USING 'BDC_OKCODE' '=MOD'.
PERFORM bdc_field USING 'RP50G-PERNR' '1000'.
PERFORM bdc_field USING 'RP50G-TIMR6' 'X'.
PERFORM bdc_field USING 'RP50G-CHOIC' '0002 Daten zur Person'.
PERFORM bdc_dynpro USING 'MP000200' '2001'.
*perform bdc_field using 'BDC_CURSOR' 'Q0002-GBPAS'.
**perform bdc_field using 'BDC_OKCODE' '=UPD'.
PERFORM bdc_field USING 'P0002-BEGDA' '05.10.2006'.
PERFORM bdc_field USING 'P0002-ENDDA' '31.12.9999'.
PERFORM bdc_field USING 'P0002-NACHN'
nachn.
PERFORM bdc_transaction USING 'PA30'.
BREAK-POINT.
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form bdc_dynpro
*&---------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "bdc_dynpro
*&---------------------------------------------------------------------*
*& Form bdc_field
*&---------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "bdc_field
*&---------------------------------------------------------------------*
*& Form bdc_transaction
*&---------------------------------------------------------------------*
FORM bdc_transaction USING tcode.
DATA: ls_opt TYPE ctu_params.
ls_opt-dismode = 'E'.
ls_opt-updmode = 'S'.
ls_opt-racommit = 'X'.
*A Alle Dynpros anzeigen
*E Fehler anzeigen
*N Dunkel prozessieren
*P Dunkel und debugfähig
REFRESH messtab.
CALL TRANSACTION tcode USING bdcdata
OPTIONS FROM ls_opt
MESSAGES INTO messtab.
ENDFORM. "bdc_transaction