<?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 Error Message in User Exit in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329739#M168286</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;I have written an user exit (program 'MV45AFZZ') ( user exit 'FORM USEREXIT_SAVE_DOCUMENT_PREPARE'). Here I want to give an error message (before save the doc) if the user did enter the correct order reason. It is giving error message properly but during the message system is showing all the fields (VA01) in display mood.After displaying the error message when user press enter system should be able to show Order Reason field as input parameter not display parameter. Pls suggest how to handle this situation. Code is given below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------" /&gt;&lt;P&gt;  if xvbak-auart = 'ZFRE'.&lt;/P&gt;&lt;P&gt;    IF XVBAK-VKORG = TVAUK-VKORG AND&lt;/P&gt;&lt;P&gt;       XVBAK-VTWEG = TVAUK-VTWEG AND&lt;/P&gt;&lt;P&gt;       XVBAK-SPART = TVAUK-SPART AND&lt;/P&gt;&lt;P&gt;       XVBAK-AUDAT GT TVAUK-DATAB.&lt;/P&gt;&lt;P&gt;      if xvbak-augru ne tvauk-augru.&lt;/P&gt;&lt;P&gt;        SET CURSOR FIELD 'VBAK-AUGRU'.&lt;/P&gt;&lt;P&gt;        message E000(zsd01) with&lt;/P&gt;&lt;P&gt;          'Please select correct Order Reason'.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      SET CURSOR FIELD 'VBAK-AUGRU'.&lt;/P&gt;&lt;P&gt;      message e000(zsd01) with&lt;/P&gt;&lt;P&gt;        'Please select correct Order Reason'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    if xvbak-augru eq tvauk-augru.&lt;/P&gt;&lt;P&gt;     SET CURSOR FIELD 'VBAK-AUGRU'.&lt;/P&gt;&lt;P&gt;      message E000(zsd01) with&lt;/P&gt;&lt;P&gt;         'Please select Order Reason not assigned to Cost Center'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 May 2006 18:55:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-09T18:55:35Z</dc:date>
    <item>
      <title>Error Message in User Exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329739#M168286</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;I have written an user exit (program 'MV45AFZZ') ( user exit 'FORM USEREXIT_SAVE_DOCUMENT_PREPARE'). Here I want to give an error message (before save the doc) if the user did enter the correct order reason. It is giving error message properly but during the message system is showing all the fields (VA01) in display mood.After displaying the error message when user press enter system should be able to show Order Reason field as input parameter not display parameter. Pls suggest how to handle this situation. Code is given below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------" /&gt;&lt;P&gt;  if xvbak-auart = 'ZFRE'.&lt;/P&gt;&lt;P&gt;    IF XVBAK-VKORG = TVAUK-VKORG AND&lt;/P&gt;&lt;P&gt;       XVBAK-VTWEG = TVAUK-VTWEG AND&lt;/P&gt;&lt;P&gt;       XVBAK-SPART = TVAUK-SPART AND&lt;/P&gt;&lt;P&gt;       XVBAK-AUDAT GT TVAUK-DATAB.&lt;/P&gt;&lt;P&gt;      if xvbak-augru ne tvauk-augru.&lt;/P&gt;&lt;P&gt;        SET CURSOR FIELD 'VBAK-AUGRU'.&lt;/P&gt;&lt;P&gt;        message E000(zsd01) with&lt;/P&gt;&lt;P&gt;          'Please select correct Order Reason'.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      SET CURSOR FIELD 'VBAK-AUGRU'.&lt;/P&gt;&lt;P&gt;      message e000(zsd01) with&lt;/P&gt;&lt;P&gt;        'Please select correct Order Reason'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    if xvbak-augru eq tvauk-augru.&lt;/P&gt;&lt;P&gt;     SET CURSOR FIELD 'VBAK-AUGRU'.&lt;/P&gt;&lt;P&gt;      message E000(zsd01) with&lt;/P&gt;&lt;P&gt;         'Please select Order Reason not assigned to Cost Center'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 18:55:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329739#M168286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-09T18:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message in User Exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329740#M168287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try information(type I) or warning (type W) message instead of error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 19:04:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329740#M168287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-09T19:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message in User Exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329741#M168288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can achieve this by following method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the user exit you can set one variable to 'N' if you don't allow the user to SAVE order.Your Variable should be avaiable at Global level.IF you dont want to use variables then you can achieve this by IMPORT EXPORT into memory also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the error message to Warning message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Include MV45AF0B_BELEG_SICHERN&lt;/P&gt;&lt;P&gt;Immidiately after user exit&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Userexit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM USEREXIT_SAVE_DOCUMENT_PREPARE.&lt;/P&gt;&lt;P&gt;Create new include and in the include&lt;/P&gt;&lt;P&gt;write the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF VARIABLE = 'N'.&lt;/P&gt;&lt;P&gt;   CLEAR VARIABLE.&lt;/P&gt;&lt;P&gt;   FCODE = FCODE_GLEICHE_SEITE.&lt;/P&gt;&lt;P&gt;   PERFORM FCODE_BEARBEITEN.&lt;/P&gt;&lt;P&gt;   CH_SUBRC = 4.&lt;/P&gt;&lt;P&gt;   EXIT.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;   CH_SUBRC = 0.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If any issues let me know.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will not allow you to SAVE the order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Amandeep  Singh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 19:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329741#M168288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-09T19:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message in User Exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329742#M168289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of EXIT statement, try use LEAVE SCREEN. And off-course, do MESSAGE with 'I' or 'S', not 'E'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 19:31:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329742#M168289</guid>
      <dc:creator>nablan_umar</dc:creator>
      <dc:date>2006-05-09T19:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message in User Exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329743#M168290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi aman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will implement this logic tomorrow since today basis guy is not there and I need the access key to implement this logic. I will let you know the status tomorrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 20:33:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329743#M168290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-09T20:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error Message in User Exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329744#M168291</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;Use the user exit USEREXIT_MOVE_FIELD_TO_VBAK instead of USEREXIT_SAVE_DOCUMENT_PREPARE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraju Chidurupalli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 20:36:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-message-in-user-exit/m-p/1329744#M168291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-09T20:36:01Z</dc:date>
    </item>
  </channel>
</rss>

