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

F4 help problem

Former Member
0 Likes
533

Hi Experts,

I have 2 fields Order type, and Foreign Carrier in my screen.

Based on Order type, Foreign carrier value will come.

If I type the Order type without pressing F4, it is not coming in screen variable.

then, foreign carrier value is also not coming.

Thanks in advance.

Bala.

3 REPLIES 3
Read only

MarcinPciak
Active Contributor
0 Likes
512

Hi Bala,

Use this FM DYNP_VALUES_READ to read screen field content and assing it to you variable.

Regards

Marcin

Read only

Former Member
0 Likes
512

hello,

here is the code for your ref.

DATA: BEGIN OF it_aufnr OCCURS 0,

aufnr TYPE caufv-aufnr,

END OF it_aufnr,

BEGIN OF it_aufnr1 OCCURS 0,

aufnr TYPE caufv-aufnr,

objnr TYPE caufv-objnr,

END OF it_aufnr1.

DATA: it_dynpread TYPE TABLE OF dynpread,

wa_dynpread TYPE dynpread,

tabix TYPE sy-tabix.

wa_dynpread-fieldname = 'P_WERKS'.

APPEND wa_dynpread TO it_dynpread .

CLEAR wa_dynpread.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-repid

dynumb = sy-dynnr

TABLES

dynpfields = it_dynpread

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.

DATA v_werks LIKE t001w-werks.

READ TABLE it_dynpread INTO wa_dynpread WITH KEY fieldname = 'P_WERKS'.

IF sy-subrc EQ 0.

MOVE wa_dynpread-fieldvalue TO v_werks.

ENDIF.

SELECT aufnr

objnr

FROM caufv

INTO TABLE it_aufnr1

WHERE werks EQ v_werks.

Regards,

Ravi Kiran

Read only

Former Member
0 Likes
512

Thanks