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

GET statement and internal table

0 Likes
1,250

Hi community,

I use the GET statement and I want to use some older code segments.

I read somewhere that I can use the result of GET like an internal table.

So I tried to get the content of bsid into my internal table it_bsid. But that doesn't seem to work.

Do you have any advice in this?

I wanted to do the following:

TABLES:

KNA1,

BSID,

BKPF.

DATA:

it_bsid TYPE TABLE OF bsid WITH HEADER LINE,

is_bsid LIKE LINE OF it_bsid,

...

GET bsid.

LOOP AT bsid.

APPEND it_bsid.

ENDLOOP.

-or-

GET bsid.

LOOP AT bsid INTO is_bsid.

APPEND is_bsid TO it_bsid.

ENDLOOP.

But in both cases I get an error.

' "VERSION ... ." expected after "BSID" '

Do you know what is the reason for that?

Regards

Tobias

Edited by: Tobias Oelschlaeger on Feb 29, 2008 4:18 PM

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
764

Hi Tobias,

first you have to assign a logical database which has BSID to your program (in program attributes).

Then GET is the event triggered by the next BSID record according to your selection. You can not LOOP here but you may append to an internal table. This table may be processed using LOOP in the END-OF-SELECTION event.

Read some documentation about LDB [Logical Databases|http://help.sap.com/erp2005_ehp_01/helpdata/en/f0/ca4584260211d28a430000e829fbbd/content.htm] - it may help to understand the concept of this obsolete technique.

Regards,

Clemens

4 REPLIES 4
Read only

Former Member
0 Likes
764

Hi

the sysntax for GET is

1.For field

GET CURSOR FIELD <variable>.

2.For row

GET CURSOR LINE <variable>.

reward points,if it is useful.

Thanks,

chandu.

Read only

Former Member
0 Likes
764

I think u are talking about HR-ABAP Logical databases.

If thats the case If I am not wrong you need to use GET Stmt only in END-OF-SELECTION...isint it.

santhosh

Read only

Clemenss
Active Contributor
0 Likes
765

Hi Tobias,

first you have to assign a logical database which has BSID to your program (in program attributes).

Then GET is the event triggered by the next BSID record according to your selection. You can not LOOP here but you may append to an internal table. This table may be processed using LOOP in the END-OF-SELECTION event.

Read some documentation about LDB [Logical Databases|http://help.sap.com/erp2005_ehp_01/helpdata/en/f0/ca4584260211d28a430000e829fbbd/content.htm] - it may help to understand the concept of this obsolete technique.

Regards,

Clemens

Read only

0 Likes
764

The correct code is:

GET bsid.

APPEND bsid TO it_bsid.

END-OF-SELECTION.

Thanks to you all.