‎2008 Jul 08 12:57 PM
Hi experts.
I am using a Test system (Child system). The child system is attached to the CUA.
I have used the BAPI_USER_CHANGE to update the SNC of one user. But surprisingly, all
the emails addresses in the CUA of all users in the child system have been changed.
I think the system user chanegs this in a way.
My code is very simple written.
I have written a program that updates the SNC Name of a user. In this program I used the following BAPIs:
1) BAPI_USER_GETLIST --> to get the user name of a certain user
2) BAPI_USER_GET_DETAIL --> to get the other information of the User
3) BAPI_USER_CHANGE --> to change the SNC Name of the User.
Does any body have an idea as to why the system user changes all the email addresses in CUA for all Users that are in the child system?
I am relentlessly in search for answers please.
Thanks
Nadin.
‎2008 Jul 08 9:15 PM
>
> I am relentlessly in search for answers please.
In your relentless search did you look for SAP notes?
355754 looks promissing.
Rob
‎2008 Jul 09 3:32 PM
Hi (Frank and Rob),
Thank you for your input. The note implies for release 4.6 but the release I am using is the basis release 7.0(SAP NetWeaver 2004s). I don't know if this matters in this release.
The system (TS) that I call the BAPIs in has two clients. Client 01(Test Monitoring) and Client 02(Test CUA). Now Client 02 is attached to the PRD (Master CUA system). But I run the BAPIs in Client 01.
The CUA settings for both Clients (01 and 02) in TS system is set to Global (Global button is ticked) in transaction SCUM. Also Internal-mail is set to Redistribution in both Clients in TS system and in PRD(Redistribution is ticked) in transaction SCUM.
The code below shows the form with the BAPI_USER_CHANGE:
FORM snc_update.
DATA: lw_snc TYPE bapisncu.
DATA: lw_sncx TYPE bapisncux.
DATA: lw_return TYPE bapiret2.
* Initializing the Flags
lw_sncx-pname = 'X'.
lw_sncx-guiflag = 'X'.
* Check for which button is clicked
CASE sscrfields.
WHEN 'CL1'. "When update button is clicked
CLEAR w_return.
CLEAR t_return.
FREE t_return.
MOVE p_snc TO lw_snc-pname. "p_snc is parameter field & with the SNC for the user
lw_snc-guiflag = 'X'. " No Passwordsr -only SNC-data
* Change only the SNC of the User
CALL FUNCTION 'BAPI_USER_CHANGE'
EXPORTING
username = gw_bname "User clicked from Index. Only one user is given
snc = lw_snc
sncx = lw_sncx
TABLES
return = t_return.
IF sy-subrc = 0.
READ TABLE t_return INTO w_return WITH KEY type = 'S'.
* Status message when SNC-Name is successfully changed
MESSAGE ID w_return-id TYPE w_return-type NUMBER w_return-number
WITH w_return-message.
LEAVE TO SCREEN 0.
ELSE.
CLEAR w_return.
READ TABLE t_return INTO w_return WITH KEY type = 'E'.
* Error when unsuccessful.
MESSAGE ID w_return-id TYPE w_return-type NUMBER w_return-number
WITH w_return-message .
LEAVE TO SCREEN 0.
ENDIF.
ENDIF.
WHEN 'CL2'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
LEAVE TO SCREEN 0.
ENDCASE.
ENDFORM. " SNC_UPDATEAlso one important NOTE: After the program runs, I receive the message user XX has been successfully updated. But then I looked at the t_return table in debugging I saw the following 4 Messages (3 of type 'W' and 1 of type 'S'): All the messages came from the Message class SNC(SE91)
Num 005 of TYPE W with message "Unable to determine the canonical SNC name"
NUM 006 of TYPE W with message "User name SNC-Name: with the value"
NUM 003 of TYPE W with message SNC error RC= 19 ( message 19 says "Logon with external ID not activated in this system")
NUM 039 of TYPE S with message "User was successful changed".
Any help to explain this mistery will be highly appreciated.
Thank you all
Nadin