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

bapi for miro

Former Member
0 Likes
424

hi friends,

I want to know the BAPI name for posting the invoice using MIRO.

Please help me out

Thanks & Regards

Nigesh

1 ACCEPTED SOLUTION
Read only

kostas_tsioubris
Contributor
0 Likes
359

Hi,

you can use the bapi 'BAPI_INCOMINGINVOICE_CREATE'.

Kostas

2 REPLIES 2
Read only

kostas_tsioubris
Contributor
0 Likes
360

Hi,

you can use the bapi 'BAPI_INCOMINGINVOICE_CREATE'.

Kostas

Read only

0 Likes
359

Hi,

Check the code below:

----


  • Build Invoice header *

----


  • Indicator

gs_headerdata-invoice_ind = gc_x.

  • Document Date

gs_headerdata-doc_date = gv_date1.

  • Posting Date

gs_headerdata-pstng_date = gv_date1.

  • Reference Document No

gs_headerdata-ref_doc_no = gs_itab5-docid.

  • Currency

gs_headerdata-currency = text-035.

  • Inorder to fetch the data from ALOGIS

PERFORM fetch_alogis_data.

  • Reading the data

READ TABLE gt_tax INTO gs_tax WITH KEY augru = gs_itab5-augru.

  • Document type

IF sy-subrc EQ gc_zero_num.

gs_headerdata-doc_type = gv_blart.

gs_headerdata-comp_code = gv_bukrs.

gs_itemdata-tax_code = gv_mwskz.

ENDIF.

  • Baseline Date

  • gs_headerdata-bline_date = gv_date1 .

*Tax Indicator

  • gs_headerdata-calc_tax_ind = gc_x.

LOOP AT gt_itab4 INTO gs_itab4. "#EC CI_NESTED

----


  • Build order item(s) *

----


  • Document Item

gs_itemdata-invoice_doc_item = gc_item.

  • Purchase Order Number

gs_itemdata-po_number = gs_itab4-vbeln.

  • Purchase Order Item

gs_itemdata-po_item = gs_itab4-posnn.

READ TABLE lt_itab5 INTO ls_itab5 WITH KEY ebeln = gs_itab4-vbeln BINARY SEARCH.

IF sy-subrc EQ gc_zero_num.

  • Quantity

gs_itemdata-quantity = ls_itab5-menge.

ENDIF.

gs_itemdata-po_unit = text-034.

  • Item Amount

lv_price = ls_itab5-menge * ls_itab5-netpr.

gs_itemdata-item_amount = lv_price.

gs_itemdata-taxjurcode = gc_jcode.

APPEND gs_itemdata TO gt_itemdata.

  • Gross Amount.

lv_gross = lv_price.

gs_headerdata-gross_amount = lv_gross.

*Call the BAPI to Create the Return Order

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'

EXPORTING

headerdata = gs_headerdata

IMPORTING

invoicedocnumber = gv_invoice

fiscalyear = gv_year

TABLES

return = gt_return

itemdata = gt_itemdata.

  • Commit Work

PERFORM error.

Regards

Kannaiah