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

Former Member
0 Likes
650

hi all ,

i have two pushbutton like 'display' and 'insert' in selection screen and each have two fields, problem is that i have to hide

one pushbutton and corresponding fields when clicking another . can anyone plz. tell me how could i do ?

regards saurabh .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
631

Hope below example gives you an idea in handling your case:


TABLES sscrfields.

DATA: flag TYPE c.

SELECTION-SCREEN:
   PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
   PUSHBUTTON 12(10) but2 USER-COMMAND cli2 MODIF ID abc.

PARAMETERS: p_text TYPE char10 MODIF ID abc.

AT SELECTION-SCREEN OUTPUT.

  IF NOT flag IS INITIAL.
    LOOP AT SCREEN.
      IF screen-group1 = 'ABC'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
      BREAK-POINT.
    ENDLOOP.

  ENDIF.

AT SELECTION-SCREEN.

  IF sscrfields-ucomm = 'CLI1'.
    flag = 'X'.
  ELSE.
    flag = space.
  ENDIF.

INITIALIZATION.
  MOVE: 'Button1' TO but1,
        'Button2' TO but2.

Though i wonder, when are you going to bring the fields active again.

Regards

Eswar

7 REPLIES 7
Read only

Former Member
0 Likes
631

Hi Saurabh,

You will have to place both the two fields in one group. For example for the insert button fields put the two fields in one group example G1. And then for the other button put the other two fields in one group example G2.

Then in the AT SELECTION-SCREEN ON INPUT use the LOOP AT SCREEN to change the visibility properties of the groups.

I hope this helps.

Read only

Former Member
0 Likes
631

hi,

When 'PUSH1'.

LOOP AT SCREEN.

IF SCREEN-NAME = (Name of push button) or (field1) or (field2) or ....... .

screen-active = 0(or 1; plz check).

modify screen.

endif.

endloop.

Regards,

Nishant

Read only

Former Member
0 Likes
631

Hi ,

USE THIS..

AT SELECTION-SCREEN OUTPUT.

if P_report = 'X'.

loop at screen.

if screen-group1 = 'PTH'.

screen-active = 0.

screen-input = 0.

screen-invisible = 1.

screen-required = 0.

modify screen.

clear screen.

endif.

endloop.

ELSEif P_DOwn = 'X' or P_dw_rp = 'X'.

loop at screen.

if screen-group1 = 'PTH'.

screen-active = 1.

screen-input = 1.

screen-output = 1.

screen-invisible = 0.

*screen-required = 1.

modify screen.

clear screen.

endif.

endloop.

endif.

CHECK ur Fcode..

REWARD IF HELPFUL..

GAURAV J>

Read only

Former Member
0 Likes
632

Hope below example gives you an idea in handling your case:


TABLES sscrfields.

DATA: flag TYPE c.

SELECTION-SCREEN:
   PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
   PUSHBUTTON 12(10) but2 USER-COMMAND cli2 MODIF ID abc.

PARAMETERS: p_text TYPE char10 MODIF ID abc.

AT SELECTION-SCREEN OUTPUT.

  IF NOT flag IS INITIAL.
    LOOP AT SCREEN.
      IF screen-group1 = 'ABC'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
      BREAK-POINT.
    ENDLOOP.

  ENDIF.

AT SELECTION-SCREEN.

  IF sscrfields-ucomm = 'CLI1'.
    flag = 'X'.
  ELSE.
    flag = space.
  ENDIF.

INITIALIZATION.
  MOVE: 'Button1' TO but1,
        'Button2' TO but2.

Though i wonder, when are you going to bring the fields active again.

Regards

Eswar

Read only

Former Member
0 Likes
631

try this out

SELECTION-SCREEN BEGIN OF BLOCK SO WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS:

S_VBELN FOR VBAK-VBELN modif-id g1," Sales order number

S_VBELNP FOR VBKD-BSTKD modif-id g2"PO number

SELECTION-SCREEN END OF BLOCK SO.

*--- EVENT AT SCREEN OUTPUT -


AT SELECTION-SCREEN OUTPUT.

CASE sy-ucomm.

WHEN 'display'.

LOOP AT SCREEN.

CASE SCREEN-GROUP1.

WHEN 'g1'. "Sales order select

SCREEN-ACTIVE = '1'. "1=Active, 0=Don't display

MODIFY SCREEN.

WHEN 'g2'. "Delivery select

SCREEN-ACTIVE = '0'. "1=Active, 0=Don't display

MODIFY SCREEN.

hope u got help

plz reawrd if useful

keep rockin

vivek

Read only

Former Member
0 Likes
631

Hai,have a look on the following code.

if kunnr1 = 'X'.

p_matnr = ' '.

loop at screen.

if screen-group1 = 'ONE'.

screen-input = '1'.

modify screen.

endif.

if screen-group1 = 'TWO'.

screen-input = '0'.

modify screen.

endif.

endloop.

elseif matnr1 = 'X'.

p_kunnr = ' '.

loop at screen.

if screen-group1 = 'TWO'.

screen-input = '1'.

modify screen.

endif.

if screen-group1 = 'ONE'.

screen-input = '0'.

modify screen.

endif.

endloop.

endif.

reward points,if it is helpful.

Thanks,

chandu.

Read only

Former Member
0 Likes
631

Hi,

DATA: flag TYPE c.

SELECTION-SCREEN:

PUSHBUTTON 2(10) but1 USER-COMMAND cli1

MODIF ID abc ,

PUSHBUTTON 12(10) but2 USER-COMMAND cli2

MODIF ID efg.

PARAMETERS: p_text1 TYPE char10 MODIF ID abc,

p_text2 TYPE char10 MODIF ID abc,

p_text1 TYPE char10 MODIF ID efg,

p_text2 TYPE char10 MODIF ID efg.

AT SELECTION-SCREEN OUTPUT.

IF NOT flag IS INITIAL.

LOOP AT SCREEN.

IF screen-group1 = 'ABC'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'EFG'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 = 'ABC'.

screen-active = 0.

MODIFY SCREEN.

ENDIF.

IF screen-group1 = 'EFG'.

screen-active = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

AT SELECTION-SCREEN.

IF sscrfields-ucomm = 'CLI1'.

flag = 'X'.

ELSE.

flag = space.

ENDIF.

INITIALIZATION.

MOVE: 'DISPLAY' TO but1,

'INSERT' TO but2.

Don't foget to reward if useful...