<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem while saving PR in ME51N in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024157#M1609173</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dez,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, but i still have some question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the BADI, how can I restrict the user not to choose the asset number (ANLN1) that have already exist in the system when they create new PR (account assignment: A)?&lt;/P&gt;&lt;P&gt;Users must create new asset instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not familiar with Badi, and I really appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Aug 2011 06:20:33 GMT</pubDate>
    <dc:creator>former_member209770</dc:creator>
    <dc:date>2011-08-09T06:20:33Z</dc:date>
    <item>
      <title>Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024152#M1609168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dear Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm coding in userexit "EXIT_SAPLMEREQ_010"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i &lt;STRONG&gt;try to save the ME51N transaction all the fields gets disabled or greyed out and there is an error message that i write it.&lt;/STRONG&gt; BUT I want that the fields should be enabled so that he can make the corrections. &lt;/P&gt;&lt;P&gt;I found that when we click the save button the user exit is activated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance, and i really appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 03:28:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024152#M1609168</guid>
      <dc:creator>former_member209770</dc:creator>
      <dc:date>2011-08-09T03:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024153#M1609169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did not understand the requirement. Explain more.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;When i try to save the ME51N transaction all the fields gets disabled or greyed out and there is an error message that i write it.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 03:56:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024153#M1609169</guid>
      <dc:creator>madhu_vadlamani</dc:creator>
      <dc:date>2011-08-09T03:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024154#M1609170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Madhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Userexit I use: EXIT_SAPLMEREQ_010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first half of my code, I write some code to select the information I want to check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in the screen of ME51N, if it is wrong data, it will appear an error msg that i write.(as following code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;MESSAGE E999(CK) WITH 'TEST MESSAGE'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but after that, i can't change the fields directly in PR anymore, the fields gets disabled or greyed out.&lt;/P&gt;&lt;P&gt;I have to re-enter the order instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you understand what I mean?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ya-Chun Liou on Aug 9, 2011 7:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 05:36:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024154#M1609170</guid>
      <dc:creator>former_member209770</dc:creator>
      <dc:date>2011-08-09T05:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024155#M1609171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;why you are using user exit when there is BADI ME_PROCESS_REQ_CUST which works perfectly (your code will be assembled in one place  )? &lt;/P&gt;&lt;P&gt;Implement that BADI and add your code into CHECK method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

INCLUDE mm_messages_mac.

 IF sy-subrc = 0.
      mmpur_message 'E' 'CK' '999' 'TEST MESSAGE' '' '' ''.
      ch_failed = mmpur_yes.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dez_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 05:44:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024155#M1609171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-09T05:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024156#M1609172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liou,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry little late reply. I did this a long back. Check this link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Post if need help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: madhurao123 on Aug 9, 2011 2:40 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 05:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024156#M1609172</guid>
      <dc:creator>madhu_vadlamani</dc:creator>
      <dc:date>2011-08-09T05:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024157#M1609173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dez,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, but i still have some question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the BADI, how can I restrict the user not to choose the asset number (ANLN1) that have already exist in the system when they create new PR (account assignment: A)?&lt;/P&gt;&lt;P&gt;Users must create new asset instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not familiar with Badi, and I really appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 06:20:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024157#M1609173</guid>
      <dc:creator>former_member209770</dc:creator>
      <dc:date>2011-08-09T06:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024158#M1609174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read this article about BADI:&lt;/P&gt;&lt;P&gt;[http://wiki.sdn.sap.com/wiki/display/ABAP/Concepts&lt;EM&gt;and&lt;/EM&gt;Working&lt;EM&gt;with&lt;/EM&gt;BADI]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you could use the same check method for asset number validation. Just use asset number which is entered into anla1 field and write a simple select from anla table if select returns 4 &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;(sy-subrc eq 4)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; then asset does not exist if zero - it exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INCLUDE mm_messages_mac.

  DATA: t_items TYPE mmpur_requisition_items.
  DATA: wa_item TYPE mmpur_requisition_item.
  DATA: ls_mereqitem TYPE mereq_item.

  CALL METHOD im_header-&amp;gt;get_items
    RECEIVING
      re_items = t_items.

  LOOP AT t_items INTO wa_item.

    CLEAR ls_mereqitem.

    CALL METHOD wa_item-item-&amp;gt;get_data
      RECEIVING
        re_data = ls_mereqitem.

    "here should be your select

    IF sy-subrc = 0.
      mmpur_message 'E' 'ME' 'Message' '' '' ''.
      ch_failed = mmpur_yes.
    ENDIF.

  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br, &lt;/P&gt;&lt;P&gt;dez_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 06:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024158#M1609174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-09T06:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024159#M1609175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Dez,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand why select return number have to equal 4 ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 09:03:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024159#M1609175</guid>
      <dc:creator>former_member209770</dc:creator>
      <dc:date>2011-08-09T09:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024160#M1609176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if select returns 4 - such entry does not exits or you could write &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;sy-subrc ne 0&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;br,&lt;/P&gt;&lt;P&gt;dez_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 09:17:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024160#M1609176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-08-09T09:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024161#M1609177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I select ANLN1 from the table ANLA to compare the data with ls_mereqitem.&lt;/P&gt;&lt;P&gt;But when I execute ME51N, it still doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
INCLUDE mm_messages_mac.

  DATA: t_items TYPE mmpur_requisition_items.
  DATA: wa_item TYPE mmpur_requisition_item.
  DATA: ls_mereqitem TYPE mereq_item.
  DATA: IT_ANLA TYPE ANLA.

  CALL METHOD im_header-&amp;gt;get_items
    RECEIVING
      re_items = t_items.

  LOOP AT t_items INTO wa_item.

    CLEAR ls_mereqitem.

    CALL METHOD wa_item-item-&amp;gt;get_data
      RECEIVING
        re_data = ls_mereqitem.

  SELECT ANLN1 FROM ANLA INTO IT_ANLA.
CHECK IT_ANLA-ANLN1 = ls_mereqitem.  "IF THE USER SELECT EXISTED ASSET NUMBER
  ENDSELECT.

    IF sy-subrc = 0.
      mmpur_message 'E' 'ck' '999' 'Message' '' '' ''.
      ch_failed = mmpur_yes.
    ENDIF.

  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 09:41:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024161#M1609177</guid>
      <dc:creator>former_member209770</dc:creator>
      <dc:date>2011-08-09T09:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024162#M1609178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liou,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you tell me what is happening here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ANLN1 FROM ANLA INTO IT_ANLA.&lt;/P&gt;&lt;P&gt;CHECK IT_ANLA-ANLN1 = ls_mereqitem.  "IF THE USER SELECT EXISTED ASSET NUMBER&lt;/P&gt;&lt;P&gt;  ENDSELECT.&lt;/P&gt;&lt;P&gt; &lt;EM&gt;mereq_item this is item record. IT_ANLA-ANLN1 this is a field&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: madhurao123 on Aug 9, 2011 3:15 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 09:45:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024162#M1609178</guid>
      <dc:creator>madhu_vadlamani</dc:creator>
      <dc:date>2011-08-09T09:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024163#M1609179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Madhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am so sorry about my poor programming skill...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have changed my code as following...&lt;/P&gt;&lt;P&gt;but i have no idea how to set the account assignment must = 'A'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
INCLUDE MM_MESSAGES_MAC.

DATA LTO_ITEMS TYPE MMPUR_REQUISITION_ITEMS.
DATA L_ITEM TYPE MMPUR_REQUISITION_ITEM.

DATA LTO_ITEMS_ACCOUNTING_LIST TYPE MMPUR_ACCOUNTING_LIST.
DATA L_ACC_ITEM TYPE MMPUR_ACCOUNTING_TYPE.

DATA LRE_EXKN TYPE EXKN.

LTO_ITEMS = IM_HEADER-&amp;gt;GET_ITEMS( ).   " Get PR items

LOOP AT LTO_ITEMS INTO L_ITEM.   " Loop at each item

  CLEAR: LTO_ITEMS_ACCOUNTING_LIST, L_ACC_ITEM, LRE_EXKN.

  LTO_ITEMS_ACCOUNTING_LIST = L_ITEM-ITEM-&amp;gt;IF_ACCT_CONTAINER_MM~GET_ITEMS( ).

  READ TABLE LTO_ITEMS_ACCOUNTING_LIST INTO L_ACC_ITEM INDEX 1.

  IF SY-SUBRC = 0.

    LRE_EXKN = L_ACC_ITEM-MODEL-&amp;gt;GET_EXKN( ).   " Get the EXKN structure.

    IF LRE_EXKN-ANLN1+0(6) NE 'INTERN'.   " Filter the new entry

      MMPUR_MESSAGE 'E' 'CK' '999' 'u8ACBu5EFAu7ACBu4E00u7D44u65B0u7684u8CC7u7522...u4E0Du5F97u9078u53D6u5DF2u5B58u5728u7684u8CC7u7522u865Fu78BC' '' '' ''.
      CH_FAILED = MMPUR_YES.
      CLEAR LRE_EXKN-ANLN1.

    ENDIF.

  ENDIF.

ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody tell me what can I do?&lt;/P&gt;&lt;P&gt;I really appreciate that!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 06:36:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024163#M1609179</guid>
      <dc:creator>former_member209770</dc:creator>
      <dc:date>2011-08-12T06:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while saving PR in ME51N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024164#M1609180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have solved my problem.&lt;/P&gt;&lt;P&gt;Thanks for any help~&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 08:17:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-while-saving-pr-in-me51n/m-p/8024164#M1609180</guid>
      <dc:creator>former_member209770</dc:creator>
      <dc:date>2011-08-12T08:17:35Z</dc:date>
    </item>
  </channel>
</rss>

