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

Need help to disable inputs at selection-screen

Former Member
0 Likes
1,868

Hi,

I have 2 selection screen as follows:

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.

PARAMETERS: pfile1 TYPE string OBLIGATORY DEFAULT text-003,

pfile2 TYPE string OBLIGATORY DEFAULT text-003,

pfile3 TYPE string OBLIGATORY DEFAULT text-003.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-019.

PARAMETERS:p_upld TYPE char1 AS CHECKBOX,

pfile TYPE string OBLIGATORY DEFAULT text-003.

SELECTION-SCREEN END OF BLOCK b4.

Now when p_upld is 'X' I want to disable entire BLOCK b3 ...how to do it...

I am trying as follows...not working:

IF p_upld IS NOT INITIAL.

LOOP AT SCREEN.

IF SCREEN-NAME = 'PFILE1'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF SCREEN-NAME = 'PFILE2'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF SCREEN-NAME = 'PFILE3'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,822

Hello Guys,

But i doubt this will not work because the OP has declared the elements of Block B3 as OBLIGATORY.

If you declare the elements as obligatory i think you cannot hide them. May be i am wrong, please correct me in that case.

BR,

Suhas

Hi,

I have 2 selection screen as follows:

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.

PARAMETERS: pfile1 TYPE string OBLIGATORY DEFAULT text-003,

pfile2 TYPE string OBLIGATORY DEFAULT text-003,

pfile3 TYPE string OBLIGATORY DEFAULT text-003.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-019.

PARAMETERS:p_upld TYPE char1 AS CHECKBOX,

pfile TYPE string OBLIGATORY DEFAULT text-003.

SELECTION-SCREEN END OF BLOCK b4.

Now when p_upld is 'X' I want to disable entire BLOCK b3 ...how to do it...

I am trying as follows...not working:

IF p_upld IS NOT INITIAL.

LOOP AT SCREEN.

IF SCREEN-NAME = 'PFILE1'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF SCREEN-NAME = 'PFILE2'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

LOOP AT SCREEN.

IF SCREEN-NAME = 'PFILE3'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

15 REPLIES 15
Read only

Former Member
0 Likes
1,822

Hi,


at selection-screen output.

IF p_upld IS NOT INITIAL.

LOOP AT SCREEN.
  IF SCREEN-NAME = 'PFILE1'
    OR SCREEN-NAME = 'PFILE2'
    OR SCREEN-NAME = 'PFILE3'  
    screen-input = 0.
    MODIFY SCREEN.
  ENDIF.
ENDLOOP.

ENDIF.

Regards Marcel

Edited by: MarcelKucharek on Feb 24, 2010 8:59 AM

Read only

Former Member
0 Likes
1,822

Hi,

Use this


"Note the use of MODIF ID
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
  PARAMETERS: P_EBELN TYPE EKKO-EBELN MODIF ID S1 AS LISTBOX VISIBLE 
  LENGTH 20,
              P_OPNUM(5) TYPE C MODIF ID S1.   
SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-T02.
PARAMETERS: p_upld TYPE char1 AS CHECKBOX MODIF ID S2.
  PARAMETERS: P_MATNR TYPE MARA-MATNR MODIF ID S2,
              P_WERKS TYPE EKPO-WERKS MODIF ID S2.
SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN OUTPUT.
IF p_upld = 'X'.
LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'S2'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

ENDIF.

Read only

Former Member
0 Likes
1,822

Hi,

AT SELECTION SCREEN.

IF p_upld = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'PFILE1'

OR SCREEN-NAME = 'PFILE2'

OR SCREEN-NAME = 'PFILE3'

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Read only

0 Likes
1,822

Hi SomyaP,

please do not duplicate my code.

Marcel

Read only

0 Likes
1,822

Hi All,

The above suggestions not working.

Read only

0 Likes
1,822

try this change.

CS instead of EQ


at selection-screen output.
 
IF p_upld IS NOT INITIAL.
 
LOOP AT SCREEN.
  IF SCREEN-NAME CS 'PFILE1'
    OR SCREEN-NAME CS 'PFILE2'
    OR SCREEN-NAME CS 'PFILE3' .
    screen-input = 0.
    MODIFY SCREEN.
  ENDIF.
ENDLOOP.
 
ENDIF.

Edited by: MarcelKucharek on Feb 24, 2010 10:45 AM

Read only

0 Likes
1,822

>

> Hi All,

>

> The above suggestions not working.

Hi, Ginger

Please Check the bellow code it is working fine for me.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
PARAMETERS: pfile1 TYPE string  DEFAULT text-003 MODIF ID aaa, " USE Modif ID
            pfile2 TYPE string  DEFAULT text-003 MODIF ID aaa,
            pfile3 TYPE string  DEFAULT text-003 MODIF ID aaa.
SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-019.
PARAMETERS: p_upld TYPE char1 AS CHECKBOX USER-COMMAND uc, " USE This USER-COMAND
            pfile TYPE string DEFAULT text-003.
SELECTION-SCREEN END OF BLOCK b4.

AT SELECTION-SCREEN OUTPUT.
  IF p_upld = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'AAA'.
        screen-active = 0.
        MODIFY SCREEN .
      ENDIF.
    ENDLOOP.
  ENDIF.

Best Regards,

Faisal

Read only

0 Likes
1,822

Dear Ginger,

Faisal code is working correctlyvexcept displaying message when any of the field in first block empty.

PF below code. It generates a message when checkbox is not selected and all fields are empty in 1st block And secondly when checkbox is selected it makes them invisible .

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
PARAMETERS: param1 TYPE string  DEFAULT text-003 MODIF ID aaa, " USE Modif ID
            param2 TYPE string  DEFAULT text-003 MODIF ID aaa,
            param3 TYPE string  DEFAULT text-003 MODIF ID aaa.
SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-019.
PARAMETERS: p_upld TYPE char1 AS CHECKBOX,
            param4 TYPE string DEFAULT text-003.
SELECTION-SCREEN END OF BLOCK b4.

AT SELECTION-SCREEN OUTPUT.
  if p_upld ne 'X'.
    if param1 is INITIAL or param2 is INITIAL or param3 is INITIAL. "For Displaying Message
*      MESSAGE E000(zmsg).
      MESSAGE 'Enter all Parameters in first block' type 'S'.
    endif.
 endif.
  IF p_upld = 'X'.

    LOOP AT SCREEN.
      IF screen-group1 = 'AAA'.
        screen-input = 0.
        MODIFY SCREEN .
      ENDIF.
    ENDLOOP.
  ENDIF.

START-OF-SELECTION. "Use for displaying output
  write 'hi'.

Regards,

Apoorv

.

Read only

0 Likes
1,822

I have a question about the code in this specific posting. Can code be used to make it automatic? I used the code in this post and it does work if you press the enter key but is there a way for parameters to appear and disappear based on pressing the radio button only and not in conjunction with pressing enter?

Thanks

Read only

0 Likes
1,822

Hi ,

Please search before posting

check link:[http://www.sdn.sap.com/irj/scn/advancedsearch?query=atselectionscreenoutputradio+button]

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,822

PARAMETERS:p_upld TYPE char1 AS CHECKBOX USER-COMMAND ABC. "try adding this.

at selection-screen output.

IF p_upld = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'PFILE1'.

screen-input = 0.

MODIFY SCREEN.

elseif SCREEN-NAME = 'PFILE2'.

screen-input = 0.

MODIFY SCREEN.

elseif SCREEN-NAME = 'PFILE3'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,823

Hello Guys,

But i doubt this will not work because the OP has declared the elements of Block B3 as OBLIGATORY.

If you declare the elements as obligatory i think you cannot hide them. May be i am wrong, please correct me in that case.

BR,

Suhas

Read only

0 Likes
1,822

Thats Right ... I didnt see that ...!!!

Read only

0 Likes
1,822

Hi Suhas,

You are right...It won't work.

Regards,

Nagaraj

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,822

Hello,

I think if you make the elements as non-obligatory & add the MODIF-ID to the BEGIN OF BLOCK you have hide the block directly.

@Ginger: You have to make the 3 params inside the block B3 non-mandatory & do the validations in your START-OF-SELECTION or AT SELECTION-SCREEN event.

BR,

Suhas