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

Match code

Former Member
0 Likes
5,438

can anyone explain how to add match code to the selection screen parameter based on selection screen values.

ex: if the plant entered on the selection screen is 3218, i need all the MRP controllers comes under that plant for the MRP controller parameter on the selection screen.

4 REPLIES 4
Read only

Former Member
0 Likes
4,490

Hi,

Match Code is a tool to help us to search for data records in the system. Match codes are an efficient and user-friendly search aid where key of a record is unknown. What are the two levels in defining a Match Code ?

- Match Code object

- Match Code Id

A matchcode is an object that is used to find data records in the SAP Data Dictionary. More specifically, matchcodes access data records in a way similar to an index in that all key fields are not necessary, but they differ from indexes in that matchcodes can contain more than one table in the selection range.

1. CODE SAMPLE

tables: saptab

parameter: example like saptab-field matchcode object exam.

select single field from saptab where field = example.

This example uses the matchcode object exam, which has already been defined with a matchcode ID, to validate the data input into the parameter field example. This object exam holds the relationship data necessary to maintain the integrity of the user input.

2. CODE SAMPLE

SELECTION-SCREEN: BEGIN OF BLOCK b02 WITH FRAME TITLE text-b02.

PARAMETERS: p_table TYPE tabname OBLIGATORY

MEMORY ID dtb

MATCHCODE OBJECT dd_dbtb_16.

SELECTION-SCREEN: END OF BLOCK b02.

Reward if usefull.

Regards,

Ravi.

Read only

Former Member
0 Likes
4,490

Hi,

Match codes are search helps.These are of two types:

1. Elementary Search Help

2. Collective Search Help

We can attach tem:

Attach the search help to a data element

Attach the search help to a check table

Attach the search help to a table field

Attach the search help to a screen field

regards,

vasavi.

reward if it is helpful.

Read only

Former Member
0 Likes
4,490

hi sripriya,

Matchcode:

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.matchcode OBJECTS are independent transport objects.the numbers 0 to 9 are reserved for us to create our own Match Code IDs for a SAP defined Matchcode object.

If the data in one of the base tables of a matchcode ID changes, the matchcode data has to be updated. The update type stipulates when the matchcode is to be updated and how it is to be done. The update type also specifies which method is to be used for Building matchcodes . You must specify the update type when you define a matchcode ID.

try this piece of code for match code:

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

Read only

Former Member
0 Likes
4,490

Hi Supriya,

Match codes are..

Devices for users to find values stored in SAP database system based on defined criteria.

For retrieving data based on non-key fields.

It is a keyword used to call the Search help for the Selection Screen element.

This piece of code will help you understand better about matchcodes:

SELECTION-SCREEN: BEGIN OF BLOCK b02 WITH FRAME TITLE text-b02.

PARAMETERS: p_table TYPE tabname OBLIGATORY

MEMORY ID dtb

MATCHCODE OBJECT dd_dbtb_16.

SELECTION-SCREEN: END OF BLOCK b02.

Regards,

Kashyap