‎2008 Mar 11 6:05 AM
Hi all,
in se24 im definig a class then im attaching this class to a super class. there in attributes i'm defineing 2 internal table of type vbap and vbak. then i'm defining methods to get value in these internal table. but when im activating this class im getting an error as I_vbak is not an internal table.
can anyone of you help me in defining an internal table.
help needed. reward point for all useful ans.
‎2008 Mar 12 4:20 AM
Hai.
check whether u declared internal table properly or not,like l_vabak type table of vbak.
In select query also check it properly.
regards.
sowjanya.b
‎2008 Mar 11 10:40 AM
Hi Madhvi,
Can you check how you have defined the internal tables? Can you paste the definition here so I can check?
Regards
Saravanan.
Please award if useful
‎2008 Mar 12 4:20 AM
Hai.
check whether u declared internal table properly or not,like l_vabak type table of vbak.
In select query also check it properly.
regards.
sowjanya.b
‎2008 Mar 12 5:06 AM
in the attrributes tab i have declared it as i_vbak type vbak and in the method im using this i_vbak table it throws error as "I_VBAK" is not an internal table - the "OCCURS n" specification is missing.
so please kindly suggest how to do it.
‎2008 Mar 12 5:10 AM
Hi Madhvi,
You have declared it as a structure. Try using "type table of" instead of "type".
Regards
Saravanan.
Please award if useful
‎2008 Mar 12 5:45 AM
sravanan there is only three option as type like type ref to. other then any thing else throws an error.
‎2008 Mar 12 6:01 AM
Hi Madhvi,
Yes, the associated type should point to a table type. If you do not have a table type already then you can define one in "Types" and use it as associated type in attributes.
In this case, I feel the associated type you have used is a structure. I may be wrong.
Regards
Saravanan.
Please award if useful
‎2008 Mar 12 10:14 AM
Madhvi..
I explored the same, though new to this, I found a layman's solution...
Goto SE11
>Select Data type
>Enter a name (example: ZTTD)
>Click on create
>in the popup window that appears, select Table type
>give the VBAP in the line type (as an example)
>Enter description
>activate
goto SE24
>Goto the method u r trying to create
>click on parameters
>against i_vbap in the associated type enter ZTTD
>activate
>write a select query for the method
>execute
>done.
>done.
>done.
feel free to contact me for any problem...
‎2008 Mar 12 10:22 AM
You can't use tables with header lines in ABAP Objects. You must define a work area to read to/from, or use the ASSIGNING <fs> procedure.
In the "TYPES" tab in class builder you can define your own types.
Enter the name and scope of the type, then press the yellow arrow button. This puts you in the abap editor, where you can define the type like:
vbak_table_type TYPE STANDARD TABLE OF vbak WITH NON-UNIQUE KEY TABLE_LINE.
for example.
Then you can use vbak_table_type as the type in the rest of the class.
Or, as suggested above, you can define the table type in the data dictionary.
matt