Application Development 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: 

DIALOG PROGRAMMING

Former Member
0 Kudos

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.

10 REPLIES 10

Former Member
0 Kudos

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.

0 Kudos

put like this

Data: okcode like sy-ucomm.

it should be 4 char length.

Regards

Prabhu

0 Kudos

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

Bema
Active Participant
0 Kudos

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.

Former Member
0 Kudos

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.

former_member196299
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

thanks to everyone but i can not get it right.

can anyone send me steps for some dynpro example

?

troy

0 Kudos

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.