Skip to Content
author's profile photo Former Member
Former Member

P.O validation

Hi,

i have made user exit program. program logic is as follows.

we maintain a 'z' table with material code & WBS element and when ever we create a p.o with account assingment 'q'. it needs to check the 'z' table whether the material code along with wbs are maintained. for example : if material code Agg1002 & WBS element cbb.009.1 are mainteined in th table it should allow the P.O to post. But if i give a material code whcih is not maintained in table for example Agg1001 for that WBS i should get the error message as material code not maintained in the table. and once adding the material code in the 'z' table only it should allow.

Here i used a exit pgm MM06E005 and function exit EXIT_SAPMM06E_017. But i am not able to get the correct result. And the problem i am facing is whenver i give a wrong material first i am getting the error msg as "material not maintained in table" which is correct, but when i replace that material with a correct material also i am getting the same error as material not mainatined. this also happening vise-versa that is when i give a correct material code and i am getting the correct msg. but when i replace that with wrong materila code i still getting that material maintained in table.

Pls help me with this issue. If there is any other user exit programs available pls let me know. or if there is any other alternate solution pls let me know.

Thanks

Dinesh

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 06, 2009 at 12:33 PM

    The userexits you have mentioned look right. Its most likely a programming bug as its looking at the table but posting the result. Get an ABAPer to look at this im sure they will solve this.

    Regards

    Adeel

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks for your support, As i am new to ABAP i need your help. So could be pls check the below coding which i used for the user exit pgm.

      Thanks awaiting for your reply

      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.

      clear : fin,fin1.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.