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 in dialog program

Former Member
0 Likes
2,735

In the screen , i want to use checkbox. But at runtime when i click on the checkbox , it does not appear as checked. The tick mark on this checkbox disappears. And if i want to code something when this checkbox is clicked , then if i do it as:

write MODULE CHECK in the PAI and then write case sy-ucomm . is it OK.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,480

Hi priti suryawanshi,

Design ur screen using screen painter (Tcode SE51)

then put check box in the screen...

Assign Function Code for that checkbox from the properties of the checkbox..

Lets Function code for check box is 'CHK' and Screen no is 100.

Now in Flow logic for the screen

In PAI

Write a code like in MODULE USER_COMMAND_0100 INPUT.



CASE SY-UCOMM.
WHEN 'CHK'. " here CHK is the Function code for check box and it's case sensitive so mst be in upper case...
MESSAGE 'check box clicked' TYPE 'I'.
*Write your logic here...
ENDCASE.

Activate Screen and whole program and then execute it...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

4 REPLIES 4
Read only

Former Member
0 Likes
1,481

Hi priti suryawanshi,

Design ur screen using screen painter (Tcode SE51)

then put check box in the screen...

Assign Function Code for that checkbox from the properties of the checkbox..

Lets Function code for check box is 'CHK' and Screen no is 100.

Now in Flow logic for the screen

In PAI

Write a code like in MODULE USER_COMMAND_0100 INPUT.



CASE SY-UCOMM.
WHEN 'CHK'. " here CHK is the Function code for check box and it's case sensitive so mst be in upper case...
MESSAGE 'check box clicked' TYPE 'I'.
*Write your logic here...
ENDCASE.

Activate Screen and whole program and then execute it...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Read only

0 Likes
1,480

I have done all this . But when i click on the checkbox it does not remain clicked. The tickmark disappears.

Read only

0 Likes
1,480

Did you declare the field in your program which you assigned it as checkbox in the screen painter.

if not it will always be initial.

declare a Global variable , and use it in your screen design while creating the checkbox.

Then try..

Read only

Former Member
0 Likes
1,480

Hi priti suryawanshi,

Use below code...

DATA : CHEK1 TYPE C. " here CHEK1 is same as the name property of Check box in screen painter...

MODULE USER_COMMAND_0100 INPUT.
  CASE SY-UCOMM.
    WHEN 'CHK'. " here CHK is the Function code for check box and it's case sensitive so mst be in upper case...
      MESSAGE 'check box clicked' TYPE 'I'.

*Write your logic here...

      SCREEN-INPUT = 1.
      

CHEK1 = 'X'. " ==> To Keep the checkbox ticked... Use this as and when u require 
*      CHEK1 = 'X' ==> For Ticked Checkbox & CHEK1 = SPACE ==> For Unticked Checkbox
      
MODIFY SCREEN.

      WHEN 'EXIT'.
        LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT

Or u can design your selection screen and call it as a subscreen in your modulepool screen and you can achieve it... As I am not getting ny propery for checkbox to be ticked in screen painter properties...

Upper code shows the logic u need to apply as and when it's required... user X or SPACE value as per your need...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7