‎2009 Sep 23 9:42 AM
Transaction MIRO(enter incoming invoice) lets you enter conditions for each line of the invoice. Each line has a "Edit Own Conditions" button which when pressed, branches to a conditions entry screen.
The corrensponding BAPI does not seem to support this functionality. There are no table parameters on this BAPI to specify conditions for each line. Has anyone found a way around this one?
Mind you, MIRO is an "enjoy" transaction, so CALL TRANSACTIONS and BDCs are out.
Edited by: Michael Dirndorfer on Sep 23, 2009 3:44 PM
‎2009 Sep 23 4:10 PM
Hi,
within the bapi BAPI_INCOMINGINVOICE_CREATE
in
PERFORM frseg_fill TABLES itemdata
accountingdata
USING s_rbkpv-waers
CHANGING tab_frseg[]
return[]
f_subrc.
there is:
*----- planned delivery costs, set flag XEKBZ or XEKBE ---------------*
IF ( s_itemdata-cond_type IS INITIAL
AND s_itemdata-cond_st_no IS INITIAL
AND s_itemdata-cond_count IS INITIAL ).
s_frseg-xekbe = c_x.
ELSE.
s_frseg-xekbz = c_x.
s_frseg-kschl = s_itemdata-cond_type.
s_frseg-stunr = s_itemdata-cond_st_no.
s_frseg-zaehk = s_itemdata-cond_count.
CALL FUNCTION 'ME_READ_COND_INVOICE'
EXPORTING
i_ebeln = s_frseg-ebeln
i_ebelp = s_frseg-ebelp
i_lifnr = f_lifnr_initial
TABLES
xek08bn_curr = t_ek08bn_temp
EXCEPTIONS
error_message = 02.
IF sy-subrc NE 0.
Here the conditions seem to be filled.
so maybe you´ll just have to fill in fields
COND_TYPE
COND_ST_NO
COND_COUNT
of table ITEMDATA.
The documentation of ITEMDATA says the following:
Posting purchase order items or planned delivery costs
1. If the fields Condition type (COND_TYPE), Level number (COND_ST_NO) and Conditions counter (COND_COUNT) are blank, the system creates an invoice for a purchase order item.
2. If the fields Level number (field COND_ST_NO) and Conditions counter (field COND_COUNT) or Condition type (field COND_TYPE) are filled, the system creates an invoice for a purchase order item with planned delivery costs.
If you do not enter any data in the following fields, the system determines the data according to the priorities specified. If the system cannot determine any data, it returns appropriate return messages from the method call. These are listed in the return parameter.
Best regards.
Edited by: Pablo Casamayor on Sep 23, 2009 5:15 PM
‎2013 Jul 25 2:40 PM
Hi Michael,
I am facing the same scenario,Could you please tell me how you resolved this ..?
Thanks
Vivek