[绝对原创] SAP Get User data by User ID

本文介绍了在SAP系统中通过不同方式获取用户数据的方法,包括直接查询USR21表来获取人员编号,使用该编号进一步查询ADRP表,以及通过视图V_USR_NAME或调用函数模块SUSR_USER_ADDRESS_READ来读取用户的完整姓名。

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

[绝对原创] SAP Get User data by User ID

 

1, Table

Go to table USR21 and get the person number, then use that person number number go to ADRP

2, View

view V_USR_NAME is a view over the USR21 and ADRP tables

 

3, Function module

You can alternatively use SUSR_USER_ADDRESS_READ.

The exporting parameter user_address would have the full name of the user in the field name_text.

    DATA: user_address LIKE addr3_val.

    CALL FUNCTION 'SUSR_USER_ADDRESS_READ'

      IMPORTING

        user_name                    = sy-uname

*       READ_DB_DIRECTLY             = ' '

      EXPORTING

        user_address                 = user_address

*       USER_USR03                   =

      EXCEPTIONS

        user_address_not_found       = 1

        OTHERS                       = 2.

 

    IF sy-subrc = 0.

       write:/ user_address-name_text.

    ENDIF.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值