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

Mathch code

Former Member
0 Likes
514

what is mean by match code objects how to implement

3 REPLIES 3
Read only

Former Member
0 Likes
479

Hi,

For many entry fields, but not all, SAP provides a search function called a Matchcode. Matchcodes allow you to select a value from a list or search for a value by categories of data if there are many possibilities.

Types of Matchcodes

Matchcodes fall into three basic categories:

1) Short list or hit list

The values are listed on one screen. For longer lists, you may need to scroll down to see all the values.

2) Restrict Value Range

Many entries are available for the field. A number of tabbed screens with different categories display so that you can enter your search criteria.

3) Calendar search

A calendar-type dialog box is displayed so that you can select day, month, and year. This is used in date fields such as invoice posting date.

Matchcodes were replaced with Search Helps starting with Release 4.0. Please use search helps to assign an input help to a field.

Existing matchcodes were automatically converted to search helps. A matchcode object is hereby converted to a collective search help with the same name. Each matchcode ID of the matchcode object is converted into an elementary search help with the same name and assigned to the collective search help created from the matchcode object.

A matchcode is a means of finding data records stored in the system. The matchcode is defined in the ABAP Dictionary in two steps:

You first define the relevant tables and fields for the search in a matchcode object. A matchcode object describes the set of all possible search paths for a search string.

You then create one or more matchcode IDs for a matchcode object. A matchcode ID describes a special search path for a search string. The matchcode ID defines the fields or field combinations to be used in the search.

http://www.sapdevelopment.co.uk/dictionary/shelp/shelphome.htmhttp://help.sap.com/saphelp_nw04/helpd...

This is also a good link

************************************************************************

  • A search help can be created in ABAP Dictionary ( tcode se11 )

  • Create a new search help (say myHelp) , choose Elementary search help (simple one), select Definitions tab, enter the table name(say myTable) in "Text Table" text box.

  • Then enter the column to be used (say myField) for this help in search help parameter, choose Import/Export, give Lpos as 1, and activate. ( You can add more columns from the same table here).

  • In report, code as

parameter p1 like myTable-myField matchcode object myHelp.

  • when you execute this report, p1 will have a f4 help enabled. The help list will have all values from myTable for field myField.

CHECK THIS LINK TO CREATE A MATCHCODE OBJECT

http://searchsap.techtarget.com/tip/1,289483,sid21_gci553386,00.html

more details...

Regards,

Priyanka.

Read only

Former Member
Read only

Former Member
0 Likes
479

Hi

A search help is a ABAP Dictionary object used to define possible values (F4) help (see Input Help in the ABAP Dictionary). You can link a search help to a parameter as follows:

PARAMETERS p ... MATCHCODE OBJECT search_help.

The search help search_help must be defined in the ABAP Dictionary. The system now automatically displays the input help button for the field on the screen and activates the F4 key for it. When the user requests input help, the hit list of the search help appears, and when he or she selects an entry, the corresponding export parameter is placed in the input field.

The predecessors of search helps in the ABAP Dictionary were called matchcode objects, hence the name of the addition, MATCHCODE OBJECT in the PARAMETERS statement. Existing matchcode objects are still supported.

PARAMETERS p_carrid TYPE s_carr_id 
           MATCHCODE OBJECT demo_f4_de.

The search help DEMO_F4_DE is defined in the ABAP Dictionary. The search help reads the columns CARRID and CARRNAME from the database table SCARR. Only CARRNAME is listed, but CARRID is flagged as an export parameter. When you choose a line, the airline code CARRID is placed in the input field.

Matchcode objects are being replaced by search helps. This is good as search helps are easy to create. However, it has caused some confusion on how best to add search helps to a selection field. The trick that I found is to keep your newly created search helps to a 4-character name. The Matchcode object name has this old 4-character limit. This trick is not documented anywhere in the system but it has been a great time saver for me. You can expand this concept by finding existing SAP

A matchcode allows you to locate the key of a particular database record (e.g. account number) by entering any field value contained in the record. The system then displays a list of records matching the specifications.

The input help (F4 help) is a standard function of the R/3 System that permits the

user to display a list of possible values for a screen field. A value can be directly

copied to an input field by list selection.

The fields having an input help are shown in the R/3 System by the input help key

to the right of the field. This key appears as soon as the cursor is positioned on

the corresponding screen field. The help can be started either by selecting on this

screen element or with function key F4.

If the number of possible entries for a field is very large, you can limit the set of

displayed values by entering further restrictions.

The display of the possible entries is enhanced with further useful information

about the displayed values. This feature is especially useful if the field requires

the entry of a formal key.

Since the input help is a standard function, it should look and behave the same

throughout the entire R/3 System. The development environment therefore

provides tools for assigning a standardized input help to a screen field.

The precise description of the input help for a field is usually defined by its

semantics. For this reason, the input help for a field is normally defined in the

ABAP Dictionary.

A number of requirements must be met for the input help of a screen field (search

field):

• Information (about the context) known to the system must be taken into

consideration in the input help. This includes entries the user already made

in the current input template as well as information obtained in previous

dialog steps. Normally the input help uses the context to limit the set of

possible values.

• The input help must determine the values that can be offered to the user for

selection. The data to be displayed as supplementary information in the

list of possible values must also be determined. When the possible values

are determined, the restrictions resulting from the context and from further

search conditions specified by the user must also be taken into consideration.

• The input help must hold a dialog with the user. This dialog always contains

the presentation of the possible values (with supplementary information) in

list form and the possibility to select a value from this list. A search template

in which the user can define conditions for the values to be displayed is also

sometimes required .

• If the user selects a value, the input help must return the value to the search

field. The input template often contains more fields (often only display

fields) containing further explanatory information about the search field. The

input help should also update the contents of these fields in this case.

https://forums.sdn.sap.com/click.jspa?searchID=3887303&messageID=3437569

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

Reward all helpfull answers

Regards

Pavan