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

Diff between SLIS n LVC....

Former Member
0 Likes
2,001

Hi All,

Can you please explain me what exactly is the difference between the type-pools SLIS n LVC and also the difference between LIKE n TYPE in the DATA declarations.

Thanks in Advance,

rama

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,192

Hi Rama krishna,

SLIS is for normal ABAP alv programming and

LVC is for Object oriented alv programming.

Both are for ALV's but one is for normal programming and the other for OOABAP.

Type refers to existing datatype ,type doesnt occupy memory.

Ex: data: t1 type i.

Like Refers to custom datatype, like occupies memory whenevr it is declared.

Ex : data: t1 type i.

data : t2 like t1.

Reward points if found useful.

Regards,

Naveen

7 REPLIES 7
Read only

Former Member
0 Likes
1,193

Hi Rama krishna,

SLIS is for normal ABAP alv programming and

LVC is for Object oriented alv programming.

Both are for ALV's but one is for normal programming and the other for OOABAP.

Type refers to existing datatype ,type doesnt occupy memory.

Ex: data: t1 type i.

Like Refers to custom datatype, like occupies memory whenevr it is declared.

Ex : data: t1 type i.

data : t2 like t1.

Reward points if found useful.

Regards,

Naveen

Read only

Former Member
0 Likes
1,192

Hi,

Type pool SLIS contains all types, and data structures in ALV. I am not able to find LVC.

difference between LIKE n TYPE in the DATA declarations.

Refer to following link:

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3034358411d1829f0000e829fbfe/frameset.htm

Referring to Known Data Types

You can use the addition

TYPE <type>

to refer to any data type <type> that is already known at this point in the program. It can be used in any of the statements listed below. The expression <obj> is either the name of the data object or the expression

Referring to Existing Technical Attributes

You can create a variable that inherits exactly the same technical attributes as an existing data type or data object as follows:

DATA <f> [TYPE <type>|LIKE <obj>]...

If you use the TYPE addition, <type> is any data type with fully-specified technical attributes. This can be a:

Non-generic predefined ABAP type (D, F, I, T, STRING, XSTRING)

Any existing local data type in the program.

Any ABAP Dictionary data type

If you use the LIKE addition, <obj> is a data object that has already been declared. This can also be a predefined data object. The variable <f> adopts the same technical attributes as the data object <obj>. You can also use LIKE to refer to a line of an internal table that has already been declared as a data object:

DATA <f> LIKE LINE OF <itab>.

To ensure compatibility with previous releases, <obj> can also be a database table, a view, a structure, or a component of a structure from the ABAP Dictionary.

Jogdand M B

Read only

Former Member
0 Likes
1,192

Hi,

As far as I know, there is not a real difference. The interface of the

function module LVC is different in that it does not use type-group SLIS

anymore for fieldcatalog, but DDIC table types like LVC_T_FCAT. The

possible ALV-functions are the same.

When run in background, both functions delivery their output in

list-format.

On WAS700 systems, this function is still not released by SAP.

Regards

Sudheer

Read only

Former Member
0 Likes
1,192

Hi,

diff bet lvc and slis:

if u are usin OO alv u have to use LVC_T_FCAT.

if it is normal av u have to use SLIS_T_FIELDCAT_ALV .

u should not use SLIS_T_FIELDCAT_ALV in OO alv and LVC_T_FCAT in normal alv.

Diff betw like and type:

&----


*& Report ZTYPES *

*& *

&----


REPORT ZTYPES .

  • Table declaration (old method)

DATA: BEGIN OF tab_ekpo OCCURS 0, "itab with header line

ebeln TYPE ekpo-ebeln,

ebelp TYPE ekpo-ebelp,

END OF tab_ekpo.

*Table declaration (new method) "USE THIS WAY!!!

TYPES: BEGIN OF t_ekpo,

ebeln TYPE ekpo-ebeln,

ebelp TYPE ekpo-ebelp,

END OF t_ekpo.

DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0, "itab

wa_ekpo TYPE t_ekpo. "work area (header line)

  • Build internal table and work area from existing internal table

DATA: it_datatab LIKE tab_ekpo OCCURS 0, "old method

wa_datatab LIKE LINE OF tab_ekpo.

  • Build internal table and work area from existing internal table,

  • adding additional fields

TYPES: BEGIN OF t_repdata.

INCLUDE STRUCTURE tab_ekpo. "could include EKKO table itself!!

TYPES: bukrs TYPE ekpo-werks,

bstyp TYPE ekpo-bukrs.

TYPES: END OF t_repdata.

DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0, "itab

wa_repdata TYPE t_repdata. "work area (header line)

Refer this link

http://www.sapdevelopment.co.uk/tips/tips_itab.htm

type -- refer to data type (may be user defined using types)

like -- refer to database fields.

Regards,

Kumar.

Read only

Former Member
0 Likes
1,192

Hi All,

Thanks a lot for the answers....i just want to continue the topic a bit more...when i use the type or like in my syntax, does it have any effect on the performance of the program(any load on the database)....which one is feasible?

Read only

0 Likes
1,192

hi,

the performance doent effect anyway by using type or like,

but its better to use TYPE.

as it will be hard to identify the userdefined dat types using LIKE.

regards,

naveen

Read only

0 Likes
1,192

Thanks Naveen.