01-29-2008 6:17 AM
Hi Gurus,
do help me!
In MM01 , WHILE CREATING Material , we had to maintain profit center at plant/data storage2 or at costing 1 manually,
but i want it to get filled automatically as we entered plant through ztable which we are ainting for it.
so how to do it.
i had used field exit but its giving an error .
please do help me.
helpful answer will be rewarded points.
01-29-2008 6:36 AM
hi,
try setting up the value by making use of field symbols for that field in the corresponding user exit.
or make use of any badi available.
I have done a similar case for BOM creation where base quantity has to filled automatically from ztable and it worked very well.
regards
hemanth
01-29-2008 6:54 AM
hi ,
thanks for the reply!
but in mm01 their are only three user exit
MGA00001
MGA00002
MGA00003
but in which user exit i had to do coding is not getting clear or can u tell me the badi name .
01-29-2008 6:58 AM
01-29-2008 7:21 AM
you got to make use of EXIT_SAPLMGMU_001 in MGA0001 exit.
Just try if the required field is available in the changing parameter CMARA of the exit.
Otherwise make use of field symbol and assign the value fetched from the ztable to the field symbol. in that way u could make it appear automatically.
you got to write your code in the include ZXMG0U02
regards
hemanth
01-29-2008 7:34 AM
Sample code to make use of field symbols
One can read as well as modify fields from calling program.
data : name1(30),
v_paprf1 like TWVMO-PAPRF.
field-symbols <paprf1> like TWVMO-PAPRF.
name1 = '(RWVMIPAD)G_DEFPRF'.
Here, in the bracket you have to give name of origianl program which is calling this exit & have a data available in memory.
assign (name1) to <paprf1>.
v_paprf1 = <paprf1>.
reward points if useful...
regards
hemanth
Edited by: hemanth kumar on Jan 29, 2008 8:34 AM
01-29-2008 7:54 AM
hi hemant!
thanks for the reply,
i not able to get yr coding ,
i want to modify field PRCTR (profit centre) which is not present in the structure maru.
so how i will do?
01-29-2008 8:30 AM
Hope you understand this part of code..
it is this code which i implemendted for BOM.
DATA : name1(30).
DATA : name2(30).
DATA: BEGIN OF t_zbom OCCURS 0,
werks LIKE marc-werks,
bmeng LIKE stko-bmeng,
modifiable(1),
END OF t_zbom.
*Variable for Exporting to check copy or create
DATA: check(10) VALUE 'CREATE'.
*Field Symbols for OK code and Base quantity
FIELD-SYMBOLS <ok_code> LIKE t185f-fcode.
FIELD-SYMBOLS <bmeng1> LIKE stkob-bmeng.
name1 = '(SAPLCSDI)STKOB-bmeng'.
name2 = '(SAPLCSDI)okcode'.
*Assigning the structure value to the field symbol
ASSIGN (name1) TO <bmeng1>.
ASSIGN (name2) TO <ok_code>.
*Fetching the data from the ZTable ZBOM_BASEQTY
SELECT SINGLE werks
bmeng
modifiable
FROM zbom_baseqty
INTO t_zbom WHERE
werks = ctrldata-werks.
*Assigning the entry from ztable to standard field BMENG
READ TABLE t_zbom INDEX 1.
<bmeng1> = t_zbom-bmeng.
Regards
Hemanth