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: 

selection-screen (Checkbox)

Former Member
0 Kudos

Hi all,

I want to have the following functionality,

First i want to display only 5 check boxes .

Suppose i click on one checkbox it will show me three parameters.

suppose i click on second it will show me the respective parameters.

I want to handle event on the checkbox.

Thank you.

1 ACCEPTED SOLUTION

varma_narayana
Active Contributor
0 Kudos

Hi..

Check the Following program using Radiobuttons and Accordingly convert the Same using Checkboxes.

REPORT ZSEL_RADIO1 .

TABLES SSCRFIELDS .

DATA : VCOMM TYPE SSCRFIELDS-UCOMM.

PARAMETERS: P_CH1 AS CHECKBOX USER-COMMAND CB1.

PARAMETERS: P_CH2 AS CHECKBOX USER-COMMAND CB2.

PARAMETERS: P_FIELD1 TYPE I MODIF ID ABC.

PARAMETERS: P_FIELD2 TYPE I MODIF ID ABC.

AT SELECTION-SCREEN.

VCOMM = SSCRFIELDS-UCOMM.

AT SELECTION-SCREEN OUTPUT.

CASE VCOMM.

WHEN 'CB1'.

IF CH1 = ' '.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INVISIBLE = 0.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF CH1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INVISIBLE = 0.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

WHEN 'CB2'.

ENDCASE.

<b>Reward if Helpful</b>

7 REPLIES 7

Former Member
0 Kudos

Hi,

to see the functionality of the check box event

goto tcode abapdocu.

select ABAP User Dialogs ->Screens ->Processing Screens ->Checkboxes and radio buttons .

<b>reward if helpful</b>

rgds,

bharat.

Former Member
0 Kudos

Do you mean if we have 5 parameter and you click one one check box,those respective parameters shud get enabled and othrs disabled?

0 Kudos

ya thats true...i want that..

0 Kudos

Hi Pathak

use at selection-screen output event.

at selection-screen output.

if c1 = 'X'.

LOOP AT SCREEN.

CASE SCREEN-NAME.

WHEN 'P1'.

SCREEN-ACTIVE = '0'. 'HERE I AM DISABLING FIRST PARAMETER (P1 IS A PARAMETER NAME)

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

if c2 = 'X'.

LOOP AT SCREEN.

CASE SCREEN-NAME.

WHEN 'P2'.

SCREEN-ACTIVE = '0'.'HERE I AM DISABLING SECOND PARAMETER

MODIFY SCREEN.

ENDCASE.

ENDLOOP.

reward points to all helpful answers

kiran.M

Former Member
0 Kudos

This is not possible with checkboxes alone.

You have to use button to get action of the related checkbox. For each checkbox, provide one button.And at the event of button, you can write the required code.

<i><b>Reward if helpful.</b></i>

Former Member
0 Kudos

hi dear,

first declare the check box and define function code for the check box as given below:

PARAMETERS: p_alvrep as checkbox default ' ' user-command check.

when you tick the check box it ll tigger at selection-screen output.

loop at screen.

if screen-name = 'S_REGION-LOW'.

if p_alvrep = 'X'.

screen-ACTIVE = 0.

refresh S_REGION.

else.

screen-ACTIVE = 1.

endif.

modify screen.

endif.

it helpful reward the points.

varma_narayana
Active Contributor
0 Kudos

Hi..

Check the Following program using Radiobuttons and Accordingly convert the Same using Checkboxes.

REPORT ZSEL_RADIO1 .

TABLES SSCRFIELDS .

DATA : VCOMM TYPE SSCRFIELDS-UCOMM.

PARAMETERS: P_CH1 AS CHECKBOX USER-COMMAND CB1.

PARAMETERS: P_CH2 AS CHECKBOX USER-COMMAND CB2.

PARAMETERS: P_FIELD1 TYPE I MODIF ID ABC.

PARAMETERS: P_FIELD2 TYPE I MODIF ID ABC.

AT SELECTION-SCREEN.

VCOMM = SSCRFIELDS-UCOMM.

AT SELECTION-SCREEN OUTPUT.

CASE VCOMM.

WHEN 'CB1'.

IF CH1 = ' '.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INVISIBLE = 0.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF CH1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-INVISIBLE = 0.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

WHEN 'CB2'.

ENDCASE.

<b>Reward if Helpful</b>