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

Former Member
0 Likes
772

Hello all,

Am trying to get the selection screen such a way like ' By selecting the first radio button 'second radio button block' should be disable mode and first 'radio button block' should be enabled And if suppose i select secound Radio button '2nd radio button block' should be enabled and 'first radio button block' should be Disabled" the Blocks contains some select-option parameters .

I tried the below code but not getting exact one. please HELP ME ON BELOW.

REPORT Z_ST.

TABLES:KNA1,LFA1.

DATA:V TYPE C VALUE '1'.

parameter:cust radiobutton group g1 .

selection-screen:begin of block B1 WITH FRAME TITLE TEXT-004.

SELECT-OPTIONS:S_CUST FOR KNA1-KUNNR MODIF ID G1.

SELECTION-SCREEN END OF BLOCK B1.

parameter:vend radiobutton group g1.

selection-screen:begin of block B2 WITH FRAME TITLE TEXT-003.

SELECT-OPTIONS:S_VEND FOR LFA1-LIFNR MODIF ID G2.

SELECTION-SCREEN END OF BLOCK B2.

START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.

*IF V EQ 1.

IF CUST EQ 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'G2'.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ELSE.

SCREEN-ACTIVE = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'G1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ELSE.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

*ENDIF.

THANKS IN ADVANCE

1 ACCEPTED SOLUTION
Read only

faisalatsap
Active Contributor
0 Likes
612

Hi, Sunny,

Test the following Code now it is working Fine now.

TABLES:kna1,lfa1.
DATA:v TYPE c VALUE '1'.

PARAMETER:cust RADIOBUTTON GROUP g DEFAULT 'X' USER-COMMAND a .
PARAMETER:vend RADIOBUTTON GROUP g.

SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
SELECT-OPTIONS:s_cust FOR kna1-kunnr MODIF ID g1.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
SELECT-OPTIONS:s_vend FOR lfa1-lifnr MODIF ID g2.
SELECTION-SCREEN END OF BLOCK b2.

START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.
*IF V EQ 1.
*  BREAK-POINT.
  IF cust EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'G2'.
        screen-active = '0'.
        MODIFY SCREEN.
*      ELSE.
*        screen-active = '0'.
*        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'G1'.
        screen-active = '0'.
        MODIFY SCREEN.
*      ELSE.
*        screen-active = '0'.
*        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Test the following Too.

 TABLES:kna1,lfa1.
DATA:v TYPE c VALUE '1'.

PARAMETER:cust RADIOBUTTON GROUP g DEFAULT 'X' USER-COMMAND a .

SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
SELECT-OPTIONS:s_cust FOR kna1-kunnr MODIF ID g1.
SELECTION-SCREEN END OF BLOCK b1.

PARAMETER:vend RADIOBUTTON GROUP g.
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
SELECT-OPTIONS:s_vend FOR lfa1-lifnr MODIF ID g2.
SELECTION-SCREEN END OF BLOCK b2.

START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.
*IF V EQ 1.

  IF cust EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'G2'.
*        screen-active = '0'.
        Screen-input = '0'.
        MODIFY SCREEN.
*      ELSE.
*        screen-active = '0'.
*        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'G1'.
*        screen-active = '0'.
        Screen-input = '0'.
        MODIFY SCREEN.
*      ELSE.
*        screen-active = '0'.
*        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
*ENDIF.  

Please Reply if any Issue,

Kind Regards,

Faisal

5 REPLIES 5
Read only

Former Member
0 Likes
612

Hi,

First your code for screen changes should be before start of selection.Then try out the below code.

IF CUST EQ 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'G1'.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

endif.

IF screen-group = 'G2'.

screen-active = 0.

modify screen.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'G1'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

if screen-group = 'G2'.

screen-active = 1.

modify screen.

endif.

ENDLOOP.

ENDIF.

Thanks,

Srilakshmi.

Read only

faisalatsap
Active Contributor
0 Likes
613

Hi, Sunny,

Test the following Code now it is working Fine now.

TABLES:kna1,lfa1.
DATA:v TYPE c VALUE '1'.

PARAMETER:cust RADIOBUTTON GROUP g DEFAULT 'X' USER-COMMAND a .
PARAMETER:vend RADIOBUTTON GROUP g.

SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
SELECT-OPTIONS:s_cust FOR kna1-kunnr MODIF ID g1.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
SELECT-OPTIONS:s_vend FOR lfa1-lifnr MODIF ID g2.
SELECTION-SCREEN END OF BLOCK b2.

START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.
*IF V EQ 1.
*  BREAK-POINT.
  IF cust EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'G2'.
        screen-active = '0'.
        MODIFY SCREEN.
*      ELSE.
*        screen-active = '0'.
*        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'G1'.
        screen-active = '0'.
        MODIFY SCREEN.
*      ELSE.
*        screen-active = '0'.
*        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Test the following Too.

 TABLES:kna1,lfa1.
DATA:v TYPE c VALUE '1'.

PARAMETER:cust RADIOBUTTON GROUP g DEFAULT 'X' USER-COMMAND a .

SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
SELECT-OPTIONS:s_cust FOR kna1-kunnr MODIF ID g1.
SELECTION-SCREEN END OF BLOCK b1.

PARAMETER:vend RADIOBUTTON GROUP g.
SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
SELECT-OPTIONS:s_vend FOR lfa1-lifnr MODIF ID g2.
SELECTION-SCREEN END OF BLOCK b2.

START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.
*IF V EQ 1.

  IF cust EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'G2'.
*        screen-active = '0'.
        Screen-input = '0'.
        MODIFY SCREEN.
*      ELSE.
*        screen-active = '0'.
*        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'G1'.
*        screen-active = '0'.
        Screen-input = '0'.
        MODIFY SCREEN.
*      ELSE.
*        screen-active = '0'.
*        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
*ENDIF.  

Please Reply if any Issue,

Kind Regards,

Faisal

Read only

Former Member
0 Likes
612

Hai Sudheer,

Kindly check the following link.Definitely it will solve your problem.

[;

Regards

Read only

Former Member
0 Likes
612

REPORT Z_ST.

TABLES:KNA1,LFA1.

DATA:V TYPE C VALUE '1'.

****Change as follows

parameter:cust radiobutton group g1 DEFAULT 'X'. -


Add DEFAULT

selection-screen:begin of block B1 WITH FRAME TITLE TEXT-004.

SELECT-OPTIONS:S_CUST FOR KNA1-KUNNR MODIF ID G1.

SELECTION-SCREEN END OF BLOCK B1.

          • If only S_CUST field in group, then you can avoid modif id.

parameter:vend radiobutton group g1.

selection-screen:begin of block B2 WITH FRAME TITLE TEXT-003.

SELECT-OPTIONS:S_VEND FOR LFA1-LIFNR MODIF ID G2.

SELECTION-SCREEN END OF BLOCK B2.

          • If only S_VEND field in group, then you can avoid modif id.

START-OF-SELECTION.

AT SELECTION-SCREEN OUTPUT.

IF CUST EQ 'X'.

LOOP AT SCREEN.

                  • See changed code

IF ( SCREEN-NAME = 'S_CUST-LOW' or SCREEN-NAME = 'S_CUST-HIGH' ). ** Add for text *****after debugging

SCREEN-ACTIVE = '1'.

ELSE.

SCREEN-ACTIVE = '0'.

ENDIF.

MODIFY SCREEN

ENDLOOP.

ELSE.

LOOP AT SCREEN.

                  • See changed code

IF ( SCREEN-NAME = 'S_VEND-LOW' or SCREEN-NAME = 'S_VEND-HIGH' ). ** Add for text

SCREEN-ACTIVE = '1'.

ELSE.

SCREEN-ACTIVE = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

Hope this helps you.

Regards,

Anil

Read only

Former Member
0 Likes
612

Hi,

Just copy, paste and execute.

It is same as ur requirement.

TABLES : mara,marc.

*******************************************************************************************

************************Selection screen fields******************************************

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

PARAMETERS : p_meth1 RADIOBUTTON GROUP g1 USER-COMMAND g1,

p_meth2 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK matnr

WITH FRAME TITLE text-002.

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS : so_matnr FOR marc-matnr MODIF ID m1.

SELECTION-SCREEN SKIP 1.

SELECT-OPTIONS : so_werks FOR marc-werks MODIF ID m1 .

SELECTION-SCREEN END OF BLOCK matnr.

SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME TITLE text-003.

SELECTION-SCREEN SKIP 1.

PARAMETERS: p_fpath TYPE ibipparms-path MODIF ID m2 LOWER CASE.

SELECTION-SCREEN END OF BLOCK file.

SELECTION-SCREEN BEGIN OF BLOCK date WITH FRAME TITLE text-004.

SELECTION-SCREEN SKIP 1.

PARAMETERS : p_date TYPE datuv. "CCT51576.

SELECTION-SCREEN END OF BLOCK date.

***************************************************************************************

***********************Screen Validation*********************************************

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

CASE screen-group1.

WHEN 'M1'.

IF p_meth1 <> 'X'.

screen-active = 1.

ENDIF.

IF p_meth2 = 'X'.

screen-active = 0.

ENDIF.

WHEN 'M2'.

IF p_meth2 = 'X'.

screen-active = 1.

ELSE.

screen-active = 0.

ENDIF.

IF p_meth1 = 'X'.

screen-active = 0.

ENDIF.

ENDCASE.

MODIFY SCREEN.

ENDLOOP.