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

regarding search help

Former Member
0 Likes
870

Hi all,

This is a requriement like i have created a ztable and in that 3 fields ... and they dont have search help.

But i want to call these fields in a progarm and put search help.

i have got a function module "F4_FIELD_ON_VALUE_REQUEST".

so what can i do to dynamically create a seach help .

plz help me frnds.

regards,

satish

Hi all,

This is a requriement like i have created a ztable and in that 3 fields ... and they dont have search help.

But i want to call these fields in a progarm and put search help.

i have got a function module "F4_FIELD_ON_VALUE_REQUEST".

so what can i do to dynamically create a seach help .

plz help me frnds.

regards,

satish

8 REPLIES 8
Read only

Former Member
0 Likes
810

Hi,

Below is the example code :

'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'BEGRU'

value_org = 'S'

tables

value_tab = t_values

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

Please refer to the link below :

http://saptechnical.com/Tutorials/ABAP/F1Help/Create.htm

Thanks.

Sri.

Edited by: Sriram Ponna on Jan 8, 2008 7:19 PM

Read only

0 Likes
810

any other way....

Read only

Former Member
0 Likes
810

Hi,

You can do it using many methods.

1. The function module which you have found can be used.

2, the function module VRM_SET_VALUES can be used where you have to specify the type pool VRm in your program

3. Assign an se11 search help for the fields.

4. assign the same ztable as value table in the domain of the fields.

Regards,

Renjith Michael.

Read only

Former Member
0 Likes
810

Hi Satish,

This sample program demonstrate how to create "Help Value Request". It will appear when user pressing F4 (help) on an input field to request list of available value.

To do this we are using function module F4IF_INT_TABLE_VALUE_REQUEST. It provide help value request with following feature:

1. single / multiple choice.

2. update screen without PBO, so it can be used to update more than one field on one request.

Here is the code:

REPORT ZAALGAL0003 .

TABLES: usr02.

parameters: p_bname LIKE usr02-bname,

p_class LIKE usr02-class.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bname.

PERFORM f_valuerequest_vbeln.

&----


*& Form f_valuerequest_vbeln

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_valuerequest_vbeln.

DATA: BEGIN OF t_data OCCURS 1,

data(20),

END OF t_data.

DATA: lwa_dfies TYPE dfies.

data h_field_wa LIKe dfies.

data h_field_tab like dfies occurs 0 with header line.

data h_dselc like dselc occurs 0 with header line.

SELECT * FROM usr02.

t_data = usr02-bname. APPEND t_data.

t_data = usr02-class. APPEND t_data.

ENDSELECT.

PERFORM f_fieldinfo_get USING 'USR02'

'BNAME'

CHANGING h_field_wa.

APPEND h_field_wa TO h_field_tab.

PERFORM f_fieldinfo_get USING 'USR02'

'CLASS'

CHANGING h_field_wa.

APPEND h_field_wa TO h_field_tab.

h_dselc-fldname = 'BNAME'.

h_dselc-dyfldname = 'P_BNAME'.

APPEND h_dselc.

h_dselc-fldname = 'CLASS'.

h_dselc-dyfldname = 'P_CLASS'.

APPEND h_dselc.

DATA: ld_repid LIKE sy-repid.

ld_repid = sy-repid.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'P_BNAME'

dynpprog = ld_repid

dynpnr = '1000'

dynprofield = 'P_BNAME'

  • multiple_choice = ''

  • value_org = 'S'

TABLES

value_tab = t_data

field_tab = h_field_tab

  • return_tab = return_tab

DYNPFLD_MAPPING = h_dselc

EXCEPTIONS

OTHERS = 0.

ENDFORM. " f_valuerequest_vbeln

&----


*& Form f_fieldinfo_get

&----


  • text

----


  • -->P_0079 text

  • -->P_0080 text

  • <--P_H_FIELD_WA text

----


FORM f_fieldinfo_get USING fu_tabname

fu_fieldname

CHANGING fwa_field_tab.

CALL FUNCTION 'DDIF_FIELDINFO_GET'

EXPORTING

TABNAME = fu_tabname

FIELDNAME = fu_fieldname

LFIELDNAME = fu_fieldname

IMPORTING

DFIES_WA = fwa_field_tab

EXCEPTIONS

NOT_FOUND = 1

INTERNAL_ERROR = 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.

ENDFORM. " f_fieldinfo_get

Hope this help u

Reward points if useful

Regards,

Sreenivas

Read only

Former Member
0 Likes
810

Hi,

1.Goto SE11 create one search help.

2.After u click on create button, it will ask for (Elementry or collective search ), select as elementry.

3.A new screen will appear,in that screen

fill the following details

a.short description.

b.selection method (in that give ur table name).

c.Parameter(in that give ur field name which u need search help).In that same row CHECK the IMP and EXP check boxes

and give Lpos andSPos as 1 and give the dataelement.

4.Save ,check and activate.

Regards,

Billa

Read only

Former Member
0 Likes
810

Hi,

pls refer the below sample code.

TABLES: mara.

DATA:

BEGIN OF x_matnr OCCURS 0,

COLOR(18) TYPE C,

  • maktx like makt-maktx,

END OF x_matnr.

DATA:

l_dynprofld TYPE help_info-dynprofld,

l_matnr(7) TYPE c VALUE 'P_COLOR',

l_prog TYPE sy-repid,

l_dynnr TYPE sy-dynnr.

PARAMETERS: p_COLOR(15) TYPE C,

p_maktx like makt-maktx.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_COLOR.

PERFORM f_get_values.

*&----


*

*& Form F_GET_VALUES

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM f_get_values.

DATA: i_return LIKE ddshretval OCCURS 0,

i_dynpfields like DYNPREAD occurs 0 with header line,

l_repid like sy-repid.

l_prog = sy-repid.

l_dynnr = sy-dynnr.

l_dynprofld = l_matnr.

X_MATNR-COLOR = 'RED'.

APPEND X_MATNR.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'COLOR'

dynpprog = l_prog

dynpnr = l_dynnr

dynprofield = l_dynprofld

value_org = 'S'

TABLES

value_tab = x_matnr

return_tab = i_return.

IF sy-subrc <> 0.

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

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

ENDIF.

ENDFORM. " F_GET_VALUES

Reward if useful.

Thanks,

Sreeram.

Read only

Former Member
0 Likes
810

Hi frnds,

Any sample program where we can use

this function module.

F4_FIELD_ON_VALUE_REQUEST

frnds plz give me this function module usage.

regards,

satish

Read only

Clemenss
Active Contributor
0 Likes
810

Hi satish,

just use SE11 to create an elementary search help. It is easy.

If you wannna be good, then define fixed values with (translatable) texts for the domains of the data elements of the table fields or create check tables with language dependent text tables for the fields. Then it is fully SAP standard compliant an you can win merits.

Regards,

Clemens