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: 

handling an event in dialog..

Former Member
0 Kudos

hi,

i have a screen with a tabstrip inside which a subscreen exists. in that subscreen i have two fields in which user can enter/choose any value. Once he does that it's corresponding value i need to fetch from the table and display in a nearby display only text field.

so in the PAI of the subscreen i need to write the logic that will identify when the user modifies the value in those fields and then fetch the equivalent value for the display fields.

what is that logic ?

my guess is something like

PROCESS AFTER INPUT.

LOOP at SCREEN.

??

??

ENDLOOP.

I am not sure what to write. any help ?

thks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

u can use 'ON CHANE OF <field_name>'

9 REPLIES 9

former_member188685
Active Contributor
0 Kudos

even if you write some thing in pai it will not work.


"this is wrong...
PROCESS AFTER INPUT.

LOOP at SCREEN.
??
??
ENDLOOP.

you have to call the function DYNP_VALUES_UPDATE in the event PAI ,say when ENTER Action.

Former Member
0 Kudos

u can use 'ON CHANE OF <field_name>'

0 Kudos

actually i used

FIELD <fieldname> module <module name> and it worked...

but one problem is that in a situation i need to blank out that display field. if i simply say MOVE ' ' TO f1. it does not help...how do i inform SAP to refresh the screen so that the display field now displays blank ?

thks

0 Kudos

why can't you update the screen field value using the function module DYNP_VALUES_UPDATE

0 Kudos

hey vijay,

i used the FM u said. thanks...but i am facing an issue where in my subscreen there are two display fields that i need to clear out based on two fields...so my PAI has statements as

FIELD F1 MODULE F1_VALIDATE.

FIELD F2 MODULE F2_VALIDATE.

Now it so happens that in F1_validate and F2_validate I have written code as follows

SELECT SINGLE PORT_NAME INTO L_PORTNAME FROM ZTAB WHERE PORT_CODE = F1.

CLEAR WA_DYNPREAD.

REFRESH I_DYN_FIELDS.

WA_DYNPREAD-FIELDNAME = 'F1_DISPLAY_FIELD'.

WA_DYNPREAD-FIELDVALUE = L_PORTNAME .

APPEND WA_DYNPREAD TO I_DYN_FIELDS.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = SY-REPID

dynumb = SY-DYNNR

TABLES

dynpfields = I_DYN_FIELDS

EXCEPTIONS

INVALID_ABAPWORKAREA = 1

INVALID_DYNPROFIELD = 2

INVALID_DYNPRONAME = 3

INVALID_DYNPRONUMMER = 4

INVALID_REQUEST = 5

NO_FIELDDESCRIPTION = 6

UNDEFIND_ERROR = 7

OTHERS = 8.

what happens is the display fields are updated only after my second field's validation is done !!

i want this way..as soon as user presses enter key to move out of the first field i want the f1_display_field to have the display value...same with second field..whats wrong ?

thsk

0 Kudos

are you writing this in PAI user_command module or placing in the respective field modules..?

0 Kudos

field modules...

0 Kudos

then it should trigger before the enter event. since field modules will trigger for each change in the fields.

karol_seman
Active Participant
0 Kudos

deleted ...

Edited by: Karol Seman on Oct 22, 2008 9:40 PM