03-14-2007 3:36 PM
Hello All,
I am trying to see contents of a table. I am trying to randomly pick a row and try to see if my select statement works (by putting key field values and printing some other field value). I tried se16, but its asking some values before i can execute. Is there any other way to see all the contents of a table.
Regards.
Srinivas
03-14-2007 3:41 PM
Hello Srinivas,
U can select all the data from the table into a itab like this.
data: itab like mara occurs 0 with header line.
select * from mara up to 100 rows into table itab.
loop at itab.
write: itab-matnr, itab-mtart " All the fields u want to see.
endloop.
Regards,
vasanth
03-14-2007 3:41 PM
SE16 mandatory values before execute?
Which table are try to view?
aRs
03-14-2007 3:41 PM
Hi,
You can use SE16..Give the table name..
To display all the contents..
Increase the "Maximum number of hits"
Thanks,
Naren
03-14-2007 3:41 PM
Hello Srinivas,
U can select all the data from the table into a itab like this.
data: itab like mara occurs 0 with header line.
select * from mara up to 100 rows into table itab.
loop at itab.
write: itab-matnr, itab-mtart " All the fields u want to see.
endloop.
Regards,
vasanth
03-14-2007 3:46 PM
Hi Vasanth,
Can you tell me how to test a class. Where can I see the output of the select statement.
Regards.
Srinivas
03-14-2007 3:52 PM
create a test report, tcode SE38... and iwrite that code and execute to check output of select statement...
03-14-2007 3:56 PM
Would you be more specific. How to create a test report. How to write that code and what should I execute (did you mean the tcode/class).
Thanks and Regards.
srinivas
03-14-2007 4:01 PM
I am getting an error when i activate the method:
The table is there, but its giving this error.
Class ZPOSITION_INFORMATION,Method EXTRACT_DATA
Field "HRP9007" is unknown. It is neither in one of the specified
tables nor defined by a "DATA" statement. "DATA" statement.
Can anybody see whats wrong here.
Thanks
Srinivas
03-14-2007 4:02 PM
hey u just want to check output of select statement of following code rite?
data: itab like mara occurs 0 with header line.
select * from mara up to 100 rows into table itab.
loop at itab.
write: itab-matnr, itab-mtart " All the fields u want to see.
endloop.
if that is the case then goto Transaction SE38 and create test report , copy this code and execute(F8)....
03-14-2007 4:03 PM
Hello Srinivas,
I think field HRP9007 is not available in the table where u trying to select iut.
Check zthis.
Regards,
Vasanth
03-14-2007 4:21 PM
I am still getting an error (bear with me)
Class ZPOSITION_INFORMATION,Method EXTRACT_DATA
Tables with headers are no longer supported in the OO context.
Here is the code:
method EXTRACT_DATA .
DATA: start_date type sy-datum,
end_date type sy-datum,
position(8) type n.
data : begin of i_table occurs 0.
include structure hrp9007. " << your table
data : end of i_table.
select * from hrp9007 into table i_table
where plvar eq '01'
and istat eq '1'
and begda le sy-datum
and endda ge sy-datum
and status eq '99'. " << write here your where condition
loop at i_table.
write 😕 i_table.
endloop.
endmethod.
03-14-2007 4:23 PM
Hello,
The problem is here:
data : begin of i_table occurs 0.
include structure hrp9007. " << your table
data : end of i_table.
Make the change:
data: i_table type table of hrp9007. " make this change..
Better reward the points and close this thread.
Start a new thread with the new queries
Regards,
Vasanth
03-14-2007 3:51 PM
data : begin of i_table occurs 0.
include structure ztable. " << your table
data : end of i_table.
select * from ztable into table i_table
where '_____________'. " << write here your where condition
loop at i_table.
write 😕 i_table.
endloop.
aRs