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_INCOMINGINVOICE_CREATE: Edit own conditions

Former Member
0 Likes
2,216

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

2 REPLIES 2
Read only

former_member182371
Active Contributor
0 Likes
1,255

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

Read only

Former Member
0 Likes
1,255

Hi Michael,

I am facing the same scenario,Could you please tell me how you resolved this ..?

Thanks

Vivek