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

problem with using BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
1,970

hello experts,

I am using BAPI_ACC_DOCUMENT_POST in a z program to post general ledger account document by uploading an excel file. The problem is, if i give the same input in FB50,document is created and the exchange rate is taken based on posting date (from TCURR). But in, the bapi it is taking based on Document date..what am i doing wrong?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,429

Exchange rate will be calculated based on the translation date. By default system will calculate the translation date as positing date.

I think in this case you have to pass the posting date and check the results with OC41 txn.   

     g_accit-wwert              = gs_bapi_accit-trans_date

    gs_accit-wwert           is initial and

      not gs_bapi_acchd-trans_date is initial.

     gs_accit-wwert = gs_bapi_acchd-trans_date.

   endif.

6 REPLIES 6
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,429

What are you passing in posting date and CURRENCYAMOUNT? What data are you passing to the bAPI?

Read only

0 Likes
1,429

hi 

posting date as 10/31/2012  and doc date as 10/1/2013.

in currency amount : curr_type = 00  , currency = ARS and the amount.

document currency is ARS and group currency is USD.

Read only

0 Likes
1,429

Hi

Can you please put a break point in subroutine

 

fill_acccr_from_bapi_acccr. Inside it is determining exchange rate in sub routine.

Debug and check how it is determining.

Nabheet

Read only

0 Likes
1,429

plz tell me what shoud i pass as translation date in the header?  for  now the program is passing sy-datum. I think this is causing the problem. Should i leave it blank?

Read only

0 Likes
1,429

You can try two things..

First is try with Blank.. and check..

Or you can pass the posting date...Check what is the translation date SAP is defauloting in the tcode.

Read only

Former Member
0 Likes
1,430

Exchange rate will be calculated based on the translation date. By default system will calculate the translation date as positing date.

I think in this case you have to pass the posting date and check the results with OC41 txn.   

     g_accit-wwert              = gs_bapi_accit-trans_date

    gs_accit-wwert           is initial and

      not gs_bapi_acchd-trans_date is initial.

     gs_accit-wwert = gs_bapi_acchd-trans_date.

   endif.