Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

unable to do miro for services using BAPI

Former Member
0 Likes
835

how to use bapi_incominginvoice_create of services for MIRO.

Tried testing The above FM.but not helping.

if it is possible in coding then how?Please guide

Thanks

3 REPLIES 3
Read only

Former Member
0 Likes
649

Hi Kumar,

What`s message return to you after you call this BAPI?

A example code, refer this thread, http://scn.sap.com/thread/394234

regards,

Archer

Read only

0 Likes
649

Can we change header details e.g. taxcode in MIRO Transaction using FM.

Read only

Former Member
0 Likes
649

I was trying with below code but while checking a/c details in MIRO the tax amount is adjusted in cenvat clearing or coin adjustment.

Please guide.

headerdata-invoice_ind = 'X'.

   headerdata-CALC_TAX_IND = 'X'.

   headerdata-doc_type  = 'RE'.

   headerdata-doc_date    = '20140927'.

   headerdata-ref_doc_no 'GDFGDFG'.

   headerdata-pstng_date  = '20140927'.

   headerdata-comp_code  = 'VALC'.

   headerdata-currency = 'INR'."it_final-currency.

   headerdata-gross_amount = '219.102'.

   headerdata-exch_rate = '1.00000'.

   headerdata-PMNTTRMS = '0001'.

   headerdata-bline_date = '20140927'.

   headerdata-bus_area =   '3001'.

   headerdata-header_txt = 'abcddfghvkj'.

   headerdata-alloc_nmbr = 'BVKJFDLNV'.

   headerdata-item_text = 'BJFDbbf'.

   headerdata-business_place = '1000'.

---------------------------------------------------------------------

   ls_itemdata-invoice_doc_item = '000001'.

   ls_itemdata-po_number = '6600003195'.

   ls_itemdata-po_item = '00010'.

   ls_itemdata-tax_code = 'S1'.

   ls_itemdata-item_amount = '195.00'.

   ls_itemdata-quantity = '10'.

   ls_itemdata-po_unit  = 'NO'.

   ls_itemdata-ref_doc = '1000363546'.

   ls_itemdata-ref_doc_it = '001'.

   ls_itemdata-REF_DOC_YEAR = '2014'.

   ls_itemdata-SHEET_NO = '1000363546'.

   ls_itemdata-SHEET_ITEM = '0000000010'.

   APPEND ls_itemdata TO itemdata.

   CLEAR ls_itemdata.



CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'

     EXPORTING

       headerdata       = headerdata

**   ADDRESSDATA         =

     IMPORTING

       invoicedocnumber = invoicedocnumber

       fiscalyear       = fiscalyear

     TABLES

       itemdata         = itemdata

*   accountingdata      = accountingdata

*      glaccountdata    = gldata

*     MATERIALDATA     = matdata

      TAXDATA          = taxdata

**   WITHTAXDATA         =

**   VENDORITEMSPLITDATA =

       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 .

       FORMAT INVERSE .

       WRITE'Invoice & Created Successfully' COLOR 5,invoicedocnumber COLOR 5 .

       FORMAT INVERSE OFF.

     ENDIF.

   ENDIF.