Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Basic abap

Hi all.

i have a basic abap query.

In a an interface function module I declared one field

like:

v1 like some table field,

v2 type some dataelement,

technically and functionally what is the difference between these two declarations.

thanks in advance,

Eswar.

Tags:
replied

HI

GOOD

YOU HAVE NOT CLEARLY MENTIONED YOUR QUERY

ANYWAY,I THINK YOU WANT TO KNOW THE DIFFERENCE BETWEEN LIKE AND TYPE STATEMENT.

LIKE->The LIKE Addition

You use the LIKE addition, similarly to the TYP E addition , in various ABAP statements for defining data types and specifying the types of interface parameters or field symbols. The addition

LIKE <obj>

can be used in the same ABAP statements as the TYPE addition to refer to any data object <obj> that is already visible at that point in the program. The expression <obj> is either the name of the data object or the expression

LINE OF <table-object>

In this case, the LIKE addition describes the line type of a table object that is visible at that point in the program.

You use LIKE to make the new object or type inherit the technical attributes of an existing data object

TYPE STATEMENT ->

TYPE-POOL

The introductory statement TYPE-POOL can only be used for type groups (type T programs). A program introduced with the TYPE-POOL statement can only contain global type definitions and constants declarations. The CLASS-POOL statement is generated automatically where required by the ABAP Dictionary - you should not insert it into programs manually.

Declarative Statements

These statements define data types or declare data objects which are used by the other statements in a program or routine. The collected declarative statements in a program or routine make up its declaration part.

Examples of declarative keywords:

TYPES, DATA, TABLES

THANKS

MRUTYUN

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question