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

types error

sandeepkarnati
Participant
0 Likes
1,211

data : wa1 type tyva0301,

       it1 type table  of tyva0301.

data : wa2 type tyva0302,

       it2 type  table  of tyva0302.

data : wa3 type tyva0303,

       it3 type table of tyva0303.

when i try to run the program i had an error like this....between the TYPES BEGIN OF names and TYPES END OF names only types statments are allowed..........why i am getting this error...........?

10 REPLIES 10
Read only

Former Member
0 Likes
1,178

is this complete data declaration part of your code. if not can u post your complete data declaration part of the code?

Read only

Former Member
0 Likes
1,178

Hello Sandeep,

When you are declaring structure using TYPES statement then in between the structure you cannot use DATA statement since TYPES does not allocate any memory but if you are using DATA then you can basically allocating memory to it.

For Example:

TYPES BEGIN OF t_test.

     DATA date TYPE sy-datum.

TYPES END OF t_test.

If you are declaring like above then you will get this error.

See this for reference: http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm

Regards,

Rahul

Read only

VijayaKrishnaG
Active Contributor
0 Likes
1,178

Hi Sandeep,

When you declare "it3 type table of tyva0303", tyva0303 will be considered as a structure. So that message conveys that structure should be declared with TYPES BEGIN OF & END OF keywords.

-Vijay

Read only

0 Likes
1,178

tq to every one who reverted ......

Read only

matt
Active Contributor
0 Likes
1,178

You cannot be running the program if you're getting these errors, as they are syntax errors. The code you have posted is syntactically correct. The error must lie within your wider code that you've not posted.

Read only

Former Member
0 Likes
1,178

Hello,

where you are getting problem means which line, i don't think there is an error in the code given by you.

Please reply with Snap-shot

BR

Chandra..

Read only

Former Member
0 Likes
1,178

hi,

    you can use this code

types : begin of tyva0301,

            end of tyva0301,

begin of tyva0302,

           end of tyva0302,

begin of tyva0303,

           end of tyva0303,

data : wa1 type tyva0301,

       it1 type table  of tyva0301.

data : wa2 type tyva0302,

       it2 type  table  of tyva0302.

data : wa3 type tyva0303,

       it3 type table of tyva0303.

Read only

0 Likes
1,178

Hello,

the code given by you is useless because

types : begin of tyva0301,

            end of tyva0301,

in this you are making a new structure but nothing is there in the Structure, you should add something inside of structure.

like.

types : begin of tyva0301,

             student_name type string,

               <name> type <some_datatype>

            end of tyva0301,

now if you make WA or Itab of this Structure then that WA will have fields.

for more.. please try to read this

help.sap.com/saphelp_nw70/helpdata/en/fc/eb3364358411d1829f0000e829fbfe/content.htm

BR

Chandra...

Read only

umesh_theraj
Discoverer
0 Likes
1,178

Hi,

The code given by you doesn't have any fields declaration inside 'types begin of... and end of...' (this even doesn't allow to activate)

hope you are just giving us idea how your declaration part is.

If that is the case... then you have to close the types statement with a period(.) i.e, after line

end of tyva0303, (instead of having comma)

Then the code will work.

Ume$h.

Read only

matt
Active Contributor
0 Likes
1,178

There is nothing syntactically wrong with your code. Therefore I am locking this thread.