Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with SAP function module (user details)

Former Member
0 Kudos

Hi everyone, I'm using function module SUSR_SHOW_USER_DETAILS to correspond the current user's SY-UNAME(associate number in my case) with a table holding their information and expecting to receive back their real first name and last name. I believe I need to be using a commit work but I'm not sure which one to use. Any ideas would be helpful. Thanks!!!

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

This is working good for me.



report zrich_0001.

call function 'SUSR_SHOW_USER_DETAILS'
     exporting
          bname      = sy-uname
          mandt      = sy-mandt
          no_display = space.

Regards,

Rich Heilman

7 REPLIES 7

Former Member
0 Kudos

Hi Ryan,

Just to fetch details, you don't need a commit work. Try BAPI_USER_GET_DETAILS.

Regards,

Ravi

Note : Please mark all the helpful answers and close the thread if the issue is resolved.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

This is working good for me.



report zrich_0001.

call function 'SUSR_SHOW_USER_DETAILS'
     exporting
          bname      = sy-uname
          mandt      = sy-mandt
          no_display = space.

Regards,

Rich Heilman

suresh_datti
Active Contributor
0 Kudos

try SUSR_USER_ADDRESS_READ instead.

regards,

Suresh Datti

Former Member
0 Kudos

Hi again,

When using SUSR_SHOW_USER_DETAILS, I need to return the first & last names by supplying the sy-uname, and then I plan to post their names into a smartforms form I have created. After it processes through the function module, a subscreen pops up showing the associate ID and name information but then it causes a runtime error. I do not need this subscreen to show, just bring the information back into working storage and I can continue processing from there, any ideas?

0 Kudos

Try using the BAPI I have mentioned.

Regards,

Ravi

0 Kudos

You need put 'X' in parameter no_display:

call function 'SUSR_SHOW_USER_DETAILS'

exporting

bname = sy-uname

mandt = sy-mandt

no_display = 'X'.

0 Kudos

If you don't want the dialog, you can get the information back via the USR03 parameter of the function module, make sure to swith the NO_DISPLAY parameter to "X".



report zrich_0001.


data: xusr03 type usr03 .

call function 'SUSR_SHOW_USER_DETAILS'
     exporting
          bname      = sy-uname
          mandt      = sy-mandt
          no_display = 'X'
     changing
          user_usr03 = xusr03.

write:/ xusr03-name1.
write:/ xusr03-name2.

Regards,

Rich Heilman