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: 

fields on screen.

Former Member
0 Kudos

Hi all, I have a screen 0100, on this screen ,there are 2 fields field1, field2.

If I choose field1, can I display field2 without any command, even without pressing 'ENTER'? The field2 can be selected from a tabel using field1. It means that once selected field1, field2 should be diplayed.

Is it possible to achieve this requirement? If it's possible, how?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

ABAP is event driven progarmming.

The case u explained is not possible in ABAP without pressing ENTER button.

5 REPLIES 5

Former Member
0 Kudos

Hi,

ABAP is event driven progarmming.

The case u explained is not possible in ABAP without pressing ENTER button.

GauthamV
Active Contributor
0 Kudos

Use this logic in your program.


REPORT Z_TEST.

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.

Former Member
0 Kudos

Hi Gautham,

he is saying without presssing (any Button)F1 button also.

the logic you mentioned is right when if you press any command. right?

but the Yu is asking if he enters in data in field1, he wnats to display automatically field2.

is it possible.

former_member209217
Active Contributor
0 Kudos

Hi,

I am not fully clear with ur requirement.

Try Using logical databases.U can select the fields during runtime and they can be displayed dynamically.

Regards,

lakshman.

Former Member
0 Kudos

Hi,

This is not possible... You have to atleast use the 'ENTER' button.