<?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: Selection Screen related Problem - Remove Mandatory Option in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-related-problem-remove-mandatory-option/m-p/6889551#M1479831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK once you have set the mandatory flag for a field you cannot revert it back. Instead of making the field OBLIGATORY, you can write a simple code to do the job for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN.

IF SY-UCOMM = 'ONLI' "Execute Button
OR SY-UCOMM = 'PRIN'. "Schedule Background Button

IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
  MESSAGE 'Input required for S_ARTNO' TYPE 'E'.
ENDIF.

ENDIF.

START-OF-SELECTION.

IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
  MESSAGE 'Input required for S_ARTNO' TYPE 'I'.
  LEAVE LIST-PROCESSING.
ENDIF.&lt;/CODE&gt;&lt;/PRE&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;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Apr 2010 06:45:47 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2010-04-24T06:45:47Z</dc:date>
    <item>
      <title>Selection Screen related Problem - Remove Mandatory Option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-related-problem-remove-mandatory-option/m-p/6889550#M1479830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have created on selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which have two input screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One field is mandatory and another is optional.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But requirement is that if user fill the second field for input the first field mandatiry option removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SELECT-OPTIONS: S_ARTNO  FOR DRAP-DOKNR OBLIGATORY.&lt;/P&gt;&lt;P&gt; PARAMETERS:   S_MATNR  like MARA-MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if user not fill S_ARTNO and fill S_MATNR . Then remove mandatory option from S_ARTNO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And not error dispaly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and report displayed on the base of second field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me as soon as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &amp;amp; Thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Apr 2010 06:24:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-related-problem-remove-mandatory-option/m-p/6889550#M1479830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-24T06:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen related Problem - Remove Mandatory Option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-related-problem-remove-mandatory-option/m-p/6889551#M1479831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AFAIK once you have set the mandatory flag for a field you cannot revert it back. Instead of making the field OBLIGATORY, you can write a simple code to do the job for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN.

IF SY-UCOMM = 'ONLI' "Execute Button
OR SY-UCOMM = 'PRIN'. "Schedule Background Button

IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
  MESSAGE 'Input required for S_ARTNO' TYPE 'E'.
ENDIF.

ENDIF.

START-OF-SELECTION.

IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
  MESSAGE 'Input required for S_ARTNO' TYPE 'I'.
  LEAVE LIST-PROCESSING.
ENDIF.&lt;/CODE&gt;&lt;/PRE&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;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Apr 2010 06:45:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-related-problem-remove-mandatory-option/m-p/6889551#M1479831</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-24T06:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Screen related Problem - Remove Mandatory Option</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-related-problem-remove-mandatory-option/m-p/6889552#M1479832</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;Try like this,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Here just remove obligatory.
SELECT-OPTIONS: S_ARTNO FOR DRAP-DOKNR.
PARAMETERS: S_MATNR like MARA-MATNR.

At selection-screen.

if s_artno-low eq space and s_matnr eq space.
stop.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it will not show any error message but it is compulsory to enter &lt;/P&gt;&lt;P&gt;either one of the specified fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Apr 2010 06:47:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selection-screen-related-problem-remove-mandatory-option/m-p/6889552#M1479832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-24T06:47:54Z</dc:date>
    </item>
  </channel>
</rss>

