Skip to Content
author's profile photo Former Member
Former Member

sap table which holds the count of fieldname

hi gurus

say 'kna1' has 10 fieldname in total .

so is there any saptable which holds this count .

i need to fetch the fieldname and the total count in each table

dont want to loop and stuff

need only a standard table

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Dec 04, 2007 at 01:09 PM

    hi Renu,

    the fieldname you'll find in table DD03, however the number of fields in one table is not maintained directly, you have to count:

    SELECT COUNT( * )
                 FROM dd03l
                 WHERE tabname EQ ...

    hope this helps

    ec

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 01:27 PM

    Dear Renu,

    If you run transaction se11 and look for the number of fields in e.g. KNA1, you can see in the top right corner the number of fields. This number is being calculated by standard SAP in the following way:

    DESCRIBE TABLE df-fld_tb LINES tc0_sec-count.

    Therefore, it seems very likely to me that there is no table where the number of fields are maintained (also because you can extend tables with new fields).

    Kind regards,

    John.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 01:30 PM

    Hi renu,

    no table field for this but kernel function call 'DB_RD_NTABHDR' id 'NTABHDR' field x030l will return field count in x030l-FLDCNT.

    Regards,

    Clemens

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 01:36 PM

    DD03L

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 01:56 PM

    hi

    try this function moudule

    RFC_READ_TABLE

    just give table name in parameters

    it will give fields count

    Please give points for good answers

    Thanks

    Siva Kumar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 02:07 PM

    Use the function module:

    'DDIF_FIELDINFO_GET'.Just pass the table name.

    In the output, table DFIES_TAB will contain the fields and their description of the table.

    Use describe DFIES_TAB to get the total no. of fields.

    Note: If you look at the database table from SE11 the field count shown on the right hand top also includes the 'APPEND' and INCLUDE'.

    I mean in MARA it may fields as 1/250 but the actual count of fields might be only 230 or so.

    250 includes '.APPEND' and '.INCLUDE' if any.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.