How to get the field descriptions of a table?

简介:

Descriptions:
I need to get the associated data element descriptions of all the fields in a table.  I think there's a way to do that using the SELECT statement. 

Can you please give me in detail, the various steps and methods to find the corresponding SAP tables and fields for a particular transaction code, for example (CS03). 

Ans:
Do the following 2 steps. Then create your ABAP program accordingly with the SELECT statement.

1. From table DD03L, give your tablename and get all of its field names and corresponding data element names. 

2. From table DD03T, get the description of each data element you have got in step 1. 

Then Use Function Module DDIF_FIELDINFO_GET 

The sample program will look like this:

REPORT ZTABLEFIELDNAME.
TABLES: DFIES,
        X030L.
DATA: BEGIN OF INTTAB OCCURS 100.
        INCLUDE STRUCTURE DFIES.
DATA: END OF INTTAB.
PARAMETERS: TABLENM TYPE DDOBJNAME       DEFAULT 'MSEG',
            FIELDNM TYPE DFIES-FIELDNAME DEFAULT 'MENGE'.
      call function 'DDIF_FIELDINFO_GET'
        exporting
          tabname              = TABLENM
          FIELDNAME            = FIELDNM
          LANGU                = SY-LANGU
*         LFIELDNAME           = ' '
*         ALL_TYPES            = ' '
*       IMPORTING
*         X030L_WA             = WATAB
*         DDOBJTYPE            =
*         DFIES_WA             =
*         LINES_DESCR          =
        TABLES
          DFIES_TAB            = INTTAB
*         FIXED_VALUES         =
        EXCEPTIONS
          NOT_FOUND            = 1
          INTERNAL_ERROR       = 2
          OTHERS               = 3.
      if sy-subrc <> 0.
         WRITE:/ 'Field name not found'.
      endif.
      LOOP AT INTTAB.
         WRITE:/ INTTAB-TABNAME, INTTAB-FIELDNAME, INTTAB-FIELDTEXT.
      ENDLOOP.
*** End of Program 
OR

Step 1.  
Run the transaction and click on System -> Status. Note the program name shown under the transaction code. 

Step 2.  
Run SE49 and enter the program name you identified in step 1 (SAPLCSDI) and then press enter. 

This will identify the tables used, however, as you want to know the fields used as well then you may have to resort to looking at the actual code (get a developer involved if you're not one) using transaction SE80. 

In this case the transaction CS03 is assigned to a screen with a function group so it's a slightly tricker process, hence the need for a developers service. 

For all the tables, descriptions and fields you can refer to these tables: 
DD02L : ALL SAP TABLE NAMES 
DD02T : DESCRIPTION OF TABLE NAMES 
DD03L : FIELDS IN A TABLE.

专注于企业信息化,最近对股票数据分析较为感兴趣,可免费分享股票个股主力资金实时变化趋势分析工具,股票交流QQ群:457394862

本文转自沧海-重庆博客园博客,原文链接:http://www.cnblogs.com/omygod/archive/2008/01/28/1056646.html,如需转载请自行联系原作者
目录
相关文章
|
3月前
|
存储 关系型数据库 MySQL
Column Indexes
常见的索引类型通过复制列值至高效数据结构(如B树),实现快速查找。B树助力WHERE子句中=、&gt;、≤、BETWEEN等运算符对应值的检索。每表至少支持16个索引,总长不少于256字节,具体限制依存储引擎而定。字符串列索引可指定前N字符,减少索引文件大小;BLOB或TEXT列索引需指定前缀长度。全文索引用于全文搜索,适用于InnoDB和MyISAM引擎的CHAR、VARCHAR、TEXT列;空间索引则针对空间数据类型,MyISAM和InnoDB采用R树索引。MEMORY引擎默认使用HASH索引,也支持BTREE索引。
|
3月前
|
存储 索引
Indexed Lookups from TIMESTAMP Columns
UTC值存储在`TIMESTAMP`列中,在插入和检索时根据会话时区与UTC进行转换。若会话时区采用夏令时,可能导致本地时区的值不是唯一的,影响查询结果。无索引查询在会话时区中进行比较,可能返回多个匹配值;有索引查询则按UTC比较,可能仅返回一个匹配值。为确保返回所有匹配值,可使用`IGNORE INDEX`提示禁用索引。此外,使用`FROM_UNIXTIME()`和`UNIX_TIMESTAMP()`也可能遇到类似问题,请参考第12.7节了解详情。
|
4月前
|
SQL
[Err] 1052 - Column ‘roleId‘ in where clause is ambiguous
这篇文章解释了SQL查询中出现"Column ‘roleId’ in where clause is ambiguous"错误的原因,即在多表查询中,如果没有明确指定表名,相同的列名在where子句中会产生歧义,并提供了修正方法,即明确指定条件中所引用的列属于哪个表。
|
关系型数据库 MySQL
order by field
order by field
69 1
order by field
|
存储 SQL 关系型数据库
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column的解决办法
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column的解决办法
252 0
成功解决AttributeError: ‘Series‘ object has no attribute ‘columns‘
成功解决AttributeError: ‘Series‘ object has no attribute ‘columns‘
|
关系型数据库 MySQL 数据库
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
View ‘information_schema.SCHEMATA‘ references invalid table(s) or column(s) or function(s) or define
245 0
|
SQL 数据库
Unknown column ‘张三‘ in ‘where clause‘
Unknown column ‘张三‘ in ‘where clause‘
153 0
|
数据库
Incorrect table definition; there can be only one auto column and it must be defined as a key
Incorrect table definition; there can be only one auto column and it must be defined as a key
182 0
Incorrect table definition; there can be only one auto column and it must be defined as a key
1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause
1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause
209 0
1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause