Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection screen

Former Member
0 Likes
725

Hi ,

I have 2 parameters in Selection screen.

If field1 is null then I have to make the field 2 as Mandatory.If Field1 has some value then I have to proceed with the value...no need to make field 2 as mandatory.

Help me on this.

Sumithra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
695

HELLO,

probe the code:

REPORT zaon_prueba_input .

PARAMETERS: field1(5),

field2(5).

AT SELECTION-SCREEN ON field1.

IF field1 IS INITIAL.

LOOP AT SCREEN.

IF screen-name = 'FIELD2'.

BREAK-POINT.

screen-required = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

START-OF-SELECTION.

WRITE: 'leche'.

9 REPLIES 9
Read only

Laxmana_Appana_
Active Contributor
0 Likes
695

Hi,

Put this code at event : AT SELECTION-SCREEN OUTPUT.


if field1 is initial.
loop at screen.
if screen-name = 'FIELD2'.  
  screen-required = 1.    
  modify screen.  
endif.
endloop.
endif.

or


AT SELECTION-SCREEN .

IF field1 IS INITIAL.
  if field2 is initial.
     MESSAGE e000(xx) 'enter data for field2'.
  ENDIF.
ENDIF.

Regards

appana

Read only

Former Member
0 Likes
695

hi,

To keep both the fields open for input, keep them under the same block.

If we dont keep them under same block, as soon as an error message is thrown, only second field

will be open for input and the first field will be grayed.

selection-screen begin of block b1 with frame title text-001.

parameters : p_first type c,

p_scnd type c.

selection-screen end of block b1.

At selection-screen on block b1.

If p_first is initial.

if p_scnd is initial.

message e000 with 'Enter value in p_scnd'.

endif.

endif.

Regards,

Sailaja.

Read only

Former Member
0 Likes
695

hi Vasu,

Do this way ..

AT-SELECTION SCREEN

PERFORM VALIDATE_SELECTION_SCREEN.

FORM VALIDATE_SELECTION_SCREEN.
  IF P_RAD2 = 'X'.
    IF S_WERKS[] IS INITIAL.
      IF  S_PLNTY IS INITIAL OR
          S_PLNNR IS INITIAL OR
          S_PLNKN IS INITIAL OR
          S_VORNR IS INITIAL OR
          S_STEUS IS INITIAL.
         MESSAGE E000 WITH 'Please make an entry in plant'(030).
       ENDIF.
    ENDIF.
  ENDIF.
ENDFORM.                    " VALIDATE_SELECTION_SCREEN

Regards,

Santosh

Read only

Former Member
0 Likes
695

USE FOLLOWING

IF P1 NOT INITIAL.

PARAMERE P2.

ELSE.

PARAMERE P2 OBLIGATORY.

ENDIF.

REWARD IF HELPFUL

REGARDS

Read only

dani_mn
Active Contributor
0 Likes
695

HI,

Try one of the following two methods,

which suit you better.

<b>REPORT ztest.

tables: bkpf.

parameter: a(10) default 'dd' MODIF ID ABC.
select-options: b for bkpf-belnr MODIF ID SEL.


AT selection-screen on  a.

if a is initial.
message e000(su) with 'enter in a'.
endif.</b>

OR

<b>at selection-screen output.
  If  a is initial.
    loop at screen.

      if screen-group1 = 'SEL'.
        screen-required = 1.
        modify screen.
      endif.

    endloop.</b>

REgards,

Read only

Former Member
0 Likes
695

AT SELECTION-SCREEN OUTpUT.

 IF p_FIELD1 IS INITIAL.
    IF p_FIELD2 IS INITIAL.
      *DISpLAy ERROR MESSAGE TO ENTER p_FIELD2.
    ENDIF.
  ENDIF.

Message was edited by: Chandrasekhar Jagarlamudi

Read only

Former Member
0 Likes
695

Hi,

Still I have the same oproblem...nothing is solving my prob

1.If I give that in At selection-scren <b>OUTPUT</b>

Its showing that in initial screen.If I didnt give value its updating the screen but not showing the things.

2. IF I give message its working fine.But I dont want to print any message.I want5 to make field2 as mandatory

Read only

Former Member
0 Likes
696

HELLO,

probe the code:

REPORT zaon_prueba_input .

PARAMETERS: field1(5),

field2(5).

AT SELECTION-SCREEN ON field1.

IF field1 IS INITIAL.

LOOP AT SCREEN.

IF screen-name = 'FIELD2'.

BREAK-POINT.

screen-required = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

START-OF-SELECTION.

WRITE: 'leche'.

Read only

Former Member
0 Likes
695

Thanks OLONO