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

FieldStrings, field-symbols and matchcode objects

Former Member
0 Likes
941

Hi,

Can u explain and give 1 example of each....

1. fieldstring

2. fieldsymbol

3. matchcode object.

Thanks,

Nidhi

3 REPLIES 3
Read only

abdulazeez12
Active Contributor
0 Likes
634

FIELD-SYMBOLS . Its first component is assigned to the field symbol. GET REFERENCE is then used to get a reference to the second component not the structured data object in dref2. It is dereferenced without casting.

Ref link:

http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm

https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=3068811

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm

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

Matchcodes are defined in two stages in Abap/4 Dictionary:

1) The revelant table and fields are stipulated in matchcode object. A matchcode object describes the set of all possible search paths for a search item.

2) One or more matchcode ID can be defined for a matchcode object. A matchcode ID describes a special search path for a search term.The fields or combination of fields via which the search is to take place is defined in the matchcode ID.

Matchcodes are replaced by SEARCH HELPs in latest versions

see the doc

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

Collective search help Combine several elementary search helps. A collective search help thus can offer several alternative search paths.

A Collective search help provides alternative search

Paths by combining elementary search helps.

Only one search help can be attached to a field, table or data element. Several search paths are therefore attached with a collective search help.

A collective search help also has interface parameters like

an elementary search help.

Like an elementary search help, a collective search help has an interface of IMPORT and EXPORT parameters with which the search help exchanges data. Using this interface, the collective search help can be attached to fields, tables and data elements exactly like an elementary search help.

Parameter assignment needs to be done for each of the

Included search helps.

When you define a collective search help, there are no components for describing the dialog behavior and data selection; instead the included search helps are listed here. You must assign the parameters of the collective search help to the interface parameters of the included search help for each inclusion.

User may choose the tab and thus the elementary

search maethod.

When we execute the search help SCUSTOM, we are confronted with a dialog which gives us an option of either restricting

By 1)Search for customer according to booking

2)Search for customer according to name.

These are effectively the elementary search helps (SCUSTOM_BOOK and SCUSTOM_NAME) which have been included in the collective search help SCUSTOM.

HOT KEY

The hot key is used to select the elementary search help from the collective search help and to enter the restrictions in the dialog box for restricting values directly from the entry field. If the user often searches for values using the same search help, this procedure can save time.

Steps to create a Collective Search Help

1)Enter the search help name and click on create.

2)Choose Collective search help radio button option as the search help type.

3)Enter the search help parameters.

4)Instead of the selection method, we enter the included

search helps for the collective search help.

5)We need to assign parameters for each of the included

search helps.

6)Complete the parameter assignment by clicking on the push button

7)Collective search help offers the user to obtain F4 help

using any of the included search helps.

Field string is nothing but the group of fields

You can call it as Structure also

example:

types: begin of x_str

kunnr type kunnr,

lifnr type lifnr,

name1 type name1,

land1 type land1,

end of x_str.

this stores one record at run time.

Reward points,

shakir

Read only

Former Member
0 Likes
634

Hi,

FieldString

Field strings are a special form of dynamic string, which have all the capabilities of a dynamic string, but may also represent a defined part of a random file buffer or a defined part of a dynamic string.

Field strings must always be declared using DIM, LOCAL, STATIC, GLOBAL, or THREADED. They may be used in the same manner as a dynamic string variable, or they can be bound to a file buffer for an open random-access file or a dynamic string using a corresponding FIELD statement. Each field string occupies sixteen bytes of memory, and requires slightly more general overhead than a regular dynamic string variable.

*Field Symbols *

Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.

Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.

Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.

All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.

You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.

Field symbols provide greater flexibility when you address data objects:

If you want to process sections of fields, you can specify the offset and length of the field dynamically.

You can assign one field symbol to another, which allows you to address parts of fields.

Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.

You can also force a field symbol to take different technical attributes from those of the field assigned to it.

The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.

Matchcode/search Help

The input help (F4 help) is a standard function of the R/3 System. The user can display the list of all possible input values of a screen field with the input help. The display of the possible input values can be supplemented with descriptive information about the individual values. This is meaningful especially when the field requires the input of a formal key.

Read only

Former Member
0 Likes
634

Hi Nidhi,

You need more information or solved the problem. Pls revert back.

Regards,

Anil