Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8623

Re: Error on bapi_acc_document_post

$
0
0

Hi Sivashankar,

 

I checked your code completely. It seems you are passing ITEMNO_ACC = 1 for GL Account as well as Customer.

 

It must be incremental. For eg. in your case, you are giving 1 to customer then the GL line items must start from 2.

 

REFRESH it_acc_aR.

     it_acc_aR-itemno_acc = '1'. " Invoice Number

     it_acc_aR-customer = WA_HEADER-KUNNR. " Customer Number

     it_acc_aR-comp_code = 'JPOL'. " Company Code

     it_acc_aR-item_text = WA_HEADER-txt. " Line Item Text

 

     APPEND it_acc_aR.

 

CLEAR : ITEM_NO,item_no1.

 

     LOOP AT it_ITEM INTO WA_ITEM where id = wa_header-ID.

 

       ITEM_NO = ITEM_NO + 1.               "Here it must start from 2

  it_acc_gl-itemno_acc = ITEM_NO.

       it_acc_gl-gl_account = WA_ITEM-GL_ACCOUNT."gv_gl_acc. " GL Account

       it_acc_gl-item_text = WA_ITEM-ITEM_TEXT. "bdc_source-col_o. " Line Item Text

       it_acc_gl-doc_type = 'DR'. " Return Order...?

       it_acc_gl-comp_code = 'JPOL'."bdc_source-col_a. " Company Code

       it_acc_gl-bus_area = WA_ITEM-BUS_AREA."bdc_source-col_a. " Company Code

       it_acc_gl-CUSTOMER = WA_HEADER-KUNNR.

 

       conv_s_amt = WA_ITEM-AMT_DOCCUR."bdc_source-col_f. " Invoice Amount

       IF conv_s_amt < 0.

         it_acc_gl-de_cre_ind = 'H'. " H-Credit

         conv_s_amt = - conv_s_amt.

       ELSE.

         it_acc_gl-de_cre_ind = 'S'. " S-Debit

       ENDIF.

       APPEND it_acc_gl.

 

 

       ITEM_NO1 = ITEM_NO1 + 1.

       it_curr_amt-itemno_acc ITEM_NO1 . " Invoice Number

       it_curr_amt-curr_type = '00'.

       it_curr_amt-currency = 'INR'. " Currancy

       it_curr_amt-amt_doccur = conv_s_amt . " Line Item Amount

       APPEND it_curr_amt.

 

       ITEM_NO1 = ITEM_NO1 + 1.

       it_curr_amt-itemno_acc ITEM_NO1 . " Invoice Number

       it_curr_amt-curr_type = '00'.

       it_curr_amt-currency = 'INR'. " Currancy

       it_curr_amt-amt_doccur = conv_s_amt * -1. " Line Item Amount

 

              APPEND it_curr_amt.

 

     ENDLOOP.

*  

 

     REFRESH it_return.


Viewing all articles
Browse latest Browse all 8623

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>