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

checkbox

Former Member
0 Likes
979

Hi all this is my code i have 2 blocks in my selection screen . if i enable p_last check box s_date should be in disable mode is working fine . 2nd one if enable scr_out check box , P-file should be in disable mode this is not working . can any one help me in this issue ?

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_werks FOR estmj-werks NO INTERVALS ."OBLIGATORY.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: p_last AS CHECKBOX USER-COMMAND run.

SELECTION-SCREEN COMMENT 3(60) text-002 FOR FIELD p_last.

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS: s_date FOR sy-datum MODIF ID sc1.

SELECTION-SCREEN SKIP.

PARAMETERS: p_file TYPE rlgrap-filename Modif ID sc2.

SELECTION-SCREEN END OF BLOCK b1.

PARAMETERS : scr_out AS CHECKBOX.

----


  • INITIALIZATION *

----


INITIALIZATION.

*Get Filename With Last Run Date.

concatenate 'ex\user\ROHS' sy-datum '.TXT' into p_file.

----


  • AT SELECTION-SCREEN OUTPUT

----


AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_last EQ c_x.

IF screen-group1 = 'SC1' .

screen-input = 0.

MODIFY SCREEN.

CONTINUE.

ENDIF .

ENDIF.

ENDLOOP.

Message was edited by:

priya katragadda

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
883

Here is the modified code.



report zrich_0001.

tables: estmj.

constants: c_x type c value 'X'.

selection-screen begin of block b1 with frame title text-001.
select-options: s_werks for estmj-werks no intervals ."OBLIGATORY.
selection-screen skip.
selection-screen begin of line.
parameters: p_last as checkbox user-command run.
selection-screen comment 3(60) text-002 for field p_last.
selection-screen end of line.
select-options: s_date for sy-datum modif id sc1.
selection-screen skip.
parameters: p_file type rlgrap-filename modif id sc2.

selection-screen end of block b1.
parameters : scr_out as checkbox user-command run.. "  <= See here  !!!



*----------------------------------------------------------------------*
* INITIALIZATION *
*----------------------------------------------------------------------*
initialization.



  concatenate 'exuserROHS' sy-datum '.TXT' into p_file.


*----------------------------------------------------------------------*
* AT SELECTION-SCREEN OUTPUT
*----------------------------------------------------------------------*
at selection-screen output.

  loop at screen.
    if p_last eq c_x.
      if screen-group1 = 'SC1' .
        screen-input = 0.
        modify screen.
        continue.
      endif .
    endif.
   if scr_out = 'X'.       "  <= See here  !!!
      if screen-group1 = 'SC2' .
        screen-input = 0.
        modify screen.
        continue.
      endif.
    endif.
  endloop.

Regards,

Rich Heilman

5 REPLIES 5
Read only

Former Member
0 Likes
883

Hi priya,

Do this way ..

LOOP AT SCREEN.
IF p_last EQ c_x.
IF screen-group1 = 'SC1' .
screen-input = 0.
MODIFY SCREEN.
CONTINUE.
ENDIF .
<b>if scr_out = 'X'.</b>     " donot put it in elseif statement
IF screen-group1 = 'SC2' .
screen-input = 0.
MODIFY SCREEN.
CONTINUE.
ENDIF
ENDIF.
<b>endif</b>
ENDLOOP.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
884

Here is the modified code.



report zrich_0001.

tables: estmj.

constants: c_x type c value 'X'.

selection-screen begin of block b1 with frame title text-001.
select-options: s_werks for estmj-werks no intervals ."OBLIGATORY.
selection-screen skip.
selection-screen begin of line.
parameters: p_last as checkbox user-command run.
selection-screen comment 3(60) text-002 for field p_last.
selection-screen end of line.
select-options: s_date for sy-datum modif id sc1.
selection-screen skip.
parameters: p_file type rlgrap-filename modif id sc2.

selection-screen end of block b1.
parameters : scr_out as checkbox user-command run.. "  <= See here  !!!



*----------------------------------------------------------------------*
* INITIALIZATION *
*----------------------------------------------------------------------*
initialization.



  concatenate 'exuserROHS' sy-datum '.TXT' into p_file.


*----------------------------------------------------------------------*
* AT SELECTION-SCREEN OUTPUT
*----------------------------------------------------------------------*
at selection-screen output.

  loop at screen.
    if p_last eq c_x.
      if screen-group1 = 'SC1' .
        screen-input = 0.
        modify screen.
        continue.
      endif .
    endif.
   if scr_out = 'X'.       "  <= See here  !!!
      if screen-group1 = 'SC2' .
        screen-input = 0.
        modify screen.
        continue.
      endif.
    endif.
  endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
883

Hi,

Changes are marked in bold..

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_werks FOR estmj-werks NO INTERVALS ."OBLIGATORY.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: p_last AS CHECKBOX USER-COMMAND run.

SELECTION-SCREEN COMMENT 3(60) text-002 FOR FIELD p_last.

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS: s_date FOR sy-datum MODIF ID sc1.

SELECTION-SCREEN SKIP.

PARAMETERS: p_file TYPE rlgrap-filename Modif ID sc2.

SELECTION-SCREEN END OF BLOCK b1.

PARAMETERS : scr_out AS CHECKBOX USER-COMMAND RUN1.

----


  • INITIALIZATION *

----


INITIALIZATION.

concatenate 'ex\user\ROHS' sy-datum '.TXT' into p_file.

<b>AT SELECTION-SCREEN OUTPUT.</b>

<b>LOOP AT SCREEN.

IF P_LAST = 'X'.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ELSE.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDIF.

IF SCR_OUT = 'X'.

IF SCREEN-GROUP1 = 'SC2'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ELSE.

IF SCREEN-GROUP1 = 'SC2'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.</b>

Thanks,

Naren

Read only

Former Member
0 Likes
883

Hi Priya,

Refer sample code: This is for Radio button... Should be similar for ur case.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS : rb_pc RADIOBUTTON GROUP r1 DEFAULT 'X'

USER-COMMAND ucomm, "For Presen

p_f1 LIKE rlgrap-filename

MODIF ID rb1, "Input File

rb_srv RADIOBUTTON GROUP r1,

"For Application

p_f2 LIKE rlgrap-filename

MODIF ID rb2,

"Input File

p_direct TYPE char128 MODIF ID abc DEFAULT c_path

.

"File Directory

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-020.

PARAMETERS : p_comp TYPE temksv-firma OBLIGATORY

MATCHCODE OBJECT emi_object," DM Company

p_obj LIKE temksv-object " For DM Object

MODIF ID abc DEFAULT 'PARTNER'.

SELECTION-SCREEN END OF BLOCK b.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF rb_pc = 'X' AND screen-group1 = 'RB2'.

screen-input = '0'.

MODIFY SCREEN.

ELSEIF rb_srv = 'X' AND screen-group1 = 'RB1'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'ABC'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Hope this helps.

Manish

Read only

Former Member
0 Likes
883

instead of this...when first checkbox selected...

loop at screen.

get the properties of the field and make output as 1.

modify screen.

endloop.

similarly write code for other check box.