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

search help for 2 fields

arpit_shah
Contributor
0 Likes
869

Hi,

I have created one screen for MBLNR (Document No) & MJAHR(Year) field, I have created one search help for this field, but based on f4 selection it is getting document no from help.

but my requirement is it will get both fields from single help,

screen take both field MBLNR & MJAHR from single search help.

how to do this?

6 REPLIES 6
Read only

venkat_o
Active Contributor
0 Likes
691

Hi Arpit, Try this way. Check this example and change accordingly .

 REPORT ZVENKAT_F4_FOR_PARAMETERS MESSAGE-ID ZMSG .
 TYPES:BEGIN OF T_T001W,
        WERKS       TYPE T001W-WERKS,
        NAME1       TYPE T001W-NAME1,
       END OF T_T001W,
       T_RETURN_TAB  TYPE DDSHRETVAL.
 DATA:W_T001W      TYPE T_T001W,
      W_RETURN_TAB TYPE T_RETURN_TAB.
 DATA:I_T001W      TYPE STANDARD TABLE OF T_T001W,
      I_RETURN_TAB TYPE STANDARD TABLE OF T_RETURN_TAB.
 DATA:W_DYNPFIELDS TYPE DYNPREAD,
      I_DYNPFIELDS LIKE STANDARD TABLE OF DYNPREAD.
 SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
 PARAMETERS :P_WERKS TYPE T001W-WERKS,
             P_NAME1 TYPE T001W-NAME1.
 SELECTION-SCREEN END OF BLOCK B1.
"F4 Help for Werks
 AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERKS.
   IF I_T001W[] IS INITIAL.
     SELECT WERKS NAME1
     FROM T001W
     INTO TABLE I_T001W.
   ENDIF.
   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
       RETFIELD    = 'WERKS'
       DYNPPROG    = SY-REPID
       DYNPNR      = SY-DYNNR
       DYNPROFIELD = 'P_WERKS'
       VALUE_ORG   = 'S'
     TABLES
       VALUE_TAB   = I_T001W
       RETURN_TAB  = I_RETURN_TAB.
   READ TABLE I_RETURN_TAB INTO W_RETURN_TAB INDEX 1.
   P_WERKS = W_RETURN_TAB-FIELDVAL.
   READ TABLE I_T001W INTO W_T001W WITH KEY WERKS = P_WERKS.
   IF SY-SUBRC = 0.
     W_DYNPFIELDS-FIELDNAME    = 'P_NAME1'.
     W_DYNPFIELDS-FIELDVALUE   = W_T001W-NAME1.
     APPEND W_DYNPFIELDS TO I_DYNPFIELDS.
     CLEAR W_DYNPFIELDS.
     CALL FUNCTION 'DYNP_VALUES_UPDATE'
       EXPORTING
         DYNAME     = SY-REPID
         DYNUMB     = SY-DYNNR
       TABLES
         DYNPFIELDS = I_DYNPFIELDS.
   ENDIF.
Thanks Venkat.O

Read only

0 Likes
691

Hi,

thanks for your reply,

but i want same thing using by creating search help.

I am using search help that is created in SE11 and assign to this field.

I hope you understand my requirements.

Regards

Arpit

Read only

0 Likes
691

In search help ensure you have placed both fields and selected option EXP for them. It will then return values for those two once you pick desired entry.

Regards

Marcin

Read only

0 Likes
691

Hi, thanks for your reply,

i have already set EXP for both fields, and when i am executing search help from se11 then its working correct,

but in selection screen it is only fetching document no only, not fetching year.

Regards,

Arpit

Read only

0 Likes
691

Hi,

after creating search help, I have to assign to both field or single one?...

in from SE11 when i m executing it is working fine , but from selection screen it is working for only single field.

Regards

Arpit

Read only

0 Likes
691

Hi Experts,

Any idea on this issue...

or i have to use functional module for this.

Regards,

Arpit