Skip to Content
avatar image
Former Member

BAPI_INCOMINGINVOICE_CREATE extension

I have added a custom field in MIRO line item I want it to be get posted thru bapi

BAPI_INCOMINGINVOICE_CREATE

can somebody help me bapi extension process for this particular bapi
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 10, 2017 at 08:23 AM

    i tried this one by using enhancement.

    1. Populate the structure:

    DATA: I_EXTNSN TYPE STANDARD TABLE OF BAPIPAREX,

    wl_ext TYPE bapiparex.


    wl_ext-structure = 'MEPOHEAD'.
    wl_ext-valuepart1 = field1
    wl_ext-valuepart2 = field2
    APPEND wl_ext TO i_extnsn.
    CLEAR wl_ext.

    2. Pass the table to extension parameter

    CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
    EXPORTING
    headerdata = X_IN_HEADER
    IMPORTING
    INVOICEDOCNUMBER = L_DOCNO
    tables
    itemdata = I_IN_ITEM
    TAXDATA = it_taxdata
    WITHTAXDATA = I_WITHTAXDATA
    return = I_RETURN
    extensionin = I_EXTNSN

    3. Do the following enhancement:

    -In include LMRM_BAPIF32 (Form mapping_ivext_park), get the extension from BAPI parameter to your enhancement

    it_extension[] = i_extensionin.

    -In include LMRM_BAPITOP, declare your internal table/work area.

    DATA: it_extension TYPE STANDARD TABLE OF bapiparex,
    wa_ext TYPE bapiparex.

    -In include LMRM_BAPIF12 (Form rbkpv_fill_from_headerdata) pass the new values to RBKP structure.

    READ TABLE it_extension INTO wa_ext WITH KEY structure = 'MEPOHEAD'.
    IF sy-subrc EQ 0.
    MOVE: wa_ext-valuepart1 TO e_rbkpv-zfield1, "Field1
    wa_ext-valuepart2 TO e_rbkpv-zfield2. "Field2
    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded