Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace Refactoring #1178

Closed
mnemotron opened this issue Feb 1, 2018 · 10 comments
Closed

Namespace Refactoring #1178

mnemotron opened this issue Feb 1, 2018 · 10 comments
Labels
crazy Fun and useful, but really difficult new feature New feature or request

Comments

@mnemotron
Copy link

Hi,
first of all, abapGit is a great tool!

This is a request for a needed feature.
A lot of people I know need to change the namespace of the ABAP objects.
A manual refactoring takes a lot of time and effort.

i.e. Z... to /IPS/... or something.

A standardized way to refactor the namespace would be great.
For example:
Repository (default) Namespace (i.e. Z) -> import -> Specific SAP System with namespace /IPS/...
or
SAP System /IPS/ -> export -> Z -> Repository

Greetings

@larshp larshp added the new feature New feature or request label Feb 1, 2018
@larshp
Copy link
Member

larshp commented Feb 3, 2018

Yeah, this would be a nice feature, but difficult to implement 😄

Several people have asked for this feature

@larshp larshp added the crazy Fun and useful, but really difficult label Feb 20, 2018
@larshp
Copy link
Member

larshp commented Feb 20, 2018

added label crazy which means it is a lot of work, the idea is good

@fabianlupa
Copy link
Member

I looked into this some time ago but couldn't find an approach that would cover the main use cases. Some things that help:

  • The repository infosystem has an API (CL_RIS_*) for object usages and also the environment check/search thing.
  • ADT has some refactoring APIs, i. e. for renaming classes. Theses do however not support namespace changes at all unfortunately (target package cannot be in a different namespace than the source one).

Doing it outside of the ABAP stack seems really risky (regex renaming), unless there if there's going to be a nicely featured ABAP parser in the future.

In SCN there's also a blog about gettting abap2xlsx ported into a reserved namespace somewhere.

(I also feel like I already typed this up at some point, but I cannot find it...)

@treisinger
Copy link
Contributor

treisinger commented Apr 2, 2018

Can these 2 blogs maybe help?

https://blogs.sap.com/2013/03/06/namespace-refactoring-in-abap/

https://blogs.sap.com/2011/05/17/chain-and-rename-your-saplink/

Wasn't there also an option for SAPLINK, where you could change the namespace during import? Can't find it at the moment, though.

@nathanss
Copy link

nathanss commented Apr 2, 2018

Hello, as a workaround, I've wrote this script: https://github.com/nathanss/search-and-replace with the main goal of using it in an abapgit project (after serialization). I've had success applying it to a project I work for.

As it is very manual, you need to be careful not to screw up the files before you import them again. Also, remember to run it two times, one with old and new namespace in uppercase and other with lower case.

@mnemotron
Copy link
Author

@mnemotron
Copy link
Author

Hi,

check out the ABAPSpace application to refactor namespaces.

@larshp
Copy link
Member

larshp commented Oct 7, 2019

think this is outside the scope of abapGit, can be solved with projects like https://github.com/SAPAssets/ABAPSpace

@larshp larshp closed this as completed Oct 7, 2019
@mkysoft
Copy link

mkysoft commented Apr 13, 2020

@mnemotron we shared a solution for this: https://github.com/isisdanismanlik/NamespaceChanger

@gregorwolf
Copy link
Contributor

Now you can also check out: Automagic standalone renaming of ABAP objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crazy Fun and useful, but really difficult new feature New feature or request
Development

No branches or pull requests

7 participants