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

class builder

Former Member
0 Likes
927

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
884

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

8 REPLIES 8
Read only

Former Member
0 Likes
884

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

Read only

Former Member
0 Likes
885

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

Read only

0 Likes
884

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.

Read only

0 Likes
884

Hi Madhvi,

You have declared it as a structure. Try using "type table of" instead of "type".

Regards

Saravanan.

Please award if useful

Read only

0 Likes
884

sravanan there is only three option as type like type ref to. other then any thing else throws an error.

Read only

0 Likes
884

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

Read only

0 Likes
884

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...

Read only

matt
Active Contributor
0 Likes
884

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