*BDC data declaration
DATA gt_bdctab LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA gt_msgtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
PERFORM bdc_dynpro USING 'SAPLMEOR' '0200'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM call_transaction USING 'ME01'.
*&---------------------------------------------------------------------*
*& Form BDC_DYNPRO
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0829 text
* -->P_0830 text
*----------------------------------------------------------------------*
FORM bdc_dynpro USING p_program p_dynpro.
CLEAR gt_bdctab.
gt_bdctab-program = p_program.
gt_bdctab-dynpro = p_dynpro.
gt_bdctab-dynbegin = 'X'.
APPEND gt_bdctab.
ENDFORM. " BDC_DYNPRO
*&---------------------------------------------------------------------*
*& Form BDC_FIELD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0834 text
* -->P_0835 text
*----------------------------------------------------------------------*
FORM bdc_field USING p_fnam
p_fval.
CLEAR gt_bdctab.
gt_bdctab-fnam = p_fnam.
gt_bdctab-fval = p_fval.
APPEND gt_bdctab.
ENDFORM. " BDC_FIELD
*&---------------------------------------------------------------------*
*& Form CALL_TRANSACTION
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0412 text
*----------------------------------------------------------------------*
FORM call_transaction USING p_tcode.
CALL TRANSACTION p_tcode USING gt_bdctab
MODE 'N'
UPDATE 'S'
MESSAGES INTO gt_msgtab.
ENDFORM. " CALL_TRANSACTION
沒有留言:
張貼留言