<?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: sy-ucomm (ok_code) is empty - ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-ok-code-is-empty-abap/m-p/12363160#M1993265</link>
    <description>&lt;P&gt;Generally speaking, your logic is wrong, you should do the processing of the function code in the PAI of the screen, not outside. Moreover, for selection screens, you should use sscrfields-ucomm, not sy-ucomm:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES sscrfields.
...

AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
    ...
  ENDCASE.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Jan 2021 18:47:15 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2021-01-21T18:47:15Z</dc:date>
    <item>
      <title>sy-ucomm (ok_code) is empty - ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-ok-code-is-empty-abap/m-p/12363159#M1993264</link>
      <description>&lt;P&gt;Hi Experts!&lt;/P&gt;I don't know why the sy-ucomm system variable is empty. Here is my sample codeSELECTION-SCREEN 100
  &lt;PRE&gt;&lt;CODE&gt;DATA: so_inv TYPE inv.

SELECTION-SCREEN BEGIN OF SCREEN 100.

SELECTION-SCREEN BEGIN OF BLOCK mdat WITH FRAME TITLE TEXT-001.
PARAMETERS: p_mdc   TYPE mdc,
            p_date TYPE dats.
SELECTION-SCREEN END OF BLOCK mdc.

SELECTION-SCREEN BEGIN OF BLOCK inv WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: s_inv FOR so_inv.
SELECTION-SCREEN END OF BLOCK inv.

SELECTION-SCREEN END OF SCREEN 100.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;START-OF-SELECTION&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;START-OF-SELECTION.
  PERFORM set_toolbar.
  PERFORM set_status.
  WRITE: 'test'.


FORM set_status.
  SET PF-STATUS 'PF1'.
ENDFORM.

FORM set_toolbar.
  CALL SELECTION-SCREEN 100.

  DATA: ok_code TYPE sy-ucomm.
  CASE ok_code.
    WHEN 'BACK'.
      LEAVE PROGRAM.
    WHEN 'EXIT'.
      LEAVE TO SCREEN 0.
    WHEN 'CANCEL'.
      LEAVE SCREEN.
*    WHEN OTHERS.
*      CALL SELECTION-SCREEN 100.
  ENDCASE.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;PF-STATUS&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1875708-pf-status.png" /&gt;&lt;/P&gt;Thus, if I debug the program, I see that the variable ok_code is empty, but I don't know why this is the case.Does anyone know what i did wrong?Thanks &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;</description>
      <pubDate>Thu, 21 Jan 2021 15:37:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-ok-code-is-empty-abap/m-p/12363159#M1993264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-01-21T15:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: sy-ucomm (ok_code) is empty - ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-ok-code-is-empty-abap/m-p/12363160#M1993265</link>
      <description>&lt;P&gt;Generally speaking, your logic is wrong, you should do the processing of the function code in the PAI of the screen, not outside. Moreover, for selection screens, you should use sscrfields-ucomm, not sy-ucomm:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES sscrfields.
...

AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
    ...
  ENDCASE.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jan 2021 18:47:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sy-ucomm-ok-code-is-empty-abap/m-p/12363160#M1993265</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-01-21T18:47:15Z</dc:date>
    </item>
  </channel>
</rss>

