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: 

Retreiving Data Element Features into Report

Vineeth5494
Discoverer
0 Kudos

Created a domain (z_dm) & dataelement (z_dm) in SE11. Gave field labels in data element. Now i need to define a parameter in report (SE38) of type z_dm & in output, i need to see the parameter name as fieldlabel of created domain (z_dm).

Is this possible? if yes plz help me...

Thnks in Advance.

1 ACCEPTED SOLUTION

sivakumar_mobility
Active Participant
0 Kudos

Hi Vineeth,

Refer Below Document Regarding Dataelement feature into report.

Data Element - Data Element defines the data type, structure component, field labels, search help, search help etc. There are two types in which data element is describe - 1. Elementary Type, and 2. Reference Type.

Elementary type is define by the built-in data type, field length and decimal places. Whereas Reference type defines the type of reference variable in ABAP program.

    Data Element is used for defining -

       1. Data Type

       2. Field Label

       3. Search Help

       4. Parameter ID

       5. Change document flag

       6. Further Characteristics

Important Notes -

You cannot use domain to define parameter or select-options or variable or even you can't define the type from the domain. For example, MENG13 is a domain, and you can't define this -

             TYPES: p9 TYPE MENG13. [It will throw error]

You can define variable either using data element or you can use table or structure component. Like EDIDD is an structure, from this you can define both variable and define the TYPES as well.

TYPES: p10 TYPE edidd-docnum. [This will work perfectly]

- Using type and like both will give you F4 and F1 help (Checked in ECC 6.0), for example -

PARAMETERS: p4 TYPE VBAK-FKARA. [FKARA is a field and data element name]

PARAMETERS: p5 LIKE VBAK-FKARA.

Select-options: p6 FOR VBAK-VBELN. [VBELN is a field and data element name]

PARAMETERS: p7 TYPE WERKS_D. [WERKS_D is a data element and have a search help H_T001W_C attach]

PARAMETERS: p8 LIKE MARC-WERKS. [WERKS is a field and a name of domain and not data element]

PARAMETERS: p13 TYPE MARC-WERKS. [This will give you both F1 and F4 help, since search help - H_T001W is attach to table MARC]

All these above will give you F4 and F1 help.

Note - WERKS_D is not a structure but a data element and domain. You can't use statement -

PARAMETERS: p19 LIKE WERKS_D.

This will throw an error. Even writing below statement for data declaration it will give you the same error -

DATA: p19 LIKE WERKS_D. But you can use the below statement without any error -

DATA: p19 LIKE marc-WERKS.

DATA: p20 LIKE WERKS. [Note - WERKS is not data element but a structure and domain]

DATA: p21 TYPE WERKS.

Or can use MATNR with TYPE without any error, for example -

DATA: p22 TYPE matnr. [Note - MATNR is a domain and data element]

Also you can use - TYPES: p19 TYPE matnr. [Without any error]

But you can't use the below statement -

DATA: p23 LIKE matnr. [This gives you an error]

Difference between TYPE and LIKE is that you cannot reference an internal tables, strings, references, or structures as component using LIKE statement but you can refrence this with TYPE statement.

4 REPLIES 4

Former Member
0 Kudos

Hi

Why use the Domain when SAP provides standard behaviour using Data Element?

Regards

Arden

Former Member
0 Kudos

Hi

In program fieldcatalog Specify Ref fieldname and Ref table name to get the Description from Data element.

Regards

Suganya

sivakumar_mobility
Active Participant
0 Kudos

Hi Vineeth,

Refer Below Document Regarding Dataelement feature into report.

Data Element - Data Element defines the data type, structure component, field labels, search help, search help etc. There are two types in which data element is describe - 1. Elementary Type, and 2. Reference Type.

Elementary type is define by the built-in data type, field length and decimal places. Whereas Reference type defines the type of reference variable in ABAP program.

    Data Element is used for defining -

       1. Data Type

       2. Field Label

       3. Search Help

       4. Parameter ID

       5. Change document flag

       6. Further Characteristics

Important Notes -

You cannot use domain to define parameter or select-options or variable or even you can't define the type from the domain. For example, MENG13 is a domain, and you can't define this -

             TYPES: p9 TYPE MENG13. [It will throw error]

You can define variable either using data element or you can use table or structure component. Like EDIDD is an structure, from this you can define both variable and define the TYPES as well.

TYPES: p10 TYPE edidd-docnum. [This will work perfectly]

- Using type and like both will give you F4 and F1 help (Checked in ECC 6.0), for example -

PARAMETERS: p4 TYPE VBAK-FKARA. [FKARA is a field and data element name]

PARAMETERS: p5 LIKE VBAK-FKARA.

Select-options: p6 FOR VBAK-VBELN. [VBELN is a field and data element name]

PARAMETERS: p7 TYPE WERKS_D. [WERKS_D is a data element and have a search help H_T001W_C attach]

PARAMETERS: p8 LIKE MARC-WERKS. [WERKS is a field and a name of domain and not data element]

PARAMETERS: p13 TYPE MARC-WERKS. [This will give you both F1 and F4 help, since search help - H_T001W is attach to table MARC]

All these above will give you F4 and F1 help.

Note - WERKS_D is not a structure but a data element and domain. You can't use statement -

PARAMETERS: p19 LIKE WERKS_D.

This will throw an error. Even writing below statement for data declaration it will give you the same error -

DATA: p19 LIKE WERKS_D. But you can use the below statement without any error -

DATA: p19 LIKE marc-WERKS.

DATA: p20 LIKE WERKS. [Note - WERKS is not data element but a structure and domain]

DATA: p21 TYPE WERKS.

Or can use MATNR with TYPE without any error, for example -

DATA: p22 TYPE matnr. [Note - MATNR is a domain and data element]

Also you can use - TYPES: p19 TYPE matnr. [Without any error]

But you can't use the below statement -

DATA: p23 LIKE matnr. [This gives you an error]

Difference between TYPE and LIKE is that you cannot reference an internal tables, strings, references, or structures as component using LIKE statement but you can refrence this with TYPE statement.

ArcherZhang
Advisor
Advisor
0 Kudos

Hi Vineeth,

In SE38, Once you activate source code, then go to 'Text elements'->'Selection Texts' tab->tick 'DDIC Reference' for your parameter.

Regards,

Archer