Posting_interface_documents

Can anyone demonstrate the use of function modules "POSTING_INTERFACE_DOCUMENTS"  with a simple example. My header data and line data are in two different tables...do i need to club all the data into one table and pass into function module. Please help me.....

Yes you have to fill FTPOST.
Eg:
  FTPOST-STYPE = 'K'.
  FTPOST-COUNT = '001'.
  FTPOST-FNAM  = BKPF-BLART.
  FTPOST-FVAL  = 'AB'.
  APPEND FTPOST.
  CLEAR FTPOST.
1. CALL FUNCTION 'POSTING_INTERFACE_START'
2. CALL FUNCTION 'POSTING_INTERFACE_CLEARING'
3. CALL FUNCTION 'POSTING_INTERFACE_END'
I think you have to call all the 3 functions

Similar Messages

  • POSTING_INTERFACE_DOCUMENT for FBS!

    Hi,
    I've written a program to simulate transaction FBS1 using
    FUNCTION 'POSTING_INTERFACE_DOCUMENT', it goes through with sy-subrc set 0, but I cannot see the document number in  T_BLNTAB, the code is below, I think I have all the right Parameters.
    DATA: i_msgid LIKE sy-msgid,
          i_msgno LIKE sy-msgno,
          i_msgty LIKE sy-msgty,
          i_msgv1 LIKE sy-msgv1,
          i_msgv2 LIKE sy-msgv2,
          i_msgv3 LIKE sy-msgv3,
          i_msgv4 LIKE sy-msgv4,
          i_subrc LIKE sy-subrc.
    DATA: ftpost LIKE ftpost  OCCURS 0  WITH HEADER LINE,
          fttax  LIKE fttax   OCCURS 1  WITH HEADER LINE,
          blntab LIKE blntab  OCCURS 1  WITH HEADER LINE.
    blntab-BELNR =
    *blntab-BUKRS = 2000.
    *blntab-GJAHR =
    Header Information first
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'BKPF-BLDAT'.
    ftpost-fval = '310506'.
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'BKPF-BLART'.
    ftpost-fval = 'SA'.
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'BKPF-BUKRS' .
    ftpost-fval = '2000'  .
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'BKPF-BUDAT' .
    ftpost-fval =   '310506' .
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'BKPF-WAERS' .
    ftpost-fval =   'GBP' .
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'BKPF-XBLNR ' .
    ftpost-fval =   'ACCRUAL POST' .
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'BKPF-STGRD' .
    ftpost-fval =  '05' .
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'BKPF-STODT' .
    ftpost-fval =  '010606'.
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'FS006-DOCID' .
    ftpost-fval =  '*'.
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'RF05A-NEWBS' .
    ftpost-fval =  '40'.
    ftpost-stype ='K'.
    ftpost-count = 1.
    ftpost-fnam = 'RF05A-NEWKO' .
    ftpost-fval =   '476000'.
    *Line Items Now
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'BSEG-WRBTR' .
    ftpost-fval =     '5000' .
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'BSEG-MWSKZ' .
    ftpost-fval =    'v0' .
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'BSEG-SGTXT' .
    ftpost-fval =  'pallet of photo paper' .
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'BDC_SUBSCR' .
    ftpost-fval =  'SAPLKACB' .
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'DKACB-FMORE' .
    ftpost-fval =    'X'.
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'COBL-KOSTL' .
    ftpost-fval =    '2-1000 '.
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'COBL-FIPOS ' .
    ftpost-fval =    ''.
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'BSEG-DMBE2' .
    ftpost-fval =  '70.42' .
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'RF05A-NEWBS' .
    ftpost-fval =      '40'  .
    ftpost-stype ='P'.
    ftpost-count = 1.
    ftpost-fnam = 'RF05A-NEWKO' .
    ftpost-fval =   '417000'.
    Item no. 2
    ftpost-stype ='P'.
    ftpost-count = 2.
    ftpost-fnam = 'BSEG-WRBTR' .
    ftpost-fval =    '500' .
    ftpost-stype ='P'.
    ftpost-count = 2.
    ftpost-fnam = 'BSEG-MWSKZ' .
    ftpost-fval =    'V0'.
    ftpost-stype ='P'.
    ftpost-count = 2.
    ftpost-fnam = 'BSEG-SGTXT' .
    ftpost-fval =    'marketing assistants'.
    ftpost-stype ='P'.
    ftpost-count = 2.
    ftpost-fnam = 'DKACB-FMORE' .
    ftpost-fval =  'X'.
    ftpost-stype ='P'.
    ftpost-count = 2.
    ftpost-fnam = 'COBL-AUFNR' .
    ftpost-fval =  ' 400157 '.
    ftpost-stype ='P'.
    ftpost-count = 2.
    ftpost-fnam = 'BSEG-DMBE2' .
    ftpost-fval =  '7.04'.
    ftpost-stype ='P'.
    ftpost-count = 2.
    ftpost-fnam = 'RF05A-NEWBS' .
    ftpost-fval =  '50' .
    ftpost-stype ='P'.
    ftpost-count = 2.
    ftpost-fnam = 'RF05A-NEWKO' .
    ftpost-fval =  '89000' .
    Next Line
    ftpost-stype ='P'.
    ftpost-count = 3.
    ftpost-fnam = 'BSEG-WRBTR' .
    ftpost-fval =   '5500'.
    ftpost-stype ='P'.
    ftpost-count = 3.
    ftpost-fnam = 'BSEG-MWSKZ' .
    ftpost-fval =   'V0' .
    ftpost-stype ='P'.
    ftpost-count = 3.
    ftpost-fnam = 'BSEG-SGTXT'  .
    ftpost-fval =   'accrual posting bala' .
    *Next Line
    ftpost-stype ='P'.
    ftpost-count = 4.
    ftpost-fnam = 'BSEG-WRBTR' .
    ftpost-fval =   '5500'.
    ftpost-stype ='P'.
    ftpost-count = 4.
    ftpost-fnam = 'BSEG-MWSKZ' .
    ftpost-fval =  'V0' .
    ftpost-stype ='P'.
    ftpost-count = 4.
    ftpost-fnam = 'BSEG-SGTXT' .
    ftpost-fval =  'accrual posting bala' .
    ftpost-stype ='P'.
    ftpost-count = 4.
    ftpost-fnam = 'COBL-GSBER ' .
    ftpost-fval =   '1000'   .
    CALL FUNCTION 'POSTING_INTERFACE_DOCUMENT'
      EXPORTING
        i_tcode                        = 'FBS1'
      I_SGFUNCT                      = ' '
      I_NO_AUTH                      = ' '
    IMPORTING
        e_msgid                  = i_msgid
        e_msgno                  = i_msgno
        e_msgty                  = i_msgty
        e_msgv1                  = i_msgv1
        e_msgv2                  = i_msgv2
        e_msgv3                  = i_msgv3
        e_msgv4                  = i_msgv4
        e_subrc                  = i_subrc
      TABLES
        t_blntab                 = blntab
        t_ftpost                 = ftpost
        t_fttax                  = fttax
    EXCEPTIONS
          account_missing          = 1
          company_code_missing     = 2
          posting_key_invalid      = 3
          posting_key_missing      = 4
          record_type_invalid      = 5
          transaction_code_invalid = 6
          amount_format_error      = 7
          too_many_line_items      = 8
          OTHERS                   = 9.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Any ideas anyone?
    Many Thanks Sims

    Hello,
    this is what I have at the momment, but I still get the error message
                                                                                    <i> Two accounts were transferred but not BSEG-HKONT                                                                               
    Message no. F8 020                                                     
            </i>                                                                    
    Diagnosis                                                                               
    Two accounts were transferred but not BSEG-HKONT.                                                                               
    This error also occurs if more than 1000 line items are transferred. In
         this case, the transferred data must be distributed across several     
         documents.                                                             
    *& Report  Zrep1                                                 *
    REPORT  zstaccrual                    .
    DATA:
    obj_type LIKE bapiache02-obj_type,
    obj_key LIKE bapiache02-obj_key,
    obj_sys LIKE bapiache02-obj_sys,
    documentheader LIKE bapiache08,
    accountgl LIKE bapiacgl08
    OCCURS 0 WITH HEADER LINE,
    currencyamount LIKE bapiaccr08
    OCCURS 0 WITH HEADER LINE,
    return LIKE bapiret2
    OCCURS 0 WITH HEADER LINE,
    extension1 LIKE bapiextc
    OCCURS 0 WITH HEADER LINE,
    t_edidd LIKE edidd OCCURS 0 WITH HEADER LINE,
    bapi_retn_info LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    DATA: error_flag.
    *documentheader-obj_key =  '000000000100000038'.
    documentheader-obj_type = 'BKPFF'.
    documentheader-obj_sys = 'RD1CLNT200'.
    documentheader-username = sy-uname.
    documentheader-doc_date = '310506'.
    documentheader-doc_type = 'SA'.
    documentheader-comp_code = 2000.
    documentheader-pstng_date = '310506'.
    documentheader-ref_doc_no = 'Accrual Post'.
    documentheader-reason_rev = '05'.
    documentheader-ac_doc_no = 476000.
    documentheader-obj_key = 40.
    *documentheader-ac_doc_no
    *documentheader-fisc_year = '2005'.
    *documentheader-trans_date
    *documentheader-fis_period
    documentheader-doc_type = 'SA'.
    *documentheader-ref_doc_no
    *documentheader-compo_acc
    *documentheader-reason_rev
    accountgl-itemno_acc = '1'.
    accountgl-gl_account = '0000476000'.
    accountgl-comp_code = '2000'.
    accountgl-pstng_date = '20060506'.
    accountgl-doc_type = 'SA'.
    accountgl-profit_ctr = '2-1000'.
    *accountgl-
    APPEND accountgl.
    accountgl-itemno_acc = '2'.
    accountgl-gl_account = '0000476000'.
    accountgl-comp_code = '2000'.
    accountgl-pstng_date = '20060506'.
    accountgl-doc_type = 'SA'.
    accountgl-profit_ctr = '2-1000'.
    *accountgl-
    APPEND accountgl.
    accountgl-itemno_acc = '3'.
    accountgl-gl_account = '0000417000'.
    accountgl-comp_code = '2000'.
    accountgl-pstng_date = '20060506'.
    accountgl-doc_type = 'SA'.
    accountgl-profit_ctr = '0000400157'.
    APPEND accountgl.
    accountgl-itemno_acc = '4'.
    accountgl-gl_account = '0000417000'.
    accountgl-comp_code = '2000'.
    accountgl-pstng_date = '20060506'.
    accountgl-doc_type = 'SA'.
    accountgl-profit_ctr = '0000400157'.
    APPEND accountgl.
    *AC_DOC_NO
    *FISC_YEAR
    *FIS_PERIOD
    *accountgl-STAT_CON = 'X'.
    *REF_KEY_1
    *REF_KEY_2
    *REF_KEY_3
    *CUSTOMER
    *VENDOR_NO
    *ALLOC_NMBR
    *ITEM_TEXT
    *BUS_AREA
    *COSTCENTER
    *ACTTYPE
    *ORDERID
    *ORIG_GROUP
    *COST_OBJ
    *PROFIT_CTR
    *PART_PRCTR
    *WBS_ELEMENT
    *NETWORK
    *ROUTING_NO
    *ORDER_ITNO
    currencyamount-itemno_acc = '1'.
    currencyamount-currency = 'EUR'.
    currencyamount-amt_doccur = '5000.00'.
    APPEND currencyamount.
    currencyamount-itemno_acc = '2'.
    currencyamount-currency = 'EUR'.
    currencyamount-amt_doccur = '-5000.00'.
    APPEND currencyamount.
    currencyamount-itemno_acc = '3'.
    currencyamount-currency = 'EUR'.
    currencyamount-amt_doccur = '-500.00'.
    APPEND currencyamount.
    currencyamount-itemno_acc = '4'.
    currencyamount-currency = 'EUR'.
    currencyamount-amt_doccur = '-500.00'.
    APPEND currencyamount.
    call BAPI-function in this system
    CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
    EXPORTING
    documentheader = documentheader
    importing
    obj_type = obj_type
    obj_key = obj_key
    obj_sys = obj_sys
    TABLES
    accountgl = accountgl
    currencyamount = currencyamount
    return = return
    extension1 = extension1
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
      MESSAGE e999(re) WITH 'Problem occured'.
    ELSE.
      LOOP AT return.
        IF NOT return IS INITIAL.
          CLEAR bapi_retn_info.
          MOVE-CORRESPONDING return TO bapi_retn_info.
          IF return-type = 'A' OR return-type = 'E'.
            error_flag = 'X'.
          ENDIF.
          APPEND bapi_retn_info.
        ENDIF.
      ENDLOOP.
      IF error_flag = 'X'.
        MESSAGE e999(re) WITH 'Problem occured'.
        ROLLBACK WORK.
      ELSE.
       COMMIT WORK.
      ENDIF.
    ENDIF.

  • Posting COPA fields to FB01 using POSTING_INTERFACE_DOCUMENT

    Hi All,
    I am trying to post FI document through FB01 using POSTING_INTERFACE_DOCUMENT. All the FI fields are getting posted. But I am unable to post COPA fields. I am using BSEG-RKE* structure as suggested in other threads but still the COPA button is disabled for the document posted. I also checked in database, the fields are not populated. Could someone suggest if any additional information needs to be passed to enable COPA specific posting to the FM. Thanks.

    Hi SS ,
    can you do like this , Pass all COPA field details in this format "BSEG_RKEXXXXX' ,let me know the results.
    im ref :   call function 'RKE_FILL_BDCDATA_WITH_CRITERIA' in that FM.
    Edited by: Prabhu Peram on Sep 29, 2011 11:50 AM

  • FB01 upload using FM POSTING_INTERFACE_DOCUMENT

    Can somebody provide me the code to do upload for FB01 using FM POSTING_INTERFACE_DOCUMENT
    thanks in advance,
    dsr

    check programs RFBIBL00 and RFBIBL0. Also include RFBIBL02

  • POSTING_INTERFACE_DOCUMENT with PA segments/CO-PA

    Does anybody able post the document using function module POSTING_INTERFACE_DOCUMENT with PA Character ( CO-PA) segment(Product,Brand, equipment type). If so, can you please suggest me.
    Iam using the structure "CE01000" which was in FB01 screen but iam getting the error screen field is un known.
    Thanks.

    Thanks Rob, profit center, cost center and IOs are taken care. only concerned with PA segments. Function module is not understanding the structures for PA segments.

  • Function 'POSTING_INTERFACE_DOCUMENT'

    Hello,
    I'm using this function , and I have got it to work, but what I am now trying to do is add multiple lines and headers to the Internal table  FTPOST, being passed into the function.
    The way I enter it at the momment is like below and it does not work, how do I match the Headers to the line items, I understand that the headers have a type 'K'
    and the line items type'P'. And each has a counter,
    Do I increment the line counter for new headers or not, please see how I have doen it, which does not seem to work
      1  STYPE COUNT FNAM           
        P    |004  |BSEG-SGTXT      
      1 K    |001  |BKPF-BLDAT      
      2 K    |001  |BKPF-BLART      
      3 K    |001  |BKPF-BUKRS      
      4 K    |001  |BKPF-BUDAT      
      5 K    |001  |BKPF-WAERS      
      6 K    |001  |BKPF-XBLNR      
      7 K    |001  |BKPF-STGRD      
      8 K    |001  |BKPF-STODT      
      9 K    |001  |FS006-DOCID     
    10 P    |001  |RF05A-NEWBS     
    11 P    |001  |BSEG-HKONT      
    12 P    |001  |BSEG-WRBTR      
    13 P    |001  |BSEG-MWSKZ      
    14 P    |001  |BSEG-ZUONR      
    15 P    |001  |BSEG-SGTXT      
    16 P    |001  |BDC_SUBSCR      
    17 P    |001  |DKACB-FMORE     
    18 P    |001  |COBL-KOSTL      
    19 P    |001  |COBL-FIPOS      
    20 P    |001  |COBL-AUFNR 
              002
    .....     003
    then for the next header and records    
      1 K    |002  |BKPF-BLART      
      2 K    |002  |BKPF-BUKRS      
      3 K    |003  |BKPF-BUDAT 
    and line items
    11 P    |001  |BSEG-HKONT      
    12 P    |001  |BSEG-WRBTR      
    13 P    |001  |BSEG-MWSKZ 
    I think it is the line items in the second batch whic is causing the confusion.
    Thanks
    <

    for the colleagues that could not use this function with multiple documents yet.
    The answer was:
    1- first, call the start interface
    CALL FUNCTION 'POSTING_INTERFACE_START'
        EXPORTING
          i_client           = sy-mandt
          i_function         = 'B' "C=Call/B=BDC
          i_group            = pv_goup "Generar Juego de datos
          i_mode             = modo
          i_update           = 'S'
          i_user             = sy-uname
          i_xbdcc            = 'X'     "Generar Juego de datos
        EXCEPTIONS
          client_incorrect   = 1
          function_invalid   = 2
          group_name_missing = 3
          mode_invalid       = 4
          update_invalid     = 5
          OTHERS             = 6.
    2- call the posting function n times as documents you need
    CALL FUNCTION 'POSTING_INTERFACE_DOCUMENT'
    3- finally, Close de interface
    CALL FUNCTION 'POSTING_INTERFACE_END'
        EXPORTING
          i_bdcimmed              =  space "'X' "Ejecutar el juego de datos solo para BDC
        EXCEPTIONS
          session_not_processable = 1
          OTHERS                  = 2.
    Hope it will be useful

  • Errors while using funtion module 'POSTING_INTERFACE_DOCUMENT'

    Hi All,
    I have written a rpogram to simulate transaction 'FB01' using the function module 'POSTING_INTERFACE_DOCUMENT'.
    It is throwing an error - 'Two accounts were transferred but not BSEG-HKONT'
    What are the possible causes of this error.
    Thank you for all your help in advance.
    Nobin

    Hi Anand,
    Could you please specify which reference fields are not getting populated?
    I think this is the standard behaviour of POSTING_INTERFACE_CLEARING. All the values in the first line item are populated, while in second line item only some of the fields like posting key, account number, account currency, amount, company code and business partner are populated.
    If you need to populate other values, I guess you will have to search for some enhancement points inside the FM POSTING_INTERFACE_CLEARING after the 'call transaction' statement.
    Regards
    Radhika

  • POSTING_INTERFACE_DOCUMENT with tax holding base amount issue.

    Hello Experts,
    There is existing custom program which taking input from excel file and by using POSTING_INTERFACE_DOCUMENT FM they are posting Vendor Doc.
    Now they want to add with tax holding base amount to be add based on Tax Code. Through recording i got fieldname like WITH_ITEM-WT_WITHCD
    (tax code) and WITH_DIALG-WT_BASE (BASE AMOUNT).
    I'm using above field names and passing values to table of structure FTPOST, but its not working. is there any other way to make this work
    i found one table of structure FTTAX  (Taxes for Internal Posting Interface) can it be useful to achieve the goal????
    Thanks in Advance to all. 

    Uhm
    As you can see you've two codes for every wt lines, the first code is not editable
    Both the codes are the same values:
    - First CB, CB
    - Second CF, CF
    The wt codes you need to transfer to your posting are from master data (I don't know if it's for vendor, LFBW, or customer, KNBW)
    I suppose the order to show the wt depends on how they are set in master data
    Now, I've never used fm POSTING_INTERFACE_DOCUMENT directly, but it's used by BI standard RFBIBL00 and I've used it many many times.
    Usually the lines of wt have to have both codes, if it doesn't need to fill a code, this code has to fill with 'blank'
    So if It moved the wt for RFBIL00:
    - CB lines:
    WITH_ITEM-WITHT                 = 'CB'
    WITH_ITEM-WT_WITHCD       = SPACE
    WITH_DIALG-WT_BAS           = 0.
    - CF lines:
    WITH_ITEM-WITHT                 = 'CF'
    WITH_ITEM-WT_WITHCD       = 'CF'
    WITH_DIALG-WT_BAS           = 500.
    I repeat this is how the wt lines should be preparated for RFBIBL00, but this program calls POSTING_INTERFACE_DOCUMENT so I suppose it should be preparated in the same way.
    You can also considere to use RFBIBL00 instead of fm
    Max

  • Many documents posting using POSTING_INTERFACE_DOCUMENT

    Does anyone know the format for header and item to post many documents using POSTING_INTERFACE_DOCUMENT ?
    is it scenario A ?
    Document header data A ( K 1)
    Document item A.1 ( P 1)
    Document item A.2 ( P 2)
    Document header data B ( K 2)
    Document item B.1 ( P 1)
    Document item B.2 ( P 2)
    or scenario B ?
    Document header data A ( K 1)
    Document item A.1 ( P 1)
    Document item A.2 ( P 2)
    Document header data B ( K 2)
    Document item B.1 ( P 3)
    Document item B.2 ( P 4)
    or it cannot be done ?
    Many Thanks.

    Hi,
    Look at the link
    Re: function 'POSTING_INTERFACE_DOCUMENT'
    http://translate.google.com/translate?hl=en&sl=es&u=http://sap4.com/wiki/index.php%3Ftitle%3DZIFIPIDOC&sa=X&oi=translate&resnum=8&ct=result&prev=/search%3Fq%3DABAP%2B%252B%2BPOSTING_INTERFACE_DOCUMENT%26hl%3Den
    Regards
    Sudheer

  • Error while posting the parked document in ECC 6.0

    Hello ABAPers,
    After upgrade from R/3 4.6c to ECC 6.0, when we try to post the parked documents ,It calls FM :POSTING_INTERFACE_DOCUMENT".
    Inside it a call transaction is done using FBVB which throws error while posting for more than 4 withholding tax types.
    Error : Field WITH_DIALG-WT_BASE(5) does not exist in the screen SAPLFWTD 0100.
    On running BDC in foreground mode ,Error is happening when the withholding dialog opens and screen seems to be small to input all the tax codes i.e it shows only 4-5 rows and hence only 4 tax types passes to the screen and remaining is left out and error is thrown. This results in document not getting posted.
    But in 4.6 c a bigger screen pops up and no error is thrwon.
    We are not able to check FBVB directly, since it does'nt allow Direct call to this transaction.
    We have checked lots of thread and notes ,But nothing seems to be relevant or helpful in our case.
    Could you please help us in resolving this issue/ let us know if any configuration/ screen variant change is required?
    Thanks!
    Regards,
    M M Jaffer.

    Hello Nabheet ,
    It is a standard code. We are calling the FM  'PRELIMINIARY_POSTING_POST_ALL'  for posting the parked document. The FM calls internally another FM 'POSTING_INTERFACE_DOCUMENT'. This calls the transaction FBVB where we get the above error.
    Thanks.

  • Error while posting parked documents

    HI ALL,
    After upgrade when we try to post the parked documents ,It calls FM :POSTING_INTERFACE_DOCUMENT"
    Inside it a call transaction is done using FBVB which throws error while posting for more than 4 withholding tax types.
    Error : Field WITH_DIALG-WT_BASE(5) does not exist in the screen SAPLFWTD 0100.
    On running BDC in foreground mode ,Error is happening when the withholding dialog opens and screen seems to be small to input all the tax codes.
    But in 4.6 c a bigger screen pops up and no error is thrwon.
    We have checked lots of thread and notes ,But nothing seems to be relevant or helpful in our case.
    Please check it.
    Thanks!

    Hi,
    Please follow as given below:
    1. Use T.Code KO31 and enter order and deactivate the control
    2. Then try to post the parked document
    3. And use T.Code KO30 and enter the order to activate the control
    Some times system will check budget availability which already commited for parked documents.
    Hope it will work.
    Chandu

  • Using 'BAPI_ACC_GL_POSTING_POST' to simulate FBS1

    Hi,
    I'm using the 'BAPI_ACC_GL_POSTING_POST' to do the same as tran saction FBS1, having a few problems with the code in terms of values I should be using.
    When using FBs1 the values I use are from the following 2 lines:
    Po Number, Item, DELv. Date, Descr., Undelvd. Val., GL ACCount, Cost centre, last field being internal order
    4500011114     10     23.05.2006     pallet of photo paper     5,000.00     476000     2-1000     
    And
    4500011114     50     20.05.2006     marketing assistants     500.00     417000                    400157
    Not sure what values I should use for the following
    documentheader-obj_key =  '000000000100000038'.
    documentheader-obj_type = 'BKPFF'.
    *documentheader-obj_key = '180000000010002004'.
    documentheader-obj_sys = 'RD1CLNT200'.
    documentheader-username = sy-uname.
    documentheader-header_txt = 'Test using BAPI'.
    documentheader-comp_code = '2000'.
    The error I get is:
    E   |RW                  |609   |Error in document: BKPFF 0000000001000000<
    and E   |F5                  |702   |Balance in transaction currency 
    The code is below:
    DATA:
    obj_type LIKE bapiache02-obj_type,
    obj_key LIKE bapiache02-obj_key,
    obj_sys LIKE bapiache02-obj_sys,
    documentheader LIKE bapiache08,
    accountgl LIKE bapiacgl08
    OCCURS 0 WITH HEADER LINE,
    currencyamount LIKE bapiaccr08
    OCCURS 0 WITH HEADER LINE,
    return LIKE bapiret2
    OCCURS 0 WITH HEADER LINE,
    extension1 LIKE bapiextc
    OCCURS 0 WITH HEADER LINE,
    t_edidd LIKE edidd OCCURS 0 WITH HEADER LINE,
    bapi_retn_info LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    DATA: error_flag.
    *documentheader-obj_type = 'BKPFF'.
    documentheader-obj_key =  '000000000100000038'.
    documentheader-obj_type = 'BKPFF'.
    *documentheader-obj_key = '180000000010002004'.
    documentheader-obj_sys = 'RD1CLNT200'.
    documentheader-username = sy-uname.
    documentheader-header_txt = 'Test using BAPI'.
    documentheader-comp_code = '2000'.
    *documentheader-ac_doc_no
    *documentheader-fisc_year = '2005'.
    documentheader-doc_date = '20060506'.
    documentheader-pstng_date = '20060506'.
    *documentheader-trans_date
    *documentheader-fis_period
    documentheader-doc_type = 'SA'.
    *documentheader-ref_doc_no
    *documentheader-compo_acc
    *documentheader-reason_rev
    accountgl-itemno_acc = '1'.
    accountgl-gl_account = '0000476000'.
    accountgl-comp_code = '2000'.
    accountgl-pstng_date = '20060506'.
    accountgl-doc_type = 'SA'.
    accountgl-profit_ctr = '2-1000'.
    *accountgl-
    APPEND accountgl.
    accountgl-itemno_acc = '2'.
    accountgl-gl_account = '0000476000'.
    accountgl-comp_code = '2000'.
    accountgl-pstng_date = '20060506'.
    accountgl-doc_type = 'SA'.
    accountgl-profit_ctr = '2-1000'.
    *accountgl-
    APPEND accountgl.
    accountgl-itemno_acc = '3'.
    accountgl-gl_account = '0000417000'.
    accountgl-comp_code = '2000'.
    accountgl-pstng_date = '20060506'.
    accountgl-doc_type = 'SA'.
    accountgl-profit_ctr = '0000400157'.
    APPEND accountgl.
    accountgl-itemno_acc = '4'.
    accountgl-gl_account = '0000417000'.
    accountgl-comp_code = '2000'.
    accountgl-pstng_date = '20060506'.
    accountgl-doc_type = 'SA'.
    accountgl-profit_ctr = '0000400157'.
    APPEND accountgl.
    *AC_DOC_NO
    *FISC_YEAR
    *FIS_PERIOD
    *accountgl-STAT_CON = 'X'.
    *REF_KEY_1
    *REF_KEY_2
    *REF_KEY_3
    *CUSTOMER
    *VENDOR_NO
    *ALLOC_NMBR
    *ITEM_TEXT
    *BUS_AREA
    *COSTCENTER
    *ACTTYPE
    *ORDERID
    *ORIG_GROUP
    *COST_OBJ
    *PROFIT_CTR
    *PART_PRCTR
    *WBS_ELEMENT
    *NETWORK
    *ROUTING_NO
    *ORDER_ITNO
    currencyamount-itemno_acc = '1'.
    currencyamount-currency = 'EUR'.
    currencyamount-amt_doccur = '5000.00'.
    APPEND currencyamount.
    currencyamount-itemno_acc = '2'.
    currencyamount-currency = 'EUR'.
    currencyamount-amt_doccur = '-5000.00'.
    APPEND currencyamount.
    currencyamount-itemno_acc = '3'.
    currencyamount-currency = 'EUR'.
    currencyamount-amt_doccur = '-500.00'.
    APPEND currencyamount.
    currencyamount-itemno_acc = '4'.
    currencyamount-currency = 'EUR'.
    currencyamount-amt_doccur = '-500.00'.
    APPEND currencyamount.
    call BAPI-function in this system
    CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
    EXPORTING
    documentheader = documentheader
    importing
    obj_type = obj_type
    obj_key = obj_key
    obj_sys = obj_sys
    TABLES
    accountgl = accountgl
    currencyamount = currencyamount
    return = return
    extension1 = extension1
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
      MESSAGE e999(re) WITH 'Problem occured'.
    ELSE.
      LOOP AT return.
        IF NOT return IS INITIAL.
          CLEAR bapi_retn_info.
          MOVE-CORRESPONDING return TO bapi_retn_info.
          IF return-type = 'A' OR return-type = 'E'.
            error_flag = 'X'.
          ENDIF.
          APPEND bapi_retn_info.
        ENDIF.
      ENDLOOP.
      IF error_flag = 'X'.
        MESSAGE e999(re) WITH 'Problem occured'.
        ROLLBACK WORK.
      ELSE.
       COMMIT WORK.
      ENDIF.
    ENDIF.
    Many Thanks
    Regards Sims

    hi,
    is there is an example of how to use FM POSTING_INTERFACE_DOCUMENT, I guess, one of my issues is trying to work out the parameters I need to use?
    Many Thanks
    Regards Sims

  • F-02 BDC

    Hi Expert,
      Very Good Morning to All .
         i'm working on BDC Program for F-02  ( G/L Account Posting ) ,but its not able to run only when posting key is '25' apart from '25' posting key it works very fine .is there any one help me to solve this issue following is my current code ..
    REPORT zcfi_sal_f02
            NO STANDARD PAGE HEADING LINE-SIZE 255.
    TYPE-POOLS: truxs.
    DATA: BEGIN OF itab OCCURS 0,
             srno(10),
             bldat(12),
             blart(2),
             bukrs(4),
             budat(12),
             monat(4),
             waers(5),
             xblnr(30),
             bktxt(30),
             newbs(2),
             newko(12),
             wrbtr(18),
             kostl(12),
             prctr(10),
             zuonr(10),
             sgtxt(30),
           END OF itab,
           itab1 LIKE TABLE OF itab WITH HEADER LINE,
           cnt   TYPE i.
    *Data decleration for Error Message
    DATA: t_msg TYPE TABLE OF bdcmsgcoll,   " Collecting Error messages
           w_msg TYPE bdcmsgcoll,
           w_msg1(51).
    *Structure for error message
    TYPES : BEGIN OF ty_s_error,
               msg_err(300) TYPE c,
             END OF ty_s_error.
    DATA: it_output TYPE TABLE OF ty_s_error,
           wa_output LIKE LINE OF it_output,
           wa_error TYPE string.
    DATA : scrn_no LIKE bdcdata-dynpro.
    DATA : scrn_no1 LIKE bdcdata-dynpro.
    DATA : bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    DATA: fieldnmknam TYPE bdcdata-fnam.
    DATA : BEGIN OF itab_lfbw OCCURS 0,
    witht TYPE lfbw-witht,
    wt_withcd TYPE lfbw-wt_withcd,
    wt_subjct TYPE lfbw-wt_subjct,
    END OF itab_lfbw.
    DATA : i TYPE i.
    DATA : ven_ind.
    DATA : no_lines TYPE sy-tabix.
    DATA : gsber(4),xref1(20),xref2(20),xref3(20).
    DATA : bukrs(4).
    *DATA : filename TYPE string.
    *Selection Screen
    ***parameters : f_file like rlgrap-filename,
    ***             ctu_mode like ctu_params-dismode default 'A'.
    PARAMETERS : f_file LIKE rlgrap-filename,
    ***             e_file   TYPE rlgrap-filename OBLIGATORY,       " Error File Path
                  ctu_mode LIKE ctu_params-dismode DEFAULT 'A'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_file.
       CALL FUNCTION 'F4_FILENAME'
    * EXPORTING
    * PROGRAM_NAME = 'ZMM02_BDC'
    * DYNPRO_NUMBER = SYST-DYNNR
    ** FIELD_NAME = ' '
       IMPORTING
       file_name = f_file.
    *START OF SELECTION
    START-OF-SELECTION.
       PERFORM upload_data.
       PERFORM bdc_execution.
    END-OF-SELECTION.
    * Uploading data file to internal table. *
    FORM upload_data.
       DATA : raw_data TYPE truxs_t_text_data.
       CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       EXPORTING
    * I_FIELD_SEPERATOR =
      i_line_header = 'X'
       i_tab_raw_data = raw_data
       i_filename = f_file
       TABLES
       i_tab_converted_data = itab[]
      EXCEPTIONS
      conversion_failed = 1
      OTHERS = 2
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
       itab1[] = itab[].
       DELETE ADJACENT DUPLICATES FROM itab COMPARING srno.
    ENDFORM. "upload_data
    *&      Form  bdc_execution
    *       text
    FORM bdc_execution.
       LOOP AT itab.
         cnt = 1.
         PERFORM bdc_dynpro      USING 'SAPMF05A' '0100'.
         PERFORM bdc_field       USING 'BDC_CURSOR'
                                       'RF05A-NEWKO'.
         PERFORM bdc_field       USING 'BDC_OKCODE'
                                       '/00'.
         PERFORM bdc_field       USING 'BKPF-BLDAT'
                                       itab-bldat.                     "'02.03.2013'.
         PERFORM bdc_field       USING 'BKPF-BLART'
                                       itab-blart.                     "'SA'.
         PERFORM bdc_field       USING 'BKPF-BUKRS'
                                       itab-bukrs.               "'1000'.
         PERFORM bdc_field       USING 'BKPF-BUDAT'
                                       itab-budat.                     "'02.03.2013'.
         PERFORM bdc_field       USING 'BKPF-MONAT'
                                       itab-monat.               "'3'.
         PERFORM bdc_field       USING 'BKPF-WAERS'
                                       itab-waers.                     "'INR'.
         PERFORM bdc_field       USING 'BKPF-XBLNR'
                                       itab-xblnr.                     "'Salary_Test2'.
         PERFORM bdc_field       USING 'BKPF-BKTXT'
                                       itab-bktxt.                     "'Salary upload'.
         PERFORM bdc_field       USING 'FS006-DOCID'
         PERFORM bdc_field       USING 'RF05A-NEWBS'
                                       itab-newbs.               "'50'.
         PERFORM bdc_field       USING 'RF05A-NEWKO'
                                       itab-newko.                     "'15030019'.
         CASE itab-newbs.
           WHEN '50'.
             PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'BSEG-SGTXT'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '/00'.
             PERFORM bdc_field       USING 'BSEG-WRBTR'
                                           itab-wrbtr.           "'100'.
             PERFORM bdc_field       USING 'BSEG-ZUONR'
                                           itab-zuonr.           "'1110'.
             PERFORM bdc_field       USING 'BSEG-SGTXT'
                                           itab-sgtxt.                     "'pf for the month jan-12'.
             PERFORM bdc_field       USING 'DKACB-FMORE'
                                           'X'.
             PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'COBL-PRCTR'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '=ENTE'.
             PERFORM bdc_field       USING 'COBL-KOSTL'
                                           itab-kostl.                    ""'11000000'.
             PERFORM bdc_field       USING 'COBL-PRCTR'
                                           itab-prctr.           "'1110'.
             PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'BSEG-WRBTR'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '=AB'.
             PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'COBL-PRCTR'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '=ENTE'.
           WHEN '40'.
             PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'BSEG-SGTXT'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '/00'.
             PERFORM bdc_field       USING 'BSEG-WRBTR'
                                           itab-wrbtr.           ""'100'.
             PERFORM bdc_field       USING 'BSEG-ZUONR'
                                           itab-zuonr.          ""'21 March'.
             PERFORM bdc_field       USING 'BSEG-SGTXT'
                                           itab-sgtxt.                    ""'21 March 2013'.
             PERFORM bdc_field       USING 'DKACB-FMORE'
                                           'X'.
             PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'COBL-KOSTL'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '=ENTE'.
             PERFORM bdc_field       USING 'COBL-KOSTL'
                                           itab-kostl.                    ""'11000000'.
             PERFORM bdc_field       USING 'COBL-PRCTR'
                                           itab-prctr.           ""'1000'.
             PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'BSEG-WRBTR'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '=AB'.
              PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'COBL-KOSTL'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '=ENTE'.
           WHEN '25'.
              PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'RF05A-NEWKO'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '/00'.
              PERFORM bdc_field       USING 'BSEG-WRBTR'
                                             itab-wrbtr.           ""'100'.
              PERFORM bdc_field       USING 'BSEG-ZUONR'
                                             itab-zuonr.          ""'21 March'.
              PERFORM bdc_field       USING 'BSEG-SGTXT'
                                             itab-sgtxt.                    ""'21 March 2013'.
              PERFORM bdc_field       USING 'RF05A-NEWBS'
                                             itab-NEWBS.
              PERFORM bdc_field       USING 'RF05A-NEWKO'
                                             itab-NEWKO.
              PERFORM bdc_field       USING 'DKACB-FMORE'
                                            'X'.
              PERFORM bdc_dynpro      USING 'SAPMF05A' '0002'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            '=ENTE'.
              PERFORM bdc_field       USING 'COBL-PRCTR'
                                           itab-prctr.           ""'1000'.
              PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'BSEG-WRBTR'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '=AB'.
             PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
             PERFORM bdc_field       USING 'BDC_CURSOR'
                                           'COBL-PRCTR'.
             PERFORM bdc_field       USING 'BDC_OKCODE'
                                           '=ENTE'.
         ENDCASE.
         LOOP AT itab1 WHERE srno = itab-srno.
           CASE cnt.
             WHEN '1'.
               CLEAR cnt.
             WHEN OTHERS.
               CASE itab1-newbs.
                 WHEN '50'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0700'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'RF05A-NEWKO'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BKPF-XBLNR'
                                                 itab1-xblnr.                 "'SALARY_TEST2'.
                   PERFORM bdc_field       USING 'BKPF-BKTXT'
                                                 itab1-bktxt.                 "'Salary upload'.
                   PERFORM bdc_field       USING 'RF05A-NEWBS'
                                                 itab1-newbs.    "'50'.
                   PERFORM bdc_field       USING 'RF05A-NEWKO'
                                                 itab1-newko.                 "'15030021'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-SGTXT'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BSEG-WRBTR'
                                                 itab1-wrbtr.    "'100'.
                   PERFORM bdc_field       USING 'BSEG-ZUONR'
                                                 itab1-zuonr.    "'1110'.
                   PERFORM bdc_field       USING 'BSEG-SGTXT'
                                                 itab1-sgtxt.                  "'pf for the month jan-12'.
                   PERFORM bdc_field       USING 'DKACB-FMORE'
                                                 'X'.
                   PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'COBL-PRCTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=ENTE'.
                   PERFORM bdc_field       USING 'COBL-KOSTL'
                                                 itab1-kostl.                    ""'11000000'.
                   PERFORM bdc_field       USING 'COBL-PRCTR'
                                                 itab1-prctr.    "'1110'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-WRBTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=AB'.
                   PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'COBL-PRCTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=ENTE'.
                 WHEN '40'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0700'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'RF05A-NEWKO'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BKPF-XBLNR'
                                                 itab1-xblnr.                    ""'REF TEXT'.
                   PERFORM bdc_field       USING 'BKPF-BKTXT'
                                                 itab1-bktxt.                    ""'DOC HEAD TEXT'.
                   PERFORM bdc_field       USING 'RF05A-NEWBS'
                                                 itab1-newbs.    ""'40'.
                   PERFORM bdc_field       USING 'RF05A-NEWKO'
                                                 itab1-newko.                    ""'42010010'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-SGTXT'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BSEG-WRBTR'
                                                 itab1-wrbtr.    ""'123'.
                   PERFORM bdc_field       USING 'BSEG-ZUONR'
                                                 itab1-zuonr.    ""'1000'.
                   PERFORM bdc_field       USING 'BSEG-SGTXT'
                                                 itab1-sgtxt.                    ""'SALARY TEXT'.
                   PERFORM bdc_field       USING 'DKACB-FMORE'
                                                 'X'.
                   PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'COBL-PRCTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=ENTE'.
                   PERFORM bdc_field       USING 'COBL-KOSTL'
                                                 itab1-kostl.                    ""'11000260'.
                   PERFORM bdc_field       USING 'COBL-PRCTR'
                                                 itab1-prctr.    ""'1000'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0300'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-WRBTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=AB'.
                   PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'COBL-KOSTL'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=ENTE'.
                 WHEN '34'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0700'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'RF05A-NEWKO'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BKPF-XBLNR'
                                                 itab1-xblnr.                 "'SALARY_TEST2'.
                   PERFORM bdc_field       USING 'BKPF-BKTXT'
                                                 itab1-bktxt.                 "'DOC HEAD TEXT'.
                   PERFORM bdc_field       USING 'RF05A-NEWBS'
                                                 itab1-newbs.    "'34'.
                   PERFORM bdc_field       USING 'RF05A-NEWKO'
                                                 itab1-newko.    "'EMP1266'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-SGTXT'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BSEG-WRBTR'
                                                 itab1-wrbtr.    "'50'.
                   PERFORM bdc_field       USING 'BSEG-ZUONR'
                                                 itab1-zuonr.    "'1110'.
                   PERFORM bdc_field       USING 'BSEG-SGTXT'
                                                 itab1-sgtxt.                  "'aaa'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-WRBTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=AB'.
                 WHEN '35'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0700'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'RF05A-NEWKO'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BKPF-XBLNR'
                                                 itab1-xblnr.                 "'SALARY_TEST2'.
                   PERFORM bdc_field       USING 'BKPF-BKTXT'
                                                 itab1-bktxt.                 "'Salary upload'.
                   PERFORM bdc_field       USING 'RF05A-NEWBS'
                                                 itab1-newbs.    "'35'.
                   PERFORM bdc_field       USING 'RF05A-NEWKO'
                                                 itab1-newko.    "'EMP1266'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-SGTXT'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BSEG-WRBTR'
                                                 itab1-wrbtr.    "'1000'.
                   PERFORM bdc_field       USING 'BSEG-ZUONR'
                                                 itab1-zuonr.    "'1110'.
                   PERFORM bdc_field       USING 'BSEG-SGTXT'
                                                 itab1-sgtxt.                  "'Advance recovered2'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-WRBTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=AB'.
                 WHEN '25'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0700'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'RF05A-NEWKO'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BKPF-XBLNR'
                                                 itab1-xblnr.                 "'SALARY_TEST2'.
                   PERFORM bdc_field       USING 'BKPF-BKTXT'
                                                 itab1-bktxt.                 "'Salary upload'.
                   PERFORM bdc_field       USING 'RF05A-NEWBS'
                                                 itab1-newbs.    "'25'.
                   PERFORM bdc_field       USING 'RF05A-NEWKO'
                                                 itab1-newko.    "'EMP1266'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-SGTXT'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BSEG-WRBTR'
                                                 itab1-wrbtr.    "'1000'.
                   PERFORM bdc_field       USING 'BSEG-ZUONR'
                                                 itab1-zuonr.    "'1110'.
                   PERFORM bdc_field       USING 'BSEG-SGTXT'
                                                 itab1-sgtxt.                  "'Advance recovered11'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-WRBTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=AB'. 
                 WHEN '24'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0700'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'RF05A-NEWKO'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BKPF-XBLNR'
                                                 itab1-xblnr.                 "'SALARY_TEST2'.
                   PERFORM bdc_field       USING 'BKPF-BKTXT'
                                                 itab1-bktxt.                 "'Salary upload'.
                   PERFORM bdc_field       USING 'RF05A-NEWBS'
                                                 itab1-newbs.    "'24'.
                   PERFORM bdc_field       USING 'RF05A-NEWKO'
                                                 itab1-newko.    "'600003'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-SGTXT'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '/00'.
                   PERFORM bdc_field       USING 'BSEG-WRBTR'
                                                 itab1-wrbtr.    "'60'.
                   PERFORM bdc_field       USING 'BSEG-ZUONR'
                                                 itab1-zuonr.    "'1110'.
                   PERFORM bdc_field       USING 'BSEG-SGTXT'
                                                 itab1-sgtxt.                  "' WEST_CGF_Direct /salary exp/jan-12'.
                   PERFORM bdc_dynpro      USING 'SAPMF05A' '0302'.
                   PERFORM bdc_field       USING 'BDC_CURSOR'
                                                 'BSEG-WRBTR'.
                   PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=AB'.
               ENDCASE.
           ENDCASE.
         ENDLOOP.
         PERFORM bdc_dynpro      USING 'SAPMF05A' '0700'.
         PERFORM bdc_field       USING 'BDC_CURSOR'
                                       'RF05A-NEWBS'.
         PERFORM bdc_field       USING 'BDC_OKCODE'
                                       '=BU'.
         CALL TRANSACTION 'F-02' USING bdcdata
         MODE ctu_mode
         UPDATE 'S'
         MESSAGES INTO t_msg.
         REFRESH: bdcdata, t_msg.
         CLEAR: bdcdata, t_msg, w_msg.
         CLEAR: itab, itab1.
       ENDLOOP.
    ENDFORM .                    "bdc_execution
    *&      Form  bdc_dynpro
    *       text
    *      -->PROGRAM    text
    *      -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
       CLEAR bdcdata.
       bdcdata-program = program.
       bdcdata-dynpro = dynpro.
       bdcdata-dynbegin = 'X'.
       APPEND bdcdata.
    ENDFORM. "BDC_DYNPRO
    * Insert field *
    FORM bdc_field USING fnam fval.
       CLEAR bdcdata.
       IF fval <> space.
         bdcdata-fnam = fnam.
         bdcdata-fval = fval.
         APPEND bdcdata.
       ENDIF.
    ENDFORM. "BDC_FIELD

    If you really don't want to use a BAPI (whatever your actual reasons) you could let Sap do it for you and do not worry about the screen numbers and sequence.
    Look at scn for following FM :
    POSTING_INTERFACE_START
    POSTING_INTERFACE_DOCUMENT
    POSTING_INTERFACE_END
    Also note that F-02 is FB01 in  disguise (with SA / 40 default values on first screen)
    Regards,
    Raymond

  • BAPI_ACC_DOCUMENT_POST for Clearing (F-30)

    How can we use BAPI_ACC_DOCUMENT_POST for Account posting with Clearing(F-30). I am able to do it for normal GL postings(FB01).I want to use this BAPI for clearing the Open items for a given customer...
    Thanks
    Rajesh

    I don't think BAPI_ACC_DOCUMENT_POST is designed to perform a "Post with clearing".  However, function module POSTING_INTERFACE_CLEARING will allow you to access the functionality of transaction FB05 (F-30 is really calling FB05 with BKPF-BLART = 'DA').  The FM documentation contains the following:
    <i>Post with clearing (FB05) using internal posting interface
    Function module 'POSTING_INTERFACE_CLEARING' creates a batch input transaction (or Call Transaction ... Using ...) for a document to be posted using transaction FB05.
    The document header data and the data for the bank postings are transferred to table FTPOST. The rules for filling table FTPOST are described in the documentation for function module 'POSTING_INTERFACE_DOCUMENT'.
    </i>
    Best of luck!
    Regards,
    James Gaddis

  • Posting a particular Ledger using BAPI_ACC_DOCUMENT_POST

    Is it possible to post to a specific ledger using the BAPI_ACC_DOCUMENT_POST.
    Currently we use a BDC on FB01L and would like to convert this into a BAPI, Can this be done ?

    Hi,
    You can try with Posting Interface, please try with the following posting interface.
    POSTING_INTERFACE_CLEARING     Post with clearing (FB05) using internal posting interface
    POSTING_INTERFACE_DOCUMENT     Post document using the internal posting interface
    POSTING_INTERFACE_END
    POSTING_INTERFACE_RESET_CLEAR  Reset clearing via posting interface
    POSTING_INTERFACE_REVERSE_DOC  Cancel document via posting interface
    POSTING_INTERFACE_START        Initial information for internal accounting interface
    Regards
    Pugazhenthi.P

Maybe you are looking for