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

Using CheckBox / Radio-Button Control in Dialog Program

Former Member
0 Likes
1,319

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.

4 REPLIES 4
Read only

Former Member
0 Likes
783

chk this demo program

DEMO_DYNPRO_CHECK_RADIO

Read only

Former Member
0 Likes
783

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.

Read only

Former Member
0 Likes
783

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>

Read only

Former Member
0 Likes
783

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.