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 event

Former Member
0 Likes
700

Hi All,

I have 2 fields in my selection screen one is date and the other one is filepath.2nd field path is mandatory but the problem is when I click on multiple selection button the program is giving mandatory message how to avoid this?

I want to give this mandatory message only after entering the date and if we dont enter file path then only the error should come.

I tried to give this error message in at selectionscreen event but this is triggering when we click on multiple selection button so again the same problem?Please suggest somebody how tod avoid this?

Regards

Mahesh

5 REPLIES 5
Read only

Former Member
0 Likes
673

well you need to check the consitions first before throwin gthe error mesaage.

e.G. if a date is supported...

Read only

Former Member
0 Likes
673

You will need to perform the edits in the code something like this.


*_________________________________________________ Start of Selection

START-OF-SELECTION.

  PERFORM screen_edits.
  CHECK scr_err IS INITIAL.

and the edits...


*&---------------------------------------------------------------------*
*&      Form  screen_edits
*&---------------------------------------------------------------------*
FORM screen_edits.
  CLEAR scr_err.

  PERFORM base_screen_edits.
  CHECK scr_err IS INITIAL.

  PERFORM action_screen_edits.
  CHECK scr_err IS INITIAL.

  PERFORM follow_screen_edits.
  CHECK scr_err IS INITIAL.


ENDFORM.                    " screen_edits
*&---------------------------------------------------------------------*
*&      Form  base_screen_edits
*&---------------------------------------------------------------------*
FORM base_screen_edits.
  CLEAR scr_err.
  IF paddlead = 'X'.
    IF NOT p_ltypf = 'X'.
      IF pltype IS INITIAL.
        scr_err = 'X'.
        MESSAGE s620.
      ENDIF.

      CHECK scr_err IS INITIAL.
      IF pstat IS INITIAL.
        scr_err = 'X'.
        MESSAGE s621.
      ENDIF.
      CHECK scr_err IS INITIAL.
      PERFORM edit_leadtype_status.
      CHECK scr_err IS INITIAL.
    ENDIF.
    IF pfctyp IS INITIAL.
      IF pctype IS INITIAL.
        scr_err = 'X'.
        MESSAGE s616.
      ENDIF.
    ENDIF.
    CHECK scr_err IS INITIAL.

    IF pfatyp IS INITIAL.
      IF patype IS INITIAL.
        scr_err = 'X'.
        MESSAGE s617.
      ENDIF.
    ENDIF.
    CHECK scr_err IS INITIAL.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF pmodstat = 'X'.
    IF p_ltyps EQ 'X'.
      IF pltype IS INITIAL.
        scr_err = 'X'.
        MESSAGE s620.
      ENDIF.
      CHECK scr_err IS INITIAL.
      IF pstat IS INITIAL.
        scr_err = 'X'.
        MESSAGE s621.
      ENDIF.
      CHECK scr_err IS INITIAL.
      PERFORM edit_leadtype_status.
    ENDIF.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF paddact = 'X'.
    IF paction IS INITIAL
    AND pfoll IS INITIAL.
      scr_err = 'X'.
      MESSAGE s622.
    ENDIF.
  ENDIF.
  CHECK scr_err IS INITIAL.


ENDFORM.                    " base_screen_edits
*&---------------------------------------------------------------------*
*&      Form  edit_leadtype_status
*&---------------------------------------------------------------------*
FORM edit_leadtype_status.
  SELECT SINGLE * FROM zlmstyp
    WHERE ltype  = pltype
      AND status = pstat.
  IF sy-subrc NE 0.
    scr_err = 'X'.
    MESSAGE s623.
  ENDIF.

ENDFORM.                    " edit_leadtype_status
*&---------------------------------------------------------------------*
*&      Form  action_screen_edits
*&---------------------------------------------------------------------*
FORM action_screen_edits.
  CHECK paction EQ 'X'.
  IF pactyp IS INITIAL.
    IF pacfty IS INITIAL.
      scr_err = 'X'.
      MESSAGE s611.
    ENDIF.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF pactrslt IS INITIAL.
    IF pacfrs IS INITIAL.
      scr_err = 'X'.
      MESSAGE s612.
    ENDIF.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF pactdate IS INITIAL.
    scr_err = 'X'.
    MESSAGE s613.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF pacttime IS INITIAL.
    scr_err = 'X'.
    MESSAGE s614.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF pactuser IS INITIAL.
    scr_err = 'X'.
    MESSAGE s615.
  ENDIF.
  CHECK scr_err IS INITIAL.

ENDFORM.                    " action_screen_edits
*&---------------------------------------------------------------------*
*&      Form  follow_screen_edits
*&---------------------------------------------------------------------*
FORM follow_screen_edits.
  CHECK pfoll EQ 'X'.
  IF pfoltyp IS INITIAL.
    IF pfofty IS INITIAL.
      scr_err = 'X'.
      MESSAGE s611.
    ENDIF.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF pfoldate IS INITIAL.
    scr_err = 'X'.
    MESSAGE s613.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF pfoltime IS INITIAL.
    scr_err = 'X'.
    MESSAGE s614.
  ENDIF.
  CHECK scr_err IS INITIAL.

  IF pfoluser IS INITIAL.
    scr_err = 'X'.
    MESSAGE s615.
  ENDIF.
  CHECK scr_err IS INITIAL.

Read only

Former Member
0 Likes
673

give in the selection screen as below.

selection-screen begin of block.

PARAMETERS: p_file TYPE rlgrap-filename obligatory.

selection-screen end of block.

Read only

Former Member
0 Likes
673

you can change the property of your field on the event

at selection-screen output.

loop at screen.

if screen-name = ..... and

condition.

screen-obligatory = ....

modify screen

endif.

endloop.

Indeed, you must use USER-COMMAND on your parameter, so program will pass everytime on selection-screen output.

By

andrea

Read only

0 Likes
673

Hi All,

The problem is solved by self it is very simple.

just after start-of-selection we should give like below.

if p_fname is initial.

MESSAGE s031 display like 'E'.

exit.

endif.

Thanks for ur responses.

Regards

Mahesh