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

Error in document for BAPI_ACC_GL_POSTING_POST - help me with Pointers

Former Member
0 Likes
8,231

Hi Gurus,

I have a question on BAPI_ACC_GL_POSTING_POST.

I tried to search in the forum, but didn't find any pointers on this.

I am getting error message like:

T ID NUM MESSAGE

E RW 609 Error in document: BKPFF 50000000542009 DW1

E F5 702 Balance in transaction currency

Please guide me on how to use this bapi.

Many Thanks,

Madan

1 ACCEPTED SOLUTION
Read only

Adi_Bathineni
Participant
0 Likes
4,103

Hi Madan,

For posting the Documents, the basic rule is the Debit and Credit Values (Total) should be equal.

If you add both values, you should get '0'. (ZERO).

First check the Document and Balance the totals. If the Document is ok, then the Problem is in the Program.

Try to Debug the Program and find whether the totals are passing Correctly to the respective structures.

The Credit Values should pass as Negative values to the Structures and Debit Values as +VE.

Thanks,

Adi.

23 REPLIES 23
Read only

Former Member
0 Likes
4,103

Hi,

Check the total line item the amount should be zero...(debit and credit).. or if you are using multiple currency and if there is a difference either u have to take care or the config should be there to post the diff in some default gl account.

Atul

Read only

Former Member
0 Likes
4,103

Hi,

Please check the given link. hope It will help you.

Regards,

Shamma

Read only

Adi_Bathineni
Participant
0 Likes
4,104

Hi Madan,

For posting the Documents, the basic rule is the Debit and Credit Values (Total) should be equal.

If you add both values, you should get '0'. (ZERO).

First check the Document and Balance the totals. If the Document is ok, then the Problem is in the Program.

Try to Debug the Program and find whether the totals are passing Correctly to the respective structures.

The Credit Values should pass as Negative values to the Structures and Debit Values as +VE.

Thanks,

Adi.

Read only

0 Likes
4,103

Hi Gurus,

I tried all your sugestions, but still I am facing the same issue.

I am still getting error as:

T ID NUM MESSAGE

E RW 609 Error in document: BKPFF 50000000542009 DW1

E F5 702 Balance in transaction currency

Please guide me on this one.

Thanks,

Madan

Read only

0 Likes
4,103

The error message is telling you exactly what the problem is. See Atul's answer.

rob

Read only

0 Likes
4,103

Hi guys,

I understand that the amount should be balanced, and i have doen that.

I even tried with different GL accounts, but of no use.

I am still facing the same issue - "Error in document, Balance in transaction currency".

What can be the possible root cause, please let me know.

Thanks in Advance.

Madan

Read only

0 Likes
4,103

Hi

Check the amounts you're transfering in CURRENCYAMOUNT parameter: the total has to be ZERO, so

CURRENCYAMOUNT-CURR_TYPE    = 00 - transaction currency
CURRENCYAMOUNT-CURRENCY      = <Currency code>
CURRENCYAMOUNT-AMT_DOCCUR = <amount>

The total of the value in AMT_DOCCUR (for all records you're appending there) has to be zero: u need to transfer the amount with the sign if it has to be less than 0.

Max

Read only

0 Likes
4,103

Hi Max,

Thank you for your quick response.

Here is a snapshot of my Currency details:

ITEMNO_ACC  CU CURRE CUR       AMT_DOCCUR                     EXCH_RATE    EXCH_RATE_V

0000000001               00 USD                             61.0000                                               0.00000
0000000002               00 USD                             61.0000-                                              0.00000

please let me know where i a m going wrong.

Thanks in Advance,

Madan

Read only

0 Likes
4,103

Hi

It seems to be ok, so the error is not there,

How are you transfering the data to ACCOUNTGL parameter?

Max

Read only

0 Likes
4,103

Hi Max,

I am still facing the same error.

I am testing the BAPI manually thru se37.

I need to use this BAPI in my code, so before using it I am testing it.

Please suggest me any pointers of wat might be going wrong.

Thanks,

Madan

Read only

0 Likes
4,103

Hi

The data for amounts are ok, so the problem can be in the data for ACCOUNTGL? How do you fill it?

MAx

Read only

0 Likes
4,103

Hi Max,

Here is the details on AccountGL data population:

ITEMNO_ACC GL_ACCOUNT COMP PSTNG_DATE DO COSTCENTER

0000000001   22980010        1001   06/26/2009    WE  100110013

Apart from those fields i am not populating anything else in AccountGL table.

Please suggest.

Madan

Read only

0 Likes
4,103

Hi Madan,

I have faced this issue long back using the bapi.

I my case the Currency conversion factor was the problem.

Donno wat is the exchange rates you are using and rounding of values that is taking place.

I faced this issue with currencies like HUF,JPY as they have rounding problems in SAP.

Consider this point. Hope this could help you.

Usally Balance in transaction Currency is an issue when the debit and credits doesn't match and has nothing to do with GL entries.

There is also an observation on the Currency line items passed. Document currency is in Fifth column. I am not sure in which column you are passing the currency values. Please check the same.(I am referring to structure fields BAPIACCR09)

-- Durga.

Edited by: Durgaprasad Kare on Jul 15, 2009 10:01 PM

Durga
Read only

0 Likes
4,103

Hi Durga,

Thanks for your suggestion.

I am still facing the same issue.

One thing i noticed is to post any FI document, there should be either - Posting Key or Posting Indicator.

Can anyone let me know which field i can use in this BAPI for 'Posting key' or 'Posting Indicator'

I searched the entire forum, but i am still stuck in using this BAPI.

Please help/guide me on this.

Many Thanks,

Madan

Read only

0 Likes
4,103

Hi,

We tried using the bapi in one of our requirement and failed to use it successfully.

Finally we decided to go for BDC.

you should convince your client for doing BDC on FB05 transaction. Its easy to post a FI doc using BDC.

Regards,

Prathap

Read only

0 Likes
4,103

Hi Madan/Pratap,

We have successfully implemente dteh BAPI...We have to pass the posting key as a mandatory field.....

I have a sample code...hope this helps

This is a sample code for post the GL entries in SAP....i am using bapi instead GL_DOC_POSt bapi.........

      • There is a 2.500 character limit for posts. Please post only relevant portions of code.***

Please let me know if u need anything else.

Also send me ur code so that i can check if somethingis missing.

Regards,

Durga.

Edited by: Durgaprasad Kare on Aug 4, 2009 8:54 PM

Edited by: Rob Burbank on Aug 4, 2009 2:55 PM

Durga
Read only

0 Likes
4,103

Hi Durga,

Thanks for your info, can you please paste ur sample code related to bapi filling.

Here is my way of filling the bapi.

lwa_doc_hdr-obj_type = 'BKPFF'.
        lwa_doc_hdr-obj_key  = <gwa_final>-belnr.
        lwa_doc_hdr-obj_sys  = sy-sysid.
        lwa_doc_hdr-username = sy-uname.
        lwa_doc_hdr-header_txt = <gwa_final>-bktxt.
        lwa_doc_hdr-comp_code = <gwa_final>-bukrs.
        lwa_doc_hdr-doc_date = sy-datum.
        lwa_doc_hdr-pstng_date = p_budat.
        lwa_doc_hdr-doc_type = <gwa_final>-blart.

        lwa_accntgl-itemno_acc = sy-tabix.
        lwa_accntgl-gl_account = p_saknr.
        lwa_accntgl-comp_code  = <gwa_final>-bukrs.
        lwa_accntgl-pstng_date = p_budat.
        lwa_accntgl-doc_type   = <gwa_final>-blart.
        lwa_accntgl-profit_ctr = <gwa_final>-kostl.
        APPEND lwa_accntgl TO lt_accntgl.

        lwa_curramnt-itemno_acc = sy-tabix.
        lwa_curramnt-currency   = <gwa_final>-waers.
        lwa_curramnt-amt_doccur = <gwa_result>-diff.
        APPEND lwa_curramnt TO lt_curramnt.

Please correct me if i am going wrong.

Also please let me know which field to pass 'Posting Key/Indicator'

Many Thanks,

Madan

Read only

0 Likes
4,103

Hi ,

There Should to Debit and Cerdit balance and There is no way to pass Posting key In BAPI_ACC_GL_POSTING_POST but event RWBAPI01 (BTE ) which you can use to change posting key you need to pass the EXTENSION structure in bapi call and implements SAMPLE_INTERFACE_RWBAPI01 function module where you write logic to pass to posting .


bapiache09-username       = sy-user'.
bapiache09-bus_act        = 'RFBU'.
bapiache09-comp_code      = 'RS01'.
bapiache09-comp_code      = 'RS01'.
bapiache09-pstng_date     = '20090230'.
bapiache09-doc_date       = '20090230'.
bapiache09-trans_date     = '20090230'.
bapiache09-fisc_year      = '2008'.
bapiache09-fis_period     = '11'.
bapiache09-doc_type       = 'KY'.

it_bapiacgl09-itemno_acc = '0000000001'.
it_bapiacgl09-gl_account = '0024520080'.
it_bapiacgl09-comp_code  = 'RS01'.
it_bapiacgl09-bus_area   = 'BARD'.
*it_bapiacgl09-doc_type   = 'KY'.
*it_bapiacgl09-acct_type  = 'K'.

APPEND it_bapiacgl09 .

it_bapiacap09-itemno_acc   = '0000000002'.
it_bapiacap09-vendor_no    = 'MSHS0100'.
*it_bapiacap09-gl_account   = '0013000001'.
*it_bapiacap09-comp_code    = 'RS01'.
*it_bapiacap09-bus_area     = 'BARD'.
*it_bapiacap09-doc_type   = 'KY'.
*it_bapiacap09-acct_type  = 'K'.
*it_bapiacap09-PYMT_AMT     = '1287'.
*it_bapiacap09-PYMT_CUR_ISO = 'INR'.
APPEND it_bapiacap09.

it_bapiaccr09-itemno_acc   = '0000000001'.
it_bapiaccr09-currency_iso = 'INR'.
it_bapiaccr09-amt_doccur   = '-1287'.
it_bapiaccr09-amt_base     = '-1287'.
APPEND it_bapiaccr09.

it_bapiaccr09-itemno_acc   = '0000000002'.
it_bapiaccr09-currency_iso = 'INR'.
it_bapiaccr09-amt_doccur   = '1287'.
it_bapiaccr09-amt_base     = '1287'.
APPEND it_bapiaccr09.


*
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
  EXPORTING
    documentheader          =  bapiache09
*   CUSTOMERCPD             =
*   CONTRACTHEADER          =
* IMPORTING
*   OBJ_TYPE                =
*   OBJ_KEY                 =
*   OBJ_SYS                 =
  TABLES
   accountgl               =  it_bapiacgl09[]
*   ACCOUNTRECEIVABLE       =
   accountpayable          =  it_bapiacap09[]
*   ACCOUNTTAX              =
    currencyamount          = it_bapiaccr09[]
*   CRITERIA                =
*   VALUEFIELD              =
*   EXTENSION1              =
    return                  = it_return[]
*   PAYMENTCARD             =
*   CONTRACTITEM            =
*   EXTENSION2              =
*   REALESTATE              =
*   ACCOUNTWT               =
          .

Regards,

Read only

0 Likes
4,103

Hi madan,

Follow the code carefully,

***data declatrions: dont forget this piece

lwa_doc_hdr-username = sy-uname.

lwa_doc_hdr-header_txt = 'HEAD'.

lwa_doc_hdr-comp_code = '1900'.

lwa_doc_hdr-doc_date = sy-datum.

lwa_doc_hdr-pstng_date = '20090101'.

lwa_doc_hdr-doc_type = 'ZI' .

lwa_accntgl-itemno_acc = '000001'.

lwa_accntgl-gl_account = '2169000304'.

lwa_accntgl-comp_code = '1900' .

lwa_accntgl-doc_type = 'ZI'.

lwa_accntgl-profit_ctr = '0001000891'.

APPEND lwa_accntgl TO lt_accntgl.

lwa_accntgl-itemno_acc = '000002'.

lwa_accntgl-gl_account = '2950500408'.

APPEND lwa_accntgl TO lt_accntgl.

lwa_curramnt-itemno_acc = '000001'.

lwa_curramnt-curr_type = '00'.

lwa_curramnt-currency = 'CAD' .

lwa_curramnt-amt_doccur = '10.00' . ******posting key value 40

APPEND lwa_curramnt TO lt_curramnt.

lwa_curramnt-itemno_acc = '000002'.

lwa_curramnt-currency = 'CAD' .

lwa_curramnt-amt_doccur = '-10.00'. ******posting key value 50

APPEND lwa_curramnt TO lt_curramnt.

lwa_extn-field1+0(10) = '000001'.

lwa_extn-field1+20(4) = 'ECGL'.

APPEND lwa_extn TO lt_extn.

lwa_extn-field1+0(10) = '000002'.

lwa_extn-field1+20(4) = 'ECGL'.

APPEND lwa_extn TO lt_extn.

CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'

EXPORTING

documentheader = lwa_doc_hdr

  • IMPORTING

  • OBJ_TYPE =

  • OBJ_KEY =

  • OBJ_SYS =

TABLES

accountgl = lt_accntgl

currencyamount = lt_curramnt

return = lt_return

extension1 = lt_extn.

WRITE:/ 'passed'.

we do not require any posting keys as the currency can be passed directly.......Im my logic i am using extension structure for populating zfields.....use them only if u have to pass them else skip it...

Regards,

Durga.

Durga
Read only

0 Likes
4,103

Hi Durga,

Thank you so much !!

I populated the BAPI, in a way suggested by you and is wroking great !

Just to confirm, the posted document no is at obj_key(10) correct ? I did check in BKPF

Once again thank you so much

Madan

Read only

0 Likes
4,103

HI Madan,

As long as we have return table in the bapi never look for other options...it is not of much use declaring variables. If we r having a situation of performance then these variables will consume the memory without any purpose.

object key , object type field values are avaialble in return table success message.

Regards,

Durga.

Durga
Read only

0 Likes
4,103

Hi Durga,

Have you tried extending BAPI_ACC_GL_POSTING_POST.

I need to extend this BAPI to add Tax Code - MWSKZ field.

Can you please help me out in this with step by step procedure.

Many Thanks,

Madan

Read only

0 Likes
4,103

Hi Madan,

Instead of extending the GL Bapi why r u not using BAPI_ACC_DOCUMENT_POST where all the fields are available.

This is having all the fields in the invoice postings. this is much easier to maintain and handle also.

send a test mail to my ID and i can send you the code. I have not extended the fields in GL bapi. i can try sending the code i have.

Thank You.

Regards,

Durga.