cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Material validation

Former Member
0 Likes
800

Hi,

I have written a user exit prgram for material validation. I.e we maniatin a seprate "z" table, where the 'z' table contains filed like material code, wbs element & material price. when i create a P.O then it should check whether that material exit in table. if that material exits then P.O should be saved or else it should display a message that material not mainatined in table.

Our Scenerio as follows

"z" is will be like

WBS element MAterial Price

cbb.009 ABC 11

cbb.009 DEF 12

Now if i create a P.O with material ABC And WBS element cbb.009 P.O should be saved. And when i create a P.O with WBS cbb.009 with material GHI (which is not in table for WBS cbb.009) an error msg a 'material not mainatined' should come.

For this i have used a user exit MM06E005 and Function exit EXIT_SAPMM06E_017.

And now the issue is when i create a P.O with material whcih exist in the table it is allowing me to Save the P.O. And when i delete the material code and enter a material code which is not in the 'z' table it's not displaying the error msg but when i change any other field than material code its showing the error message. When i set the break point in pgm and check the material field is not getting changed when i change the material in P.O but when i chnage either Qty,plant or price it getting updated.

But for me when i change the material code itself it should be changed in the material code field.

EVEN I TREID WITH CLEAR,REFERESH COMMANDS. BUT STILL ITS NOT SOLVEING MY PROBLEM

And Regarding this issue i have posted many threads in SDN but i have not got any correct solution.

Pls guide me to this issue and help

Thanks

Regards

Dinesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

thanks

Former Member
0 Likes

Here u can try 2 ways..

a) Try to clear the parameter ID of the material field

ie: in the transaction ie: in the screen click F1 and check the screen field and for that screen field it will have a data element in that data element u will have a parameter ID.. So try refresh that parameter ID before the screen is displayed....

b) check in debugiing form which structure field it is assinging the values to the materail screen field...

try to clear that only for your condition.

Regards

Kumar

Former Member
0 Likes

Hi,

Thanks for your support.

I have found the field name : EMATN, Data element: EMATNR, Parameter id : MAT, Screen filed MEP01211-Ematn. May i know how to clear the parameter id. And also in whcih table is parameter id stored.

Regards

Dinesh

Former Member
0 Likes

Hi,

Thanks for your support.

I have found the field name : EMATN, Data element: EMATNR, Parameter id : MAT, Screen filed MEP01211-Ematn. May i know how to clear the parameter id. And also in whcih table is parameter id stored.

Below is my coding, so pls explain where and how to referesh parameter id.

data : fin like line of TEKKN.

data : fin1 like line of TEKPO.

DATA : lv_matnr like ekpo-matnr.

data : lv_matnr1 like ztendprice-matnr.

data : lv_proj like prps-psphi.

Data : lv_pspid like ekkn-ps_psp_pnr.

Data : lv_pspid3 like prps-psphi.

loop at tekkn into fin.

endloop.

loop at TEKPO into fin1.

endloop.

lv_matnr = fin1-matnr.

lv_pspid = fin-ps_psp_pnr.

Select single psphi from prps into lv_pspid3 where pspnr = lv_pspid.

select single pspnr from ZTENDPRICE into lv_proj where pspnr = lv_pspid3.

if lv_pspid3 is initial.

MESSAGE 'project dose not exist in table' TYPE 'E'.

endif.

select single matnr from ZTENDPRICE into lv_matnr1 where matnr = lv_matnr and pspnr = lv_PROJ.

if lv_matnr1 is initial.

MESSAGE 'Material dose not exist in table' TYPE 'E'.

endif.

refresh :tekpo,tekkn.

Regards

Dinesh