SAP VLPOD的 BDC 录屏

FUNCTION ZIF_BDC_VLPOD.
*"----------------------------------------------------------------------
*"*"本地接口:
*"  IMPORTING
*"     VALUE(PVBELN) TYPE  VBELN OPTIONAL
*"     VALUE(PBUDAT) TYPE  BUDAT OPTIONAL
*"     VALUE(LV_MODE) TYPE  APQI-PUTACTIVE DEFAULT 'N'
*"  EXPORTING
*"     VALUE(OSTATUS) TYPE  BAPI_MTYPE
*"     VALUE(OMESSAGE) TYPE  BAPI_MSG
*"----------------------------------------------------------------------
  data:lt_bdcmessage like TABLE OF BDCMSGCOLL.

  PERFORM bdc_dynpro  USING 'SAPMV50A' '4006'.
  PERFORM bdc_field USING 'BDC_CURSOR' 'LIKP-VBELN'.
  PERFORM bdc_field USING 'BDC_OKCODE' '=ENT2'.
  PERFORM bdc_field USING 'LIKP-VBELN' pvbeln.

  PERFORM bdc_dynpro USING 'SAPMV50A' '1000'.
  PERFORM bdc_field USING 'BDC_OKCODE' '=PODQ'.
  PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPMV50A                                1502SUBSCREEN_HEADER'.
   PERFORM bdc_field USING 'BDC_SUBSCR' 'SAPMV50A                                1110SUBSCREEN_BODY'.
  PERFORM bdc_field  USING 'LIKP-PODAT' pbudat.
  PERFORM bdc_field USING 'BDC_CURSOR' 'TVPODVB-GRUND(01)'.
  PERFORM bdc_field USING 'GV_XSIT' '2'.

  PERFORM bdc_dynpro  USING 'SAPMV50A' '1000'.
  PERFORM bdc_field USING 'BDC_OKCODE' '=SICH_T'.
  PERFORM bdc_field USING 'BDC_CURSOR' 'TVPODVB-GRUND(02)'.

  data:ls_params TYPE ctu_params.
  ls_params-dismode = 'N'.
  ls_params-racommit = 'X'.
  ls_params-updmode = 'S'.
  CALL TRANSACTION 'VLPOD' USING bdcdata
*        OPTIONS FROM ls_params
        MODE lv_mode UPDATE 'S'
        MESSAGES INTO lt_bdcmessage.

  READ TABLE lt_bdcmessage TRANSPORTING NO FIELDS
            WITH KEY
             msgtyp = 'S'
             msgid = 'VL' "表示保存成功
             msgnr = '311'.
  IF sy-subrc <> 0.
    ostatus = 'E'.
    omessage =  'pod确认失败!'.
  ELSE .
    ostatus = 'S'.
    omessage =  'pod确认成功!'.
  ENDIF.
ENDFUNCTION.

你可能感兴趣的:(ABAP,SD,其他,经验分享)