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

selection screen help

Former Member
0 Likes
886

Hi,

i have a selection screen in which i have two parameters. once the user enters the value in first field f1, he goes for F4 functionality on the second field f2, where i perform some validations and display the values with in 'at selection screen on value req..'.

however, i cannot see the value entered unless i hit 'Enter' after entering the value in the first field, f1.

what should i do in order to get the value entered in the first field with in my program. kindly let me know

Regards,

kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
860

hello kumar,

How you can say, u dont get value of p1 using dynp_values_read ?

here is what i tested for u. It is working perfect for me.

parameters : p1 like vbak-spart,

p2 like vbak-bsark.

at selection-screen on value-request for p2.

data : t_dyn like DYNPREAD occurs 0 with header line.

t_dyn-fieldname = 'P1'.

append t_dyn.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = sy-repid

DYNUMB = sy-dynnr

  • TRANSLATE_TO_UPPER = ' '

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

TABLES

DYNPFIELDS = t_dyn

  • EXCEPTIONS

  • INVALID_ABAPWORKAREA = 1

  • INVALID_DYNPROFIELD = 2

  • INVALID_DYNPRONAME = 3

  • INVALID_DYNPRONUMMER = 4

  • INVALID_REQUEST = 5

  • NO_FIELDDESCRIPTION = 6

  • INVALID_PARAMETER = 7

  • UNDEFIND_ERROR = 8

  • DOUBLE_CONVERSION = 9

  • STEPL_NOT_FOUND = 10

  • OTHERS = 11

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

9 REPLIES 9
Read only

amit_khare
Active Contributor
0 Likes
860

Make a call screen before calling second seelct option, as any change require a trigger of an event to get complete.

REgards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
860

Hi,

can you explain in detail.

Regards,

Kumar.

Read only

0 Likes
860

Before calling the on selection screen event for seond option make a use call screen, this will trigger an event and your value will be saved.

Regards,

Amit

Read only

Former Member
0 Likes
860

Hi,

You can use the FM DYNP_VALUES_READ to read the values..

Thanks,

Naren

Read only

0 Likes
860

Hi,

here is the code

parameters : f1 like...

f2 like...

AT SELECTION SCREEN ON VALUE REQUEST FOR f2.

        • i can't see f1 value here. even if i use dynp_values_read

please suggest any inputs. amit can you suggest some sample code.

Regards,

kumar.

Read only

0 Likes
860

Check this code -

REPORT zaktest.

tables: pa0000.

*data: t_530 type standard table of t530 with header line.

parameters : f1 type pa0000-massn,

f2 type pa0000-massg.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR f2.

data : t_dyn like DYNPREAD occurs 0 with header line.

t_dyn-fieldname = 'F1'.

append t_dyn.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = sy-repid

DYNUMB = sy-dynnr

TABLES

DYNPFIELDS = t_dyn.

You will get the value in t_dyn-fieldvalue.

Read only

Former Member
0 Likes
861

hello kumar,

How you can say, u dont get value of p1 using dynp_values_read ?

here is what i tested for u. It is working perfect for me.

parameters : p1 like vbak-spart,

p2 like vbak-bsark.

at selection-screen on value-request for p2.

data : t_dyn like DYNPREAD occurs 0 with header line.

t_dyn-fieldname = 'P1'.

append t_dyn.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = sy-repid

DYNUMB = sy-dynnr

  • TRANSLATE_TO_UPPER = ' '

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

TABLES

DYNPFIELDS = t_dyn

  • EXCEPTIONS

  • INVALID_ABAPWORKAREA = 1

  • INVALID_DYNPROFIELD = 2

  • INVALID_DYNPRONAME = 3

  • INVALID_DYNPRONUMMER = 4

  • INVALID_REQUEST = 5

  • NO_FIELDDESCRIPTION = 6

  • INVALID_PARAMETER = 7

  • UNDEFIND_ERROR = 8

  • DOUBLE_CONVERSION = 9

  • STEPL_NOT_FOUND = 10

  • OTHERS = 11

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

Former Member
0 Likes
860

Hi,

Check this code..

PARAMETERS: p_werks TYPE werks_d,

p_lgort TYPE t001l-lgort.

AT SELECTION-SCREEN ON p_lgort.

DATA: itab LIKE dynpread OCCURS 0 WITH HEADER LINE.

DATA: v_prog LIKE d020s-prog.

v_prog = sy-repid.

itab-fieldname = 'P_WERKS'.APPEND itab.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = v_prog

dynumb = '1000'

TABLES

dynpfields = itab.

READ TABLE itab INDEX 1.

TABLES: t001l.

SELECT SINGLE * FROM t001l

WHERE werks = itab-fieldvalue

AND lgort = p_lgort.

IF sy-subrc <> 0.

MESSAGE e208(00) WITH 'Invalid storage location'.

ENDIF.

THanks,

Naren

Read only

Former Member
0 Likes
860

Hi,

Did you try my example or checked my reply??

Thanks,

Naren