Skip to content

Create Extractions via Commandline

The command line tool xu-config.exe tool creates extractions, sources and destinations outside of the Xtract Universal Designer. The tool is available in the installation directory of Xtract Universal, e.g. C:\Program Files\XtractUniversal\xu-config.exe.

The xu-config.exe tool supports the creation of the following extraction types and destinations:

Extraction Types Destinations
Table Azure Storage
Table CDC Amazon AWS S3
ODP
DeltaQ

Prerequisites

The execution of PowerShell scripts must be authorized on your system, see Microsoft Documentation: Managing the execution policy with PowerShell.

Note

From Xtract Universal version 5.0.0 (2021-10-18) up to version 2024.8.6.35, the xu-config.exe tool must be run by the same Windows AD account that runs the Xtract Universal Service. This means, you either run the Windows command prompt as the respective user or you use the runas command in the command prompt. This is necessary, because passwords are encrypted for the user account that runs the xu-config.exe tool and can only be decrypted by the same account.

Create an SAP Source using Windows Command Prompt

Note

the xu-config.exe tool only supports SAP connections with plain authentication.

  1. Start the Windows command prompt application with administrator rights .
    cmd-prompt
  2. Navigate to the installation directory of Xtract Universal .
    create_source_command_prompt
  3. Run the following shell command to create an encrypted password for your SAP source :

    powershell ./protect-password.ps1
    
  4. Use the following command to select the xu-config.exe command line tool from the Xtract Universal installation directory and to create a new SAP source:

    xu-config.exe --source <name> <host> <instance-number> <client> <language> <user> <protected-password>
    
  5. Replace the parameters in < > with actual values . The parameters are not case sensitive.

  6. Press [Enter] to run the command.
  7. Check the generated source in the Xtract Universal Designer or in the directory C:\Program Files\XtractUniversal\config\sources.
    sources

Create a Destination using Windows Command Prompt

  1. Start the Windows command prompt application with administrator rights .
    cmd-prompt
  2. Navigate to the installation directory of Xtract Universal .
    create_destination_command_prompt
  3. Run the following shell command to create encrypted passwords or keys necessary for the destination :

    powershell ./protect-password.ps1
    
  4. Use one the following commands to select the xu-config.exe command line tool from the Xtract Universal installation directory and to create a new destination:

    xu-config.exe --azure <account> <accesskey> <container> <folder(opt)>
    
    xu-config.exe --s3 --auth user <key> <secretkey> <bucket> <region> <folder(opt)>
    
    xu-config.exe --s3 --auth iam <bucket> <region> <folder(opt)>
    
  5. Replace the parameters in < > with actual values . The names of the parameters are not case sensitive.

  6. Press [Enter] to run the command.
  7. Check the generated destination in the Xtract Universal Designer or in the directory C:\Program Files\XtractUniversal\config\destinations.
    Destinations

Create a Table Extraction using Windows Command Prompt

  1. Start the Windows command prompt application with administrator rights .
    cmd-prompt
  2. Navigate to the installation directory of Xtract Universal.
  3. Use the following command to select the xu-config.exe command line tool from the Xtract Universal installation directory and to create a new Table extraction:

    xu-config.exe --extraction <source> <destination> --table <table>
    
  4. Replace the parameters in < >with actual values .

  5. Enter a defined SAP Connection, Destination and an SAP Table object for the parameters \<source>, \<destination> and \<table>. The names of the parameters are not case sensitive.
    administrator-command-prompt-xu-config
  6. Press [Enter] to run the command.
  7. Check the generated table extraction in the Xtract Universal Designer or in the directory C:\Program Files\XtractUniversal\config\extractions.
    xu-config-xu-designer-gui

Note

The following table settings are set by default after creation: Package Size (50000), Extract data in background job (enabled), all columns are selected for output.

Tip

Use the command xu-config.exe -h to look up the syntax for Table, Table CDC, ODP and DeltaQ extractions.

Examples for all Extraction Types

Extraction Type Command
Table xu-config.exe --extraction ec5 sql-server --table TCURR
DeltaQ xu-config.exe --extraction ec5 sql-server --table TCURR
ODP (ABAP Core Data Services) xu-config.exe --extraction bw2 sql-server --odp ABAP_CDS UCONRFC_ATTR$F
ODP (SAP NetWeaver Business Warehouse) xu-config.exe --extraction bw2 sql-server --odp BW 0ADDR_SHORT$T
ODP (SAP HANA Information Views) xu-config.exe --extraction S4H sql-server --odp HANA HCCT232H1KHY32F7UL59IH224$F
ODP (DataSources/Extractors) xu-config.exe --extraction ec5 sql-server --odp SAPI 2LIS_11_VAITM
Table CDC (extract table on first run) xu-config.exe --extraction ec5 csv --tablecdc KNA1 true 5000
Table CDC (do not extract table on first run) xu-config.exe --extraction ec5 csv --tablecdc KNA1 false 10000

Create Multiple Extractions using PowerShell

Multiple extractions can be generated semi-automatically using suitable scripts. The scripts for creating extractions can be used to contribute to the generation of an SAP data warehouse.

PowerShell Script to Create Multiple Tbale Extractions
# read table list
$tableList = "KNA1","LFA1","MARA","CSKT","SKA1"
# set the path to the installation folder
$XUConfig = 'C:\Program Files\XtractUniversal\xu-config.exe'
# source sytem
$source = "ec5"
# destination
$destination = "sqlserver2019"

# loop the tables
foreach ($tableName in $tableList) {
    # create the extraction e.g.
    # xu-config.exe --extraction ec5 sqlserver2019 --table KNA1 
    Try {                   
        write-host -f Green "$tableName : Creation of Extraction is starting "  (Get-Date)                      
        &$XUConfig --extraction $source $destination --table $tableName    

        # check the last exit code
        # 0: successful
        # else unsuccessful
        if($LASTEXITCODE -eq 0) {                           
            write-host -f Green "$tableName : Creation of Extraction  is successful"  (Get-Date)            
        } else {           
            write-host -f Red "$tableName : Creation of Extraction failed with error code $LASTEXITCODE!"  (Get-Date)
            #Write-Host $errorMessage
        }                
    }
    Catch {
        write-host -f Red "$tableName : Creation of Extraction failed with Exception ! " + (Get-Date)  $_.Exception.Message
    }         
}


Last update: October 20, 2024