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

checkbox

Former Member
0 Likes
779

hi experts,

i have three check boxs for different output display. wht my requirement is if i press one check box ---> execute it have to display customer data like wise different boxes for different output display. how can i do it.

thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
751

Hi,

If you use checkbox there is a possibility of selecting all the three check boxes. Instead of check boxes you can use radio buttons. If your requirment is to use only checkboxes you can use the below code and at any given point of time user has to select only one checkbox that validation can be done in the at selection-screen event.

Below is the full code :

selection-screen begin of block b1 with frame title text-001.

PARAMETERS: c1 AS CHECKBOX DEFAULT ’X’,

c2 as checkbox,

c3 as checkbox.

selection-screen end of block b1.

if c1 = 'X' and c2 = 'X'.

message 'Two checkboxes should not be selected' type 'E'.

elseif c1 = 'X' and C3 = 'X'.

message 'Two checkboxes should not be selected' type 'E'.

elseif c2 = 'X' and C3 = 'X'.

message 'Two checkboxes should not be selected' type 'E'.

elseif C1 = 'X' and C2 = 'X' and C3 = 'X'.

message 'Three checkboxes should not be selected' type 'E'.

endif.

start-of-selection.

If C1 = 'X'.

"Here comes your select statemen to retrive Customer data use perform

elseif C2 = 'X'.

"Here comes your related select statement for second requirement use perform

elseif C3 = 'X'.

"Here comes your related select statement for second requirement use perform.

Endif.

Thanks,

Sriram Ponna.

6 REPLIES 6
Read only

Former Member
0 Likes
751

hi

put three checkboxes on screen. say ch1, ch2, ch3.

in logic,

if ch1 = 'X'.

______

elseif ch2 = 'X'.

___________

else ch3 = 'X'.

_________

endif.

kindly reward if helpful.

regards

Read only

Clemenss
Active Contributor
0 Likes
751

Hi surendra,

what you describe smells like radio buttons.


selection-screen begin of block disp.
parameters:
  p_dis1 type flag radiobutton group disp,
  p_dis2 type flag radiobutton group disp,
  p_dis3 type flag radiobutton group disp.
selection-screen end of block disp.

at selection-screen on block disp.
case 'X'.
  when p_dis1.
* switch to display customer data like wise
  when p_dis2.
* switch for different output display
  when p_dis3.
* switch for different output display
endcase.

Soething like this.

Regards,

Clemens

Read only

Former Member
0 Likes
752

Hi,

If you use checkbox there is a possibility of selecting all the three check boxes. Instead of check boxes you can use radio buttons. If your requirment is to use only checkboxes you can use the below code and at any given point of time user has to select only one checkbox that validation can be done in the at selection-screen event.

Below is the full code :

selection-screen begin of block b1 with frame title text-001.

PARAMETERS: c1 AS CHECKBOX DEFAULT ’X’,

c2 as checkbox,

c3 as checkbox.

selection-screen end of block b1.

if c1 = 'X' and c2 = 'X'.

message 'Two checkboxes should not be selected' type 'E'.

elseif c1 = 'X' and C3 = 'X'.

message 'Two checkboxes should not be selected' type 'E'.

elseif c2 = 'X' and C3 = 'X'.

message 'Two checkboxes should not be selected' type 'E'.

elseif C1 = 'X' and C2 = 'X' and C3 = 'X'.

message 'Three checkboxes should not be selected' type 'E'.

endif.

start-of-selection.

If C1 = 'X'.

"Here comes your select statemen to retrive Customer data use perform

elseif C2 = 'X'.

"Here comes your related select statement for second requirement use perform

elseif C3 = 'X'.

"Here comes your related select statement for second requirement use perform.

Endif.

Thanks,

Sriram Ponna.

Read only

0 Likes
751

but it is not retriving from select statement, we have to display the data which we uploaded to internal table using FM UP_LOAD. this data should we have show if we select the check box and click on execute.

send sample source code please.

thanks for reply

Read only

0 Likes
751

Hi,

selection-screen begin of block disp.

parameters:

p_dis1 type flag radiobutton group disp,

p_dis2 type flag radiobutton group disp,

p_dis3 type flag radiobutton group disp.

selection-screen end of block disp.

selection-screen begin of block disp.

parameters:

p_dis1 type flag radiobutton group disp,

p_dis2 type flag radiobutton group disp,

p_dis3 type flag radiobutton group disp.

selection-screen end of block disp.

START-OF-SELECTION.

IF p_dis1 EQ 'X'.

  • switch to display customer data like wise

LOOP AT itab .

Put " IF " to get customerwise data

ENDLOOP.

ELSEIF p_dis2.

  • switch for different output display

Put " IF " condition to get required result

ELSE.

  • switch for different output display

Put " IF " condition to get required result

ENDIF.

Don't forget to reward if useful.....

.

case 'X'.

when p_dis1.

  • switch to display customer data like wise

when p_dis2.

  • switch for different output display

when p_dis3.

  • switch for different output display

endcase.

Read only

Former Member
0 Likes
751

Hi,

You can use the following code....

if chbox1 = 'X'

Code1 for execution

endif.

if chbox2 = 'X'

Code2 for execution

endif.

if chbox3 = 'X'

Code3 for execution

endif.

If chbox1 is checked then it would hold the value 'X' .

Hence the If statement succeeds and the code inside the if statement is executed .

Similarly if chbox2 is checked then it would hol the value 'X'.

Hence the if statement succeeds and the code inside the if statement is executed.

Similarly for chbox3.

Kindly reward if helpful.

Regards,

Vijay