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 for MM01/MM02

Former Member
0 Kudos

Dear all,

Before posting this discussion, I have gone through all the posts of SCN, but still my hunt is continue.

I want to create an Idoc for every material as soon as the SAVE button is pressed in MM01/MM02.

I will be requiring following details of a material:

1. MATNR (Material Number)

2. WERKS(Plant)

3. MAKTX(Material Description)

4. MATKL (Material Group)

5. MEINS (UOM)

6. PRDHA/PRODH (Material/Product Heirarchy)

7. ATTYP ( Material Category)

8. MTART ( Material Type).

So kindly help me finding the BADI or EXIt to get all this data after saving the MM01/MM02 as using this data I have to generate I doc.

Or can you give me any BADI or EXIT for generating Idoc directly after saving MM01/MM02.

With Regards,

Akshay

11 REPLIES 11

Former Member
0 Kudos

You can use MGA00001 exit.

FM : EXIT_SAPLMGMU_001

Thanks,

Shambu

0 Kudos

Dear Shambu,

I have checked the above EXIT but I unable to get all the above parameters from it.

With Regards,

Akshay

0 Kudos

If the data is saved in database, you could do a select and get the extra fields.

Thanks,

Shambu

raymond_giuseppi
Active Contributor
0 Kudos

You could try BTE (Documentation and sample FM via BERE or FINF, Implementation via FIBF)

- Event 00001250 (Master data material, data transfer).

- Event 00001270 (Material)

Regards,

Raymond   

0 Kudos

Dear  Raymond Giuseppi ,

- Event 00001250 (Master data material, data transfer). is having data but it is for MM02, I want BTE for MM01, can you help me little bit more...

With Regards,

Akshay

0 Kudos

Are you sure , put a break-point at start of FM OPEN_FI_PERFORM_00001250_E (driver for this BTE) and create a material via MM01 transaction.

Regards,

Raymond

Marcel_Wahl
Advisor
Advisor
0 Kudos

Hi Akshay,

you can do thefollowing thing. Before pusihng the save button enable debugging (/h)

and set breakpoints for the following :

- statement "get badi"

- statement "call badi"

- method "cl_exithandler" "get_instance"

- statement"call customer-function"

It will stop for most existing functions.

Else.

The standard strategy, which is used in CRM and business partner is, to register a form routine on commit. "perfom my_callback on commit."

So will be informded if the save process is successfully commited.

But you require a spot to place the "perform" statement and the currently saved material number

Regards

0 Kudos

The event  00001250 should get triggered for MM01/MM02 as the documentation for the sample interface SAMPLE_INTERFACE_00001250 itself is saying that "The event will run when creating and changing a material after writing the material master data.". So try putting a breakpoint in the FM(by copying it from the SAMPLE_INTERFACE_00001250) and see whether it is getting triggered in MM01/MM02.

Regards,

Bygine Benziger

0 Kudos

Hi

event  00001250 fun before the commit. Do you know where I can write code after commit ?

thanks!

0 Kudos

In the FM associated to BTE 00001250 you could use a CALL z_fm IN BACKGROUND TASK so this customer FM will be executed after a commit-work and update tasks end.

(I hope, Former Member has solved his problem now.)

Regards,

Raymond

0 Kudos

Work!! .

Thanks Raymond 😃