SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, code samples and tools and downloads for ASP.Net, SQL Server, R Script, Windows, Windows Phone, AWS, SAP HANA and ABAP, like SAP UI5, Screen Personas, etc.

Install SAP Free

List SAP Table Fields and Properties using ABAP Function Module

SAP programmers especially using dynamic programming features of ABAP can use DDIF_NAMETAB_GET function module to list table columns and get field properties of a SAP database table.

Following ABAP code fetches SAP table properties for requested table and returns data in a table.

field-symbols <dfies> type dfies
data pp_tabname LIKE dfies-tabname.
data pt_dfies TYPE tt_dfies.
data lr_dataelement type ref to cl_abap_elemdescr.

pp_tabname = 'T001'.

call function 'DDIF_NAMETAB_GET'
  tabname = pp_tabname
  dfies_tab = pt_dfies
  not_found = 1
  others = 99.

It is possible for ABAP developers to get missing information about the table field name from data element information by calling ABAP class method cl_abap_typedescr=>describe_by_name( )

if sy-subrc = 0 and not pt_dfies[] is initial.

loop at pt_dfies assigning <dfies> where rollname is not initial.

 clear: lr_dataelement, lwa_dfies.
 lr_dataelement ?= cl_abap_typedescr=>describe_by_name( <dfies>-rollname ).
" Data element (semantic domain)
 lwa_dfies = lr_dataelement->get_ddic_field( ).

 <dfies>-scrtext_s = lwa_dfies-scrtext_s.
 <dfies>-scrtext_m = lwa_dfies-scrtext_m.
 <dfies>-scrtext_l = lwa_dfies-scrtext_l.



SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table

Meetup Sunumu 1 meetup

Copyright © 2004 - 2020 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems