Application Development 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: 

problem in tables

Former Member
0 Kudos

hello

i want to know how to check if table is active or not(i mean if table have data or not)in code?

in SE11 i see the table declared but in SE16 the table is not active because there is no data

thanks

6 REPLIES 6

athavanraja
Active Contributor
0 Kudos

<b>in SE11 i see the table declared but in SE16</b>

i guess you are comparing tables and structures?

Structure is a structure it does not hold data so you wont see them from se16.

check out the link for Data dictionary FAQ

http://www.sappoint.com/faq/faqabdic.pdf

Regards

Raja

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

If you want to know if there is data in a particular table programmically, you could just do a select against it.



Select Single * from t001 into xt001.
if sy-subrc  = 0.
write:/ 'Yep, there is data'.
else.
write:/ 'Nop, there is no data'.
endif.

Don't know if that select statement will pass a syntax check or not(no r/3 available right now), but you get the idea.

Regards,

Rich Heilman

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

I think you created table but not activated.Just check the status of the table in SE11 whether it is 'Active'.Sometimes if you copied the table the status will be New.You have to activate them.

If you want to see whether the table has data,you can see it in SE11 itself.Just go to table of contents and execute.

Former Member
0 Kudos

In se11, if u have created a structure, then see that whetehr u have referred <b>all the reference table and field</b>, if u click on the currencyfields tab if u see some blank lines in the edit mode. U have to fill those details.

When u try to activate it,it will give some error.

If the table is not active then it wont accept the table name while u define that in code.

Former Member
0 Kudos

Hi,

Please let us know the error message you r getting while u try to activate the table.

Regards,

Anjali

Former Member
0 Kudos

Hi,

Guess you've mixed up the terms..:-).

A table (or any workbench object in SAP , for that matter) when created has the status <b>new</b>. When you have saved it at least once, it has the status <b>inactive</b>. when you have activated it, the status is <b>active</b>.

Only those tables in SE11 that have the status <b>active</b> can be populated with data. But if a table is active, it doesn't necessarily mean that it has got some data. It may just be that nobody has updated this table. Or the entries that were in the table have been deleted.

Regards,

Anand Mandalika.