Alles rund um die Sprache ABAP®: Funktionsbausteine, Listen, ALV
by Bjarne3246 » Wed Nov 26, 2014 3:45 pm
Hallo,
ich möchte in einem Programm anhand des Benutzernamens den Vornamen und Nachnamen eines Benutzers auslesen. Kann mir da jemand helfen? Habe einen FuBa gefunden SUSR_USER_ADDRESS_READ aber komme nicht weiter.
Danke
-
Bjarne3246
- ..
-
- Posts: 17
- Joined: Wed Aug 07, 2013 2:10 pm
by Bjarne3246 » Wed Nov 26, 2014 4:02 pm
Es funktioniert. Eventuell etwas umständlich, aber es erfüllt seinen Zweck:
- Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
DATA l_name2
type string.
CALL FUNCTION 'SUSR_USER_ADDRESS_READ'
EXPORTING
USER_NAME = p_cp-afnam
* READ_DB_DIRECTLY = ' '
* CACHE_RESULTS = 'X'
IMPORTING
* USER_ADDRESS =
USER_USR03 = l_name1.
* EXCEPTIONS
* USER_ADDRESS_NOT_FOUND = 1
* OTHERS = 2
.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
CONCATENATE l_name1
-name1 l_name1
-name2
INTO l_name2
SEPARATED BY space.
- GeSHi ©
-
Bjarne3246
- ..
-
- Posts: 17
- Joined: Wed Aug 07, 2013 2:10 pm
by Ayla149 » Thu Nov 27, 2014 11:00 pm
Gibt nen Bapi was das tut.äsuch mal nach Bapi*user* in der se37
-
Ayla149
- ..
-
- Posts: 24
- Joined: Wed Dec 17, 2003 5:22 pm
by Tron » Fri Nov 28, 2014 12:37 pm
Moin.
BAPI_USER_GET_DETAIL liefert das.
In der Struktur ADDRESS sind dann die gesuchten Infos.
Wobei es evtl. auch die Möglichkeit gibt, den Vor-und Zunamen über PA0105 und PA0002 zu lesen (HR-Stamm).
lg Jens
-
Tron
- .....
-
- Posts: 1112
- Joined: Sat Aug 04, 2007 10:21 pm
Return to ABAP® Core
Who is online
Users browsing this forum: No registered users and 25 guests