How to get the field descriptions of a table

本文介绍如何使用ABAP程序获取SAP系统中特定表的所有字段及其描述信息。通过两个步骤实现:首先从DD03L表获取表名对应的所有字段名及数据元素名;其次从DD03T表获取每个数据元素的描述。此外还提供了使用Function Module DDIF_FIELDINFO_GET的示例程序。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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). 

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.



http://www.erpgreat.com/abap/how-to-get-the-field-descriptions-of-a-table.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值