cancel
Showing results for 
Search instead for 
Did you mean: 

Convert BDC to BAPI_DOCUMENT_ACC_POST

Abapper0114
Explorer
0 Kudos
43

Hello experts,

Can anyone help me convert this BDC code to BAPI_DOCUMENT_ACC_POST.

  DO.
    READ DATASET P_UNIX INTO I_STATEMENT.
    IF SY-SUBRC NE 0.   EXIT. ENDIF.

    PERFORM INITIALISE.


    PERFORM PROCESS_BDC_HEADER.
    PERFORM PROCESS_BDC_DETAIL.
  ENDDO.

FORM PROCESS_BDC_HEADER.
  PERFORM SCREENS USING:

   'X' 'SAPMF05A'  '0100',
   ' ' 'BKPF-BLDAT'  DOC_DATE,         "document date
   ' ' 'BKPF-BLART'  'KZ',             "document type,
*   ' ' 'BKPF-BUKRS'  'WB01',           "company
   ' ' 'BKPF-BUKRS'  '2000',           "company
   ' ' 'BKPF-BUDAT'  W_DATE,           "posting  date
*   ' ' 'BKPF-XBLNR' I_STATEMENT-PLANT, "reference doc dec 02/08/02
   ' ' 'BKPF-XBLNR' W_REFERENCE_DOC,    "reference doc dec 02/08/02
   ' ' 'RF05A-NEWBS' W_FIRST_POSTKEY,  "posting key
   ' ' 'RF05A-NEWKO' P_ACCT,           "vendor
   ' ' 'BKPF-WAERS'  'USD',            "currency   dec 02/05/02
   ' ' 'BDC_OKCODE' '/00'.
ENDFORM.                               " PROCESS_BDC_HEADER

FORM PROCESS_BDC_DETAIL.
  PERFORM SCREENS USING:

  'X' 'SAPMF05A' '0302',
  ' ' 'BSEG-WRBTR'  W_AMT,
  ' ' 'BSEG-ZUONR' I_STATEMENT-BILLING_NO, "allocation    "6-06-00
  ' ' 'RF05A-NEWBS' W_NEXT_POSTKEY,
  ' ' 'RF05A-NEWKO' '2020',
  ' ' 'BDC_OKCODE'  '/00',

  'X' 'SAPMF05A' '0300',
  ' ' 'BSEG-WRBTR'  W_AMT,
  ' ' 'DKACB-FMORE' 'X',
  ' ' 'BDC_OKCODE'  'BU',

  'X' 'SAPLKACB'  '0002',
  ' ' 'BDC_OKCODE' 'ENTE'.
ENDFORM.

I tried to do it. But so far this is the outcome:

FORM PROCESS_BDC_HEADER.
  WA_HEADER-USERNAME    = SY-UNAME.
  WA_HEADER-COMP_CODE   = '2000'.
  WA_HEADER-DOC_DATE    = DOC_DATE.
  WA_HEADER-PSTNG_DATE  = W_DATE.
  WA_HEADER-DOC_TYPE    = 'KZ'.
  WA_HEADER-REF_DOC_NO  = W_REFERENCE_DOC.
ENDFORM.

FORM PROCESS_BDC_DETAIL.
  WA_ITEM_GL-ALLOC_NMBR   = I_STATEMENT-BILLING_NO.
ENDFORM.

I'm kinda lost. This is the first time I'm using this BAPI. Thank you in advance.

Accepted Solutions (0)

Answers (0)