<?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: Validation check in selection screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498114#M1421305</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;Instead of exit, try to use "LEAVE LIST PROCESSING".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jan 2010 07:12:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-08T07:12:19Z</dc:date>
    <item>
      <title>Validation check in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498112#M1421303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a selection screen in which there are 2 radio buttons S1 n S2, and a text field (Parameter) namely P_PATH.&lt;/P&gt;&lt;P&gt;I am using a method (CALL METHOD cl_gui_frontend_services=&amp;gt;file_save_dialog) for selecting a file to save some&lt;/P&gt;&lt;P&gt;data in the XLS format.&lt;/P&gt;&lt;P&gt;Once the user selects S2, and presses the F4 help in the parameter P_PATH, this method is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_frontend_services=&amp;gt;file_save_dialog&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      window_title      = p_title&lt;/P&gt;&lt;P&gt;      default_file_name = p_filename&lt;/P&gt;&lt;P&gt;      file_filter       = l_file_filter&lt;/P&gt;&lt;P&gt;      initial_directory = p_download_path&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      filename          = p_filename&lt;/P&gt;&lt;P&gt;      path              = p_download_path&lt;/P&gt;&lt;P&gt;      fullpath          = p_full_path&lt;/P&gt;&lt;P&gt;      user_action       = g_user_action    "save or cancel&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      OTHERS            = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The  g_user_action given here has a value of 9 in case the user selects the CANCEL button in the pop up that asks for the file name to be given for saving the file.&lt;/P&gt;&lt;P&gt;My req. is that when  g_user_action = 9. then the selection screen should be displayed back, with the S1 being selected (instead of the earlier S2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done the below coding, but its not working. Is there something that I am doing incorrect?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.&lt;/P&gt;&lt;P&gt;PARAMETERS: s1 RADIOBUTTON GROUP rad2 DEFAULT 'X' USER-COMMAND ac,&lt;/P&gt;&lt;P&gt;            s2 RADIOBUTTON GROUP rad2.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN: END OF BLOCK b4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: g_s1 type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; PERFORM get_download_path&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN OUTPUT.&lt;/P&gt;&lt;P&gt; if g_s1 = 'X'.&lt;/P&gt;&lt;P&gt;  s1 = 'X'.&lt;/P&gt;&lt;P&gt;  s2 = ''.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_download_path&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;the above method is called**&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;IF g_user_action = 9.&lt;/P&gt;&lt;P&gt; g_s1 = 'X'.&lt;/P&gt;&lt;P&gt;  exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 06:43:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498112#M1421303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-08T06:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Validation check in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498113#M1421304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason why the S1 is not getting 'X' is because the &lt;STRONG&gt;selection-screen output&lt;/STRONG&gt; event will not trigger after the &lt;STRONG&gt;ON VALUE-REQUEST&lt;/STRONG&gt; event. This is a standard behavior of the dialog step procedure and you cannot do much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you are assigning 'X' to S1 in the selection-screen output  if gs_1 is 'X'. Thus the consecutive attempts to select S2 radio button will fail forever after the first attempt. &lt;/P&gt;&lt;P&gt;This is because the selection-screen output will tigger and gs_1 is 'X' so it will always make S1 as 'X' and on the screen you will always see 'S1' radiobutton selected eventhough one selects the S2 radiobutton.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is why do you want the S1 do be selected as default if Cancel is pressed on the file save dialog?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 07:09:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498113#M1421304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-08T07:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Validation check in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498114#M1421305</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;Instead of exit, try to use "LEAVE LIST PROCESSING".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 07:12:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498114#M1421305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-08T07:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Validation check in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498115#M1421306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ajay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Advait has pointed out already AT SELECTION_SCREEN OUTPUT event (or the PBO) does not trigger after the ON VALUE-REQUEST (or the POV) event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to use the FM: DYNP_VALUES_UPDATE to update the selection-screen value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM get_download_path
** the above method is called**
  data: dyname like d020s-prog,
        dynumb like d020s-dnum.

  data: it_dyfields type standard table of dynpread,
           st_dyfields type dynpread.

IF g_user_action = 9.

  dyname = sy-repid.
  dynumb = sy-dynnr.

  CLEAR s2.
  s1 = 'X'.
  move 'S1' to st_dyfields-fieldname.
  move  'X'  to st_dyfields-fieldvalue.
  append st_dyfields to it_dyfields.

  move 'S2' to st_dyfields-fieldname.
  CLEAR st_dyfields-fieldvalue.
  append st_dyfields to it_dyfields.

  call function 'DYNP_VALUES_UPDATE'
       exporting
            dyname               = dyname
            dynumb               = dynumb
       tables
            dynpfields           = it_dyfields
       exceptions
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            others               = 8.
  check sy-subrc eq 0.
endif.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 07:15:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498115#M1421306</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-01-08T07:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Validation check in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498116#M1421307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Advait,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a req. that seems to be more of a logical thing than technical. The only point is that once the user presses CANCEL, it is assumed that he is not interested in the excel output (S2), and he wants to now go for the ALV output (S1).&lt;/P&gt;&lt;P&gt;So to make it convenient, S1 should itself be selected.&lt;/P&gt;&lt;P&gt;I cant argue much on this point, as this is the req. given to me n I need to deliver it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ajay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 07:16:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498116#M1421307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-08T07:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Validation check in selection screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498117#M1421308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The S1 radio button is now selected successfully in case user presses CANCEL button.&lt;/P&gt;&lt;P&gt;I used the solution given by Suhas Saha (using 'DYNP_VALUES_UPDATE')&lt;/P&gt;&lt;P&gt;Now I need to make the parameter P_PATH as grey out as soon as S1 is selected. &lt;/P&gt;&lt;P&gt;How can I achieve this functionality? Will that need to be done inside this FM??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ajay singh on Jan 8, 2010 11:35 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 10:34:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validation-check-in-selection-screen/m-p/6498117#M1421308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-08T10:34:52Z</dc:date>
    </item>
  </channel>
</rss>

