Application Development and Automation 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: 
Read only

cs72 user exit

Former Member
0 Likes
504

Hello Friends.

AS per my requirement in tcode cs72 ' No duplicate material should be entered in BOM'.

System shoud give error message ,when duplicate material number is entered.

I want to write logic (coding) in user exit pcsd0005.

But i cannot understand what coding should be written.

Can any one tell me the coding.

please.

Hello Friends.

AS per my requirement in tcode cs72 ' No duplicate material should be entered in BOM'.

System shoud give error message ,when duplicate material number is entered.

I want to write logic (coding) in user exit pcsd0005.

But i cannot understand what coding should be written.

Can any one tell me the coding.

please.

1 REPLY 1
Read only

Former Member
0 Likes
425

hi,

from your requirement i understood that, no two material(material no.) should be same.

so check whether the material entered are getting populated in the table 'MAT_BOM_ALLOCATION'. if populating, sort them by matnr and then loop the table and check whether user entered 2 same matnr and give ur error message.

ie.,

sort mat_bom_allocation.
loop at mat_bom_allocation.
  if sy-tabix = 1.
    wa = mat_bom_allocation.
  else.
    wa1 = mat_bom_allocation.
    if wa1 = wa.
      message e000(z1) with ' no duplicate materials allowed'.
      exit.
    else.
      wa1 = wa.
    endif.
  endif.
endloop.

where wa and wa1 are work areas of mat_bom_allocation.

hope this helps you.

Regards,

Sakthi Sri.