Application Development and Automation 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: 
Read only

Module (Dialogue) pool program

Former Member
0 Likes
886

Hi viewers,

I'm striving sample module pool program. I'm unable to get/retrieve the value from the screen. I developed the screen with three fields. First field name is username with input filed, second field name is password and third field name is push button.

For username input field name I have taken as zpassword-uname and for password zpassword-psw.

(Note: zpassword is the table name I have created and storing some values.)

After this I have choosen PAI event and I have clicked on flow logic option and it is redirected to flow logic for this program.

Here I have defined as:

DATA : WA_PSW TYPE ZPASSWORDS,

USERNAME TYPE ZPASSWORDS-UNAME,

PASS TYPE ZPASSWORDS-PSW.

MODULE USER_COMMAND_0100 INPUT.

CASE SY-UCOMM.

WHEN 'LOGON'.

WA_PSW-UNAME = USERNAME.

WA_PSW-PSW = PASS.

SELECT * FROM ZPASSWORDS INTO WA_PSW WHERE UNAME = WA_PSW-UNAME ."AND PSW = WA_PSW-PSW.

ENDSELECT.

IF SY-SUBRC = 0.

MESSAGE USERNAME TYPE 'I'.

MESSAGE 'LOGIN SUCCESSFULLY' TYPE 'I'.

ELSE.

MESSAGE USERNAME TYPE 'I'.

MESSAGE 'HELLO VENKAT this is INVALID USERNAME AND PASSWORD' TYPE 'I'.

ENDIF.

ENDCASE.

ENDMODULE.

Finally I have created Tcode which is called as ZTEST and run the TCODE.

Screen is showing and action is performing but entered filed values are not retrieving. I mean input field values are showing empty.

ANYBODY PLEASE GUIDE ME HOW TO RETRIEVE THE VALUES FROM INPUT FILEDS? I HOPE AND WAIT FOR YOUR KIND INFORMATION.

Thanks

venkat

7 REPLIES 7
Read only

Former Member
0 Likes
851

Hi,

Please check the values in sy-ucomm. Check if the control is coming into the case.

Give the function code(FctCode) to the Button you have declared.

Regards,

Srini.

Read only

0 Likes
851

Thank you Srini for your kind information. I have defined function code and controller is executing into the sy-ucomm. But entered input values are not picking.

Could you explain ?

Thanks

venkaT

Edited by: venkatehBI on Jan 24, 2011 6:21 AM

Read only

0 Likes
851

Hi Venkat ,

What is ur screen field name, is it WA_PSW-UNAME or USERNAME. If it is this field WA_PSW-UNAME then in user command u r replacing it here

WA_PSW-UNAME = USERNAME.
WA_PSW-PSW = PASS.

in user command, and if ur screen field is USERNAME then enter the value and start the debugger and press the logon button check where is it clearing the variable USERNAME.

Regards,

Madhukar Shetty

Read only

Former Member
0 Likes
851

Hello ,

IN PAI , you need to process fieild

Process After Input.

FIELD WA_PSW-PSW.

FIELD WA_PSW-UNAME.

module user_command_0100.

regards

Prabhu

Read only

Former Member
0 Likes
851

Are your declarations global?

Read only

Former Member
0 Likes
851

Hi,

your OK code field (e.g. SY-UCOMM) has to be defined on your screen. You can check this in SE51 in the element list of your dynpro. This field has type OK.

If you edit this dynpro first the cursor position is the OK code field in the upper left corner (not visible!). Give it a name, save it and generate the dynpro. You should see this field now in the element lsit and can use it in the program!

Regards,

Klaus

Read only

Former Member
0 Likes
851

in module pool program,

u can get the screen values to abap variable in PAI EVENT

and then u can give back abap variables to same screen values in PBO EVENT.

Here u need to get screen values in ur abap variables, so first u need to declare the variables in ur program to hold the screen values once u vl have it u can get screen values in ur variables in PAI event.

okay , as i can understand from ur question is u need to check ur input values in database, so for tht in screen prograaming, u have provision to check by writing in pai event:

FIELD f MODULE mod.

or

CHAIN.

FIELD: f1, f2,...

MODULE mod1.

FIELD: g1, g2,...

MODULE mod2.

...

ENDCHAIN.

check the link : http://help.sap.com/saphelp_nw70/helpdata/en/47/a19fd982841503e10000000a42189c/frameset.htm

and also when u design the screen, u have got the option like get from dictionay and get from program, if u select get from program, then u need to have those variables or tables declared in ur program in top include.