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: 

Badi or User exit to modify MSEG data during Goods issue

Former Member
0 Kudos

Hello,

I have a requirement to modify the field plant MSEG-WERKS while doing goods issue of outbound delivery via transactiona VL02N.

Can anybody suggest me which BADI or user exit should i use.I have searched the SDN and all the previous threads on this haven't yeild any solution for this.

I have tried with below listed Badis and enhancements which wont work.

Badi

===================

MB_DOCUMENT_BADI

MB_MIGO_BADI

LE_SHP_GOODSMOVEMENT

DELIVERY_PUBLISH

Enhancements

===============

MB_CF001

MBCF0005

Thanks and Regards,

Koustubh

6 REPLIES 6

Former Member
0 Kudos

Hi kausthab,

Try this. But put sy-tcode condition b4 the code.

Write below code in exit: EXIT_SAPMM07M_001

FIELD-SYMBOLS: <WERKS> TYPE any,

<WORKS> TYPE any.

ASSIGN '(SAPMM07M)MSEG-WERKS' TO <WERKS>.

assign (<WERKS>) to <WERKS1>.

<WERKS1> = 'ur plant'.

--

Reddy

Former Member
0 Kudos

Hi,

You can use badi "LE_SHP_GOODSMOVEMENT". Use method "CHANGE_INPUT_HEADER_AND_ITEMS" in this Badi.

You can modify the structure field CT_XIMSEG-WERKS to update Site in MSEG.

Regards

Vinod

0 Kudos

Hi,

I am facing a similar issue of updating the MSEG-DMBTR field when Post Goods reciept is done in VL02n.

I hav tried to update the value in LE_SHP_GOODSMOVEMENT BADI and tried to modify the structure .

eg in this way

method IF_EX_LE_SHP_GOODSMOVEMENT~CHANGE_INPUT_HEADER_AND_ITEMS.

data: wa1 type LINE OF shp_imsegvb_t. "IMSEGVB.

DATA: flag TYPE c.

LOOP at CT_XIMSEG INTO wa1.

wa1-dmbtr = '12345'.

MODIFY CT_XIMSEG FROM wa1.

" TRANSPORTING dmbtr.

flag = 'x'.

ENDLOOP.

endif.

endmethod.

The value gets updated in the structure but when the material document gets created then the table MSEG has the amount DMBTR field not changed.

Also, I tried doing the updation in the Function eXit : EXIT_SAPMM07M_001 by the method mentioned in different threads:

betweeb statemnet if sy-tcode = 'VL02n'

FIELD-SYMBOLS: <DMBTR> TYPE any,

<DMBTR1> TYPE any.

ASSIGN '(SAPMM07M)MSEG-DMBTR' TO <DMBTR>.

assign (<DMBTR>) to <DMBTR1>.

......

But still on save of the material document in MSEG I cannot find the new DMBTR field value.

Kindly help me on this, urgently required. I have already gone through the number of threads in the forum, but no solution.

0 Kudos

Hello,

Did you find out how to change MSEG-DMBTR ? I have the same issue.

Thanks,

Tania

0 Kudos

Hi.,

      I am also trying to update MSEG-DMBTR while doing PGI.. if you have any idea on this, can you pls share with us.,

-Mahendran

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Be careful always during the PGI. Read these notes:

Note 415716 - User exits in delivery processing

Note 1284654 - Caution with implementations of the BAdI: MB_DOCUMENT_BADI

Note 92550 - Stock inconsistency due to customer enhancement (exit, BAdI)

I suggest to read the first note to find the proper userexit. MB_MIGO_BADI only works with tcode MIGO.

Think also what kind of impact it will have on ATP, transfer of needs and so on.

I hope this helps you

Regards

Eduardo