cancel
Showing results for 
Search instead for 
Did you mean: 

inconsistent currency information error while posting gl account through bapi_acc_document_post

gnanu8055_62
Explorer
0 Kudos

in my gt_sum table i have list of profit centers ,and for each profit centers 3 gl accounts of posting key 40 , 40 and 50 .

here after the loop i am calling the bapi_acc_doc_post  , but i am getting the  inconsistent currency information error , could you please assist me on the below code

LOOP AT gt_sum INTO DATA(lw_sum1).
    lw_accountgl-itemno_acc  = '1'.
    lw_accountgl-gl_account  = '1040107010'.
    lw_accountgl-item_text = w_docheader-header_txt.
    lw_accountgl-profit_ctr = lw_sum1-prctr.

    APPEND lw_accountgl TO    i_gl_acc .
    lw_accountgl-itemno_acc  = '2'.
    lw_accountgl-gl_account  = '1040108010'.
    lw_accountgl-item_text = w_docheader-header_txt.
    lw_accountgl-profit_ctr = lw_sum1-prctr.
    APPEND lw_accountgl TO    i_gl_acc .
    w_curr_amt-itemno_acc = '1'.
    w_curr_amt-curr_type  = '00'.
    w_curr_amt-currency   = 'INR'.
    w_curr_amt-amt_doccur = lw_sum1-freight_lc1.
    APPEND w_curr_amt TO i_curr_amt .
    w_curr_amt-itemno_acc = '1'.
    w_curr_amt-curr_type  = '10'.
    w_curr_amt-currency   = 'INR'.
    w_curr_amt-amt_doccur = lw_sum1-freight_lc1.
    APPEND w_curr_amt TO i_curr_amt .
    w_curr_amt-itemno_acc = '1'.
    w_curr_amt-curr_type  = '31'.
    w_curr_amt-currency   = 'USD'.
    w_curr_amt-amt_doccur = lw_sum1-freight_lc2.
    APPEND w_curr_amt TO i_curr_amt .
     w_curr_amt-itemno_acc = '2'.
    w_curr_amt-curr_type  = '00'.
    w_curr_amt-currency   = 'INR'.
    w_curr_amt-amt_doccur = lw_sum1-duty_lc1.
    APPEND w_curr_amt TO i_curr_amt .
    w_curr_amt-itemno_acc = '2'.
    w_curr_amt-curr_type  = '10'.
    w_curr_amt-currency   = 'INR'.
    w_curr_amt-amt_doccur = lw_sum1-duty_lc1.
    APPEND w_curr_amt TO i_curr_amt .
    w_curr_amt-itemno_acc = '2'.
    w_curr_amt-curr_type  = '31'.
    w_curr_amt-currency   = 'USD'.
    w_curr_amt-amt_doccur = lw_sum1-duty_lc2.
    APPEND w_curr_amt TO i_curr_amt .
    lw_accountgl-itemno_acc  = '3'.
    lw_accountgl-gl_account  = '6030201020'.
    lw_accountgl-item_text = w_docheader-header_txt.
    lw_accountgl-profit_ctr = lw_sum1-prctr.
    APPEND lw_accountgl TO    i_gl_acc .
     w_curr_amt-itemno_acc = '3'.
    w_curr_amt-curr_type  = '00'.
    w_curr_amt-currency   = 'INR'.
    w_curr_amt-amt_doccur = - ( lw_sum1-freight_lc1 + lw_sum1-duty_lc1 ).
    APPEND w_curr_amt TO i_curr_amt .
    w_curr_amt-itemno_acc = '3'.
    w_curr_amt-curr_type  = '10'.
    w_curr_amt-currency   = 'INR'.
    w_curr_amt-amt_doccur = - ( lw_sum1-freight_lc1 + lw_sum1-duty_lc1 ) .
    APPEND w_curr_amt TO i_curr_amt .
    w_curr_amt-itemno_acc = '3'.
    w_curr_amt-curr_type  = '31'.
    w_curr_amt-currency   = 'USD'.
    w_curr_amt-amt_doccur = - ( lw_sum1-freight_lc2 + lw_sum1-duty_lc2 ) .
    APPEND w_curr_amt TO i_curr_amt .
    clear : w_curr_amt , lw_accountgl .
  ENDLOOP.

Sandra_Rossi
Active Contributor
0 Kudos

After checking the tens of existing answers to your question, explain what you have tried.

Sandra_Rossi_0-1715249045698.png

 

Accepted Solutions (0)

Answers (0)