获得domain中fix value 对应text的另外一种方法

GET DOMAIN FIXED VALUE

Author: Bhumika Mahawar
Submitted: 18 March,2009
Related Links: N/A

The F4 for screen field can be fetched either through value table, explicit F4 help or through fixed values associated with the domain.
There is sometimes a requirement to fetch the fixed values associated with a domain. Database view "DD07V" contains this information along with the text maintained for these fixed value. To fetch these values we have a simple Function Module "DD_DOMA_GET". There are other FM's as well. However the advantage of using this FM is that unlike other FM's you have the option to fetch the text as and when required.
As the following fig shows, the fixed value for the domain XFELD are:-

The code is as follows:-

*&--------------------------------------------------------------------*
*& Report ZTEST_GETDOMVAL
*&--------------------------------------------------------------------*
*This report is used to fetch the fixed values associated with domain
*&--------------------------------------------------------------------*

REPORT  ztest_yh1148.

DATA:
  fs_taba TYPE dd07v.
DATA:
it_taba TYPE STANDARD TABLE OF dd07v,
it_tabb TYPE STANDARD TABLE OF dd07v.

CALL FUNCTION 'DD_DOMA_GET'
  EXPORTING
    domain_name   = 'XFELD'
    langu         = sy-langu
    withtext      = 'X'
  TABLES
    dd07v_tab_a   = it_taba
    dd07v_tab_n   = it_tabb
  EXCEPTIONS
    illegal_value = 1
    op_failure    = 2
    OTHERS        = 3.
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. 
WRITE: 'The fixed values for the domain','''XFELD''','are:-'. 
LOOP AT  it_taba INTO fs_taba.
  WRITE:
  / sy-tabix,fs_taba-domvalue_l CENTERED ,fs_taba-ddtext CENTERED.
ENDLOOP.
ULINE.
*----------------------END OF CODE-----------------------------------*

The output is shown below :-

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值