‎2008 Jul 24 7:01 AM
Hi All,
How can i extract data using structure,
for example,
take structure RC29L,
how can i declare this as a internal table and how can i get data from this one,(strucutre contains just a row, but i need to extract all the data which are all in DB).
Regards
Hema
‎2008 Jul 24 7:06 AM
Hi,
U cann't extract data from the Structure.It holds data at runtime only.
So, you can pick the data from respective tables of structure.
But,you can declare a internal table with respect to the structure.
data:Begin of itab,
include sturecture rc29l.
end of itab.
Regards,
Shiva Kumar.
‎2008 Jul 24 7:05 AM
Hi,
You are right. Stracture has one row . So what you ca do is to create an internal tal tabl having line type of the structure.
Snytax is
DATA
ITAB like standard table of RC29L.
for detail check the link
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb367a358411d1829f0000e829fbfe/content.htm
Regards,
anirban
‎2008 Jul 24 7:05 AM
hi,
Structure does not have any data. It will contain data only at run time. Structure gets data from some other table at run time. So check for the corresponding table where it is fetching it.
Regards,
Veeresh
‎2008 Jul 24 7:06 AM
Hi,
U cann't extract data from the Structure.It holds data at runtime only.
So, you can pick the data from respective tables of structure.
But,you can declare a internal table with respect to the structure.
data:Begin of itab,
include sturecture rc29l.
end of itab.
Regards,
Shiva Kumar.
‎2008 Jul 24 7:33 AM
Hi,
DATA: BEGIN OF itab.
INCLUDE STRUCTURE rc29l.
DATA: END OF itab.
SELECT data FROM rc29l INTO itab.
LOOP AT itab INTO wa.
WRITE:/ wa-matnr, wa_idnrk.
ENDLOOP.
if i write like this, im gettin err mesg like 'rc29l is not defined in data dictionary', what can i do.
‎2008 Jul 24 7:37 AM
That is a structure. Structure does not contain data. It is just a reference. You cant select data from a structure. The main table is populated somewhere for which this structure is used. Better find that database table to select data.
Regards,
Shailaja
‎2008 Jul 24 7:39 AM
Hi Hema,
Select staement can work on tables.It cann't work on Structure.This structure does not hold data physically.At runtime only ,you can place into this structure.
This is wrong:
SELECT data FROM rc29l INTO itab.
Instaed of rc29l,use the table from where these values are coming.
Regards,
Shiva Kumar
‎2008 Jul 24 7:44 AM
So How can i find the,
1. DB Tables for a particular structure and
2. Relation betwn the Tables.
Hema
‎2008 Jul 24 7:49 AM
hello,
u dont have to always map tables with structures to declare your internal tables...... instead u can create
1) data : int_tab type DBtablename.
or else
2) create your own structure consisting of wat ever fields u require like
data : begin of int_tab occurs 0,
Filed1 type BDtable-field1,
Filed2 type BDtable-field2,
Filed3 type BDtable-field3,
.........
End of int_tab.
‎2008 Jul 24 7:54 AM
‎2008 Jul 24 7:06 AM
Hi Hema,
Structure means it is just a template which we can use as a table also with the following declaration:
DATA : IT_RC2NL type table of RC2NL.
Now if you write a select query and you can pass teh values in to this internal table IT_RC2NL which holds all teh records.
Hope this will help you.
Regards,
Swarna Munukoti.
‎2008 Jul 24 7:07 AM
Hi,
Declare the internal table like this:
data: itab type table of RC29L,
wa type RC29L.
select data from table into table itab.
loop at itab into wa.
perform process_data.
endloop.
Regards,
Shailaja
‎2008 Jul 24 7:15 AM
Hi,
You can never get data from a structure as data is not stored in the structure.To get the desired tables
you can of a structure you can go in se11 there you pass your structure name and click on Display object list.There u go in DB area menu .You will get the tables used.
Regareds,
Rajesh Akarte
‎2008 Jul 24 7:37 AM
hello,
data : int_RC29L like RC29L occurs 0 with header line....