‎2007 Jul 14 9:25 AM
hi , i am using Bapi BAPI_ACC_DOCUMENT_POST for Fb50 but i am getting error , the error is For object RF_BELEG 110, number range interval J4 does not exist FBN1,
i am using the following code ,is there any thing additioally i ahve to pass
gw_documentheader-comp_code = gw_main-bukrs.
gw_documentheader-doc_date = gw_main-budat.
gw_documentheader-pstng_date = gw_main-budat.
gw_documentheader-doc_type = c_blart.
gw_documentheader-username = sy-uname.
gw_documentheader-bus_act = c_busact.
gw_documentheader-header_txt = gw_main-bktxt.
gw_customercpd-region = gw_main-state.
gw_customercpd-city = gw_main-city.
gw_accountgl-itemno_acc = g_item.
gw_accountgl-vendor_no = gw_main-lifnr.
gw_accountgl-costcenter = gw_main-kostl.
gw_accountgl-gl_account = g_hkont .
gw_accountgl-alloc_nmbr = gw_main-zuonr.
gw_accountgl-item_text = g_item_txt.
gw_accountgl-comp_code = gw_main-bukrs.
IF gw_main-shkzg EQ c_dr.
gw_main-shkzg = c_s.
g_tot_de = g_tot_de + gw_main-dmbtr.
ELSEIF gw_main-shkzg EQ c_cr .
gw_main-shkzg = c_h.
g_tot_cr = g_tot_cr + gw_main-dmbtr.
ENDIF.
gw_accountgl-de_cre_ind = gw_main-shkzg.
APPEND gw_accountgl TO gt_accountgl.
gw_currencyamount-itemno_acc = g_item.
gw_currencyamount-currency = c_usd.
IF gw_main-shkzg EQ c_s.
gw_currencyamount-amt_doccur = gw_main-dmbtr.
ELSEIF gw_main-shkzg EQ c_h.
gw_currencyamount-amt_doccur = gw_main-dmbtr * -1.
ENDIF.
APPEND gw_currencyamount TO gt_currencyamount.
‎2007 Jul 14 9:47 AM
Hi,
you can use the following
For accounting document: BAPI_ACC_DOCUMENT_POST.
For measurement document: MEASUREM_DOCUM_RFC_SINGLE_001 (this is not a BAPI but an RFC) or search for MEASDOC*.
BAPI_ACC_DOCUMENT_POST is available in 46c.
you can also use 'BAPI_ACC_GL_POSTING_POST instead of BAPI_ACC_DOCUMENT_POST if it is not available.
**************please reward points if the information is helfpul to you****************
‎2007 Jul 14 10:15 AM
Hi,
i think u can use the bapi <b>'BAPI_ACC_GL_POSTING_POST'</b>.
and i think you can also write a bdc in your own bapi too.
<b>Reward points</b>
Regards
‎2007 Jul 14 10:26 AM
sorry , i have to use that bapi only BAPI_ACC_DOCUMENT_POST, bcoz iam posting city and state also , could u give me some code for this