‎2008 Jun 23 4:10 PM
Hi,
I want to fetch the personalization data for a user from SU01. I guess there is method called get_data of class CL_PERS_ADMIN which I can use to fetch the data. How can I use this in my custom program.
I directly used like this:
LOOP at I_KEYROLEUSERS.
call method CL_PERS_ADMIN->GET_OBJECT
exporting
p_pers_key = 'LAW_PERS'
p_uname = I_KEYROLEUSERS-UNAME
p_rfc = p_rfc
receiving
p_object = p_object
exceptions
default_not_set = 1
internal_error = 2
user_does_not_exist = 3
pers_key_not_found = 4
rfc_connection_failed = 5
others = 6.
ENDLOOP.
But I get an error saying "Field CL_PERS_ADMIN->GET_OBJECT" is unknown. It is niether one of specified table nor defined by 'DATA' statement.
Regards,
Rajesh.
‎2008 Jun 23 4:21 PM
Hello Rajesh Thomas,
You need to create a reference variable for the class that you are trying make use a method. and call the method using the variabe like this :
eg:
DATA: lr_typedesc TYPE REF TO CL_PERS_ADMIN.
lr_typedesc->GET_OBJECT
Hope this helps.
Thanks,
Greetson
‎2008 Jun 23 4:21 PM
Hello Rajesh Thomas,
You need to create a reference variable for the class that you are trying make use a method. and call the method using the variabe like this :
eg:
DATA: lr_typedesc TYPE REF TO CL_PERS_ADMIN.
lr_typedesc->GET_OBJECT
Hope this helps.
Thanks,
Greetson
‎2008 Jun 23 4:29 PM
Did you create object reference as follows:
DATA: object_ref type ref CL_PERS_ADMIN.
START-OF-SELECTION.
CREATE OBJECT object_ref.
Thanks,
SKJ
‎2008 Jun 23 4:30 PM
Data: lcl_pers_adm TYPE REF TO CL_PERS_ADMIN.
CREAT OBJECT lcl_pers_adm.
LOOP at I_KEYROLEUSERS.
call method lcl_pers_adm->GET_OBJECT
exporting
p_pers_key = 'LAW_PERS'
p_uname = I_KEYROLEUSERS-UNAME
p_rfc = p_rfc
receiving
p_object = p_object
exceptions
default_not_set = 1
internal_error = 2
user_does_not_exist = 3
pers_key_not_found = 4
rfc_connection_failed = 5
others = 6.
ENDLOOP.
Try with the above code.
<removed_by_moderator>
Regards,
Kiran Bobbala
Edited by: Julius Bussche on Jun 23, 2008 10:55 PM
‎2008 Jun 23 11:52 PM
Hi,
Try to use like this :
LOOP at I_KEYROLEUSERS.
call method CL_PERS_ADMIN=>GET_OBJECT
exporting
p_pers_key = 'LAW_PERS'
p_uname = I_KEYROLEUSERS-UNAME
p_rfc = p_rfc
receiving
p_object = p_object
exceptions
default_not_set = 1
internal_error = 2
user_does_not_exist = 3
pers_key_not_found = 4
rfc_connection_failed = 5
others = 6.
ENDLOOP.
Thanks,
Greetson