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

Problem with Search Help

Former Member
0 Likes
1,694

Hello Everyone,

I encountered a problem in search help. There are four fields in the search help, Material Number, Plant, Storage Location and Batch. The matchcode shown however do not display the correct values. The values are somewhat truncated and misplaced. Is there any way to correct it?

Thanks,

Jim

5 REPLIES 5
Read only

Former Member
0 Likes
979

Hi

use the search help in ur program lik ethis then it will will display only required values

TYPES : BEGIN OF ST_OBJID_SH,

OTYPE TYPE HRP1000-OTYPE,

OBJID TYPE HRP1000-OBJID,

END OF ST_OBJID_SH.

DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.

DATA : WA_OBJID_SH TYPE ST_OBJID_SH.

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

*SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .

SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .

SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.

SELECTION-SCREEN END OF BLOCK B1.

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

  • IF S_OBJID IS NOT INITIAL.

SELECT OTYPE OBJID FROM HRP1000

INTO TABLE IT_OBJID_SH

WHERE OTYPE = 'D'.

IF SY-SUBRC EQ 0.

  • SEARCH HELP FOR QUALIFICATION.

<b> CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'</b>

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'OBJID'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'S_OBJID'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_OBJID_SH

  • FIELD_TAB =

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

ENDIF.

.

<b>reward if usefull</b>

Read only

Former Member
0 Likes
979

hi

good

please check the table name and the corresponding field name that you r using in the search help,if it is f4 search help than i hope the way the values stores in the database table,the same way it is coming .

thanks

mrutyun^

Read only

Former Member
0 Likes
979

Hi,

If you are using the standard search helps for the fields then it will display as it is stored in the database. You can even change the sequence of the columns displayed in the search help.

Check out this for further information

SEARCH HELP

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

http://help.sap.com/saphelp_46c/helpdata/en/cf/21ee2b446011d189700000e8322d00/frameset.htm

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

MATCH CODE

http://help.sap.com/saphelp_40b/helpdata/en/cf/21ef46446011d189700000e8322d00/content.htm

http://web.mit.edu/sapr3/docs/webdocs/dontindex/pdf/mcqc.pdf

Reward if useful.......

Read only

Former Member
0 Likes
979

Hi

this are the steps for F4 help

Blocking Searchhelp and Create New Searchhelp

How to block a pre-existing search help and create new search help which contains the old ones data and the new one which entered now.

Look at this statement .

parameters :p_pernr like pa0001-pernr MATCHCODE OBJECT new_search.

If you define like this previous search help is gone.

You have to create new search help into the dictionary .

or else .

parameters :p_pernr like pa0001-pernr

define like this

use this event

AT Selection-screen on p_pernr.

under this event call this function module and pass required data .

F4IF_FIELD_VALUE_REQUEST 

  • F4 help also returning the value to be displayed in internal table

F4IF_INT_TABLE_VALUE_REQUEST

<u>Example :</u>

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

<u>if you want the ways of ataching the Search help please see the link</u>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee93446011d189700000e8322d00/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee93446011d189700000e8322d00/content.htm</a>

Reward points if it is usefull ....

Girish

Read only

Former Member
0 Likes
979

yes u are saying that while using the searchhelp the values for fields are truncating.so i think you used same lpos and spos in the parameters.

->go to the searchhelp u created.

->after searchhelpparameter,import,export there is lpos and spos.

->give lpos 1 and spos 1 for first field.

->give lpos 2 and spos 2 for second field.

and so on.then u will get the values properly