‎2010 Sep 07 8:57 AM
Hi Gurus,
My requirement is to save material master data in additional Z tables when material is created or modified. I am trying to find proper BADI or Userexit but I cannot find any. Iu2019ve tried with BADI_MATERIAL_REF and BADI_MATERIAL_CHECK and BADI_MATERIAL_OD and EXIT_SAPLMGMU_001 but they all seem to be designed for other purposes. Do you know if there is any reasonable solution that could be used ?
Regards
Pawel
‎2010 Sep 07 3:42 PM
Hi Pawel,
EXIT_SAPLMGMU_001 I hope this will work.
I am using the same to update the values in the Ztable.
Please find my sample code:
IF wstat-aktyp = lc_h.
SELECT COUNT(*)
FROM zmarc_entry
WHERE werks = wmarc-werks AND
matnr = wmara-matnr.
* If entry already exists, don't add it to the table
CHECK sy-dbcnt LE 0.
MOVE : wmarc-werks TO lwa_marc_entry-werks,
wmara-matnr TO lwa_marc_entry-matnr,
sy-datum TO lwa_marc_entry-erdat.
* Store data in Table
INSERT zmarc_entry FROM lwa_marc_entry.
ENDIF.
ENDIF.
I hope this may helpfull.
Thank you,
Thanks,
AMS
‎2010 Sep 07 3:42 PM
Hi Pawel,
EXIT_SAPLMGMU_001 I hope this will work.
I am using the same to update the values in the Ztable.
Please find my sample code:
IF wstat-aktyp = lc_h.
SELECT COUNT(*)
FROM zmarc_entry
WHERE werks = wmarc-werks AND
matnr = wmara-matnr.
* If entry already exists, don't add it to the table
CHECK sy-dbcnt LE 0.
MOVE : wmarc-werks TO lwa_marc_entry-werks,
wmara-matnr TO lwa_marc_entry-matnr,
sy-datum TO lwa_marc_entry-erdat.
* Store data in Table
INSERT zmarc_entry FROM lwa_marc_entry.
ENDIF.
ENDIF.
I hope this may helpfull.
Thank you,
Thanks,
AMS
‎2010 Sep 08 7:27 AM
Hi Pawel,
Can I expect the problem is solved.If solved please make this post as closed.
If you got any other solution please post it before closing it may helpfull to others.
Thank you,
Thanks,
AMS
‎2010 Sep 08 7:28 AM
hello,
yes it was helpful, thank a lot. i have one more question related to this code. do you know or maybe anyone else knows what are possible values of wstat-aktyp ?
regards
pawel
‎2010 Sep 08 12:29 PM
AKTYP = 'V'. " Only Change
AKTYP = 'H'. " Only Creation mode.
01 Create
02 Change
03 Display
04 Modify (Direct Input: Create/Change)
06 Delete
11 Create defaults
12 Change defaults
13 Display defaults
Based on the table AKTYP changes.
I hope this may helpfull.
Thank you.
Thanks,
AMS