‎2009 Dec 23 3:31 PM
Hi Friends,
I need help because i have to post clearing accounts with a BAPI BAPI_ACC_DOCUMENT_POST,
but it don't work with the structures that i'm filling, the only thing that i have do is post, but clearing accounts, never. Can you give me an good example for Post Clearing Accounts with this BAPI,
sorry for my poor English,
Many Thanks,
J.G.
‎2009 Dec 23 3:41 PM
‎2009 Dec 23 3:43 PM
Hi ,
try fm BAPI_ACC_GL_POSTING_POST
or look for where use list of the fm BAPI_ACC_DOCUMENT_POST
All the best !!
Regards
Ravi
‎2009 Dec 23 4:28 PM
Ravi: I try your suggest but i couln't find nothing interesting in my Sap system, thanks.
Anurag: I'm going to test your code in my Sap system today and i tell you.
Many Thanks
J.G.
‎2009 Dec 23 7:32 PM
FORM F_BUILD_CLEARING_RECORD .
DATA: lv_posnr TYPE posnr_acc.
DATA: lv_hkont2 LIKE bseg-hkont.
DATA: lv_totamt TYPE bapiwrbtr.
CLEAR: gt_gl_item,
gt_doc_values.
lv_posnr = gv_cnt + 1.
lv_hkont2 = p_clract.
lv_totamt = gv_posting_debits - gv_posting_credits .
lv_totamt = lv_totamt * -1.
* Fill Line of Document Item
gt_gl_item-itemno_acc = lv_posnr.
gt_gl_item-gl_account = lv_hkont2.
gt_gl_item-pstng_date = gv_file_date-date.
gt_gl_item-item_text = 'Clearing Account'.
APPEND gt_gl_item.
** Fill Line of Document Value
gt_doc_values-itemno_acc = lv_posnr.
gt_doc_values-currency_iso = gv_comp_curr. " posting companies currency.
gt_doc_values-currency = gv_comp_curr. " posting companies currency..
gt_doc_values-amt_doccur = lv_totamt.
APPEND gt_doc_values.
clear: gv_posting_credits, gv_posting_debits.
ENDFORM. " F_BUILD_CLEARING_RECORD
{/code}
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = gv_doc_header
IMPORTING
obj_type = gv_doc_header-obj_type
obj_key = gv_doc_header-obj_key
obj_sys = gv_doc_header-obj_sys
TABLES
accountgl = gt_gl_item
accountreceivable = gt_ar_item
accountpayable = gt_ap_item
currencyamount = gt_doc_values
extension1 = gt_extension
return = gt_return.
{/code}
‎2010 Jan 18 9:53 AM
Thank you very much to all, but i couldn't that this bapi clear my open items, so i'm going to try with FIPI functions.
J.G.