Skip to Content
avatar image
Former Member

BAPI_ACC_GL_POSTING_POST error The +/- sign in the currency field is wrong

Hi all,

Using BAPI_ACC_GL_POSTING_POST for GL to GL posting .But is giving error The +/- sign in the currency field is wrong.Help me out. Here is the sample code. Thanks in advance.


data :GL_ACC like bseg-hkont value '125000'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = GL_ACC
IMPORTING
OUTPUT = GL_ACC .


clear: lv_amt, lv_percent.
REFRESH :lt_crncy ,lt_glacc ,lt_return.
loop at lt_collect into ls_collect.
lv_amt = lv_amt + ls_collect-disbursalamt.
lv_percent = lv_percent + ls_collect-disbursalper.
clear: ls_collect.
endloop.

if lv_percent ne '100.00' or lv_amt ne p_dis_amt.
Message 'Total bussiness areas disbursal amount or percent equal to total disbursal amount or 100 %' type 'E' DISPLAY LIKE 'S'.
endif.

clear ls_header.
ls_header-header_txt = 'G/L posting for loan disbursal'.
ls_header-comp_code = p_ccode.
ls_header-doc_date = p_dis_date.
ls_header-pstng_date = sy-datum.
ls_header-ref_doc_no = ls_dldetails-rfha.
ls_header-doc_type = 'SA'.
ls_header-username = sy-uname.
data: count type n VALUE IS INITIAL.
clear: count.

clear ls_glacc.
ls_glacc-itemno_acc = count + 1.
ls_glacc-gl_account = gl_acc.
ls_glacc-bus_area = '1000'.
ls_glacc-pstng_date = sy-datum.
ls_glacc-item_text = 'Loan Disbursal credit'.
append ls_glacc to lt_glacc.


loop at lt_collect into ls_collect.

clear ls_glacc.
ls_glacc-itemno_acc = count + 1.
ls_glacc-gl_account = gl_acc.
ls_glacc-bus_area = ls_collect-businessarea.
ls_glacc-pstng_date = sy-datum.
ls_glacc-item_text = 'Loan Disbursal debit'.
append ls_glacc to lt_glacc.
clear :ls_collect , ls_glacc.
endloop.

clear count.
data:lv_amt type tb_bzbetr.
lv_amt = -1 * p_dis_amt.
clear ls_crncy.
ls_crncy-itemno_acc = count + 1.
ls_crncy-currency = ls_dldetails-wgschft.
ls_crncy-amt_doccur = lv_amt.
append ls_crncy to lt_crncy.

loop at lt_collect into ls_collect.
clear ls_crncy.
ls_crncy-itemno_acc = count + 1.
ls_crncy-currency = ls_dldetails-wgschft.
ls_crncy-amt_doccur = ls_collect-disbursalamt.
append ls_crncy to lt_crncy.
endloop.
CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'
EXPORTING
documentheader = ls_header
IMPORTING
OBJ_TYPE = OBJ_TYPE
OBJ_KEY = OBJ_KEY
OBJ_SYS = OBJ_SYS
tables
accountgl = lt_glacc
currencyamount = lt_crncy
return = lt_return.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 01, 2017 at 01:57 AM

    Hi,

    Instead of TB_BZBETR, use type BAPIWRBTR.

    DATA: lv_amt TYPE bapiwrbtr.

    Regards,

    Priyanka.

    Add comment
    10|10000 characters needed characters exceeded