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 criteria valuefield

Former Member
0 Likes
3,653

Hi all,

Apparently, i may need to enter a line item with Debit G/L, and with its CO-PA (Profitibility Segment) details as per follow:

1) Material/Product (MATNR)

2) Sales Org (VKORG)

3) Distribution Channel (VTWEG)

4) Division (SPART)

I found that BAPI_ACC_DOCUMENT_POST has a CO-PA area parameters, which are CRITERIA and VALUEFIELD. I am wondering how can I input the above fields to my line item. Has anyone have the experience on handling the above before? I would appreciate if you can share some light (sample code) if you have any.

Any helpful answer will be rewarded

Thanks and regards,

Patrick

Hi all,

Apparently, i may need to enter a line item with Debit G/L, and with its CO-PA (Profitibility Segment) details as per follow:

1) Material/Product (MATNR)

2) Sales Org (VKORG)

3) Distribution Channel (VTWEG)

4) Division (SPART)

I found that BAPI_ACC_DOCUMENT_POST has a CO-PA area parameters, which are CRITERIA and VALUEFIELD. I am wondering how can I input the above fields to my line item. Has anyone have the experience on handling the above before? I would appreciate if you can share some light (sample code) if you have any.

Any helpful answer will be rewarded

Thanks and regards,

Patrick

6 REPLIES 6
Read only

Former Member
0 Likes
1,881

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.

Yo 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

include LACC9F20

Further Information

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

Functionality

Using this method you can create a posing in accounting for certain business transactions.

Possible ( Business Transactions):

Postings that generally only affect the general ledger. (RFBU)

Billing: For billing in Sales and Distribution, accounting is supplied with the relevant billing data. (SD00) Billing Document

Accounting can use the data of a logistics system that result from an Invoice Receipt. (RMRP)

Goods Movement are triggered by transactions in Sales and Distribution or by inventory postings. Within logistics, they lead to a change in the warehouse stocks of <DS:GLOS.Inventory Management>Inventory Management. This results in a posting in accounting. This is why accounting is supplied with the relevant data from logistics. (RMWA)

Example

Billing document:

By selling goods in accordance with targets, revenue is generated. The revenue is posted in billing and forwarded to accounting.

Invoice receipt:

Raw materials are purchased in accordance with targets. The invoice receipt is posted in a logistics system. The data from the raw materials is forwarded to accounting.

Goods Movment:

The use of raw materials leads to a change in stock in inventory managment. The posting of raw material consumption is forwarded to accounting.

G/L Account Posting:

Provision posting for an expected warranty service. This can refer to acquisitions or retirements belonging to stocks that are not in subledger accounting relevant to inventory management. This is particularly the case if such materials are not displayed as vendor/customer, materials, loans etc. or cannot be displayed in this way. This can also refer to write-ups or depreciation that contain higher aggregations of values than are maintained in a corresponding subledger that is relevant to inventory management.

The conversion of foreign currencies for receivables/payables due to large exchange rate changes that should not lead to an update of the accounts payable or accounts receivable accounting. A similar transaction can arise for the revaluation of raw materials if this revaluation takes place at a correspondingly aggreagated level.

Reclassification of inventory of P&L statement accounts that are only used for reconcilliation purposes in the general ledger (this rearranges values for balance sheet items).

Balance reclassifications of stocks to receivables with different return times.

Notes

If the parameter CurrencyAmount is filled with the currency fields, a complete document check including characteristics and value components of profitability analysis (CO-PA). Otherwise, the account assignment objects are checked.

Messages are returned in the parameter Return. In the parameter documentation you can find the return values and their meaning.

Even <b>BAPI_ACC_GL_POSTING_POST</b> is also used in this work

<b>Reward points</b>

Regards

Read only

0 Likes
1,881

Hi skk,

Do you have any sample code reflect to my question on CO-PA?

Appreciate if you can lead me the way.

Thanks,

Patrick

Read only

0 Likes
1,881

Hi,

I have solved my puzzle.

Thanks,

Patrick

Read only

0 Likes
1,881

Hi Patrick,

I got same issue like you got earlier.

Could  u please explain how to pass CO-PA (Profitibility Segment)  to FM(BAPI_ACC_DOCUMENT_POST) details.

Please help on this one.

Regards,

Narasaiah T.

Read only

Former Member
0 Likes
1,881

Solved.

Read only

0 Likes
1,881

Hi,

I know it has been a few years but how did you solve this?

regards,

Wim