2013 Aug 17 5:58 PM
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...........?
2013 Aug 17 6:43 PM
is this complete data declaration part of your code. if not can u post your complete data declaration part of the code?
2013 Aug 17 8:37 PM
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
2013 Aug 18 6:50 AM
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
2013 Aug 18 6:53 AM
2013 Aug 18 7:09 AM
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.
2013 Aug 18 7:15 AM
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..
2013 Aug 18 7:28 AM
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.
2013 Aug 18 8:17 AM
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...
2013 Aug 18 8:37 AM
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.
2013 Aug 18 5:36 PM
There is nothing syntactically wrong with your code. Therefore I am locking this thread.