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

Loop at screen wit h checkbox

Former Member
0 Likes
3,540

selection-screen : begin of block b1.

parameters : p_dl as checkbox ,

p_file type rlgrap-filename modif id FIL.

Hi all,

Requirement here is

Having two selection screen parameters

1. Check box for download 2. File .

if i didnt select the checkbox it should disable.

If i check the checkbox, the file parameter should enable

after execution the file field is disable ,but in the selection screen when i select the check box, it is not enable mode.

will anybody try the code in your sys and let me know.

selection-screen : end of block b1.

at selection-screen output.

if p_dl = 'X'.

loop at screen.

if screen-group1 = 'FIL'.

screen-input = '1'.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-group1 = 'FIL'.

screen-input = '0'.

modify screen.

endif.

endloop.

endif.

its urgent.

REgards..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,563

Check below example:


PARAMETERS: p_dl AS CHECKBOX USER-COMMAND abc,
            p_file TYPE localfile.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF screen-name CP '*P_FILE*'.
      IF p_dl IS INITIAL.
        screen-active = 0.     " File Parameter Invisible
      ELSE.
        screen-active = 1.     " File Parameter Visible
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

selection-screen : begin of block b1.

parameters : p_dl as checkbox ,

p_file type rlgrap-filename modif id FIL.

Hi all,

Requirement here is

Having two selection screen parameters

1. Check box for download 2. File .

if i didnt select the checkbox it should disable.

If i check the checkbox, the file parameter should enable

after execution the file field is disable ,but in the selection screen when i select the check box, it is not enable mode.

will anybody try the code in your sys and let me know.

selection-screen : end of block b1.

at selection-screen output.

if p_dl = 'X'.

loop at screen.

if screen-group1 = 'FIL'.

screen-input = '1'.

modify screen.

endif.

endloop.

else.

loop at screen.

if screen-group1 = 'FIL'.

screen-input = '0'.

modify screen.

endif.

endloop.

endif.

its urgent.

REgards..

6 REPLIES 6
Read only

Former Member
0 Likes
1,563

Hi ,

Basically, when you select/deselect the checkbox, the PBO of the selection screen (AT SELECTION-SCREEN OUTPUT event) needs to be called again, so that that modify screen command works , for this fo the following:

PARAMETERS: p_dl AS CHECKBOX USER-COMMAND one.

Cheers,

Aditya

Edited by: Aditya Laud on Feb 20, 2008 2:45 AM

Read only

Former Member
0 Likes
1,564

Check below example:


PARAMETERS: p_dl AS CHECKBOX USER-COMMAND abc,
            p_file TYPE localfile.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF screen-name CP '*P_FILE*'.
      IF p_dl IS INITIAL.
        screen-active = 0.     " File Parameter Invisible
      ELSE.
        screen-active = 1.     " File Parameter Visible
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Read only

0 Likes
1,563

Hi eswar ,

I understood it should decalre with usercommand.

but where are you checking the user command.

is it like

PARAMETERS: p_dl AS CHECKBOX USER-COMMAND abc,

p_file TYPE localfile.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name CP 'P_FILE'.

IF p_dl = abc .

screen-active = 1. " File Parameter Invisible

ELSE.

screen-active = 0. " File Parameter Visible

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

0 Likes
1,563

Hi, The USER-COMMAND addition triggers the AT SELECTION-SCREEN OUTPUT event. If we dont use the addition, you have to use ENTER key each time you change the value of Check Box. Note that USER-COMMAND Addition can only be used for CHECK BOX or RADIOBUTTON. Also see below extract from help: ... USER-COMMAND ucom Effect This addition is only supported for parameters that are defined as checkboxes or radio buttons. In this case, clicking the parameter triggers the user command ucom, similarly to SELECTION-SCREEN PUSHBUTTON. Hope this helps.

Read only

0 Likes
1,563

Thank you eswar .

Problem resolved .

I need one more clarification with you.

in selection screen i am having MEAN-EAN11(Refernece number as parameter)

While validating this parameter EAN11, there is no master table for that field .

how to validate that field now.

Could you let me know

Read only

0 Likes
1,563

Remember i have answered this question in your other thread. Anyhow, validating the EAN in the sense you need to check if any material exists with this external identification number. So you can do that as below:


SELECT SINGLE ean11 INTO p_ean11 FROM mara WHERE ean11 = p_ean11.
IF sy-subrc NE 0.
   MESSAGE e001(00) WITH 'Invalid EAN!!!'.    "Error Message
ENDIF.
EAN's are not pre-defined, they can vary time to time for the same material. So only means to check is from material master unless maintained is other specifically designed tables.