09-21-2007 7:42 AM
hi all,
I am working on a module pool prog . There is a single screen 0900 on which i have a checkbox 'CHK' and two input fields 'IP1' and 'IP2'.
I have a requirement where i need an event to occur immediately on checking the checkbox on screen without the press of any key.
Also i have a separate requirement where i need that the data entered into IP1 is immediately copied to IP2 without pressing enter or any other key.
Points assured
thanks in advance
09-21-2007 8:49 AM
You open your screen using the screen painter - and assign a Function Code to your checkbox. ( say U attach fcode "CLIK" to it.)
(You can attach it from Mod groups/ Fucntion tabs of your screen painter also - in case your dont want to open the graphical editor)
So when the user clicks on the Checkbox , the PAI of the screen will automatically be invoked with function code 'CLIK'.
09-21-2007 7:46 AM
09-21-2007 7:55 AM
thanks sreejith for your reply but i am not able to figure out how to use this function module..
can you please send some sample code as to how to use this.
thanks
09-21-2007 8:49 AM
You open your screen using the screen painter - and assign a Function Code to your checkbox. ( say U attach fcode "CLIK" to it.)
(You can attach it from Mod groups/ Fucntion tabs of your screen painter also - in case your dont want to open the graphical editor)
So when the user clicks on the Checkbox , the PAI of the screen will automatically be invoked with function code 'CLIK'.
09-21-2007 10:06 AM
i've awarded the points..
thanks SKC that solved half of my problem regarding that check box.
Could you please provide some help for the other half i.e. I have two input fields on a screen and the requirement is such that when i enter anything into input field 1 it should immediately be copied to field 2 also without pressing any key .
more points assured
thanks in advance
09-21-2007 10:34 AM
Punnit,
You are using simple textboxes of the screen painter right ? So when you are typing something in Textbox1, SAP has not provided any event for tracking the same. When you complete the typing and press enter or any other key then only processing starts. You can check it ur self - turn ur debugger on and type something in any textbox of any program - u ll see the debugger is not getting activated - it does when you press a button or double click or something like that.
So you will have to atleat press an ENTER process ur codes. the conventional way is to handle it using a CHAIN ENDCHAIN statement. You can refer to the HELP for the same.
or you can handle it simply in the PAI under the FCODE for enter , effect will be the same.
09-21-2007 10:56 AM
well SKC cud u plz tell what exactly is the syntax for copying the contents of input field1 to input field2.
thanks
09-21-2007 11:19 AM
U have defined it in the Screen Painter, Say its name is T1 and the second one is T2.
In your main prog , declare them as data ( if you have referenced a data element or table field - keep the type as same).
so syntax is
Data : T1 type char20,
T2 type char20.
then go to the Flow Logic tab, u ll find PBO and PAI events of the screen. Create the PAI module and inside it u can wtite
T2 = T1, may be u ll be having a few conditions on which value of t2 will take value of t1 -- u can put those logic there.
For further helps, open any standard program say SE38 itslef and click on the screen number and see the codes. U ll understand by urself.
OK ?
09-21-2007 11:32 AM
well SKC when i am doing INPUT2 = INPUT1, it is simply showing the text 'INPUT1' in the input field2 and INPUT1 is blank. Also when i enter any data into input1 input2 doesnt change..
please help
thanks
09-21-2007 11:42 AM
well there was some other problem due to which i was not getting the required result. Now i have resolve that and my problem is solved.
thanks
i'll reward the points