Application Development 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: 

Adding A custom field in MSEG

Former Member
0 Kudos

Hi,

I am appending a custom field in MSEG 'MRP'

I want to update this field throgh upload by using BAPI BAPI_GOODSMVT_CREATE

but its not working

I search throgh SDN but could not find the solution but could not find

So i am posting this question again here

Please help me.

Thanks

Veda

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Veda ,

                  You need to fill the extensionin parameters of BAPI , bcz the standard BAPI structure will not include you custom field which you appended . Look more for  Enhancing a BAPI in SCN ... Hope this helps .

below is the sample code , how to do that

DATA ls_extensionin TYPE bapiparex.

DATA lt_extensionin TYPE TABLE OF bapiparex.

DATA ls_extensioninx TYPE bapiparex.

DATA lt_extensioninx TYPE TABLE OF bapiparex.

DATA ls_bapi_te_mara TYPE bapi_te_mara.

DATA ls_bapi_te_marax TYPE bapi_te_marax.

ls_extensionin-structure = 'BAPI_TE_MARA'.

ls_bapi_te_mara-material = lv_matnr.

ls_bapi_te_mara-zzfld01  = lv_zzfld01.

ls_bapi_te_mara-zzfld02  = lv_zzfld02.

PERFORM transfer_to_extensionin USING ls_bapi_te_mara CHANGING ls_extensionin.

APPEND ls_extensionin TO lt_extensionin.

ls_extensioninx-structure = 'BAPI_TE_MARAX'.

ls_bapi_te_marax-material = lv_matnr.

ls_bapi_te_marax-zzfld01  = 'X'.

ls_bapi_te_marax-zzfld02  = 'X'.

PERFORM transfer_to_extensionin USING ls_bapi_te_marax CHANGING lt_extensioninx.

APPEND ls_extensioninx TO lt_extensioninx.

Regards ,

Shiv

6 REPLIES 6

Former Member
0 Kudos

Hi Veda ,

                  You need to fill the extensionin parameters of BAPI , bcz the standard BAPI structure will not include you custom field which you appended . Look more for  Enhancing a BAPI in SCN ... Hope this helps .

below is the sample code , how to do that

DATA ls_extensionin TYPE bapiparex.

DATA lt_extensionin TYPE TABLE OF bapiparex.

DATA ls_extensioninx TYPE bapiparex.

DATA lt_extensioninx TYPE TABLE OF bapiparex.

DATA ls_bapi_te_mara TYPE bapi_te_mara.

DATA ls_bapi_te_marax TYPE bapi_te_marax.

ls_extensionin-structure = 'BAPI_TE_MARA'.

ls_bapi_te_mara-material = lv_matnr.

ls_bapi_te_mara-zzfld01  = lv_zzfld01.

ls_bapi_te_mara-zzfld02  = lv_zzfld02.

PERFORM transfer_to_extensionin USING ls_bapi_te_mara CHANGING ls_extensionin.

APPEND ls_extensionin TO lt_extensionin.

ls_extensioninx-structure = 'BAPI_TE_MARAX'.

ls_bapi_te_marax-material = lv_matnr.

ls_bapi_te_marax-zzfld01  = 'X'.

ls_bapi_te_marax-zzfld02  = 'X'.

PERFORM transfer_to_extensionin USING ls_bapi_te_marax CHANGING lt_extensioninx.

APPEND ls_extensioninx TO lt_extensioninx.

Regards ,

Shiv

former_member184569
Active Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Sushmita And Shiva Kumar,

I have extended Bapi using Bapiparex and appended the same fiels in mseg, bapi_xmseg and imseg tables.

But the problem is MRP field is not saved in MSEG table .

I want to save it in MSEG table.

Please guide me how to do this?

Thanks

Veda

Former Member
0 Kudos

Hi,

I solved the issue by myself.

Thank you for your suggestions.

Thanks Veda

0 Kudos

Happy to hear that Nice .

0 Kudos

Hi,

I am facing the same issue. I just don;t understand why the field cannot get update into MSEG.

I already put in the structure as "BAPI_TE_XMSEG" for extensionin.

Don;t understand this statement "move-corresponding wa_bapi_mb_item to <fs_imseg>.".

the field "wa_bapi_mb_item" does not contain the custom field.

Please assist.