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

Reg: BAPI_ACC_GL_POSTING_POST

Former Member
0 Likes
2,401

HI All,

Can u pls help me in entering the values for the BAPI_ACC_GL_POSTING_POST.

I am getting errors while giving the test data for the structure. I had given the below mentioned data in the structures documentheader, accountgl, currencyamount respectively.

Error:

1. Error in document: 'BKPFF 490456946210102007 logsys110.

2. Balance in transaction currency.

Test data:

documentheader-obj_type = 'BKPFF'.

documentheader-obj_key = '490456946210102007'.

documentheader-obj_sys = 'logsys110'.

documentheader-username = sy-uname.

documentheader-header_txt = 'Test using BAPI'.

documentheader-comp_code = '1010'.

documentheader-fisc_year = '2007'.

documentheader-doc_date = '09/18/2007'.

documentheader-pstng_date = '09/18/2007'.

documentheader-doc_type = 'WA'.

accountgl-itemno_acc = '1'.

accountgl-gl_account = '0000510030'.

accountgl-comp_code = '1010'.

accountgl-pstng_date = '09/18/2007'.

accountgl-doc_type = 'WA'.

accountgl-profit_ctr = '0000002030'.

currencyamount-itemno_acc = '1'.

currencyamount-currency = 'USD'.

currencyamount-amt_doccur = '10.00'.

Thanks in advance.

Arundhathi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,493

Hi,

This error is related to the balance of the postings. Check the balance of the Debit & credit entries. both should be having the same amount but one should be negativ. e.g.: suppse debit entry is having amount 100 & credit entry should have

-100.

Reward points if helpful.

Ashvender

6 REPLIES 6
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,493

hi Arundhathi,

I am not sure if this correct:

documentheader-obj_sys = 'logsys110'.

Pls. run the following FM in your system: OWN_LOGICAL_SYSTEM_GET. The export result of this FM has to be the value for the import parameter above.

hope this helps

ec

Read only

0 Likes
1,493

Hi Eric,

i have checked with ur function module the parameter documentheader-obj_sys = 'logsys110' what i have given is correct.

Please suggest me any other thing

Read only

0 Likes
1,493

than you should go for what another commenter mentioned: there should be equal level debit and credit items. In your example there is only one item, there should be at least one more.

On the other hand the logsys has to be LOGSYS (uppercase), just in case...

Read only

Former Member
0 Likes
1,494

Hi,

This error is related to the balance of the postings. Check the balance of the Debit & credit entries. both should be having the same amount but one should be negativ. e.g.: suppse debit entry is having amount 100 & credit entry should have

-100.

Reward points if helpful.

Ashvender

Read only

abdulazeez12
Active Contributor
0 Likes
1,493

Refer to Standard program RBUS6030.

Document Header

Description

Parameter for transferring document header data

The following fields must be filled out:

OBJ_TYPE Sender ID

OBJ_KEY Reference number of source document

OBJ_SYS Logical system of source document

COMP_CODE Company code

PSTNG_DATE Posting date

USERNAME User name

Default

The field COMPO_ACC must remain blank in the case of a general posting. If an SAP application component is entered in this field, posting only takes place in that application component. This function is only used for subsequent posting.

Source document

Description

When a business transaction is updated in Accounting, it may be that several documents are updated at the same time (FI document, CO document, etc). If the business transaction is not initiated in Accounting, a source document must exist outside Accounting. The information from this document must be transferred when the FI/CO interface is called up. The source information is updated in all accounting documents, and is made up of the following fields:

AWTYP (OBJ_TYPE) Reference transaction

Sender ID

AWKEY (OBJ_KEY) Reference key

Source document number

The reference key is made up of:

AWREF Reference document number (10 digits)

Source document number

AWORG Reference organizational unit (10 digits)

Number range ID (if required)

AWSYS (OBJ_SYS) Logical system

Logical system of source document

When the document is being processed, the system checks whether a reference document number (first part of the reference key) has been transferred.

G/L Account Line Items

Description

Parameter for transferring G/L account line items

The following field must be filled out:

GL_ACCOUNT G/L account

The currency fields are not contained in this parameter. They must be transferred separately in the parameter CurrencyAmount for the various currency types and currencies. The system creates a link to the relevant line item via the line item number ITEMNO_ACC, which for this reason must be unique for each line item.

Default

If this method can be used to post G/L account line items across several company codes, the following fields are also contained in the G/L account line items:

COMP_CODE Company code

PSTNG_DATE Posting date

DOC_TYPE Document type

AC_DOC_NO Document number

FISC_YEAR Fiscal year

FIS_PERIOD Fiscal period

Line Item Currency Fields

Description

This parameter describes the currency fields for a particular line item.

The parameter is a required field for the method POST. If the parameter is not maintained for the method CHECK, only a general account assignment check is carried out. Individual line items or several documents can be checked at once in this way.

The following fields must be filled out:

CURRENCY Currency key

AMT_DOCCUR Currency amount

Value range

The field CURR_TYPE (currency type) describes the role played by a currency in the SAP System.

The currency type can take on the following values, for example:

00 Transaction currency

10 Company code currency

20 Controlling area currency

30 Group currency

40 Hard currency

50 Index-based currency

60 Global company currency

60 Global company currency

If an entry is not made in the field CURR_TYPE, the default value "00" is retained.

If only one data record is transferred in transaction currency for each line item,

Return Parameter

Description

This table contains the return messages from the method call.

Value range

The first message contains the general status of processing:

Type ID Number Message

S RW 605 Document posted successfully

S RW 614 Document check without errors

A RW 609 Error in document

The fields MESSAGE_V1, MESSAGE_V2 and MESSAGE_V3 contain the following information:

Reference transaction ( OBJ_TYPE)

Reference key ( OBJ_KEY)

Logical system of source document ( OBJ_SYS)

Additional messages are transferred with the following information:

Parameter ( PARAMETER)

Row ( ROW)

Field ( FIELD)

in which the error occurred.

Table for Customer Enhancement

Description

Container used to transfer data for calling up user exits when processing update BAPIs in Accounting. The user exit must be activated with transaction CMOD (extension ACBAPI01) for this to be possible.

In addition to the container (structure BAPIEXTC), the document header (structure ACCHD) and line items (structure ACCIT) from the accounting document are also transferred in the exit. The accounting document header and line items can be supplemented or modified in this way.

The container does not have a structure, which means that the user can transfer any data in character format. If line items are to be supplemented, the relevant line item ( ITEMNO_ACC,), which is also contained in other parameters, must be transferred, as well as the data.

Read only

Former Member
0 Likes
1,493

Hi,

Look at the sample Program


DATA: 
* Structure for document header 
g_docheader LIKE bapiache08, 
* Table and header for G/L Account Line Items 
gi_accountgl TYPE STANDARD TABLE OF bapiacgl08, 
g_accountgl LIKE bapiacgl08, 
* Table and header for Line Item Currency Fields 
gi_amount TYPE STANDARD TABLE OF bapiaccr08, 
g_amount LIKE bapiaccr08, 
* Return 
gi_return TYPE STANDARD TABLE OF bapiret2, 
g_return LIKE bapiret2. 

START-OF-SELECTION. 
*--------------------------------------------------------- 
* HEADER DATA 
* 
* OBJ_TYPE Objekttypes can be found in table TTYP 
* OBJ_KEY Seems that you can use any value 
* OBJ_SYS Logical system. Logical ystems can be found in 
* table TBDLS. If there is no logical system assigned 
* to the client, assign it this way: 
* 
* Transaction: SPRO 
* - Basis components 
* - Application Link Enabling (ALE) 

* - Sending and receiving systems 
* - Logical systems 
* - Define logical system 
* - Assign client o logical system 
* 
* 
*--------------------------------------------------------- 
g_docheader-obj_type = 'BKPFF'. 
g_docheader-obj_key = '1'. 
g_docheader-obj_sys = 'B3TCLNT800'. 
g_docheader-username = sy-uname. 
g_docheader-header_txt = 'BAPI test'. 
g_docheader-comp_code = '1000'. 

g_docheader-doc_date = sy-datum. 

APPEND g_amount TO gi_amount. 

*--------------------------------------------------------- 
* LINE ITEMS 
*--------------------------------------------------------- 
* Item 1 
g_accountgl-itemno_acc = '0000000001'. 
g_accountgl-gl_account = '0000192600'. 
g_accountgl-pstng_date = sy-datum. 

APPEND g_accountgl TO gi_accountgl. 


* Item 2 
g_accountgl-itemno_acc = '0000000002'. 
g_accountgl-gl_account = '0000192600'. 

g_accountgl-pstng_date = sy-datum. 

APPEND g_accountgl TO gi_accountgl. 

*--------------------------------------------------------- 
* CURRENCY AND AMOUNT 
*--------------------------------------------------------- 
* Item 1 
g_amount-itemno_acc = '0000000001'. 
g_amount-currency = 'EUR'. 
g_amount-amt_doccur = 5000. 

APPEND g_amount TO gi_amount. 

* Item 2 
g_amount-itemno_acc = '0000000002'. 
g_amount-currency = 'EUR'. 
g_amount-amt_doccur = -5000. 

APPEND g_amount TO gi_amount. 


END-OF-SELECTION. 
* Call the BAPI function 
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST' 
EXPORTING 
documentheader = g_docheader 
* IMPORTING 
* OBJ_TYPE = 
* OBJ_KEY = 
* OBJ_SYS = 
TABLES 
accountgl = gi_accountgl 
currencyamount = gi_amount 
return = gi_return 
* EXTENSION1 = 
. 

LOOP AT gi_return INTO g_return. 

WRITE: / g_return-message. 
ENDLOOP.

Regards

Sudheer