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 is not working

former_member1284402
Participant
0 Kudos

hi all,

i made an Implementation for BADI 'BADI_GTIN_VARIANT' for tcode MM01 for making default value '03' in view 'sales organization1' during material creation, but problem is that value is coming during debug but it is not showing on screen, so can anyone please help me?

i m writing code :

if sy-tcode = 'MM01'.

mara-mstav = '03'.

endif.

regards saurabh.

Edited by: saurabh srivastava on May 5, 2009 9:23 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hello ,

the problem is that ur changing the import parameter and that is the problem

MARA is the import paramter u can just use it u cannot modify it i,e u cannot change it

and the code u use is

if sy-tcode = 'MM01'.

mara-mstav = '03'.

in debug u can change it bu tas it is import parameter the method cannto change it so it is not reflected even though u have implemented it , so try some other alternate way

hope it solves ur problem

afzal

4 REPLIES 4

Former Member
0 Kudos

hello ,

the problem is that ur changing the import parameter and that is the problem

MARA is the import paramter u can just use it u cannot modify it i,e u cannot change it

and the code u use is

if sy-tcode = 'MM01'.

mara-mstav = '03'.

in debug u can change it bu tas it is import parameter the method cannto change it so it is not reflected even though u have implemented it , so try some other alternate way

hope it solves ur problem

afzal

0 Kudos

hi thanx for reply,

so can u tell me that which export parameter shud i paas? can u plzz modify my code?

regards saurabh.

0 Kudos

hai saurabh,

the badi is for User Exit for Customer-Specific GTIN Variant Check

u can check only the GTIN Variant check thrugh it and u can modify it as it is changing paramter

and the fields of MARA u cant change u have to either search other user exit or badi for doign the same

u can use field exit for the same if it exists else create a field exit for the same

u can search for field exits and u get lot of help on sdn

regards

afzal

0 Kudos

HI,

Why dont u try witha different Bapi. Implement the Bapi BADI_MATERIAL_REF.

METHOD IF_EX_MATERIAL_REFERENCE~CREATE_MATERIAL.

IF SY-TCODE = 'MM01'.

E_MARAU-MSTAV = '03'.

ENDIF.

ENDMETHOD.

Also add the field E_MARAU-MSTDV value if its mandatory.