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: 

Creating search help

Former Member
0 Kudos

Hi ABAPers,

Please help me out. I will reward points for the usefull answers.

I have two fields REGUH-LAUFD, REGUH-LAUFI as select-options and i need to implement the search help for these fields. Please let me know what should i do inorder to achieve this one.

Thanx in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Please use the FM 'F4_ZAHLLAUF' with the below mentioned values, this will give F4 for both LAUFI and LAUFD,

For LAUFI:

CALL FUNCTION 'F4_ZAHLLAUF'

EXPORTING

F1TYP = 'D'

F2NME = 'F110V-LAUFI'

For LAUFD:

CALL FUNCTION 'F4_ZAHLLAUF'

EXPORTING

F1TYP = 'I'

F2NME = 'F110V-LAUFD'

Hope this helps !

~ Ranganath

9 REPLIES 9

Former Member
0 Kudos

Use FM "F4IF_FIELD_VALUE_REQUEST".

At selection-screen on value request of glaccount.

call function F4IF_FIELD_VALUE_REQUEST

Check the following sample code to get the F4 help in select options for G/L Account

AT SELECTION-SCREEN ON VALUE-REQUEST FOR HKONT-LOW.

SELECT KSTAR KTEXT INTO TABLE IT_HKONT FROM CSKU WHERE SPRAS EQ 'EN'.

SORT IT_HKONT BY KSTAR.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'HKONT'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = IT_HKONT

RETURN_TAB = IT_RETURN.

IF SY-SUBRC = 0.

READ TABLE IT_RETURN INDEX 1.

MOVE IT_RETURN-FIELDVAL TO HKONT-LOW.

ENDIF.

Or

Go to SE11-> Give the search help name and create.

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm

REgards.

Edited by: Sravan Prakash.V on Jan 11, 2008 10:40 AM

Former Member
0 Kudos

Hi

Please use the FM 'F4_ZAHLLAUF' with the below mentioned values, this will give F4 for both LAUFI and LAUFD,

For LAUFI:

CALL FUNCTION 'F4_ZAHLLAUF'

EXPORTING

F1TYP = 'D'

F2NME = 'F110V-LAUFI'

For LAUFD:

CALL FUNCTION 'F4_ZAHLLAUF'

EXPORTING

F1TYP = 'I'

F2NME = 'F110V-LAUFD'

Hope this helps !

~ Ranganath

0 Kudos

Thanks Ranganath it solved my problem

0 Kudos

Thanx all I gave points to all helpfull answers

Former Member
0 Kudos

hi,

this code might help you to create search help:

Use this functionality to get help.

FORM HELP_CHECK.

*-- Set up fields to retrieve data

ltab_fields-tabname = 'ZFI_PMNTADV'.

ltab_fields-fieldname = 'CHECT'.

ltab_fields-selectflag = 'X'.

APPEND ltab_fields.

ltab_fields-tabname = 'ZFI_PMNTADV'.

ltab_fields-fieldname = 'PMNT_ADV'.

ltab_fields-selectflag = 'X'.

APPEND ltab_fields.

SORT ltab_fields.

DELETE ADJACENT DUPLICATES FROM ltab_fields.

*-- Fill values

SELECT chect

INTO TABLE ltab_values

FROM zfi_pmntadv

WHERE pmnt_adv NE space.

SORT ltab_values.

DELETE ADJACENT DUPLICATES FROM ltab_values.

CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'

EXPORTING

fieldname = 'chect'

tabname = 'zfi_pmntadv'

title_in_values_list = 'Select a value'

IMPORTING

select_value = so_chect

TABLES

fields = ltab_fields

valuetab = ltab_values

EXCEPTIONS

field_not_in_ddic = 01

more_then_one_selectfield = 02

no_selectfield = 03.

ENDFORM. "fiscal_year

plz reward points if useful..

Former Member
0 Kudos

Hi Govardhan,

You can refer the following code:

1. For selection screen

SELECTION-SCREEN BEGIN OF BLOCK process WITH FRAME TITLE text-001.

parameter: matnr like mara-matnr.

parameter: ernam like mara-ernam.

SELECTION-SCREEN END OF BLOCK process.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

if matnr is not initial.

select single ernam

from mara

into ernam

where matnr eq matnr.

endif.

MODIFY SCREEN.

ENDLOOP.

2.For screen

Here you have to code in 'POH' event.

Reward if helpful.

Thankyou,

Regards.

Former Member
0 Kudos

Hi,

Instead of search help you can simply use F4 help.

Just use AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field name>.

After this use FM

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'MATNR'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'S_MATNR'

value_org = 'S'

TABLES

value_tab = i_mara_temp[]

return_tab = i_return[]

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Regards,

Pankaj

Former Member
0 Kudos

hi govardhan,

try using match codes:

search the relevant match code for the fields in the select-options and use the match code object for search help.

refer this piece of code which i used in my program

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t01.

PARAMETERS p_progna LIKE trdir-name MATCHCODE OBJECT progname.

SELECTION-SCREEN END OF BLOCK b1.

regards,

sravanthi.

Former Member
0 Kudos

hai.

check this example.

See the following ex:

TYPES: BEGIN OF TY_MBLNR,

MBLNR LIKE MKPF-MBLNR,

END OF TY_MBLNR.

DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.

data: it_ret like ddshretval occurs 0 with header line.

At selection-screen on value-request for s_mat-low.

Select MBLNR from mkpf into table it_mblnr.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MBLNR'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_MBLNR

  • FIELD_TAB =

RETURN_TAB = IT_RET

  • 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.

IF SY-SUBRC = 0.

read table it_ret index 1.

move it_ret-fieldval to S_mat-low.

ENDIF.

Go through the test program.

REPORT Ztest_HELP .

TABLES : MARA.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_MATNR(10) TYPE C.

SELECTION-SCREEN END OF BLOCK B1.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR TYPE MATNR,

END OF ITAB.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR

FROM MARA

INTO TABLE ITAB

UP TO 10 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATERIAL NUMBER'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).

2) Collective search helps combine several elementary search helps. A collective search help thus can offer several alternative search paths.

3)An elementary search help defines the standard flow of an input help.

4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.

5)A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.

6)Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.

CREATION:

Go to SE11 Tcode

select search help

give the 'z' search help name and create

select the selection method ur table name eg : 'mara'

dialog module 'display value immediately'.

add the field whatever u want and lpos = 1 and spos = 1 and check import and export parameter.

where left position when displaying and spos = search position

and then save and activate ..

See the links:

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee45446011d189700000e8322d00/content.htm

https://forums.sdn.sap.com/click.jspa?searchID=3173469&messageID=2176485

https://forums.sdn.sap.com/click.jspa?searchID=3173469&messageID=3601619

pls go through this for search help creation

http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm

Search Help Exits:

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee52446011d189700000e8322d00/content.htm

http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_exit.htm

https://forums.sdn.sap.com/click.jspa?searchID=4390517&messageID=1712818

regards.

sowjanya.b.