‎2012 Jul 18 9:40 AM
Hello Experts,
I want to change/edit the class and function module, like if they contains data element, say zelement, i want to update it to some other name like yelement.
For class i tried the FM RPY_CLIF_COMP_UPDATE but i am getting error in it.
For function module i got the FM RS_FUNCTION_CHANGE but it does not do anything.
Please suggest something.
Regards,
Ankur Sharma.
‎2012 Jul 18 9:48 AM
Hi,
If it is custom built, then u can directly change else if it is standard.. copy to Z and then implement ur logic.
BR/Josh
‎2012 Jul 18 9:52 AM
Sorry i forgot to mention, it should be done programatically.
Please advice.
‎2012 Jul 18 9:58 AM
‎2012 Jul 18 10:01 AM
Ok, my problem is, i want to change the name of data element which is being used in a class.
For eg: ZELEMENT is used in class attribute as data element. So i want to change it to some other name, say YELEMENT.
This can be done using FM RPY_CLIF_COMP_UPDATE, but when am trying to do so, i get error every time.
‎2012 Jul 18 10:10 AM
Hi,
Please check the function module within the functon group SD51.
SD51 is the function group for Data Element Editing.
Cheers
~Niranjan
‎2012 Jul 18 10:12 AM
In se37 , explore RPY_DATAELEMENT*
It is not advisable to change the DE names.
‎2012 Jul 18 10:16 AM
‎2012 Jul 18 10:21 AM
I know its not good to rename the data element, but this is what i need to do.
I am able to rename the data element but i should also rename at all the places where it is being used, so if its used in a class than i should also change there.
‎2012 Jul 18 10:32 AM
Hi,
I don't think there is any std way of doing this. You can check for where used list and then manually change.
‎2012 Jul 18 10:34 AM
Since the FM is available, i think we can change the DE name by using it.
Still if you get anything related to it, do share with me.
Thanks.
‎2012 Jul 18 10:41 AM
Hi Ankur,
Even if we rename the data element using the function module, it will just update the DDIC object and not to all the places where it is referred.
You will have to manually rename it in the places where it is used. I have worked with SAP Upgrades, so I don't think we have shortcuts for this in SAP .
BR/Josh
‎2012 Jul 18 10:45 AM
Hello Josh,
You are absolutely correct, but i am doing the task to rename the data element, and then using where used list i am changing the DE name at all the places where it is being used. Like DE is used in TABLES / Structures i am able to change there also. But am stuck with classes and FMs. So for classes i got the update FM but some error is coming and i dont know how to cope with it.
‎2012 Jul 18 10:55 AM
okok I understood... The error is because.. since the same DE is referred in FM or Classes.... It throws error.
Try this : Before activating --> Change it in all places where it is referenced and also in the IMPORT / EXPORT parameters. I guess then it should be activated...
Also If the same FM / Classes is referenced in multiple places, this should also be taken into consideration.
‎2012 Jul 18 11:05 AM
I have created a class for test purpose which is not used at anyother place.
I have created one data element globally and used it as attribute in the class.
for eg. :
class ZCLASS_1 definition
public
create public .
public section.
data ATTR1 type ZELEMENT .
methods METHOD1
importing
PAR1 type ZELEMENT
PAR2 type ZELEMENT .
Now in the directory i can rename the data element, say Zelement. But i should also change the name at all the places where it is being used. So using where used list i am searching all the places and changing there.
Now since ZELEMENT is used in this class, it should be changed to the new name. So update the name in this class i have to do something. I tried updating the class with that update FM but its showing some error, because i guess am not passing all the data or something like that.
So now am stuck, i have FM to update but am not getting how to use it.
‎2012 Jul 18 1:13 PM
‎2012 Jul 19 9:22 AM
SEO_PARAMETER_CHANGE_F_DATA, SEO_ATTRIBUTE_CHANGE_F_DATA
Using thse 2 FMs we can update the class/interface.
‎2014 May 07 12:36 PM
Hi Ankur,
I had the same situation where the FM: RS_FUNCTION_CHANGE was not working. So, I resolved it by the following way:-
APPLICATION = 'X'
DEVELOPMENT_CLASS
INCLUDE_NAME = 'NAME OF THE INCLUDE THAT YOU READ IN THE PREVIOUS STEP'
TITLE_STRING = 'SOME MEANINGFUL TEXT"
SOURCE_EXTENDED TABLE SHOULD HAVE THE NEW SOURCE CODE.
So, You can then see the FM changed with new source code.
~ Guru