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

problem with loop at screen

SwarnaliBasu
Participant
0 Likes
1,339

hi

i have a selection screen , in the same selection screen i have a checkbox, which will be space in default, but when the user checks it a second screen will be visible which has 4 fields, i am attaching the code, please tell me how to do it.

 parameters: p_check as checkbox default ' '.
SELECTION-SCREEN COMMENT (24) text-021 MODIF ID CCC.
PARAMETERS: P_user type char30,
            p_ricef type  char30,
            p_credt type ZCRDATE,
            p_credtm type ZCRTIME.

SELECTION-SCREEN END OF LINE.


*&---------------------------------------------------------------------*
*&                        AT SELECTION SCREEN output
*&---------------------------------------------------------------------*
*---------------------------------------------------------------------*
AT SELECTION SCREEN 
AT SELECTION SCREEN -output
IF P_check = 'X'.
      LOOP AT SCREEN.
          CHECK SCREEN-GROUP1 = 'CCC'.
          SCREEN-INPUT = '1'.
          screen-invisible = '1'.
          MODIFY SCREEN.
      ENDLOOP.
  ENDIF.

but my screen parameters are coming side by side and is visible in the same screen, which is not as normal slection screen

Edited by: swarnali_IBM on Aug 14, 2009 2:10 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,222

Swarnali,

Try using the following code.

SELECTION-SCREEN BEGIN OF BLOCK blk_chk WITH FRAME TITLE text-b01.
PARAMETERS: p_check AS CHECKBOX USER-COMMAND ucomm .
SELECTION-SCREEN END OF BLOCK blk_chk.

SELECTION-SCREEN BEGIN OF BLOCK blk_sel WITH FRAME TITLE text-b02.
PARAMETERS: p_user   TYPE char30   MODIF ID xxx,
            p_ricef  TYPE char30   MODIF ID xxx,
            p_credt  TYPE sy-datum MODIF ID xxx,
            p_credtm TYPE sy-uzeit MODIF ID xxx.
SELECTION-SCREEN END OF BLOCK blk_sel.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    CHECK screen-group1 EQ 'XXX'.

    CASE p_check.
      WHEN 'X'.

        screen-invisible = 0.

        screen-input     = 1.

        screen-output    = 1.

        screen-active    = 1.

      WHEN OTHERS.

        screen-invisible = 1.

        screen-input     = 0.

        screen-output    = 0.

        screen-active    = 0.

    ENDCASE.

    MODIFY SCREEN.

  ENDLOOP.

7 REPLIES 7
Read only

former_member209217
Active Contributor
0 Likes
1,222

U shuld use POSITION additon for ur selection screen

Read only

Former Member
0 Likes
1,222

Hi,

Try like below:


parameters: p_check as checkbox default ' ' user-command ucomm .
AT SELECTION SCREEN-output
if P_check eq space.'
  loop at screen.
    if screen-group = 'CCC'.
      screen-invisible = '1'.
     screen-input = 0.
     modify screen.
   endloop.
  ENDIF.

Using the above the fieds would not be avaliable when the p_cehck is blank other wise they would be avaliable.

Regards,

Himanshu

Read only

0 Likes
1,222

Hi,

Try using below code:

SELECTION-SCREEN BEGIN OF BLOCK blck.

PARAMETERS: p_check AS CHECKBOX DEFAULT ' ' USER-COMMAND ucomm.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (24) text-021 MODIF ID ccc.
SELECTION-SCREEN END OF LINE.

PARAMETERS: p_user TYPE char30,
            p_ricef TYPE  char30,
            p_credt TYPE vbak-erdat,
            p_credtm TYPE vbak-erzet.
SELECTION-SCREEN END OF BLOCK blck.
*&---------------------------------------------------------------------*
*&                        AT SELECTION SCREEN output
*&---------------------------------------------------------------------*
*---------------------------------------------------------------------*

AT SELECTION-SCREEN OUTPUT.
  IF p_check = 'X'.
    LOOP AT SCREEN.
      IF screen-name NE 'P_CHECK'.
        screen-input = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

  ELSE.
    LOOP AT SCREEN.
      IF screen-name NE 'P_CHECK'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

KR Jaideep,

Read only

Former Member
0 Likes
1,222

Hello Sswarnali,

Just setting the check box will not raise any event you need to put some command button to call second selection screen

if check box in not initial.

Check if this helps!

Thanks,

Augustin.

Read only

Former Member
0 Likes
1,222

Hi Swarnali,

Do like this....

parameters: rb1 RADIOBUTTON GROUP gr1 USER-COMMAND set default 'X',

rb2 RADIOBUTTON GROUP gr1.

SELECTION-SCREEN begin OF SCREEN 100 AS SUBSCREEN.

SELECTION-SCREEN END OF SCREEN 100.

SELECTION-SCREEN begin OF SCREEN 200 AS SUBSCREEN.

parameters: p_vbeln type vbak-vbeln.

SELECTION-SCREEN END OF SCREEN 200.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK subscrarea FOR 2 LINES,

END OF BLOCK subscrarea.

INITIALIZATION.

perform set_screen.

AT SELECTION-SCREEN.

perform set_screen.

start-of-selection.

write: / p_vbeln.

&----


*& Form SET_SCREEN

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM SET_SCREEN .

if rb1 is INITIAL.

subscrarea-prog = sy-repid.

subscrarea-dynnr = 200.

else.

subscrarea-prog = sy-repid.

subscrarea-dynnr = 100.

endif.

ENDFORM. " SET_SCREEN

Read only

Former Member
0 Likes
1,223

Swarnali,

Try using the following code.

SELECTION-SCREEN BEGIN OF BLOCK blk_chk WITH FRAME TITLE text-b01.
PARAMETERS: p_check AS CHECKBOX USER-COMMAND ucomm .
SELECTION-SCREEN END OF BLOCK blk_chk.

SELECTION-SCREEN BEGIN OF BLOCK blk_sel WITH FRAME TITLE text-b02.
PARAMETERS: p_user   TYPE char30   MODIF ID xxx,
            p_ricef  TYPE char30   MODIF ID xxx,
            p_credt  TYPE sy-datum MODIF ID xxx,
            p_credtm TYPE sy-uzeit MODIF ID xxx.
SELECTION-SCREEN END OF BLOCK blk_sel.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.

    CHECK screen-group1 EQ 'XXX'.

    CASE p_check.
      WHEN 'X'.

        screen-invisible = 0.

        screen-input     = 1.

        screen-output    = 1.

        screen-active    = 1.

      WHEN OTHERS.

        screen-invisible = 1.

        screen-input     = 0.

        screen-output    = 0.

        screen-active    = 0.

    ENDCASE.

    MODIFY SCREEN.

  ENDLOOP.

Read only

SwarnaliBasu
Participant
0 Likes
1,222

solved the problem, thanks and points awarded