Application Development 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: 

Posting a particular Ledger using BAPI_ACC_DOCUMENT_POST

Former Member
0 Kudos

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 ?

6 REPLIES 6

Former Member
0 Kudos

Do you have a possible solution?

I'm very interested in it, because I've got the same problem.

Kind Regards

Philip

Former Member
0 Kudos

Hello,

you can post to a particular ledger by using the table extension1 of the BAPI.

Fill it like this:

extension1(6) = 'LEDGER'.

extension+6(2) = 'L1'.

append extension1.

After you have set the FBE in transaction FIBF (search in the forum to see how this is done),

write the following code in your Z*INTERFACE_RWBAPI01:

LOOP AT EXTENSION.

IF EXTENSION(6) = 'LEDGER'.

DOCUMENT_HEADER-RLDNR = EXTENSION+6(2).

ENDIF.

ENDLOOP.

0 Kudos

Hi,

Thanks for your solution regarding posting to a general ledger using BAPI_ACC_DOCUMENT_POST.

Could you please let me know how to reverse the documents from a specific ledger group.

we are trying to reverse using BAPI_ACC-DOCUMENT_REV_POST but is not giving the desired result as there is no option in BAPI to supply the ledger group it is trying to post in all the available ledger groups.

please let us know if you have any solution regarding reversal of documents .

cheers,

srinivas

Former Member
0 Kudos

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

Former Member

Hello,

if you want to use BAPI_ACC_DOCUMENT_POST, work with the Header-parameter ACC_PRINCIPLE. You have to customize this parameter that the right Legder will be used if you fill it.

0 Kudos

You can:

  • se16n > table name: TACC_TRGT_LDGR
  • Mapping Ledger - Accounting Principle .
  • In bapi_acc_document_post > import > documentheader
  • documentheader-acc_principle = TACC_TRGT_LDGR-acc_principle.