Miro_for_freight_excise_salestax_entry_tax_using_bapi

getting error "you can not process conditions for delivery cost" using bapi_incominginvoice_create.
code snippets attached.
Please guide soon if possible.

LOOP AT it_final.
** Header
headerdata-invoice_ind  = 'X'.
headerdata-calc_tax_ind = 'X'.
*    headerdata-doc_type     = 'RE'.
headerdata-doc_date     = it_final-doc_date."'20140806'."it_final-bldat.
headerdata-pstng_date   = it_final-pstng_date."'20140806'."it_final-budat.
headerdata-comp_code    = it_final-comp_code."'VALC'.
*    headerdata-diff_inv     = it_final-diff_inv."'0000150016'.
headerdata-currency     = it_final-currency."'INR'.
headerdata-exch_rate    = '1.00000'.
headerdata-bline_date   =  it_final-bline_date."'20140806'.
headerdata-gross_amount =  it_final-gross_amount."'41708.38'."it_final-WRBTR."after tax
*headerdata-PMNTTRMS    = '0001'.
headerdata-header_txt     = it_final-header_txt."'aaaaaaa'."it_final-bktxt.
headerdata-alloc_nmbr     = it_final-alloc_nmbr."'46546546'."it_final-zuonr.
headerdata-bus_area       =   it_final-bus_area."'3001'."it_final-gsber.
*headerdata-inv_year  = '2014'.
headerdata-item_text      = it_final-item_text."'fdffd'."it_final-sgtxt.
headerdata-business_place = it_final-business_place."'1000'."it_final-bupla.
** Item
DO 2 TIMES.
CASE var.
WHEN '1'.
ls_itemdata-invoice_doc_item = it_final-nvoice_doc_item1.
ls_itemdata-po_number        = it_final-po_number1.
ls_itemdata-po_item          = it_final-po_item1
          ls_itemdata-ref_doc          = it_final-ref_doc1.
          ls_itemdata-ref_doc_year     = it_final-ref_doc_year1.
          ls_itemdata-ref_doc_it       = it_final-ref_doc_it1.
          ls_itemdata-tax_code         = it_final-tax_code1.
          ls_itemdata-item_amount      = it_final-item_amount1.
ls_itemdata-quantity         = it_final-quantity1.
ls_itemdata-po_unit          = it_final-po_unit1.
          ls_itemdata-item_text        = it_final-item_text1.
APPEND ls_itemdata TO itemdata.
CLEAR ls_itemdata.
WHEN '2'.
ls_itemdata-invoice_doc_item = it_final-nvoice_doc_item2.
ls_itemdata-po_number        = it_final-po_number2.
          ls_itemdata-po_item          = it_final-po_item2.
          ls_itemdata-tax_code         = it_final-tax_code2
          ls_itemdata-item_amount      = it_final-item_amount2
          ls_itemdata-quantity         = it_final-quantity2
          ls_itemdata-po_unit          = it_final-po_unit2
          ls_itemdata-item_text        = it_final-item_text2    
          ls_itemdata-cond_type        = it_final-cond_type
ls_itemdata-freight_ven      = it_final-freight_ven
APPEND ls_itemdata TO itemdata.
CLEAR ls_itemdata.
ENDCASE.
var = var + 1.
ENDDO.
var = 0.
***** G/L DATA*********
ls_gldata-invoice_doc_item = it_final-invoice_doc_item3.
ls_gldata-gl_account = it_final-gl_account3.
ls_gldata-item_amount = it_final-item_amount3.
ls_gldata-db_cr_ind = it_final-db_cr_ind3.
ls_gldata-comp_code = it_final-comp_code3.
ls_gldata-tax_code = it_final-tax_code3.
ls_gldata-item_text = it_final-item_text3.
append ls_gldata to gldata.
clear ls_gldata.
PERFORM commit_wrk.
ENDLOOP.
*&      Form  commit_wrk
*       text
FORM commit_wrk.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
headerdata          = headerdata
**   ADDRESSDATA         =
IMPORTING
invoicedocnumber    = invoicedocnumber
fiscalyear          = fiscalyear
TABLES
itemdata            = itemdata
**   ACCOUNTINGDATA      =
GLACCOUNTDATA       =  GLDATA
*     TAXDATA             = TAXDATA
**   WITHTAXDATA         =
*     VENDORITEMSPLITDATA = VENITEM
return              = return.
**   EXTENSIONIN         =
**   TM_ITEMDATA         =
**   NFMETALLITMS        =
IF return IS NOT INITIAL.
LOOP AT return INTO ls_return WHERE type = 'E'.
FORMAT INTENSIFIED.
WRITE: / ls_return-message COLOR 6.
FORMAT INTENSIFIED OFF.
ENDLOOP.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait   = 'X'
IMPORTING
return = ls_return.
IF sy-subrc = 0.
WRITE: 'Invoice' COLOR 3, invoicedocnumber COLOR 3, 'Created Successfully' COLOR 3.
ENDIF.
REFRESH itemdata.
REFRESH gldata.
ENDIF.
ENDFORM.                    "commit_wrk

Similar Messages

Maybe you are looking for

  • ITunes Closes When PC Is Idle

    Whenever I run iTunes (v. 6.0.3.5/Windows XP SP2 Pro) in the mini-player, if I pause it and go away for a while, I come back to find it's closed itself down (no error messages or anything, just turned itself off). Any ideas?

  • Enhancement in web dynpro alv

    When iam enhancing ALV (web dynpro). how to add another attribute to the context. Actaully the context is referring one structure.

  • Securing the JASS CONF file

    Hi, I have put the JASS conf file as a resource in a signed JAR file. I did this so someone cannot alter this file. I also set the location of the file in the code right before I use it by setting the environment variable java.security.auth.login.con

  • SQL Loader - Junk characters

    Hi ALl This may not be exactly a SQL Loader problem. I have a XCEL file which I convert to Tab delimited file before using SQL Loader to load the records. But the XCEL file has some junk characters. So when I save it as tab delimited format the junk

  • Mail on MBP and iPhone

    I'm wondering why when I do stuff on mail on my MBP it does'nt do it on my mail on my iPhone for example it only seems to do it when I flag my emails as important or on going. It talks to each other for read emails, deleting emails and moving them to