Tip

Output table fields to a list

Output table fields to a list

This tip is excerpted from Matt Wong's SAP Basis site.

When you're looking at the structure of a table, SAP will let you print the structure, but it won't let you

    Requires Free Membership to View

save the structure. This can be annoying. This report outputs the table structure to a list. At this point you can use the System->List->Save->Local file command to save the list to a file.

*&---------------------------------------------------------------------*
*& Report  YTABFLDS                                                    *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  YTABFLDS                      .
TABLES: DD02L, DD03L, DD04T.

PARAMETERS THETABLE LIKE DD02L-TABNAME OBLIGATORY.
DATA: BEGIN OF MYTABLE,
      TABNAME LIKE DD02L-TABNAME,
      AS4LOCAL LIKE DD02L-AS4LOCAL,
      AS4VERS LIKE DD02L-AS4VERS,
      END OF MYTABLE.

SELECT SINGLE TABNAME AS4LOCAL AS4VERS INTO MYTABLE FROM DD03L
       WHERE TABNAME = THETABLE.
  WRITE: / MYTABLE-TABNAME, 11 MYTABLE-AS4LOCAL, 13 MYTABLE-AS4VERS.
  SELECT * FROM DD03L
         WHERE TABNAME = MYTABLE-TABNAME AND
              AS4LOCAL = MYTABLE-AS4LOCAL AND AS4VERS = MYTABLE-AS4VERS.
    WRITE: / DD03L-FIELDNAME, 11 DD03L-KEYFLAG, 13 DD03L-ROLLNAME,
    24 DD03L-CHECKTABLE, 35 DD03L-INTTYPE, 37 DD03L-REFTABLE,
    48 DD03L-DATATYPE.
    SELECT SINGLE * FROM DD04T
          WHERE ROLLNAME = DD03L-ROLLNAME AND
          AS4LOCAL = MYTABLE-AS4LOCAL AND AS4VERS = MYTABLE-AS4VERS AND
          DDLANGUAGE = 'E'.

    WRITE: 53 DD04T-DDTEXT.
ENDSELECT.

Did you like this tip? If so (or if not) let us know. Send an email to sound off.


This was first published in February 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.