10 Replies Latest reply: Aug 26, 2014 12:02 PM by Pavan Munukutla RSS

Using TP Import in Command Line

Sanaz Atai
Currently Being Moderated

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.

  • Re: Using TP Import in Command Line
    Sunny Pahuja
    Currently Being Moderated

    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

  • Re: Using TP Import in Command Line
    Nick Loy
    Currently Being Moderated
    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

  • Re: Using TP Import in Command Line
    Nick Loy
    Currently Being Moderated

    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

  • Re: Using TP Import in Command Line
    Edward van Beek
    Currently Being Moderated

    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

  • Re: Using TP Import in Command Line
    Eric Poellinger
    Currently Being Moderated

    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.

Actions