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 no posting CO (cost element)

Former Member
0 Likes
1,178

Hi,

We're using BAPI BAPI_ACC_DOCUMENT_POST to post to G/L.

The G/L posting works fine, postings are made.

We're expecting a CO-posting to Cost Element too. This is not the case.

This is how we filled the BAPI structures/tables (currencyamount is also filled):

documentheader:

BUS_ACT BKPF

USERNAME myusername

HEADER_TXT text

COMP_CODE 1

DOC_DATE 20070614

PSTNG_DATE 20070614

DOC_TYPE AB

REF_DOC_NO 123456

COMPO_ACC FI

accountgl:

ITEMNO_ACC 0000000001

GL_ACCOUNT 0000012345

ITEM_TEXT0 itemtext

ALLOC_NMBR 123456

COSTCENTER 0000000999

Do we need to fill more fields (and which/how)?

Any help would be welcome.

Best regards,

Mark

6 REPLIES 6
Read only

Former Member
0 Likes
860

Hi,

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader = st_bapiache09

IMPORTING

obj_key = w_awkey

TABLES

accountgl = t_bapiacgl09

accountpayable = t_accountpayable

accountreceivable = t_accountreceivable

currencyamount = t_bapiaccr09

extension1 = t_extension

return = t_bapiret2

The posting key is automatically assigned by the BAPI, u can't transfer it.

You can post upto 998 entries the 99th entry should be posted in G/L account as nullifying entry. This 99th entry should contain the total of all the 998 entries

<b>include LACC9F20</b>

Further Information

You can find further information in the SAP Library under "Financials -> Accounting - General (AC) -> Interfaces to Accounting (AC)".

<b>Reward points</b>

Regards

Read only

0 Likes
860

Hi,

The G/L posting is ok, there's no CO-posting. The total number of lines to be abel to post are no problem/issue.

What fields are required to create te CO-posting (cost element)?

Best regards,

Mark

Read only

Former Member
0 Likes
860

Hi,

You need to populate the structuure criteria & pass it to the FM.

I hope this helps,

Regards

RBC

Read only

0 Likes
860

Hi Raju,

How do I fill this structure?

I thought this was only neccessary for CO-PA. We do not use CO-PA.

Best regards,

Mark

Read only

0 Likes
860

Hi,

I am sorry, you are right it should be done only for CO-PA.

Sorry for misguiding you.

Regards

Raju Chitale

Read only

0 Likes
860

Hi,

The answer is :

clear field COMPO_ACC in structure documentheader.

Best regards.

Mark