Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_ACC_DOCUMENT_POST

0 Likes
550

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.

5 REPLIES 5
Read only

Former Member
0 Likes
511
Read only

Former Member
0 Likes
511

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

Read only

0 Likes
511

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.

Read only

0 Likes
511

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}

Read only

0 Likes
511

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.