Every SAP Basis admin knows this problem: Text variables and values in batch jobs, such as ident numbers of payment or dunning runs, can usually only be transferred manually to subsequent processes. To make this frequent activity easier for you, BatchMan offers an automatic transfer of variable values with the TXV report. This way, results can be searched in text variables and the values can be used directly for the next job.
In this documentation we show you with examples how you can use this report TXV from BatchMan version 5.1.3:
Search and replace variables
For searching, the text can be taken from the job log, spool list or application log. The report only runs in the background, but the search settings and the search results can be checked in test mode.
The report must be scheduled as the last step in the job so that it can examine the job data:
Before you save a variant for the /BTCMAN/C_TXV report, you can test the search criteria and the results in test mode:
In test mode you need a text for the search. This can be a job log, a spool list or a free text.
You can take a joblog or a spoollist of a job that has already been run and use it as a template. For this you have to enter a job name and a job count and load a text from the job.
The text from the spool list or from the job log cannot be edited. However, you can select the text mode and edit the any texts.
You can now select the following combinations for the search pattern:
- determine the start position with the search pattern,
- determine the end position with the search pattern
- or search pattern using the various options of the text to be extracted.
Press the Start Search button to start the search, and the search result will be displayed as text.
The search result is a text that lies between a start and an end position.
For the determination of the start and end position one can use a text or a RegEx:
- With an empty field Start position, the text from the start of the line / text to the end position was selected.
- If the End position field is empty, the text from the start position to the end of the line / text was selected.
- If both fields are ’empty’, the whole text was selected.
A RegEx can also be used with the search pattern.
Example for the time/date selection with the RegEx in the text “STEP 001 started on 26.11.2020 16:05:00”:
Search pattern for the start/end position can also consist of two patterns connected with OR.
The found text can be further examined. The following search settings can be selected as search result:
- All characters up to the end position: The result is a string between the found start and end position.
- All characters up to the first space: The result is a string up to the first space after the found start position
- Whole line: The result is the whole line if the start position was found
- All numbers: From the found string all numbers are displayed as result
- RegEx: The found string was examined with the RegEx
The following example shows how a found text can be further examined:
Mit dem RegEx kann auch die Zeit aus dem Text gewählt werden:
The found value was saved as a value for TVARV variable. If the entered TVARV variable is already created in the TVARVC table, the values are overwritten. Otherwise a new TVARV variable is created.
The TVARV variable can be used as a parameter or select option variable.
For the parameter variable, only the LOW values must be maintained in the search pattern; for the select option variable, the HIGH values can also be maintained.
The Select-Options TVARV variables are maintained with the number. If the LOW and HIGH search criteria are maintained, the variable was updated with the BT option, and if only LOW is maintained, with the EQ option.
If more than one value is found, then:
- for parameters, the first hit was saved as a value in the TVARV variable,
- for select options, one number per hit was generated.
If no text is found, the following actions can be triggered:
- no action
- Cancel job
- Send message to a team
The following example shows how the /BTCMAN/C_TXV report can be used:
A spool list was created in the job. The earliest and latest start times are to be determined with the report and saved as values in the TVARV variable.
The job consists of two steps: in step 1 a list was created, in step 2 the list was examined.
Step 1 generates the following spool list:
The report /BTCMAN/C_TXV runs in Step 2 with the following variant:
The earliest start time should be saved as LOW value in the TVARV variable VL_SO_FR_SP, the latest start time – as HIGH value.
The results are already visible in the job log.
In the TVARVC table you can now find a TVARV variable with the name VL_SO_FR_SP.