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

username

Former Member
0 Likes
857

Hi All!

This FM doesn't provides return code 4

instead of the correctly Sap-Usernames.

Do y have an idea why ?

regards

sas

FUNCTION GET_SAP_USR.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(LASTNAME) TYPE NAME_LAST

*" EXPORTING

*" VALUE(BENUTZER) TYPE USER_ADDR-BNAME

*" VALUE(RC) TYPE SYSUBRC

*"----


select single BNAME from user_addr

into BENUTZER where NAME_LAST = LASTNAME.

rc = sy-subrc.

ENDFUNCTION.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
821

Make sure that you pass the name to the FM in upper and lower case.

rob

6 REPLIES 6
Read only

Former Member
0 Likes
822

Make sure that you pass the name to the FM in upper and lower case.

rob

Read only

former_member194669
Active Contributor
0 Likes
821

Instead of use


 data : i_user1      like bapibname.
  data : wa_address1  like bapiaddr3.
  data : i_return1    like bapiret2   occurs 0 with header line.
  clear : wa_address1.
  move v_sapusername to i_user1-bapibname.
  call function 'BAPI_USER_GET_DETAIL'
    exporting
      username = i_user1-bapibname
    importing
      address  = wa_address1
    tables
      return   = i_return1.

a®

Read only

Former Member
0 Likes
821

Hi thank you for your hints.

Is my FM correctly as far as ?

regards

sas

Read only

0 Likes
821

I could not able find this fm GET_SAP_USR in my system . I am using Netweaver 7 version.

Whether is this a custom fm?

a®

Read only

abdul_hakim
Active Contributor
0 Likes
821

Hi,

Check the below BAPIs.It could be helpful to you.

BAPI_USER_GETLIST

BAPI_USER_GET_DETAIL

Cheers,

Hakim

Read only

Former Member
0 Likes
821

Hi!

Yes it is created by myself.

USER_ADDR is a view maybe it is allowed only

make a select statemant to its first column BNAME

istead of the others like FIRST_NAME etc.

I get still RC 4

regards

sas