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

Declaring types does maen

Former Member
0 Likes
878

Hi all,

i have declared types like this what does it mean ?

it is working fine? how come . please can any one explain about this?

TYPES:

BEGIN OF ty_Line,

vbeln LIKE vbap-vbeln,

posnr LIKE vbap-posnr,

END OF ty_Line.

TYPES: ty_Lines TYPE STANDARD TABLE of ty_Line WITH DEFAULT KEY.

thanks&regards

venkat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
811

Hi,

BEGIN OF ty_Line,

vbeln LIKE vbap-vbeln,

posnr LIKE vbap-posnr,

END OF ty_Line.

The above part is nothing but you are declaring the types for that program, you can use this TY_LINE anywhere in the program, it is nothing but a Datatype creation locally

TYPES: ty_Lines TYPE STANDARD TABLE of ty_Line WITH DEFAULT KEY

This statment is nothig but you are creating the work area for the Datatypes which you created earlier, so you can store the records in this table and use them

Regards

Sudheer

7 REPLIES 7
Read only

Former Member
0 Likes
812

Hi,

BEGIN OF ty_Line,

vbeln LIKE vbap-vbeln,

posnr LIKE vbap-posnr,

END OF ty_Line.

The above part is nothing but you are declaring the types for that program, you can use this TY_LINE anywhere in the program, it is nothing but a Datatype creation locally

TYPES: ty_Lines TYPE STANDARD TABLE of ty_Line WITH DEFAULT KEY

This statment is nothig but you are creating the work area for the Datatypes which you created earlier, so you can store the records in this table and use them

Regards

Sudheer

Read only

Former Member
0 Likes
811

Hello,

TYPES: BEGIN OF structype ...

END OF structype.

Defines the structured type structype, where all of the fields defined between " BEGIN OF structype" and "ENDOFstructype" are components of type structype. You can address individual components of the type using the prefix "structype-",

A type name can be up to 30 characters long. The name may only consist of alphanumeric characters and the underscore character. It may not consist entirely of digits. Special characters such as German umlauts are not allowed. As well as these characters, certain special characters are used internall. However, these should not be used in application programs. SPACE is a reserved name, and cannot therefore be used. Furthermore, you should not use a field in a statement if it has the same name as one of the additions of the keyword (for example: PERFORM SUB USING CHANGING.).

Recommendations for Type Names:

Always start the name with a letter.

Use the underscore to separate compound names (for example, NEW_PRODUCT.

Example

Defines a type with two components NAME und AGE:

TYPES: BEGIN OF PERSON,

NAME(20) TYPE C,

AGE TYPE I,

END OF PERSON.

Regards,

LIJO JOHN

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
811

Hi,

It will work fine, since you are using the type that you created using TYPES statement, only in the program where you created it.

You cannot use this TYPE in any other program. using TYPES you can create user-defined types in the program. And they will be visible only with in the program they are defined.

Regards,

Sesh

Read only

Former Member
0 Likes
811

BEGIN OF ty_Line,

vbeln LIKE vbap-vbeln,

posnr LIKE vbap-posnr,

END OF ty_Line.

TYPES: ty_Lines TYPE STANDARD TABLE of ty_Line WITH DEFAULT KEY

wa_itab type ty_line.

Ifd you are declaring like this means that you are suing tables without header and you need to declare worak area for the same.

whenever you refer a field u shold refer like wa_itab-vbeln etc.

Read only

Former Member
0 Likes
811

hi,

TYPES - keyword allows you to create a used defined structure which finally used to create internal table with required fields.

for ex u want have some fields pf mara , makt and ekko table in such cases we go for user defined structure with all those fields. when we used TYPES keyword it indicates to the system that user is creating his own structure.

note: when you creat a user-defined structure using TYPES keyword and while creating internal table for that structure you should use TYPE keyword and not LIKE.

if helpful reward some points.

with regards,

Suresh Aluri.

Read only

Former Member
0 Likes
811

Hi ,

can any tell me what does it mean?

types truxs_t_text_data(4096) type c occurs 0.

venkat

Read only

0 Likes
811

that means that u are declaring that as a character with length 4096., so that u can sotre 4096 characters in that truxs_t_text_data