BDC CO40


data: bdcdata like bdcdata occurs 100 with header line.
data: begin of it_msg occurs 1000.
        include structure bdcmsgcoll.
data: end of it_msg.
   
    perform. bdc_dynpro     using 'SAPLCOKO1' '0150'.
    perform. bdc_field      using 'BDC_CURSOR'
                                 'AFPOD-PLNUM'.
    perform. bdc_field      using 'BDC_OKCODE' '/00'.
    perform. bdc_field      using 'AFPOD-PLNUM'  tab2-plnum.
    perform. bdc_field      using 'AUFPAR-PP_AUFART'
                                  tab2-paart.

    perform. bdc_dynpro     using 'SAPLCOKO1' '0115'.
    perform. bdc_field      using 'BDC_OKCODE'  '=STAK'.
    perform. bdc_field      using 'BDC_CURSOR'   'CAUFVD-GAMNG'.

    perform. bdc_field      using 'CAUFVD-GSTRP'  tab2-text02.
    perform. bdc_field      using 'CAUFVD-GLTRP'  tab2-text04.
    perform. bdc_field      using 'CAUFVD-TERKZ'  '5'.

    perform. bdc_dynpro     using 'SAPLCOKO1'      '0131'.
    perform. bdc_field      using 'BDC_OKCODE'     '=ENT1'.
    perform. bdc_field      using 'BDC_CURSOR'     'RC62F-PLAUF'.
    perform. bdc_field      using 'RC62F-NEW_ROUT'  'X'.
    perform. bdc_field      using 'RC62F-PLAUF'    tab2-text02.
    perform. bdc_field      using 'BDC_CURSOR'     'RC62F-AUFLD'.
    perform. bdc_field      using 'RC62F-NEW_BOM'  'X'.
    perform. bdc_field      using 'RC62F-AUFLD'    tab2-text02.
 

    perform. bdc_dynpro     using 'SAPLCOKO1' '0115'.
    perform. bdc_field      using 'BDC_OKCODE'  '=BU'.
    perform. bdc_field      using 'BDC_CURSOR'   'CAUFVD-GAMNG'.
    perform. bdc_field      using 'CAUFVD-GSTRP'  tab2-text02.
    perform. bdc_field      using 'CAUFVD-GLTRP'  tab2-text04.
    perform. bdc_field      using 'CAUFVD-TERKZ'  '5'.

    call transaction 'CO40' using bdcdata
                                  mode p_mode
                                  update 'E'
                                  messages into it_msg.
 
*---------------------------------------------------------------------*
*       FORM. BDC_DYNPRO                                               *
*---------------------------------------------------------------------*
form. bdc_dynpro using program dynpr01.
  clear bdcdata.
  bdcdata-program = program.
  bdcdata-dynpro  = dynpr01.
  bdcdata-dynbegin = 'X'.
  append bdcdata.
endform.
*---------------------------------------------------------------------*
*       FORM. BDC_FIELD                                                *
*---------------------------------------------------------------------*
form. bdc_field using fnam fval.
  if fval <> ''.
    clear bdcdata.
    bdcdata-fnam = fnam.
    bdcdata-fval = fval.
    append bdcdata.
  endif.
endform.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15117617/viewspace-662036/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15117617/viewspace-662036/

你可能感兴趣的:(BDC CO40)