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: 

Get Table fields name for an SAP table

agnihotro_sinha2
Active Contributor
0 Kudos

hi,

i need to pass SAP table name as a parameter to the selection screen of a Report program.

This prog shud give me the table Fields name along with type and length.

Is there any standard SAP report program for the same or i have to write my own logic?

Please advise.

regards,

ags.

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos

Use DD03L table.

3 REPLIES 3

GauthamV
Active Contributor
0 Kudos

Use DD03L table.

0 Kudos

I want a report output, maybe export result in Excel sheet..

0 Kudos

Hi,

For your requirement you have to write own program in dynamic manner by using field symbol concept.

Use this FM DDIF_FIELDINFO_GET and get the field information of database table.

call function 'DDIF_FIELDINFO_GET'

exporting

tabname = <master> u201C Table name

Tables

DFIES_TAB = <table_field> u201C here you will get field information of table

exceptions

not_found = 1

internal_error = 2

others = 3.

if sy-subrc <> 0.

message text-005 type 'E' .

endif.

Loop <table_field> assignigng <field>

*---here you have to collect the relevant information that you are going to display in your output.

Endloop.

Use any one of ALV or OOALV and display your records.

Regards,

Peranandam