About BAPI_ACC_DOCUMENT_POST

Hi all,
Does BAPI_ACC_DOCUMENT_POST be used post Asset account in G/L Account Posting? as i used, only G/L, AR,AP.
If it doesn't effect for Asset account, any other BAPI can be used?
thank you very much.
helen

thank you for your repsonse.
but my customer want post it with tcode FB01 , it involoved account payment, so BAPI_ASSET_POSTCAP_POST is not suitable for this.

Similar Messages

  • Problem about bapi BAPI_ACC_DOCUMENT_POST

    Field rstgr in bseg table am not able to field this field in BAPI, what can i do ,help me ,pls.

    Hi,
    you could play a dangerous game, modifying the value in the memory of the Abap program. I give you an example :
      field-symbols: <field1> type any ,
                     <field2> type any .
      data : w_field1(30) value '(SAPMM06I)PREIS_KSCHL' ,
             w_field2(30) value '(ZZ_FG007)KSCHL'.
      assign (w_field1) to <field1>.
      check sy-subrc eq space.
      assign (w_field2) to <field2>.
      check sy-subrc eq space.
      move <field2> to <field1>.
    in this code I will modify the value of of the field PREIS_KSCHL in the program SAPMM06I (I'm not in this program when I do that).
    but ... it's quiete dangerous
    Fred

  • Making Down Payment Request using BAPI_ACC_DOCUMENT_POST

    Hi, all...
    I faced a problem while I'm testing BAPI_ACC_DOCUMENT_POST to make down payment request(F-47), so I need some help.
    I've found a BAPI_ACC_DOCUMENT_POST in down payment about this topic and followed its parameter settings except for currency settings.
    In that posting, the accountpayable-pymt_cur and currencyamount-currency are set different currency.
    While I set the two fields with same currency(USD). Belows are my source codes.
      DOCUMENTHEADER-OBJ_TYPE   = 'IDOC'.
      DOCUMENTHEADER-OBJ_KEY    = '$'.
      DOCUMENTHEADER-OBJ_SYS    = 'D10CLNT200'.
      DOCUMENTHEADER-BUS_ACT    = 'RFBU'.
      DOCUMENTHEADER-USERNAME   = SY-UNAME.
      DOCUMENTHEADER-HEADER_TXT = 'DOWN PAYMENT REQUEST'.
      DOCUMENTHEADER-COMP_CODE  = '1000'.
      DOCUMENTHEADER-DOC_DATE   = '2006.09.01'.
      DOCUMENTHEADER-PSTNG_DATE = '2006.09.01'.
      DOCUMENTHEADER-DOC_TYPE   = 'KG'.
      ACCOUNTPAYABLE-ITEMNO_ACC    = '0000000001'.
      ACCOUNTPAYABLE-VENDOR_NO     = '0002314908'.
      ACCOUNTPAYABLE-GL_ACCOUNT    = '0091120100'.
      ACCOUNTPAYABLE-COMP_CODE     = '1000'.
      ACCOUNTPAYABLE-PYMT_METH     = 'L'.
      ACCOUNTPAYABLE-PMNT_BLOCK    = 'A'.
      ACCOUNTPAYABLE-BUSINESSPLACE = '1001'.
      ACCOUNTPAYABLE-PYMT_CUR      = 'USD'.
      ACCOUNTPAYABLE-PYMT_AMT      = '123,438.0000'.
      ACCOUNTPAYABLE-SP_GL_IND     = '2'.
      ACCOUNTPAYABLE-TAX_CODE      = 'RR'.
      CURRENCYAMOUNT-ITEMNO_ACC = '0000000001'.
      CURRENCYAMOUNT-CURRENCY   = 'USD'.
      CURRENCYAMOUNT-AMT_DOCCUR = '123,438.0000'.
    But the function returns an error:
    'Enter a payment currency different to USD'
    But if I would set with different currencies, it returns an error:
    'Balance in transaction currency'
    If the ACCOUNTPAYABLE-PYMT_CUR and ACCOUNTPAYABLE-PYMT_AMT were remained empty, it returns
    'Balance in transaction currency'
    What should I do about this currency setting.
    Someone please let me know about doing this right way.
    Thank you.
    Message was edited by: Jong-woon Lee

    Hi,
    Just in case you found this thread with the same problem.
    At least in my case what was happening is that I wanted to leave the currency fields blank (the same currency as payment value) but I was filling in ACCOUNTPAYABLE-PYMT_AMT, so was receiving error telling me that currency fields could not be empty. And if I set them to the same as payment, I would receive a message telling me that currency must be different.
    If you want to use only one currency you don't need to fill in these 3 fields:
    ACCOUNTPAYABLE-PYMT_AMT
    ACCOUNTPAYABLE-PYMT_CUR
    ACCOUNTPAYABLE-PYMT_CUR_ISO
    The same probably applies for the ACCOUNTRECEIVABLE table.
    Cheers,
    Erick
    Ps.
    Some extra text so you can find this thread by searching for error messages:
    Required field CURRENCY was not transferred in parameter ACCOUNTPAYABLE
    For the ISO code  there is no unique SAP currency code for ALE
    For the ISO code  there is no unique SAP currency code for ALE
        Message no. B1888
    Diagnosis
        There are several entries in TCURC for this ISO code, but none with the
        primary flag set.
    Procedure
        In table TCURC set the primary flag for ISO codes used multiple times.
    Required field CURRENCY was not transferred in parameter ACCOUNTPAYABLE
        Message no. RW602
    Diagnosis
        Field CURRENCY is required in parameter ACCOUNTPAYABLE for processing
        the document. The document is incomplete without this field.
    System Response
        The document cannot be processed.
    Procedure
        Enter a valid value in field CURRENCY in parameter ACCOUNTPAYABLE.

  • How to use EXTENSION1 in BAPI_ACC_DOCUMENT_POST

    Hi,
    I am using BAPI_ACC_DOCUMENT_POST for posting documents similar to what is posted using FBS1 transaction code.
    I'm not able to populate reversal date in the BAPI_ACC_DOCUMENT_POST. There is a provision it seems using the EXTENSION1 tables parameter.
    Can anyone please tell me the procedure preferably a small piece of sample code in which I can know how to pass the Reversal Date using the EXTENSION1 structure.
    Also which process code is required to be used in the Business Transaction Events enhancements to implement this.
    Thanks and regards,
    Satyadev Dutta

    hi
    good
    go through this program which ll help you to give greater knowledge about use of EXTENSION1 in BAPI_ACC_DOCUMENT_POST
    ======================================
    report zbapi_factura_acreedor2 .
    *REPORT  acc_bapi_test_document                  .
    selection-screen begin of block bl01 .
    parameters:
      check_l             radiobutton group rb1,
      check_a default 'X' radiobutton group rb1,
      post                radiobutton group rb1.
    selection-screen uline.
    parameters:
      rev_c               radiobutton group rb1,
      rev_p               radiobutton group rb1.
    selection-screen uline.
    parameters:
      ref_key like bapiache01-obj_key default 'TEST000001BAPICALL',
      dest    like bdi_logsys-logsys  default '          '.
    selection-screen end   of block bl01 .
    data:
      gd_documentheader    like bapiache09,
      gd_customercpd       like bapiacpa09,
      gd_fica_hd           like bapiaccahd,
      it_accountreceivable like table of bapiacar09 with header line,
      it_accountgl         like table of bapiacgl09 with header line,
      it_accounttax        like table of bapiactx09 with header line,
      it_criteria          like table of bapiackec9 with header line,
      it_valuefield        like table of bapiackev9 with header line,
      it_currencyamount    like table of bapiaccr09 with header line,
      it_return            like table of bapiret2   with header line,
      it_receivers         like table of bdi_logsys with header line,
      it_fica_it           like table of bapiaccait with header line,
      it_accountpayable    like table of bapiacap09 with header line,
      it_paymentcard       like table of bapiacpc09 with header line,
      it_ext               like table of bapiacextc with header line.
    it_re                LIKE TABLE OF bapiacre09 WITH HEADER LINE,
    it_ext2              LIKE TABLE OF bapiparex  WITH HEADER LINE.
    perform fill_internal_tables.
    if check_l = 'X'.
      call function 'BAPI_ACC_DOCUMENT_CHECK'
           destination dest
           exporting
                documentheader    = gd_documentheader
                customercpd       = gd_customercpd
                contractheader    = gd_fica_hd
           tables
                accountgl         = it_accountgl
                accountreceivable = it_accountreceivable
                accountpayable    = it_accountpayable
                accounttax        = it_accounttax
               currencyamount    = it_currencyamount
                criteria          = it_criteria
                valuefield        = it_valuefield
                extension1        = it_ext
                return            = it_return
                paymentcard       = it_paymentcard
                contractitem      = it_fica_it.
               extension2        = it_ext2
               realestate        = it_re.
      write: / 'Result of check lines:'.                        "#EC NOTEXT
      perform show_messages.
    endif.
    if check_a = 'X'.
      call function 'BAPI_ACC_DOCUMENT_CHECK'
        destination dest
        exporting
          documentheader    = gd_documentheader
          customercpd       = gd_customercpd
          contractheader    = gd_fica_hd
        tables
          accountgl         = it_accountgl
          accountreceivable = it_accountreceivable
          accountpayable    = it_accountpayable
          accounttax        = it_accounttax
          currencyamount    = it_currencyamount
          criteria          = it_criteria
          valuefield        = it_valuefield
          extension1        = it_ext
          return            = it_return
          paymentcard       = it_paymentcard
          contractitem      = it_fica_it.
         extension2        = it_ext2
         realestate        = it_re.
      write: / 'Result of check all:'.                          "#EC NOTEXT
      perform show_messages.
    endif.
    if post = 'X'.
      data: l_type like gd_documentheader-obj_type,
            l_key  like gd_documentheader-obj_key,
            l_sys  like gd_documentheader-obj_sys.
      if dest = space or
         dest = gd_documentheader-obj_sys.
       post synchron
        call function 'BAPI_ACC_DOCUMENT_POST'
          exporting
            documentheader    = gd_documentheader
            customercpd       = gd_customercpd
            contractheader    = gd_fica_hd
          importing
            obj_type          = l_type
            obj_key           = l_key
            obj_sys           = l_sys
          tables
            accountgl         = it_accountgl
            accountreceivable = it_accountreceivable
            accountpayable    = it_accountpayable
            accounttax        = it_accounttax
            currencyamount    = it_currencyamount
            criteria          = it_criteria
            valuefield        = it_valuefield
            extension1        = it_ext
            return            = it_return
            paymentcard       = it_paymentcard
            contractitem      = it_fica_it.
           extension2        = it_ext2
           realestate        = it_re.
        write: / 'Result of post:'.                             "#EC NOTEXT
        perform show_messages.
      else.
      create Idoc
        it_receivers-logsys = dest.
        append it_receivers.
        call function 'ALE_ACC_DOCUMENT_POST'
          exporting
            documentheader    = gd_documentheader
            customercpd       = gd_customercpd
            contractheader    = gd_fica_hd
          tables
            accountgl         = it_accountgl
            accountreceivable = it_accountreceivable
            accountpayable    = it_accountpayable
            accounttax        = it_accounttax
            currencyamount    = it_currencyamount
            criteria          = it_criteria
            valuefield        = it_valuefield
            extension1        = it_ext
            paymentcard       = it_paymentcard
            contractitem      = it_fica_it
           extension2        = it_ext2
           realestate        = it_re
            receivers         = it_receivers
          COMMUNICATION_DOCUMENTS =
          APPLICATION_OBJECTS     =
          exceptions
            error_creating_idocs    = 1
            others                  = 2  .
        if sy-subrc = 0.
          write: / 'IDoc created'.                              "#EC NOTEXT
        else.
          write: sy-msgid.
        endif.
      endif.
    endif.
    if rev_p = 'X' or rev_c = 'X'.
      data: rev like bapiacrev,
            rev_key like ref_key.
      rev_key       = ref_key.
      rev_key(1)    = 'R'.
      rev-obj_type  = gd_documentheader-obj_type.
      rev-obj_key   = rev_key.
      rev-obj_sys   = gd_documentheader-obj_sys.
      rev-obj_key_r = ref_key.
      if rev_c is initial.
        if dest = space or
           dest = gd_documentheader-obj_sys.
          call function 'BAPI_ACC_DOCUMENT_REV_POST'
            exporting
              reversal = rev
              bus_act  = gd_documentheader-bus_act
            tables
              return   = it_return.
        else.
          it_receivers-logsys = dest.
          append it_receivers.
          call function 'ALE_ACC_DOCUMENT_REV_POST'
            exporting
              reversal                      = rev
              busact                        = gd_documentheader-bus_act
            OBJ_TYPE                      = 'BUS6035'
            SERIAL_ID                     = '0'
            tables
              receivers                     = it_receivers
            COMMUNICATION_DOCUMENTS       =
            APPLICATION_OBJECTS           =
            exceptions
              error_creating_idocs          = 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.
          else.
            write: / 'IDoc created'.                            "#EC NOTEXT
          endif.
        endif.
      else.
        call function 'BAPI_ACC_DOCUMENT_REV_CHECK'
          exporting
            reversal = rev
            bus_act  = gd_documentheader-bus_act
          tables
            return   = it_return.
      endif.
      write: / 'Result of Reversal Posting:'.                   "#EC NOTEXT
      perform show_messages.
    endif.
    commit work.
         Form  fill_internal_tables
    form fill_internal_tables.
      perform fill_header.
      perform fill_accountgl.
    perform fill_accountar.
      perform fill_accountap.
      perform fill_accounttax.
      perform fill_currencyamount.
    perform fill_criteria.
    perform fill_valuefield.
    perform fill_re.
    perform fill_cpd.
    perform fill_contractitem.
    perform fill_contractheader.
    perform fill_paymentcard.
    perform fill_extension.
    endform.                               " fill_internal_tables
         Form  Show_messages
    form show_messages.
      if it_return[] is initial.
        write: / 'no messages'.
      else.
        skip 1.
        loop at it_return.
          write: /    it_return-type,
                 (2)  it_return-id,
                      it_return-number,
                 (80) it_return-message,
                    IT_RETURN-LOG_NO
                    IT_RETURN-LOG_MSG_NO
                      it_return-message_v1,
                    IT_RETURN-MESSAGE_V2
                    IT_RETURN-MESSAGE_V3
                    IT_RETURN-MESSAGE_V4
                 (20) it_return-parameter,
                 (3)  it_return-row,
                      it_return-field.
                    IT_RETURN-SYSTEM
        endloop.
      endif.
      uline.
    endform.                               " Show_messages
          FORM fill_accountgl                                           *
    form fill_accountgl.
      clear it_accountgl.
      it_accountgl-itemno_acc     = 2.
      it_accountgl-gl_account     = '0021510201'.
      it_accountgl-item_text      = 'BAPI Test G/L line item'.  "#EC NOTEXT
    it_accountgl-bus_area       = '01'.
    it_accountgl-profit_ctr     = '0000010101'.
    it_accountgl-comp_code      = 'SLOC'.
      append it_accountgl.
      clear it_accountgl.
      it_accountgl-itemno_acc     = 3.
      it_accountgl-gl_account     = '0082000201'.
      it_accountgl-item_text      = 'BAPI Test G/L line item'.  "#EC NOTEXT
      it_accountgl-bus_area       = '01'.
      it_accountgl-profit_ctr     = '0000010101'.
      it_accountgl-comp_code      = 'SLOC'.
      it_accountgl-tax_code       = 'A3'.
      append it_accountgl.
      clear it_accountgl.
      it_accountgl-itemno_acc     = 5.
      it_accountgl-gl_account     = '0021510201'.
      it_accountgl-item_text      = 'BAPI Test G/L line item'.  "#EC NOTEXT
    it_accountgl-bus_area       = '01'.
    it_accountgl-profit_ctr     = '0000010301'.
    it_accountgl-comp_code      = 'SLOC'.
      append it_accountgl.
      clear it_accountgl.
      it_accountgl-itemno_acc     = 6.
      it_accountgl-gl_account     = '0082000201'.
      it_accountgl-item_text      = 'BAPI Test G/L line item'.  "#EC NOTEXT
      it_accountgl-bus_area       = '01'.
      it_accountgl-profit_ctr     = '0000010301'.
      it_accountgl-comp_code      = 'SLOC'.
      it_accountgl-tax_code       = 'A3'.
      append it_accountgl.
      clear it_accountgl.
      it_accountgl-itemno_acc     = 7.
    it_accountgl-itemno_acc     = 8.
      it_accountgl-gl_account     = '0021510201'.
      it_accountgl-item_text      = 'BAPI Test G/L line item'.  "#EC NOTEXT
    it_accountgl-bus_area       = '90'.
    it_accountgl-profit_ctr     = '0000900008'.
    it_accountgl-comp_code      = 'CORP'.
      append it_accountgl.
      clear it_accountgl.
      it_accountgl-itemno_acc     = 8.
    it_accountgl-itemno_acc     = 9.
      it_accountgl-gl_account     = '0082000201'.
      it_accountgl-item_text      = 'BAPI Test G/L line item'.  "#EC NOTEXT
      it_accountgl-bus_area       = '90'.
      it_accountgl-profit_ctr     = '0000900008'.
      it_accountgl-comp_code      = 'CORP'.
    it_accountgl-tax_code       = 'A3'.
      append it_accountgl.
    endform.                    "fill_accountgl
          FORM fill_header                                              *
    form fill_header.
    CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
       IMPORTING
         own_logical_system = gd_documentheader-obj_sys.
    OBJ_TYPE has to be replaced by customers object key (Y* or Z*)
    gd_documentheader-obj_type   = 'IDOC'.
    gd_documentheader-obj_key    = ref_key.
      gd_documentheader-username   = sy-uname.
      gd_documentheader-header_txt = 'BAPI Test'.               "#EC NOTEXT
    gd_documentheader-obj_key_r  =
    GD_DOCUMENTHEADER-reason_rev =
    gd_documentheader-comp_code  = 'SLOC'.
    GD_DOCUMENTHEADER-AC_DOC_NO  =
      gd_documentheader-fisc_year  = sy-datum(4).
      gd_documentheader-doc_date   = sy-datum.
      gd_documentheader-pstng_date = sy-datum.
    GD_DOCUMENTHEADER-TRANS_DATE =
    GD_DOCUMENTHEADER-VALUE_DATE =
    GD_DOCUMENTHEADER-FIS_PERIOD =
    gd_documentheader-doc_type   = 'KR'.
    gd_documentheader-ref_doc_no = 'xxxx'.
    GD_DOCUMENTHEADER-COMPO_ACC  =
      gd_documentheader-bus_act    = 'RFBU'.
    endform.                    "fill_header
          FORM fill_contractheader                                     *
    form fill_contractheader.
    gd_fica_hd-doc_no           =
    gd_fica_hd-doc_type_ca      =
    gd_fica_hd-res_key          =
    gd_fica_hd-fikey            =
    gd_fica_hd-payment_form_ref =
    endform.                    "fill_contractheader
          FORM fill_cpd                                                 *
    form fill_cpd.
    gd_customercpd-name
    gd_customercpd-name_2
    gd_customercpd-name_3
    gd_customercpd-name_4
    gd_customercpd-postl_code
    gd_customercpd-city
    gd_customercpd-country
    gd_customercpd-country_iso
    gd_customercpd-street
    gd_customercpd-po_box
    gd_customercpd-pobx_pcd
    gd_customercpd-pobk_curac
    gd_customercpd-bank_acct
    gd_customercpd-bank_no
    gd_customercpd-bank_ctry
    gd_customercpd-bank_ctry_iso
    gd_customercpd-tax_no_1
    gd_customercpd-tax_no_2
    gd_customercpd-tax
    gd_customercpd-equal_tax
    gd_customercpd-region
    gd_customercpd-ctrl_key
    gd_customercpd-instr_key
    gd_customercpd-dme_ind
    gd_customercpd-langu_iso
    endform.                    "fill_cpd
          FORM fill_ar                                                  *
    form fill_accountar.
    CLEAR it_accountreceivable.
    it_accountreceivable-itemno_acc =
    it_accountreceivable-customer   =
    IT_ACCOUNTRECEIVABLE-REF_KEY_1  =
    IT_ACCOUNTRECEIVABLE-REF_KEY_2  =
    IT_ACCOUNTRECEIVABLE-REF_KEY_3  =
    IT_ACCOUNTRECEIVABLE-PMNTTRMS   =
    IT_ACCOUNTRECEIVABLE-BLINE_DATE =
    IT_ACCOUNTRECEIVABLE-DSCT_DAYS1 =
    IT_ACCOUNTRECEIVABLE-DSCT_DAYS2 =
    IT_ACCOUNTRECEIVABLE-NETTERMS   =
    IT_ACCOUNTRECEIVABLE-DSCT_PCT1  =
    IT_ACCOUNTRECEIVABLE-DSCT_PCT2  =
    IT_ACCOUNTRECEIVABLE-PYMT_METH  =
    IT_ACCOUNTRECEIVABLE-DUNN_KEY   =
    IT_ACCOUNTRECEIVABLE-DUNN_BLOCK =
    IT_ACCOUNTRECEIVABLE-PMNT_BLOCK =
    IT_ACCOUNTRECEIVABLE-VAT_REG_NO =
    IT_ACCOUNTRECEIVABLE-ALLOC_NMBR =
    it_accountreceivable-item_text  =
    IT_ACCOUNTRECEIVABLE-PARTNER_BK =
    IT_ACCOUNTRECEIVABLE-GL_ACCOUNT =
    it_accountreceivable-comp_code
    it_accountreceivable-bus_area
    it_accountreceivable-pmtmthsupl
    it_accountreceivable-paymt_ref
    it_accountreceivable-scbank_ind
    it_accountreceivable-businessplace
    it_accountreceivable-sectioncode
    it_accountreceivable-branch
    it_accountreceivable-pymt_cur
    it_accountreceivable-pymt_cur_iso
    it_accountreceivable-pymt_amt
    it_accountreceivable-c_ctr_area
    it_accountreceivable-bank_id
    it_accountreceivable-supcountry
    it_accountreceivable-supcountry_iso
    it_accountreceivable-tax_code
    it_accountreceivable-taxjurcode
    it_accountreceivable-tax_date
    it_accountreceivable-sp_gl_ind
    it_accountreceivable-partner_guid = '1465464654'.
    APPEND it_accountreceivable.
    endform.                    "fill_accountar
          FORM fill_ap                                                  *
    form fill_accountap.
      clear it_accountpayable.
      it_accountpayable-itemno_acc = 1.
    it_accountpayable-vendor_no  = '0000060259'.
      it_accountpayable-vendor_no  = '0000060693'.
    it_accountpayable-gl_account
    it_accountpayable-ref_key_1
    it_accountpayable-ref_key_2
    it_accountpayable-ref_key_3
    it_accountpayable-comp_code = 'SLOC'.
    it_accountpayable-bus_area = '01'.
    it_accountpayable-pmnttrms = 'A000'.
    it_accountpayable-bline_date
    it_accountpayable-dsct_days1
    it_accountpayable-dsct_days2
    it_accountpayable-netterms
    it_accountpayable-dsct_pct1
    it_accountpayable-dsct_pct2
    it_accountpayable-pymt_meth
    it_accountpayable-pmtmthsupl
    it_accountpayable-pmnt_block
    it_accountpayable-scbank_ind
    it_accountpayable-supcountry
    it_accountpayable-supcountry_iso
    it_accountpayable-bllsrv_ind
    it_accountpayable-alloc_nmbr
      it_accountpayable-item_text  = 'BAPI Test A/P line item'. "#EC NOTEXT
    it_accountpayable-po_sub_no
    it_accountpayable-po_checkdg
    it_accountpayable-po_ref_no
    it_accountpayable-w_tax_code
    it_accountpayable-businessplace
    it_accountpayable-sectioncode
    it_accountpayable-instr1
    it_accountpayable-instr2
    it_accountpayable-instr3
    it_accountpayable-instr4
    it_accountpayable-branch
    it_accountpayable-pymt_cur
    it_accountpayable-pymt_amt
    it_accountpayable-pymt_cur_iso
    it_accountpayable-sp_gl_ind
      append it_accountpayable.
    endform.                    "fill_accountap
          FORM fill_tax                                                 *
    form fill_accounttax.
      clear it_accounttax.
      it_accounttax-itemno_acc = 4.
      it_accounttax-gl_account = '0011361502'.
      it_accounttax-tax_code   = 'A3'.
      it_accounttax-acct_key   = 'VST'.
      it_accounttax-cond_key   = 'MWVS'.
    it_accounttax-itemno_tax = 8.
      append it_accounttax.
    clear it_accounttax.
    it_accounttax-itemno_acc = 7.
    it_accounttax-gl_account = '0011361502'.
    it_accounttax-tax_code   = 'A3'.
    it_accounttax-acct_key   = 'VST'.
    it_accounttax-COND_KEY   = 'MWVS'.
    append it_accounttax.
    clear it_accounttax.
    it_accounttax-itemno_acc = 10.
    it_accounttax-itemno_acc = 9.
    it_accounttax-gl_account = '0011361502'.
    it_accounttax-tax_code   = 'A3'.
    it_accounttax-acct_key   = 'VST'.
    it_accounttax-cond_key   = 'MWVS'.
    it_accounttax-itemno_tax = 4.
    append it_accounttax.
    endform.                    "fill_accounttax
          FORM fill_currencyamount                                      *
    form fill_currencyamount.
      clear it_currencyamount.
      it_currencyamount-itemno_acc   = 1.
      it_currencyamount-curr_type    = '00'.
      it_currencyamount-currency     = 'MXN'.
      it_currencyamount-amt_doccur   = '-7408036.2'.
      append it_currencyamount.
      clear it_currencyamount.
      it_currencyamount-itemno_acc   = 2.
      it_currencyamount-curr_type    = '00'.
      it_currencyamount-currency     = 'MXN'.
      it_currencyamount-amt_doccur   = '5336472.00'.
      append it_currencyamount.
      clear it_currencyamount.
      it_currencyamount-itemno_acc   = 3.
      it_currencyamount-curr_type    = '00'.
      it_currencyamount-currency     = 'MXN'.
      it_currencyamount-amt_doccur   = '3840.00'.
      append it_currencyamount.
      clear it_currencyamount.
      it_currencyamount-itemno_acc   = 4.
      it_currencyamount-curr_type    = '00'.
      it_currencyamount-currency     = 'MXN'.
      it_currencyamount-amt_base   = '5548.00'.
      it_currencyamount-amt_doccur   = '832.2'.
    it_currencyamount-amt_doccur   = '576.00'.
    it_currencyamount-amt_base   = '3840.00'.
      append it_currencyamount.
      clear it_currencyamount.
      it_currencyamount-itemno_acc   = 5.
      it_currencyamount-curr_type    = '00'.
      it_currencyamount-currency     = 'MXN'.
      it_currencyamount-amt_doccur   = '2051279.00'.
      append it_currencyamount.
      clear it_currencyamount.
      it_currencyamount-itemno_acc   = 6.
      it_currencyamount-curr_type    = '00'.
      it_currencyamount-currency     = 'MXN'.
      it_currencyamount-amt_doccur   = '1690.00'.
      append it_currencyamount.
    clear it_currencyamount.
    it_currencyamount-itemno_acc   = 7.
    it_currencyamount-curr_type    = '00'.
    it_currencyamount-currency     = 'MXN'.
    it_currencyamount-amt_base     = '1690.00'.
    it_currencyamount-amt_doccur   = '253.5'.
    append it_currencyamount.
      clear it_currencyamount.
    it_currencyamount-itemno_acc   = 8.
      it_currencyamount-itemno_acc   = 7.
      it_currencyamount-curr_type    = '00'.
      it_currencyamount-currency     = 'MXN'.
      it_currencyamount-amt_doccur   = '13905.00'.
      append it_currencyamount.
      clear it_currencyamount.
    it_currencyamount-itemno_acc   = 9.
      it_currencyamount-itemno_acc   = 8.
      it_currencyamount-curr_type    = '00'.
      it_currencyamount-currency     = 'MXN'.
    it_currencyamount-amt_base     = '2.70'.
      it_currencyamount-amt_doccur   = '18.00'.
      append it_currencyamount.
    clear it_currencyamount.
    it_currencyamount-itemno_acc   = 10.
    it_currencyamount-itemno_acc   = 9.
    it_currencyamount-curr_type    = '00'.
    it_currencyamount-currency     = 'MXN'.
    it_currencyamount-amt_doccur   = '2.70'.
    it_currencyamount-amt_base     = '18.00'.
    append it_currencyamount.
    endform.                    "fill_currencyamount
          FORM fill_criteria                                            *
    form fill_criteria.
    CLEAR it_criteria.
    it_criteria-itemno_acc = 2.
    it_criteria-fieldname = 'BZIRK'.
    it_criteria-character = '000001'.
    append it_criteria.
    endform.                    "fill_criteria
          FORM fill_valuefield                                          *
    form fill_valuefield.
    CLEAR it_valuefield.
    it_valuefield-itemno_acc = 2.
    it_valuefield-fieldname = 'VV010'.
    it_valuefield-curr_type
    it_valuefield-currency = 'EUR'.
    it_valuefield-currency_iso
    it_valuefield-amt_valcom
    it_valuefield-base_uom
    it_valuefield-base_uom_iso
    it_valuefield-qua_valcom
    append it_valuefield.
    endform.                    "fill_valuefield
          FORM fill_extension                                           *
    form fill_extension.
    CLEAR it_ext.
    it_ext-field1
    it_ext-field2
    it_ext-field3
    it_ext-field4
    APPEND it_ext.
    DATA: ls_zzz TYPE ZZZ_ACCIT.
    CLEAR it_ext2.
    it_ext2-structure = 'ZZZ_ACCIT'.
    ls_zzz-posnr = 2.
    ls_zzz-awref_reb = '123654'.
    ls_zzz-aworg_reb = '654654'.
    ls_zzz-grant_nbr = '0022002'.
    MOVE ls_zzz TO it_ext2-valuepart1.
    APPEND it_ext2.
    endform.                    "fill_extension
          FORM fill_paymentcard                                         *
    form fill_paymentcard.
    CLEAR it_paymentcard.
    it_paymentcard-itemno_acc = 1.
    it_paymentcard-cc_glaccount
    it_paymentcard-cc_type
    it_paymentcard-cc_number
    it_paymentcard-cc_seq_no
    it_paymentcard-cc_valid_f
    it_paymentcard-cc_valid_t
    it_paymentcard-cc_name
    it_paymentcard-dataorigin
    it_paymentcard-authamount = '100'.
    it_paymentcard-currency = 'EUR'.
    it_paymentcard-currency_iso
    it_paymentcard-cc_autth_no
    it_paymentcard-auth_refno
    it_paymentcard-auth_date
    it_paymentcard-auth_time
    it_paymentcard-merchidcl
    it_paymentcard-point_of_receipt
    it_paymentcard-terminal
    it_paymentcard-cctyp = '1'.
    APPEND it_paymentcard.
    endform.                    "fill_paymentcard
          FORM fill_contractitem                                        *
    form fill_contractitem.
    CLEAR it_fica_it.
    it_fica_it-itemno_acc
    it_fica_it-cont_acct
    it_fica_it-main_trans
    it_fica_it-sub_trans
    it_fica_it-func_area
    it_fica_it-fm_area
    it_fica_it-cmmt_item
    it_fica_it-funds_ctr
    it_fica_it-fund
    append it_fica_it.
    endform.                    "fill_contractitem
    *&      Form  fill_re
    form fill_re .
    CLEAR it_re.
    it_re-itemno_acc      =
    it_re-business_entity =
    it_re-building        =
    it_re-property        =
    it_re-rental_object   =
    it_re-serv_charge_key =
    it_re-settlement_unit =
    it_re-contract_no     =
    APPEND it_re.
    endform.                    "fill_re
    thanks
    mrutyun^

  • BAPI_ACC_DOCUMENT_POST Not Using Document Type

    Hi,
    I'm currently using BAPI_ACC_DOCUMENT_POST and intended to post document type RJ, but instead the BAPI posted the document under a different document type C1. I tried other document types and the result is the same.
    Hope I can have your inputs about this.
    Thanks,
    Nikolai

    Dear Nikolai,
       If you want to change the document type means you have to use the BADI to change the Document type the BADI Name is BADI_ACC_DOCUMENT.
    In that BADI CHANGE method is there here C_ACCHD parameter is ther you can pass the Documnet type directly will c.
    Regards,
    Dhina..

  • Post document with BAPI_ACC_DOCUMENT_POST with withholding taxes

    Hi everyone!
    I have to post some documents that I got from an Excel file. At first, they were G/L documents, so I only filled the table parameter ACCOUNTL of BAPI_ACC_DOCUMENT_POST to set the "account data" (without using ACCOUNTRECEIVABLE, ACCOUNTPAYABLE, ACCOUNTTAX or ACCOUNTWT).
    After a few, another Posting Keys were allowed in the lines of the documents obtained from the excel file, so the documents can be G/L documents, receipts, etc.But, I still put every account data in ACCOUNTGL, and the created documents were right (at least nobody complained about them :P ).
    No, 3 fields have been added in the excel file:
    - QSSHB: Withholding Tax Base Amount
    - QSFBT: Withholding Tax-Exempt Amount (in Document Currency)
    - QSSKZ: Withholding Tax Code
    As I understood, this BAPI is ready to allow withholding taxes, and I suppose I should have to fill this fields that I receive into some tables that are used as parameters in the BAPI. For example,
    ACCOUNTWT-WT_CODE = Withholding Tax Code
    ACCOUNTWT-BAS_AMT_LC = Withholding Tax Base Amount (Local Currency)
    I think I should use this table (I don't know where I could "put" the other one). My question is, can I do that without using tables ACCOUNTRECEIVABLE and ACCOUNTPAYABLE? My feeling is that is not completely right not to use these tables if the documents are vendor or customer documents... If that's possible.. is it right to put the 2 fields that I have used in the last example (*) to fill that? Where I should put the third field??
    I hope I have explained myself clearly, thanks in advance,
    Victor

    Dear Sreeraj,
    The situations would be multiple, but to be precise I'll provide you one scenario where this BAPI would be failing to do the posting. The scenario is like this:
    1. If you consider GL posting using F-02 by changing any of the reference fields XREF1, or XREF2, the BAPI has to consider the varying screens of each of the line items which internally depends on Transaction Variants of different screens of the Document, which the BAPI will fail to do so.
    2. Also, if there is a Taxation to be done for each Item, still it should consider the above scenario and fill the WITH tables accordingly.
    Hope this helps,
    Regards,
    -Wahid Hussain.

  • AWKEY field of the Document Header of BAPI_ACC_DOCUMENT_POST

    HI Experts,
    I am using BAPI_ACC_DOCUMENT_POST to create Finance Postings and have a requirement to populate the Reference key field externally while using this BAPI.
    I am aware of the fact that if I leave the fields OBJ_TYP(Reference Transaction), OBJ_KEY(Reference Key) and OBJ_SYS(current system name) of the DOCUMENTHEADER segment of the BAPI as blank while executing the BAPI, these fields will be automatically populated with values as under:
    OBJ_TYP = 'BKPFF'
    OBJ_KEY = '0100000021BE102011' (BELNRBUKRSGJAHR)
    OBJ_SYS = System name
    But the Reference transaction (OBJ_TYP) which we need to use is 'HRPAY' and the OBJ_KEY should have the value of BELNR (only), OBJ_SYS should be populated as usual.
    I tried get the next BELNR available, using the FM 'NUMBER_GET_NEXT' and then tried assigning it to the BAPI in the BELNR field of the DOCUMENTHEADER segment of the BAPI, but as we know that the BAPI_ACC_DOCUMENT_POST also determines the next BELNR internally, the number returned by the FM NUMBER_GET_NEXT becomes redundant and the BAPI_ACC_DOCUMENT_POST uses the number next to it.
    To understand it in detail consider the below example:
    Suppose the number BELNR available (number returned by NUMBER_GET_NEXT) is 0100000021 and I pass it to the BAPI, since I have already used this number (by executing NUMBER_GET_NEXT) the BAPI_ACC_DOCUMENT_POST will create a Posting with 0100000022 as the BELNR.
    I am looking for a way to reserve the BELNR, so that the resultant BELNR should be the same as the one which I pass to the BAPI_ACC_DOCUMENT_POST.
    I would avoid trying to get the previous BELNR used (NUMBER_GET_INFO), increment it by 1, and then pass it to the BAPI_ACC_DOCUMENT_POST.
    Please suggest.

    Hi Amit,
    To swap the OBJ_TYP of the AWKEY from BKPFF to HRPAY sounds strange to me and I am unclear about the purpose. There are many other fields available to indicate the source of the document. (BKPF-XBLNR).
    Another approach would be to check if any exit exists for this BAPI thru which you can manipulate the OBJ_TYP:
    [User exit for BAPI_ACC_DOCUMENT_POST..? |User exit for BAPI_ACC_DOCUMENT_POST..?;
    Regards,
    Robert

  • Problem in BAPI_ACC_DOCUMENT_POST

    Hai,
       I am trying to post the documents using this BAPI(bapi_acc_document_post). it is throwing error
      FI/CO interface: Inconsistent FI/CO line item data for updating  
      Error in document: BKPFF $ RD2520LS
    this error is coming only after applying the patch sp13.
    what could be the problem...
    pls suggest with any ideas...

    Hi,
    dont pass any values to obj_key,obj_sys,obj_type fields,if u r doing it.
    the error may be because u r passing more than required lines to glaccount and accountrecivable or accountpayable tables whatever u r using.
    i suppose u r entering a vendor details,
    then give item_no 1 in accountpayable and 2,3,4 etc in glaccount tables.
    mention all in currencyamount table as 1,2,3,4 etc..and give negative values in 'amount' for credit entries.
    post in detail about more doubts.
    regards
    Arjun

  • How to use BAPI_ACC_DOCUMENT_POST

    Hello ALL.
    I need to update the field AUFNR in database table BSEG, I'm using the BAPI BAPI_ACC_DOCUMENT_POST, the function module execute with out errors, but do not change the field AUFNR.
    Could any one help me?
    Thanks in advance

    Hello Lalit, thanks for your answer.
    We take care about the order number while creating new accounting documents, But the users are creating these documents automatically through transaction code FAGL_FC_VAL (Foreign Currency Valuation).
    This transaction code creates a new accounting document based on another accounting document already created, what I need is, replicate the order number from original accounting document into the new one.
    Best regards.

  • BAPI_ACC_DOCUMENT_POST Max No of Items reached

    Hello,
    I am trying to post G/L accounts using BAPI_ACC_DOCUMENT_POST. There are about 1150 line items.
    I don't think this should be the reason to get error as the G/L account table that BAPI_ACC_DOCUMENT_POST uses allows 10 digits of line number. I am getting the following error:
    <b>Maximum Number if item in FI reached.</b> Error number 727 ID F5
    Please advise if you have seen this before.
    Thanks.
    Pranav

    SAP also provides the use of table TTYPV which can be used to designate standard SAP fields to consolidate account postings to one accounting line item.  Therefore if you choose to consolidate based on BSEG fields (BSEG MATNR, BSEG ZUONR, etc.), it limits the occurrence of surpassing the 950/999 limitation.   It does not eliminate the problem entirely, but in my organization it has enabled us to handle G/L account postings that had over 2,000 line items before this change.
    There are other things to consider when this is done, depending on the level of BSEG detail your business process requires.

  • Unsolved  BAPI_ACC_DOCUMENT_POST...problem!!!!

    Hi gurus,
    I am posting this problem of mine for the third time, but I have got any reply to my previous postings, I don't know wheter the my problem is too difficult or its not an appropriate one to ask. Can someone pleaase reply this time to my problem so that I can proceed into my development, I will really appreciate your efforts.
    I am working on an interface where I need to post an accounting document using
    f-43 and for this I have identified this bapi 'BAPI_ACC_DOCUMENT_POST', and I have written the following code. everything is working properly but the only problem is, the posting keys I am using are 31 and 40 but when I run my program and look into the document created, it shows me the posting keys as 40 and 50 instead of 31 and 40, can you please tell me how to get rid of this thing .
    v_semfile = p_ifname.
    refresh it_input_file.
    call function 'WS_UPLOAD'
    EXPORTING
    filename = v_semfile
    filetype = 'DAT'
    TABLES
    data_tab = it_input
    EXCEPTIONS
    conversion_error = 1
    file_open_error = 2
    file_read_error = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    others = 10.
    move:
    'RFBU' to documentheader-bus_act,
    it_input-doc_date2 to documentheader-doc_date,
    it_input-pos_date2 to documentheader-pstng_date,
    it_inputdoc_type to documentheader-doc_type,
    it_inputbukrs to documentheader-comp_code,
    it_input-pos_per to documentheader-fis_period,
    it_input-fis_year to documentheader-fisc_year,
    it_input-reference to documentheader-ref_doc_no,
    it_input-h_text to documentheader-header_txt,
    syst-uname to documentheader-username.
    if it_input_file-pos_key eq 31.
    move:
    v_count to glaccount-ITEMNO_ACC,
    it_input-glaccount to glaccount-gl_account,
    it_input-kostl to glaccount-COSTCENTER,
    it_input-prctr to glaccount-PROFIT_CTR,
    it_input-bus_area to glaccount-bus_area,
    it_input-item_text to glaccount-ITEM_TEXT,
    it_input-assignment to glaccount-ALLOC_NMBR.
    append glaccount.
    move:
    v_count to currencyamount-ITEMNO_ACC,
    it_input-currency to currencyamount-CURRENCY,
    it_input-amount to currencyamount-AMT_DOCCUR .
    append currencyamount.
    clear: glaccount, currencyamount.
    else.
    move: v_count to glaccount-ITEMNO_ACC,
    it_input-glaccount to glaccount-gl_account,
    it_input-kostl to glaccount-COSTCENTER,
    it_input-prctr to glaccount-PROFIT_CTR,
    it_input-bus_area to glaccount-bus_area,
    it_input-item_text to glaccount-ITEM_TEXT,
    it_input-assignment to glaccount-ALLOC_NMBR.
    append glaccount.
    move:
    v_count to currencyamount-ITEMNO_ACC,
    it_input-currency to currencyamount-CURRENCY.
    currencyamount-AMT_DOCCUR = it_input-amount * -1.
    append currencyamount.
    clear: glaccount, currencyamount.
    endif.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
    DOCUMENTHEADER = documentheader
    IMPORTING
    OBJ_TYPE = obj_type
    OBJ_KEY = obj_key
    OBJ_SYS = obj_sys
    TABLES
    ACCOUNTGL = glaccount
    ACCOUNTPAYABLE = ap
    CURRENCYAMOUNT = currencyamount
    RETURN = return.
    read table return with key type = 'S'.
    if syst-subrc eq 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT =
    IMPORTING
    RETURN = return2.
    Thanks
    Rajeev....

    Rajeev,
    for the vendor line you have to add a vendor number and not a G/L account number (SAP will know the G/L behind the vendor and will take care about that). If posting key 31 was specified that is a vendor posting and you need a vendor number for that, so you should go back to functional guys and ask them what kind of posting they want in fact.
    Some info about posting keys:
    01-09 and 11-19 : customer
    21-29 and 31-39 : vendor
    40 and 50 : G/L
    Come back if you still have questions!
    ec

  • Field Posting Key in BAPI_ACC_DOCUMENT_POST ?

    Hi
    I need to post documents like FB01 , i'm already using BAPI_ACC_DOCUMENT_POST  and it works so i can now create documents with the header and itmes positions  , filling the tables header, accountreceivable items and currency items.
    I already found the most of fields for execute the BAPI and create the documents, but i can not find three fields, some of one (BSCHL) the most important:
    Posting Key (BSCHL)
    Special G/L Indicator  (NEWUM)
    Calculate Tax Automatically (XMWST) .
    I think but i'm not sure  the Posting Key (BSCHL) is placed in the EXTENSION2 table, but this table ask for some STRUCTURE name and i don't know what should i place in this field or how fill this parameter table.
    Does somebody can help me  about where can i place these 3 fields in the BAPI or where can i find help documentation for do this ?
    Regards
    Frank

    Frank,
    you should use the Extension2 structure for passing the Posting Keys and you should implement the BADI for posting the documents with the Keys what you have supplied.
    The Enhancement Spots are BADI_ACC_DOCUMENT and IF_EX_ACC_DOCUMENT.
    I've used the BADI_ACC_DOCUMENT and now i'm able to post the documents using the keys which i've supplied to the BAPI.
    Otherwise the BAPI is going to decide the posting keys based on tha amount .
    Hope this will help you.
    Thanks,
    Adi.

  • How to use Bapi BAPI_ACC_DOCUMENT_POST for g/l account document posting

    Hi all,
    I am using BAPI_ACC_DOCUMENT_POST bapi for g/l account documents posting.as I am first time using BAPI in my program.can anyone give details about how to use this BAPI for document postings.what importing parameters need to be passed , which exporting parameters need to be passed and which tables need to be used.  
    Thanks in advance.
    Regards,
    Harshada

    Moderator message - Please search before asking - post locked
    Rob

  • External Document Number assignment using Bapi_acc_document_post

    Hi All Experts and Max,
    We want to post th same external document no using BAPI_ACC_document_post, but we are unable to post thatexternal  Document no.
    Note: If we are posting the same no using transaction FB01 , we are able to post the document , if we are passing the Acc_do_no field as the external Document no.
    Our requirement is to post the document no of the e.g A system to B system with th esame document No .
    Kindly provide what value we need to pass in the obj_type , obj_key and obj_sys fields of BAPI_ACC_Document_post.
    I am aware about the scenario that in case of internal document no creation we will get all these 3 fields from th eBAPI, but we need the values in case of external document no assignment.
    We tried with obj_type as 'BKPFF' but we are not able to post the document with that obj_type, In that case Bapi is clearing the exterbal document no acc_doc_no field in the first subroutine.
    Note: We are uploading a file in different system  with the .dat format and we are using BAPI_ACC_DOCUMENT_POST method.
    Please refer the below link for more issue details.
    Link:[External Document Number assignment using Bapi_acc_document_post;
    Kindly provide the solution.
    Thanks,
    Rahul Sisodia

    Hi All,
    Please suggest if you came across such situation. <removed by moderator>
    Thanks,
    Rahul Sisodia
    Edited by: Thomas Zloch on Sep 19, 2011 10:18 PM

  • Doubts about PI

    Hello , in the near future mybe i will need use sap PI and one the they almost sure requeriment i will have is load data from a non-sap system and upload to sap ( doing some post using bapi_acc_document_post ) , is a process that already done using a program developed by me running in a background job , the program read a txt file delimet by "|" this file have diferent name by company and date something like COMPANYCODE_DATE.txt so my question is :
    I can read plain text file using pi and upload/complete to the business process in sap ?
    is a macro way what are the step and topic that i need learn about PI that will help me complete with this task?
    Thanks in advanced

    >>I can read plain text file using pi and upload/complete to the business process in sap ?
    >> is a macro way what are the step and topic that i need learn about PI that will help me complete with this task?
    Sender side you might have to use FCC (File content  conversion) using File adapter.  Receiver side: Idoc or proxy or RFC
    So search sdn for fcc sender and idoc/proxy/RFC reciever side scenarios. you will be fine.

Maybe you are looking for

  • Scrollbar help~

    hi.. the code below are in working condition.. means can be compiled & run.. when drag the scrollbar, the "Welcome To Java" string message will be move left, right or up, down depend on which scrollbar u drag.. just wanna ask if the "Welcome To Java"

  • How do I get imessages from two different numbers

    I am able to get my son's imessages from other iphones show up on my iphone.   How can I add my daughter's number that is on my account as well?

  • Mapping of IOs

    I am doing some mapping of the IO 0REFER_DOC to 0DOC_NUMBER, and I got an information message: ConExits for assigned InfoObjects inconsistent: (KS) - ALPHA(TS) Would this cause any problem at all on the data loads?

  • Question about RegistryServer in jwsdp-1.2

    why the link of RegistryServer is error in the web page of http://localhost:8080/manager/html??what will it be if it is correct?

  • In-app purchase won't download.  What do I do other than ask for a refund?

    My in-app purchase hasn't downloaded.  Can I do it manually or should I just ask for a refund?