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

Downloading Structure of Table

Hi All,

I want to download the structure of the table in the excel sheet. Is there any menu path, transaction or program for the same?

Thanks in advance for your help.

Regards,

Anuja.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    Posted on Mar 10, 2009 at 08:46 AM

    Hi

    Use the Function Module :DDIF_FIELDINFO_GET and specify the table for which you required the strucrure,it will gives the structure of that table inclusing fields,data elements and domains etc.

    Regards,

    Sreeram Kumar.Madisetty

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 10, 2009 at 08:36 AM

    hi use this ..

    Use function module DDIF_FIELDINFO_GET. That will give you all the fields for a given table...capture it into an internal table and download it to the excel..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 10, 2009 at 08:35 AM

    you have to manually copy the structure..you cannot directly get the structure...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 10, 2009 at 08:36 AM

    May be you can use the FM: DB02_GET_TABLE_STRUCTURE_DB2

    Regards

    Satya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 10, 2009 at 08:37 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 10, 2009 at 08:39 AM

    HI,

    There are many ways of achieving this, u can use the following FM : RPY_TABLE_READ and download in excel file using any FM or SE11--> DD3T table and display u r table and download in excel file.

    Or SE11--> Table name --> Display and then go to TABLE Menu - and click on PRINT, then view the entries in Print preview of the sap script form ,

    next go to GOTO menu and click in list display........

    next go to menu SYSTEM->LIST-> SAVE->LOCAL FILE.

    Thanks & Regards,

    Rock.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2015 at 06:13 AM

    Hi Anuja,


    Good evening.

    Following are the steps to get the structure to an excel file using VBScript:

    a. Define all the variables that are needed for this script.


    - and one of the main variable is 'Long Index Variable' that you can define as follows:

    Dim lngIdx 'Needed to loop thru SAP table structure & retrieve table column field names.

    &

    Dim ExcelApp 'Excel App

    Dim ExcelWorkbook 'Excel workbook

    Dim ExcelSheet 'Excel worksheet

    b. Instantiate the structures and functions for SAP access - which are:

    Set objFileSystemObject = CreateObject("Scripting.FileSystemObject") 'Instantiation of filesystem object

    Set ctlLogon = CreateObject("SAP.LogonControl.1") 'Instantiation of SAP Logon Control Object

    Set funcControl = CreateObject("SAP.Functions") 'Instantiation of SAP Functions - NOTE SAP should be installed

    Set ctlTableFactory = CreateObject("SAP.TableFactory.1") 'Setting & instantiation of SAP Table Factory

    Set RFC_READ_TABLE = funcControl.Add("RFC_READ_TABLE") 'Function control for RFC READ TABLE, following 4 are needed in that sequence

    Set strExport1 = RFC_READ_TABLE.Exports("QUERY_TABLE") 'SAP Query Table instantiation

    Set strExport2 = RFC_READ_TABLE.Exports("DELIMITER") 'Delimiter as needed, and part of RFC READ TABLE in SAP

    Set tblOptions = RFC_READ_TABLE.Tables("OPTIONS") 'This is for writing the actual SQL Query

    Set tblData = RFC_READ_TABLE.Tables("DATA") 'Please refer to actual RFC READ TABLE FM (SE37) shown above

    Set tblFields = RFC_READ_TABLE.Tables("FIELDS")

    Set tblStructure = funcControl.CreateStructure(sapTables(m)) 'Where sapTables(m) is the array containing the list of tables for which you want to retrieve the structure.

    c. Following is the function that you need to retrieve the table structure along with their positions
    that SE16 shows you OR ZSE16 shows you.

    For lngIdx = 1 To tblStructure.ColumnCount 'Loop thru entire table structure and get the table column field names. This is ideal.

    if tblStructure.ColumnCount > 10 Then

    actCounter = 10 'This is needed since RFC_READ_TABLE which the main function that i use has an output field that is TAB512 - implying the total length of output cannot be > 512 bytes.

    else

    actCounter = tblStructure.ColumnCount

    End if

    For lngIdx = 1 to actCounter

    '.ColumnName contains field name

    '.ColumnLength contains field length

    '.ColumnOffset contains field offset

    tblFields.AppendRow

    tblFields(tblFields.RowCount, "FIELDNAME") = tblStructure.ColumnName(lngIdx)

    ExcelSheet.Cells(row, n).Value = tblStructure.ColumnName(lngIdx) '10 fields from the input table will be copied over along with their domain, size, offset and length.

    ' If tblStructure.ColumnOffset(lngIdx) + tblStructure.ColumnLength(lngIdx) > 1024 Then Exit For

    'WshShell.Popup tblFields(tblFields.RowCount, "FIELDNAME") & " column retrieved", 1, "Progress" ' show message box with table fieldname for a second & disappears.

    Next

    '---- not including full code.here.

    Additional FYI - i am currently researching on using the following functions that will help to

    increase the size of the output buffer, so that i can extract entire tables and not be limited to

    512 bytes:

    a. RPY_TABLE_READ OR

    b. BBP_RFC_READ_TABLE

    Hope it helps. Let me know if you need any more help?.

    Thanks

    Ram.S

    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.