05-07-2007 5:18 AM
HI
Friends.
I am practising simple dialog programming exercise.
where i have one push button and one input/ output box.
i want to print some message in in/op box when i click push button.
can any one please tell me what should i write in properties for push buttons , i.e. Name , text and Function code.
also what should be the properties for ip/op box ? i.e Name and text.
the problem is when i execute it . it says that
"Input/output field OKCODE and key word are not of the same type."
points will be awarded.
Cheers
troy.
can anyone please send me link where i can have snapshots for dynpro and can learn in depth from there.
05-07-2007 5:26 AM
hi
the programmjng line that i have written in module pool is
if okcode = 'click'.
text1 = ' hello how are you'
endif.
in top include its
data : okcode(10) tyep c,
text1(20) type c.
05-07-2007 5:56 AM
put like this
Data: okcode like sy-ucomm.
it should be 4 char length.
Regards
Prabhu
05-07-2007 6:52 AM
Hi Troy,
here are some inputs which might help you.....
1. u shud always give the okcode in CAPITAL LETTERS when you check for
the same. like inyour case if okcode = 'CLICK'.
2. You can better define the okcode as
DATA: OK_CODE LIKE SY-UCOMM. (In this case maxm. length will be 20
characters)
In the element list of the screen you have to include the OK_CODE (Hope u
have done this)
Hope this inputs will help you.
Anil
05-07-2007 5:34 AM
Hi ,
Check this link for dialog programming.
http://sap.niraj.tripod.com/id25.html
The name of the input/output field inthe screen and program should match.
IF the functioncode of the pushbutton is say 'RESULT'
Then in the module user_command
you should check like
Case ok_code.
when 'RESULT'.
inputfieldname = value
endcase.
05-07-2007 5:34 AM
IN the layout you have to assign a function code ( Lets say 'INSERT') with that function code. If you go to the layout and dauble click it, a proparties window will appear you have to make a entry in that window for that function code of the push button.
now in pai of the screen, code like this:
case sy-ucomm.
when 'INSERT'.
do the following........
endcase.
05-07-2007 5:37 AM
Hi Troy,
Do one thing, in the properties of push button , in name give name as ,
PUSH_BUTTON , in text write what ever you want to be displayed and in function code ,
give it as 'PUSH' , save these .
in the top include,
data: ok_code like sy-ucomm ,
text1(20) type c value 'Hello, how are you ?' .
in the PAI module,
ok_code = sy-ucomm . ( this is to capture the user-command value which we have defined as 'PUSH'.)
in PBO module ...
ok_code = sy-ucomm.
if ok_code = 'PUSH'.
move text1 to screen-field.
endif.
i m sure this will work ...
Reward if helpful ....
Regards,
Ranjita
Message was edited by:
Ranjita Kar
null
05-07-2007 5:40 AM
Hi Troy,
IN PAI of module pool screen. write following code :
Case sy-ucomm.
When 'Click'.
text = 'How r u'.
endcase.
Here "click" is the fcode and text is I/O field of module pool screen.
Reward points if helpful.
Regards,
Hemant
05-07-2007 7:53 AM
hi,
when u drag n drop a push button there its name n the function code should be the same.....let the text be anything it dosen't matter but if the name n the function module r different then it raises an error like keyword r not the same type,
in module_0100_comm
u should write it as.
if the push button u have taken is for viewing the previous page then take it as back.
when 'back'.
dynnr = '0200'.
tb-activetab = 'input'.
.....
\this is the way u have to give..
if useful reward with points.
madhuri.
05-07-2007 12:42 PM
thanks to everyone but i can not get it right.
can anyone send me steps for some dynpro example
?
troy
05-07-2007 12:53 PM
in se38 screen itself click environment in the menu bar.
Environment->Examples->ABAP examples.
A new screen opens in that select Abap user dialogs node-> screens.
U will get lot of example programs.
one more help is .
Environment->Examples->Ergonomics examples->screen
here too u can find example programs.