2006 Dec 13 7:35 AM
Dear Friends,
Please let me know the way to use check-box / radio-button control in dialog programs. Where & how to define them & write the logic.
If possible provide a small example.
Regards,
Alok.
Dear Friends,
Please let me know the way to use check-box / radio-button control in dialog programs. Where & how to define them & write the logic.
If possible provide a small example.
Regards,
Alok.
2006 Dec 13 7:38 AM
2006 Dec 13 9:54 AM
Hi,
DATA: radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
field1(10) TYPE c, field2(10) TYPE c, field3(10) TYPE c,
box TYPE c.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
CALL SCREEN 100.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'RADIO'.
IF radio1 = 'X'.
field1 = 'Selected!'.
CLEAR: field2, field3.
ELSEIF radio2 = 'X'.
field2 = 'Selected!'.
CLEAR: field1, field3.
ELSEIF radio3 = 'X'.
field3 = 'Selected!'.
CLEAR: field1, field2.
ENDIF.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
2006 Dec 13 9:58 AM
Hi,
goto tcode abapdocu.. abap user dialogs - screens-processing screens you will get examples for all --pushbutt6ons radiobutton checkboxes everything
<b>here is a sample code for you</b>
PROGRAM demo_dynpro_check_radio .
DATA: radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
field1(10) TYPE c, field2(10) TYPE c, field3(10) TYPE c,
box TYPE c.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
CALL SCREEN 100.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'RADIO'.
IF radio1 = 'X'.
field1 = 'Selected!'.
CLEAR: field2, field3.
ELSEIF radio2 = 'X'.
field2 = 'Selected!'.
CLEAR: field1, field3.
ELSEIF radio3 = 'X'.
field3 = 'Selected!'.
CLEAR: field1, field2.
ENDIF.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.<b>flow logic:</b>
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
MODULE user_command_0100.regards,
pankaj singh.
<i><b>
reward if helpful</b></i>
2006 Dec 13 11:44 AM
Please check demo_dynpro_check_radio.
1. Create program in SE38 type module pool
2. Go to SE51 give the program name and screen number then Layout Editor in drag the Check box/Radio Button and drop in form. Give the Check box name and Function code and continue same process for Radio Buttons.
3. Radio Buttons should be group them that time you give the function code of Group radio buttons.
4. Select all the radio buttons then go to Menu bar --> EDIT grouping Define the radio buttons
4. Radio buttons names and Checkboxes name should be declare the char 1 in SE38.
Code
DATA: radio1(1), radio2(1),
check1(1),check2(1).
CALL SCREEN 100.
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'RADIO'.
IF radio1 = 'X'.
Some statements.
ELSEIF radio2 = 'X'.
Some statements.
ENDIF.
WHEN 'CHECK'.
Some statements.
ENDCASE.
ENDMODULE.
Flow logic:
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
MODULE user_command_0100.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |