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: 

Search help question

Former Member
0 Kudos
152

Gentlemen,

I need your advise.

I have a requirement that a field should have different search-helps based on content of the other field of this screen.

These two fields belong to different structures. What options do I have?

Thank you.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
123

Suppose you have two fields:

Field_1 --- Content of this decides the content of search help of Field_2

Field_2 --- This one has search help

-


AT SELECTION SCREEN ON VALUE REQUEST FOR Field_2.

1. Fill the internal table you pass to the custom search help conditionally based on the values of Field_1.

2. Pass this internal table to the FM that you use to display search help.

-


6 REPLIES 6

Former Member
0 Kudos
124

Suppose you have two fields:

Field_1 --- Content of this decides the content of search help of Field_2

Field_2 --- This one has search help

-


AT SELECTION SCREEN ON VALUE REQUEST FOR Field_2.

1. Fill the internal table you pass to the custom search help conditionally based on the values of Field_1.

2. Pass this internal table to the FM that you use to display search help.

-


Former Member
0 Kudos
123

Hello, you need to use DYNP_VALUES_READ FM to read values from screen . and then use it on value request event. please search SDN with this FM. you will find many threads for how to use this... even do a where used list in SAP itself, you will get plenty of examples

Former Member
0 Kudos
123

Thanks for quick response.

I think I need to elaborate on this topic a little.

First, I'm talking about regular screen, not selection screen.

I'm also aware about DYNP_VALUES_READ.

How to determine content of other field on the screen is not a question.

The question is how to change search help assigned to screen field dynamically. Requested collective search-helps are already defined in DDIC.

I don't want to create complex search-help exit FM that will duplicate logic of these search-helps.

Is there any other alternatives?

0 Kudos
123

I think you can choose this FM F4IF_FIELD_VALUE_REQUEST. directly pass the search help name to it.. (call back program and FM are needed to return back to the program).. just do a where used list.. you will be fine

0 Kudos
123

Thanks, F4IF_FIELD_VALUE_REQUEST works perfect

Former Member
0 Kudos
123

Dear Vadim,

follow this code.

it helps you to create custom Help.

REPORT zdemo .

TYPES:BEGIN OF ty_lfa1,

lifnr TYPE lfa1-lifnr,

END OF ty_lfa1.

DATA: gt_lfa1 TYPE STANDARD TABLE OF ty_lfa1,

gs_lfa1 TYPE ty_lfa1.

PARAMETERS:vendor(10) TYPE c.

*

AT SELECTION-SCREEN ON VALUE-REQUEST FOR vendor.

SELECT lifnr FROM lfa1 INTO TABLE gt_lfa1.

IF sy-subrc EQ 0.

SORT gt_lfa1.

ENDIF.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'LIFNR'

  • PVALKEY = ' '

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'vendor'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = gt_lfa1

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

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

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

ENDIF.