cancel
Showing results for 
Search instead for 
Did you mean: 

Using TP Import in Command Line

Former Member
0 Kudos

Hi All,

I need to import number of transport requests in Quality Assurance System all at once so I decided to use TP Import in command line.

The main issue is I don't know how to handle Error and Warning. I don't want to continue import process if one transport request encounter Error or Warning. I don't know how to use TP return code to handle this situation

Any idea regarding this issue will be appreciated,

Sanaz.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I would advise using the OS level scripting to simply create the buffer and then use STMS as others have suggested to do the actual import. 

Unless it is a BW environment, the benefits of having STMS handle the dependencies via the IMPORT ALL functionality is huge IMHO.  It's been a long time since I have worried about ordering transports as opposed to simply ensuring the queue is complete.

Former Member
0 Kudos

Hi all.

for Windows platforms you can do some testing on return codes of executed programs. TP does return error codes, so you can test for failure within your .cmd file.

An example command file which shows how to handle return codes from TP is shown below. Save it to test.cmd and run it in an opened command window.

For lots of transports, create a function in your command file and feed transport requests to this function. This will make the script more readable.

@echo off

echo.Execute tp help
tp help > mytp.log

if errorlevel 1 (
   echo.tp help executed NOT successful, result = %errorlevel%
   echo.aborting script
   pause
) else (
   echo.tp help executed successful, result = %errorlevel%
)

echo.
echo.Execute tp without arguments
tp  >> mytp.log
if errorlevel 1 (
   echo.tp without arguments executed NOT successful, result = %errorlevel%
   echo.Press Ctrl-C to abort, or enter to continue
   pause
) else (
   echo.tp without arguments executed successful, result = %errorlevel%
)

echo.
echo.Tp script succesfully

Hope this answers your question.

Best regards,

Edward

Former Member
0 Kudos

Folks,

I know that there's a recommendation to use STMS instead of using Command Line, but I need to know If I do the same way Sanaz did, even with all return codes, what if I have any problem, will SAP support me? Is there any related document?

Thank you very much

Former Member
0 Kudos

Hi Edward,

Where can we capture the tp return codes and validate them..?

Thanks,

Pavan

Former Member
0 Kudos

One more input:

You can split these requests into several transports...

Ex: if you want to import 1 tp 100 requests, i would suggest to create a script for each 10 requests.

Then atleast after every transportation you can find the status of all 10 requests and take necessary action before starting next 10. The only thing is you have to make and run number of scripts.

Regards,

Nick Loy

Former Member
0 Kudos
The main issue is I don't know how to handle Error and Warning.

Then why you want to use trransporatation at OS level?

Just import all the requests thru STMS...best tool provided and very good user friendly tool.

And frankly speaking there is no difference between STMS and OS level transportation, but don't know why you want to import at OS level.

Regards,

Nick Loy

Former Member
0 Kudos

Thanks for the reply,

the reason I want to use OS instead of STMS is: There are about 2000 Transport Requests that should be imported to production system before Go Live in a limit time. I don't want to import all but the number of imports all accountable.

Sanaz.

Former Member
0 Kudos

Nicky

people work in complicated landscapes and I assume that this was because he had about a 500+ transport to do at once for a project and this was because he wanted to automate the transport into a script and let script run and notify him only when the transports fail.

sunny_pahuja2
Active Contributor
0 Kudos

Hi,

You can do transports via command line and can use below command:

1) First add all transports in the buffer with below command:

tp addtobuffer <transport number> <SID> pf=/usr/sap/trans/bin/<transport profile>

2) Then use below tp command to import all requests:

tp import <transport number> <SID> CLIENT=<client number> u128 pf=/usr/sap/trans/bin/<transport profile>

Make a .sh script and include all transport requests with add to buffer and import commands. Then when you will run it, it will show you the output of each and every transport with return codes as well.

Also, when it will finish all the transports, you can login into the system and check resulting return codes and logs in STMS.

But it is always advisable that do transports from STMS.

Thanks

Sunny

Former Member
0 Kudos

Thanks for the reply Sunny,

The main issue is to handle error and warning during import process in command line. I want to stop importing requests if Error or Warning occurred using batch

Sanaz.

sunny_pahuja2
Active Contributor
0 Kudos

Hi,

I don't think so, it is possible. Once you will do the import then later on you can check import logs in STMS. Then you can take step if some transports is in the error.

Thanks

Sunny

Former Member
0 Kudos

Hi Sunny ..what is the u code for ignoring component versions in e.g

tp pf=/usr/sap/trans/bin/TP_DOMAIN_SID.PFL import TASK901105 SID  U128 client=002;

it this case i have used 128

shouvik
Employee
Employee
0 Kudos

Hi Ntsako,

Thanks a lot this works. However, can you please clarify on what basis you select the u code as U128?

BR,
Shouvik

Former Member
0 Kudos

http://premkolipaka.blogspot.co.za/2012/08/requests-do-not-match-component-version.html?view=magazin...

in the command on the OS level the U128 option seems to be the ignore component version option as seen in stms . I normally use this option because in the command line on the os level while using TP IMPORT the system does not warn you when the transport was developed in a system with a different component version you can only see this in stms

If you are sure that you landscape is consistent then there no need to use this code but there are many codes

Former Member
0 Kudos

Hi I also think this will come in handy

while I was trying to process a solution manger request using charm the transport failed due to the component version option not being flagged and you will not be able to do the transport manualy in the managed system where the transport lies.in simple terms when you go the stms the and try to transport you get the error " you cannot import and transports for Project <SID><project number> at the moment.

Please try this to try and resolve the main problem in question

The work around the inconsistent component version is to add the parameter SP_TRANS_SYNC = OFF in the transport tool tab and this is done on the domain controller for SID PP1


goto


Tcode stms>overview>systems>


double click on the target system

got to the "transport tool '' tab


click on the pencil(edit mode)


click on insert row


then add


SP_TRANS_SYNC = OFF



make sure SP_TRANS_SY and then OFF must go under Value