Application Development 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: 

Need to hide the parameter based on radio button

vijy_mukunthan
Active Contributor
0 Kudos

hi friends

I have a requirement that when the person select the radio button based on the radio button selection the parameter should be disabled. Can any one tell me with a sample code.

I have 2 radio button and 4 parameters. if 1st radio button selects the 1st parameter field alone should disable all other field should be enabled.

Regards

vijay

4 REPLIES 4

former_member181995
Active Contributor
0 Kudos

PS:Do not reward for this easy finding information.

just refer:

JozsefSzikszai
Active Contributor
0 Kudos

hi Vijay,

pls. have a look at the following sample:

PARAMETERS : p_rb1 RADIOBUTTON GROUP 1 DEFAULT 'X' USER-COMMAND uc01,
             p_rb2 RADIOBUTTON GROUP 1,
             p_1 TYPE bkpf-bukrs MODIF ID 001,
             p_2 TYPE bkpf-bukrs,
             p_3 TYPE bkpf-bukrs,
             p_4 TYPE bkpf-bukrs.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    CASE 'X'.
      WHEN p_rb1.
        CHECK screen-group1 EQ '001'.
        screen-input = '0'.
      WHEN p_rb2.
        CHECK screen-group1 EQ '001'.
        screen-input = '1'.
    ENDCASE.
    MODIFY SCREEN.
  ENDLOOP.

hope this helps

ec

0 Kudos

hi friends

I worte the code to disable the parameter field according to the selection. its working fine but below the code is not working.

This is my code.

START-OF-SELECTION.

DATA : BEGIN OF ITAB1 OCCURS 0,

BEGDA LIKE P0006-BEGDA,

ENDDA LIKE P0006-ENDDA,

END OF ITAB1.

DATA : IT_HR LIKE ZNOC_FVISIT OCCURS 0 WITH HEADER LINE .

DAT1 = SY-DATUM.

TIM1 = SY-UZEIT.

CONCATENATE DAT1+6(2) '.'

DAT1+4(2) '.'

DAT1+(4) '_'

TIM1+(2) ':'

TIM1+4(2) ':'

TIM1+2(2) INTO ZKEY .

AT SELECTION-SCREEN OUTPUT.

IF NEW = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'ZKEY'.

SCREEN-INPUT = 0.

  • SCREEN-REQUIRED = 0.

MODIFY SCREEN.

  • SCREEN-ACTIVE = 1.

ENDIF.

ENDLOOP.

SELECT SINGLE BEGDA ENDDA INTO ITAB1 FROM PA0006 WHERE PERNR = PERNR.

IT_HR-ZKEY = ZKEY .

IT_HR-ZPERNR = PERNR .

IT_HR-ZSYSDATE = SY-DATUM.

IT_HR-ZBEGDA = ITAB1-BEGDA.

IT_HR-ZENDDA = ITAB1-ENDDA.

IT_HR-ZHR_PERNR = P_HPERNR.

IT_HR-ZDESGINATION = P_DTEXT.

APPEND IT_HR.

INSERT INTO ZNOC_FVISIT VALUES IT_HR.

ENDIF.

My key field is disabled. But my key does not fetch any values and its does not enter the value on the table. Since my table is based on the key field. No value is getting in the key.

Regards

vijay

vijy_mukunthan
Active Contributor
0 Kudos

problem sloved by changing the code.

Regards

vijay