如何得到系统table和自定义type的信息

How to get info of system table or the type we defined in program?
Please refer follwing codes i wrote, we can leverage two FM.

REPORT  zdavid_component                        .

TYPES: BEGIN OF t_typ,
         line TYPE char100,
       END OF t_typ.
DATA: wa_typ TYPE t_typ,
      it_typ TYPE TABLE OF t_typ,
      it_data TYPE TABLE OF t_typ.

wa_typ-line = '1111'.
APPEND wa_typ TO it_typ.

DATA: tbl_name TYPE x030l-tabname,
      it_flds  TYPE TABLE OF rfc_fields.
tbl_name = 'MARA'.

CALL FUNCTION 'DP_GET_FIELDS_FROM_TABLE'
  EXPORTING
    tabname          = tbl_name
  TABLES
    data             = it_data
    fields           = it_flds
  EXCEPTIONS
    dp_invalid_table = 1
    OTHERS           = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

DATA: it_components TYPE TABLE OF rstrucinfo.
CALL FUNCTION 'GET_COMPONENT_LIST'
  EXPORTING
    program    = sy-repid
    fieldname  = 'wa_typ'
  TABLES
    components = it_components.

WRITE 'End'.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值