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

at selection screen output validation

Former Member
0 Likes
2,517

Hi to all experts.

i have requirement when user selects the download radio button then only the file path should be made mandatory . can be done

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,710

Hi,

If you take a radiobutton then it will be checked by default (if only one radiobutton is present on screen).

So make sure that you have more than one radiobuttons on screen

Follow this code:-


PARAMETERS : p_filename TYPE rlgrap-filename MODIF ID abc. " download file name parameter
PARAMETERS : p_rb1 RADIOBUTTON GROUP gp1, "for file download
             p_rb2 RADIOBUTTON GROUP gp1. "for other purpose

AT SELECTION-SCREEN OUTPUT.
  IF p_rb1 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'ABC'. "for textbox (file download parameter)
        screen-required = 1. "make screen mandatory
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'ABC'. "for textbox (file download parameter)
        screen-required = 0. "make screen not-mandatory
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

Hope this helps you.

Regards,

Tarun

11 REPLIES 11
Read only

Former Member
0 Likes
1,710

hi,

you can give an error message 'Enter file path'.

if r1 = 'X'.

*give error message here of type E.

endif.

thanks

Read only

Former Member
0 Likes
1,710

One suggestion is:

You can make the download file field non-editable..i mean, gray out the field first. And when download is selectes you can make it editable. This is possible by :

LOOP AT SCREEN.

IF screen-name = 'XYZ'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Just try this once..

Regards,

Chamanthi

Read only

former_member632729
Contributor
0 Likes
1,710

Hi Dude,

For screen fields handling we have a structure called SCREEN..by using this structure we have to handle this...



parameters: ps_parm as listbox visible length 10
                          user-command abc.
* Radio buttons
parameters: rb1 radiobutton group ab modif id bl2,
            rb2 radiobutton group ab modif id bl2,
            rb3 radiobutton group ab modif id bl3.

initialization.

* Populate list box values
  name = 'PS_PARM'.
  value-key = '1'. value-text = 'Line 1'. append value to list.
  value-key = '2'. value-text = 'Line 2'. append value to list.

  at selection-screen output.

* Set list box with value
  call function 'VRM_SET_VALUES'
    exporting
      id     = name
      values = list.
* Control the display of screen components
  loop at screen.
    if ps_parm = 1.
      if screen-name = 'RB1' or screen-name = 'RB2' .
        screen-invisible = 0.
      elseif screen-name = 'RB3'.
        screen-invisible = 1.
      endif.
      modify screen.
    elseif ps_parm = 2.      if screen-name = 'RB1' or screen-name = 'RB2' .
        screen-invisible = 1.
      elseif screen-name = 'RB3'.
        screen-invisible = 0.
      endif.
      modify screen.
    elseif ps_parm = space.
      rb1 = 'X'.
      clear: rb2,rb3.
      if screen-name = 'RB1' or screen-name = 'RB2' or
         screen-name = 'RB3'.        screen-invisible = 0.
        modify screen.
      endif.
    endif.  endloop.

 at selection-screen.
  if sscrfields-ucomm = 'ABC'.  endif.

  start-of-selection.

  write: / 'Parameter:', ps_parm.

Read only

Former Member
0 Likes
1,710

Hi

Write the following code in at selecection-screen output:

If download = 'X'.

loop at screen.

screen-name = 'X'.

screen-input = 0.(screen-input has two options 0 and 1 : 0=no-display, 1= display)

modify screen.

endloop.

endif.

Hope this solve issue

Regarsd,

Rajani

Read only

Former Member
0 Likes
1,710

Hi,

You can try this one..

at selection-screen output.

check if the radio button is selected, then

loop at screen.

if screen-name = 'XXX'.->name of the parameter name for ur filename

screen-required = 1.

modify screen.

endif.

endloop.

Regards,

Leonard Chomi

Read only

Former Member
0 Likes
1,710

Hi try this,

at selection-screen on RB1. "Where RB1 is ur radio button name

LOOP AT SCREEN.

IF screen-name = 'file_path'. "File_path is ur file paths selection screen element

screen-required = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Here screen-required will make ur file path as mandit field

Read only

Former Member
0 Likes
1,710

Hi,

You can write the below logic.

PARAMETERS: rb_file RADIOBUTTON GROUP g1,
            rb_other RADIOBUTTON GROUP g1.
PARAMETERS: p_file TYPE char50.

AT SELECTION-SCREEN ON RADIOBUTTON GROUP g1.
  LOOP AT SCREEN.
    IF screen-name = 'P_FILE'.
      IF rb_file EQ 'X'.
        screen-required = 1.
        MODIFY SCREEN.
      ELSE.
        screen-required = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.

Regards,

Manoj Kumar P

Read only

dev_parbutteea
Active Contributor
0 Likes
1,710

Hi,

please find below, sample code for your requirement:

PARAMETERS : sa_fend RADIOBUTTON GROUP radi USER-COMMAND inf,

sa_bend RADIOBUTTON GROUP radi DEFAULT 'X'.

PARAMETERS: sa_flpth TYPE filename .

INITIALIZATION.

AT SELECTION-SCREEN OUTPUT.

*Input Physical Path if Front End Selected else Deactivated

IF sa_fend = 'X'.

LOOP AT SCREEN.

IF screen-name = 'SA_FLPTH'.

screen-input = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF sa_bend = 'X'.

LOOP AT SCREEN.

IF screen-name = 'SA_FLPTH'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,711

Hi,

If you take a radiobutton then it will be checked by default (if only one radiobutton is present on screen).

So make sure that you have more than one radiobuttons on screen

Follow this code:-


PARAMETERS : p_filename TYPE rlgrap-filename MODIF ID abc. " download file name parameter
PARAMETERS : p_rb1 RADIOBUTTON GROUP gp1, "for file download
             p_rb2 RADIOBUTTON GROUP gp1. "for other purpose

AT SELECTION-SCREEN OUTPUT.
  IF p_rb1 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'ABC'. "for textbox (file download parameter)
        screen-required = 1. "make screen mandatory
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'ABC'. "for textbox (file download parameter)
        screen-required = 0. "make screen not-mandatory
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
1,710

not working i tried . i have 2 radiobutton

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,710

Hi,

Then try this way:-


PARAMETERS : p_filename TYPE rlgrap-filename. " download file name parameter
PARAMETERS : p_rb1 RADIOBUTTON GROUP gp1 USER COMMAND abc, "for file download
             p_rb2 RADIOBUTTON GROUP gp1 DEFAULT 'X'. "for other purpose
 
AT SELECTION-SCREEN.
  IF p_rb1 = 'X'.
    IF p_filename IS INITIAL.
      MESSAGE 'specify file name' TYPE 'E'.
    ENDIF.
  ENDIF.

Hope this solves your problem.

Regards,

Tarun