‎2008 Oct 31 11:22 AM
Hi all,
I am new to dialog programming. I have created a dialog program which is having a screen with two radiobuttons and one push button.
Now Push button is having fun code name- Create
and OK which has name OK_CODE .
I have written following code on PAI MODULE
PROGRAM Z82426_DP_ASSIGN.
data ok_code TYPE sy-ucomm. " command field
data copy_ok_code LIKE ok_code. " copy of ok_code
&----
*& Module USER_COMMAND_9000 INPUT
&----
text
----
module USER_COMMAND_9000 input.
copy_ok_code = OK_CODE.
CLEAR OK_CODE.
OK_CODE = sy-ucomm.
CASE copy_ok_code.
WHEN 'CREATE' .
CALL SCREEN 9010.
ENDCASE.
endmodule. " USER_COMMAND_9000 INPUT
but still pushing the button is not calling any screen.
Can anybody help me?
Regards,
Smita
‎2008 Oct 31 11:41 AM
Hi,
First give a name to the ok_code field in the elements list of the screen, then declare a variable in the program with the same name.
And in PAI write as;
clear copy_ok_code.
copy_ok_code = ok_code.
clear ok_code.
case copy_ok_code.
when 'CREATE'.
call screen 9010.
....
...
...Try this and revert back.
Regards
Karthik D
‎2008 Oct 31 11:26 AM
The OK_CODE should be defined in the Element list of the screen 9000, only then the OK_CODE will have the value 'CREATE', or any other function code.
regards,
Advait
‎2008 Oct 31 11:41 AM
Hi,
First give a name to the ok_code field in the elements list of the screen, then declare a variable in the program with the same name.
And in PAI write as;
clear copy_ok_code.
copy_ok_code = ok_code.
clear ok_code.
case copy_ok_code.
when 'CREATE'.
call screen 9010.
....
...
...Try this and revert back.
Regards
Karthik D
‎2008 Oct 31 12:12 PM
Hi Smita,
Is there any reason to write the code as below
copy_ok_code = OK_CODE.
CLEAR OK_CODE.
OK_CODE = sy-ucomm.
CASE copy_ok_code. ??
Write like this
Data: ok_code like sy-ucomm.
Case ok_code.
When ' create'.
call screen 9010.
endcase.
Cheers!!
VEnk@
‎2008 Oct 31 12:36 PM
Hi venkat,
But sap recommends to use an intermediate variable to store and branch user commands. Also it will avoid unnecessary retention of a Function code in the ok_code variable.
For example in some cases after pressing a button and then when you press Enter or do any other action the Fcode of the button will be passed, so the above code will avoid that situation.
You can verify the same in all the example code given in ABAPDOCU.
Regards
Karthik D
‎2008 Oct 31 1:57 PM
Hi Karthik,
Thanks for the information. I am accepting your suggestion.
And i will try to implement the concept when i am in use of the discussed concept.
Thanks once again.
Cheers!!
VEnk@
‎2008 Nov 04 11:32 AM
Hi,
If you got the solution please mark the question as answered.
Regards
Karthik D
‎2008 Nov 05 9:01 AM
Hi Smita,
Have you declared the OK_CODE field in the screen 9000? The rest of the code seemed fine.
Just put a debug point and see what exactly is going on.
You can also have a look at the following demo ABAP reports which is handling the same Function Code.
DEMO_DYNPRO_PUSH_BUTTON.
Search SE38 with DYNPRO and you will get all the example code for the dynpro programing.
Hope this will help.
Thanks,
Samantak.