‎2008 Jan 20 12:30 PM
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.
‎2008 Jan 20 6:07 PM
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.
‎2008 Jan 20 12:49 PM
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
‎2008 Jan 20 3:51 PM
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
‎2008 Jan 20 6:07 PM
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.
‎2008 Jan 21 5:13 AM
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
‎2008 Jan 21 5:29 AM
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.
‎2008 Jan 21 6:05 AM
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