cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_INCOMINGINVOICE_CREATE extension

0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

former_member182371
Active Contributor
0 Kudos

Hi,

OP said: "I have added a custom field in MIRO line item"

would your answer (Header) be valid too for line item?.

Best regards,

Pablo

Former Member
0 Kudos

Yes you can. My point is extension not working in that BAPI if you will not do enhancement. Try to debug bapi and check where is passing the data to RSEG then it will solve your issue.

former_member154322
Discoverer
0 Kudos

Hi Guys,

I want to add PERNR field at accounting data level in BAPI_INCOMINGINVOICE_CREATE.

Can someone help me