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: 

selection-screen F4 help

Former Member
0 Kudos

suppose in a selection screen, there are 2 parameters. one for storage location & other for material. if one storage location is selected, then by clicking F4 help in material corresponding material related to storage location should come ?

4 REPLIES 4

Former Member
0 Kudos

Make sure that the same search help is attached to both the fields.The Export is set in the searchhelp.Then it will work

Reward Points,

Reemz

Former Member
0 Kudos

hi,

try like this.

TYPES : BEGIN OF ty_kna1,

kunnr TYPE kna1-kunnr, "CUstomer Code

name1 TYPE kna1-name1, "Customer Code

END OF ty_kna1.

DATA : wa_value_tab TYPE ty_kna1.

DATA : value_tab LIKE wa_value_tab OCCURS 0 WITH HEADER LINE.

DATA : field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.

DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR kunnr-low.

CHECK NOT bukrs IS INITIAL .

SELECT kna1kunnr kna1name1

INTO TABLE i_kna1

FROM kna1 INNER JOIN vbrk

ON kna1kunnr = vbrkkunag

WHERE vbrk~bukrs = bukrs. "dyfields-fieldvalue.

SORT i_kna1 BY kunnr.

DELETE ADJACENT DUPLICATES FROM i_kna1.

CLEAR : value_tab,field_tab,return_tab.

REFRESH : value_tab,field_tab,return_tab.

field_tab-fieldname = 'KUNNR'.

field_tab-tabname = 'KNA1'.

APPEND field_tab.

field_tab-fieldname = 'NAME1'.

field_tab-tabname = 'KNA1'.

APPEND field_tab.

field_tab-fieldname = 'KUNNR'.

LOOP AT i_kna1 .

value_tab-kunnr = i_kna1-kunnr.

APPEND value_tab.

CLEAR value_tab.

value_tab-name1 = i_kna1-name1.

APPEND value_tab.

ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = field_tab-fieldname

TABLES

value_tab = value_tab

field_tab = field_tab

return_tab = return_tab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc = 0.

kunnr-low = return_tab-fieldval.

ENDIF.

here i entered BUKRS and according to that i want Customer name.

hope it will b helpful.

Former Member
0 Kudos

Hi,

Write code in at selection on value request for that field and select passing the value of the st location to the material from the table and use FM 'F4IF_INT_TABLE_VALUE_REQUEST to get materials

Regards

Shiva

Former Member
0 Kudos

Have a look at DEMO_DYNPRO_F4_HELP_MODULE - the trick I think you are looking for is to use function DYNP_VALUES_READ to get the value of one field when F4 is selected on a second field. The DYNP_VALUES_READ will read what is on the screen even if the user hasn't pressed enter i.e. if the user has just keyed "123" into storage location and tabbed to material and hit F4. The demo program explains this process using context sensitive list of flights for an airline.

Jonathan