‎2008 Aug 30 12:04 PM
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.
‎2008 Aug 30 12:55 PM
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
‎2008 Aug 30 12:55 PM
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
‎2008 Aug 30 1:01 PM
I have done all this . But when i click on the checkbox it does not remain clicked. The tickmark disappears.
‎2008 Aug 30 5:04 PM
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..
‎2008 Sep 01 5:39 AM
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 INPUTOr 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