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: 

BAPI_ACC_DOCUMENT_POST error while posting for group currency FBB1.

Former Member
0 Kudos

Hi All

We are trying to post a document against different GL accounts via BAPI_ACC_DOCUMENT_POST for group currency.

But it is throwing an error 'Balance in transaction currency'. I am assuming that the credit - debit is not coming out to be ZERO. This requirement is for Hyperinflation in Venezuela.

I am doing it in USD as well as the local currency VEF. Below are the values I am passing in the structure CURRENCYAMOUNT.

credit:

wa_curramt-itemno_acc = '0001'.

wa_curramt-curr_type = '10'.

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '68.4'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

credit:

wa_curramt-itemno_acc = '0001'.

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '10'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

credit:

wa_curramt-itemno_acc = '0002'.

wa_curramt-curr_type = '10'.

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '68.4'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

credit:

wa_curramt-itemno_acc = '0002'.

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '10'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

debit:

wa_curramt-itemno_acc = '0003'.

wa_curramt-curr_type = '10'.

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '136.8'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

debit:

wa_curramt-itemno_acc = '0003'.

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '20'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

Let me know if some more info is needed from my end.

Thanks in advance,

Tejaswini

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think instead of looking at SAP Notes, i believe the error is in my amount passed in VEF curr. Seems like it is not becoming zero for debit - credit..

Please help.

10 REPLIES 10

Private_Member_14913
Contributor
0 Kudos

Hello,

Check below thread

http://scn.sap.com/thread/127180

BAPI_ACC_DOCUMENT_POST | SCN

Regards,

Sameer

Private_Member_14913
Contributor
0 Kudos

Hello,

Have you had a look for notes, Depending on the release and industry solution you can find several notes on this subject (start looking for message RW 022 "FI/CO interface: Balance in transaction currency").


Regards,

Sameer

Former Member
0 Kudos

I think instead of looking at SAP Notes, i believe the error is in my amount passed in VEF curr. Seems like it is not becoming zero for debit - credit..

Please help.

0 Kudos

The code should be like this...


credit:

wa_curramt-itemno_acc = '0001'.

wa_curramt-curr_type = '10'.

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '68.4'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

credit:

wa_curramt-itemno_acc = '0002'. "line items should not be same s.no

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '10'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

credit:

wa_curramt-itemno_acc = '0003'.

wa_curramt-curr_type = '10'.

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '68.4'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

credit:

wa_curramt-itemno_acc = '0004'.

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '10'.

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

debit:

wa_curramt-itemno_acc = '0005'.

wa_curramt-curr_type = '10'.         

wa_curramt-curr = 'VEF'.

wa_curramt-amt_doccur = '-136.8'. "debit indicator is mandatory

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

debit:

wa_curramt-itemno_acc = '0006'.

wa_curramt-curr_type = '30'.

wa_curramt-curr = 'USD'.

wa_curramt-amt_doccur = '-20'. "debit indicator is mandatory

APPEND wa_curramt TO ta_curramt.

CLEAR wa_curramt.

0 Kudos

Thanks for your response Chandra.

I tried it, but on changing the line nos it gives me a short dump as below:

'Exception condition "SYSTEM_ERROR" raised'/

Also, when i post the document manually, it asks me 'To enter positive values only'.

Please help.

0 Kudos

Hello,

Can you try only making amount +ve for credit and -ve for debit.

Regards,

Sameer

thanga_prakash
Active Contributor
0 Kudos

Hello Tejaswini,

I guess there is some problem in your currency, don't directly pass value like below.

wa_curramt-amt_doccur = '-136.8'.

The data element in which it is referring is having 4 decimals. Try like below or do the conversion of the value before passing into the table.

wa_curramt-amt_doccur = '136,800- '. "minus at last, try with comma separator ( or ) if it doesn't work

                                                                                                             try with dot as seperator

Regards,

Thanga

former_member217316
Contributor
0 Kudos

Hi Tejaswini

The only change needed in your code is passing the credit entries (the ones you are passing with SHKZG = 'H' corresponding to entries in ACCOUNTGL structure) with the '-' sign. The rest everything should be the same. Remember, the credit - debit = 0.

Try doing that and let me know.

Thanks,

Harsh

Former Member
0 Kudos

Hi  Tejaswini, If the suggestion from Harsh had worked, I am stuck in the same case. Can you please share the code.