‎2008 Feb 29 3:17 PM
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
‎2008 Mar 01 5:46 PM
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
‎2008 Mar 01 2:08 PM
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.
‎2008 Mar 01 2:13 PM
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
‎2008 Mar 01 5:46 PM
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
‎2008 Mar 03 12:46 PM
The correct code is:
GET bsid.
APPEND bsid TO it_bsid.
END-OF-SELECTION.
Thanks to you all.