cancel
Showing results for 
Search instead for 
Did you mean: 

SU01 Table look up

Former Member
0 Kudos

Hi we have a requirement , we need to lookup and fetch email address based on SAP UserID from SU01 , currently we have implement this logic in XSLT mapping ...anybody have done this or have any information about this...thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have you the username on source message interface?

If yes, you can lookup by an RFC lookup (like this http://simonlesflex.wordpress.com/2010/12/07/pi-oracle-dblookup/

Sap manual: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0b6bb9d-7689-2c10-52a7-c3bd341d4...

and get user mail in SU01 by username selection.

Former Member
0 Kudos

Hi thanks for the update ...

this is the requirement

In one field from sender we are getting SAP user ID ...and in the receiver it has to be converted to email address ...this can be done using look up to SU01 table ....can anybody assist in this ...thanks

ashish_vikas
Active Contributor
0 Kudos

Hello,

You can query ADR6 table for geting email address maintained in SU01.

thanks

ashish

Former Member
0 Kudos

This could be the abap code in the RFC function:

                  • GET MAIL ADDRESS ************************

Select single * from usr21 into ls_usr21 where

bname eq <IV_USERNAME>.

If sy-subrc eq 0 and not ls_usr21 is INITIAL.

Select * from adr6 into table lt_adr6 where

persnumber eq ls_usr21-persnumber and

ADDRNUMBER eq ls_usr21-ADDRNUMBER.

If sy-subrc eq 0 and not lt_adr6 is INITIAL.

Sort lt_adr6 by date_from DESCENDING CONSNUMBER DESCENDING.

Read TABLE lt_adr6 into ls_adr6 index 1.

If sy-subrc eq 0 and not ls_adr6 is INITIAL.

ls_receivers-receiver = ls_adr6-SMTP_ADDR.

ls_receivers-rec_type = 'U'.

append ls_receivers to et_receivers.

endif.

endif.

endif.

***************************************************

ET_RECEIVER => Table Output with mail

Then, use standard Function in MMapping for Lookup (look at previous posted document) for calling RFC, and map result to destination structure field

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Kiran,

Was this query solved. if yes then please provide some pointers to the solution. Will help others!!

Former Member
0 Kudos

Hi Puneet,

I told abaper to populate the email field at ECC , so no headache for sometime

Regards

Ravi

Former Member
0 Kudos

Hi Kiran

The easiest solution would be to use the standard BAPI (BAPI_USER_GET_DETAIL) in ECC to fetch data from SU01.

Use this BAPI to do a RFC lookup in ECC. Refer the following to understand how RFC lookup works in PI:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0b6bb9d-7689-2c10-52a7-c3bd341d4...

/people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups

Note: There is a limitation with BAPI that it will fetch only 1 record at a time. If you face any challenge in terms of performance then refer the following discussion and make a custom RFC and use to fetch multiple records at a time.

martin_dejl2
Participant
0 Kudos

Then you can still use Java RFC-Lookup. You just have to create java class and implement it to your XSLT as [Java-enhancement|http://help.sap.com/saphelp_srm40/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm].

Officially It's working only with SAP java XSLT processor "SAP-XML Toolkit". However from version PI 7.1 the standart XSTL processor is Xalan so if you have this or higher version of PI you can switch your Interface Mapping to use "SAP XML Toolkit" or implement [java-enhancement in Xalan-way|http://xml.apache.org/xalan-j/extensions.html#java-namespace].

martin_dejl2
Participant
0 Kudos

Hi r.a.kiran,

you can also use existing BAPI function BAPI_USER_GET_DETAIL. You will get all user details but you don't have to create your own RFC. May be you can use also another details from that function.

Email addresses of user will be in result table ADDSMTP.

Former Member
0 Kudos

Hi Thanks all, But I need some thing I can do from XI ...Java code where in I can lookup SU01 table from XSLT mapping in XI mapping thanks

Former Member
0 Kudos

For Java code example, please check link posted previously.