guettli
guettli

Reputation: 27855

Copy code and data types of namespace /FOO/ to second SAP system

During the last weeks I developed some code with the namespace/prefix /FOO/. The namespace is official. It is registered at SAP.

If a second customer wants to use our code how one can transfer all code and data from this namespace from one sap system to a different sap system?

Under this namespace there are some data types and some abap code, some old SAP only (netweaver 7.4), no HANA.

This question is not about the usual transport (dev -> qual -> prod). This works.

Related: https://github.com/guettli/why-i-like-django-and-sap/blob/master/README.md#packaging

Upvotes: 2

Views: 1267

Answers (2)

Suncatcher
Suncatcher

Reputation: 10621

You can try new SAP transport system that is promoted actively for new environments like S4HANA and is recommended as a replacement to CTS+, it is called abapGit.

Objects with namespaces /FOOBAR/REPORT are serialized with abapGit to #foobar#report.prog.abap

To move objects in customer namespace you need to create this namespace in the target system:

  • Create namespace in SE03, namespace role = C, and add the repair license
  • Open namespace for modifications in SE03
  • Create namespaced package
  • Change package original system to current in SE03 -> Change Object Directory Entries
  • Clone/pull like normal

then pull them in a regular way via Git, they should appear in the customer namespace.

If all the namespaced objects are stored in the same package, the task is much simpler for you,
read here about moving whole packages.

Upvotes: 2

Jagger
Jagger

Reputation: 10524

Here is how you could do that without the access to the operating and file system.

  1. Release your workbench transport containing your code (either in SE01 or SE10).
  2. Each time you release a transport two files are written in data and cofiles directories which can be found in the DIR_TRANS directory (see AL11). Those files are named exactly like your transport with R and K prefix and the extension which is named after the SAP system name, let it be XYZ for the sake of this example.
  3. Start the command line in SAP GUI with the report RSBDCOS0 (transaction SE38).
  4. Set the working directory to a directory of your choice and create there a folder named transport containing two subfolders data and cofiles.
  5. Copy transport files into the transport directory in your working directory. On Windows system it could look like that.

    copy %DIR_TRANS%\data\R<your_transport_number>.XYZ .\transport\data copy %DIR_TRANS%\cofiles\K<your_transport_number>.XYZ .\transport\cofiles

  6. Pack the contents of the transport directory in your working directory using SAP Archiver (sapcar) application. On a Windows system it could look like that.

    cd transport sapcar -cvf XYZK<your_transport_number>.SAR data\R<your_transport_number>.XYZ cofiles\K<your_transport_number>.XYZ

  7. Download the file from the application server to your local client for example with SE37 and function module ARCHIVFILE_SERVER_TO_CLIENT.

  8. Upload the file to the target SAP application server with function module ARCHIVFILE_CLIENT_TO_SERVER.

  9. Start operating system command line in the target server like you did in the point no. 3.

  10. Unpack the SAR file.

    sapcar -xvf XYZK<your_transport_number>.SAR copy cofiles\K<your_transport_number>.XYZ %DIR_TRANS%\cofiles copy data\R<your_transport_number>.XYZ %DIR_TRANS%\data

  11. Go to transaction STMS and refresh your transport import queue. The transport you wanted to import in the first place should now be visible in the queue.

%DIR_TRANS% has to be replaced with the directory you can see in the AL11 of source and target system.

Upvotes: 3

Related Questions