01-04-2011 7:09 AM
Hi All,
I have a requirement to post 3 currency types 00, 10 and 30.
For 00 , the amount is 0
For 10, the amount in -ve an for 30, amount in +ve.
After excuting I am getting following error :
The +/- sign in the currency field is wrong (see long text)
Anybody has come across this type of problem. Please help.
Regards,
Jeetu
01-04-2011 7:28 AM
Hi,
Check you code looks like you might be incorrectly passing the amount in the 'CURRENCY' field. The Amount should be passed in the field 'AMT_DOCCUR'.
Regards,
Himanshu Verma
01-04-2011 7:37 AM
Hi,
See the code below:
Header fill
lwa_docheader-obj_type = 'BKPFF'.
lwa_docheader-obj_key = '&'.
lwa_docheader-obj_sys = 'SRDCLNT012'.
lwa_docheader-username = 'tiger'.
lwa_docheader-header_txt = 'Accr Rev Diff posting'.
lwa_docheader-comp_code = '3311'.
lwa_docheader-fisc_year = '2010'.
lwa_docheader-doc_date = '20111231'.
lwa_docheader-pstng_date = '20111231'.
lwa_docheader-trans_date = '20101231'.
lwa_docheader-fis_period = '12'.
lwa_docheader-doc_type = 'AR'.
lwa_docheader-ref_doc_no = '8000002251'.
GL fill
lwa_accountgl-itemno_acc = '0000000001'.
lwa_accountgl-gl_account = '0000500200'.
lwa_accountgl-comp_code = '3311'.
lwa_accountgl-pstng_date = '20101231'.
lwa_accountgl-doc_type = 'AR'.
lwa_accountgl-fisc_year = '2010'.
lwa_accountgl-fis_period = '12'.
lwa_accountgl-wbs_element = '9TP-INT-3311'.
lwa_accountgl-profit_ctr = '1541094000'.
APPEND lwa_accountgl TO li_accountgl.
CLEAR: lwa_accountgl.
lwa_accountgl-itemno_acc = '0000000002'.
lwa_accountgl-gl_account = '0000210000'.
lwa_accountgl-comp_code = '3311'.
lwa_accountgl-pstng_date = '20101231'.
lwa_accountgl-doc_type = 'AR'.
lwa_accountgl-fisc_year = '2010'.
lwa_accountgl-fis_period = '12'.
lwa_accountgl-profit_ctr = '3511080000'.
APPEND lwa_accountgl TO li_accountgl.
Currency fill
lwa_currencyamount-itemno_acc = '0000000001'.
lwa_currencyamount-curr_type = '00'.
lwa_currencyamount-currency = 'GBP'.
lwa_currencyamount-amt_doccur = '0.00'.
APPEND lwa_currencyamount TO li_currencyamount.
lwa_currencyamount-itemno_acc = '0000000001'.
lwa_currencyamount-curr_type = '10'.
lwa_currencyamount-currency = 'EUR'.
lwa_currencyamount-amt_doccur = '18239.8900-'.
APPEND lwa_currencyamount TO li_currencyamount.
lwa_currencyamount-itemno_acc = '0000000001'.
lwa_currencyamount-currency = 'USD'.
lwa_currencyamount-curr_type = '30'.
lwa_currencyamount-amt_doccur = '4025.0000'.
APPEND lwa_currencyamount TO li_currencyamount.
CLEAR: lwa_currencyamount.
lwa_currencyamount-itemno_acc = '0000000002'.
lwa_currencyamount-curr_type = '00'.
lwa_currencyamount-currency = 'GBP'.
lwa_currencyamount-amt_doccur = '0.00'.
APPEND lwa_currencyamount TO li_currencyamount.
lwa_currencyamount-itemno_acc = '0000000002'.
lwa_currencyamount-curr_type = '10'.
lwa_currencyamount-currency = 'EUR'.
lwa_currencyamount-amt_doccur = '18239.8900'.
APPEND lwa_currencyamount TO li_currencyamount.
lwa_currencyamount-itemno_acc = '0000000002'.
lwa_currencyamount-currency = 'USD'.
lwa_currencyamount-curr_type = '30'.
lwa_currencyamount-amt_doccur = '4025.0000-'.
APPEND lwa_currencyamount TO li_currencyamount.
lwa_ext-field1 = 'POST key'.
APPEND lwa_ext TO li_ext.
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = lwa_docheader
IMPORTING
OBJ_TYPE =
OBJ_KEY =
OBJ_SYS =
TABLES
accountgl = li_accountgl
currencyamount = li_currencyamount
return = li_return
extension1 = li_ext.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
IMPORTING
RETURN =
01-04-2011 2:36 PM
Did you read the long text of message RW610?
You have mixed up the sign of the EUR and USD amounts, for each line item the amounts must have the same sign accross all currency types.
Thomas