Application Development and Automation 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: 
Read only

Problem with SAP function module (user details)

Former Member
0 Likes
1,273

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,066

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
Read only

Former Member
0 Likes
1,066

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.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,067

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

Read only

suresh_datti
Active Contributor
0 Likes
1,066

try SUSR_USER_ADDRESS_READ instead.

regards,

Suresh Datti

Read only

Former Member
0 Likes
1,066

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?

Read only

0 Likes
1,066

Try using the BAPI I have mentioned.

Regards,

Ravi

Read only

0 Likes
1,066

You need put 'X' in parameter no_display:

call function 'SUSR_SHOW_USER_DETAILS'

exporting

bname = sy-uname

mandt = sy-mandt

no_display = 'X'.

Read only

0 Likes
1,066

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