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

Updating screen field values

Former Member
0 Likes
12,447

Hi All,

I want a field called status on my screen, once i select that field to 'yes' i want to automatically set a date field on the screen to today's date.

I want this to happen even before the PAI event, i.e., when i change a value on one field i want to trigger the action of updating another field.

is there a way to do this???

Thanks & Regards,

Thirumal

Hi All,

I want a field called status on my screen, once i select that field to 'yes' i want to automatically set a date field on the screen to today's date.

I want this to happen even before the PAI event, i.e., when i change a value on one field i want to trigger the action of updating another field.

is there a way to do this???

Thanks & Regards,

Thirumal

6 REPLIES 6
Read only

Former Member
0 Likes
2,689

Hi,

Use FM DYNP_UPDATE_FIELDS.

Regards,

Shashank

Read only

Former Member
2,689

Hi Thirumal,

YOu may have to use DYNP_VALUES_READ and DYNP_VALUE_UPDATE function modules in PBO section.

Regards,

Ravi

Read only

0 Likes
2,689

Hi Both,

I am working on this function module already, but what i found in library is this :"There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event"

So does this mean that only on POV this is used or if it can solve my case can anyone tell me the logic

Read only

0 Likes
2,689

I don't think ther is any problem in using these Fms in other places.

DYNP_VALUES_READ would give the values of the screen fields and DYNP_VALUES_UPDATE would update the screen fields with the values you pass.

There are examples given in the FM documentation also.

Regards,

Ravi

Read only

0 Likes
2,689

Hi Vinod,

In my case i have a field on the module pool program, the f4 help is attached in the database table itself..

there is no POV event in the program.. how can i trigger that...

Thanks,

Thirumal

Read only

vinod_gunaware2
Active Contributor
0 Likes
2,689

<b>DYNP_VALUES_READ</b> Reads a screen field

<b>DYNP_VALUES_UPDATE</b> Updates a screen field

<b>Check it PAI after 'yes'</b>

REPORT ZVV.

tables tcurt.

DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.

PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency

P_LTEXT LIKE TCURT-LTEXT, "Long Text

P_KTEXT LIKE TCURT-KTEXT. "Short Text

*----


*--- Example of updating value of another field on the screen -


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.

CLEAR: DYFIELDS[], DYFIELDS.

*--- select currency

CALL FUNCTION 'HELP_VALUES_GET'

EXPORTING

fieldname = 'WAERS'

tabname = 'TCURT'

IMPORTING

SELECT_VALUE = P_WAERS.

*--- get long text for the selected currency

SELECT SINGLE LTEXT FROM TCURT

INTO DYFIELDS-FIELDVALUE

WHERE SPRAS = SY-LANGU

AND WAERS = P_WAERS.

IF SY-SUBRC <> 0.

CLEAR DYFIELDS-FIELDVALUE.

ENDIF.

*--- update another field

DYFIELDS-FIELDNAME = 'P_LTEXT'.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

tables

dynpfields = DYFIELDS .

*----


*--- Example of reading value of another field -


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.

*--- read another field

CLEAR: DYFIELDS[], DYFIELDS.

DYFIELDS-FIELDNAME = 'P_WAERS'.

APPEND DYFIELDS.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = DYFIELDS .

READ TABLE DYFIELDS INDEX 1.

*--- get short text and update current field

SELECT SINGLE KTEXT FROM TCURT

INTO P_KTEXT

WHERE SPRAS EQ SY-LANGU

AND WAERS EQ DYFIELDS-FIELDVALUE.

*----


regards

vinod