Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using context variables for input of tSAPBAPI component

Dear Talend team,

may I kindly ask for your help on how to use context variables in input for tSAPBapi components? For simplicity I refer to the tSAPBapi documentation example "Scenario 2" (https://help.talend.com/reader/hCrOzogIwKfuR3mPf~LydA/ljofdRaECYJBINNnF5PXsQ). See screenshot below.

For tSAPBapi input of type "table" we can use context variables in the component to feeds that input - that's working fine.

However tSAPBapi input  of type "single" seems to need to be entered directly into the tSAPBapi component. In the example it's QUERY_TABLE set to "VBRK" (highlighted in the screenshot below). The question is how to supply "VBRK" from a context variable rather than having to enter it manually in the component?

I can imagine two ways:

#1 Allowing to supply input of type "single" from other components, similar to type "table" ones. We would use context variables in those feeding components

#2 Any way to use context variables in type "single" fields directly.

 

Background: We want to use context variables to switch Talend jobs seamlessly between development, test and production environments.

Since some of the tSAPBapi parameter are different in those environments, we'd like to supply them from context variables as well for seamless transition between environments.

 

Many thanks in advance for your support!

Markus

Backup: Screenshot of the referenced tSAPBapi input:

0683p000009M5OV.png

Labels (2)
1 Solution

Accepted Solutions
nfz11
Creator III
Creator III

I am not sure how to put context variables in your highlighted field.  Does context.myParam not work?  How about using a globalMap variable?  Can you put a tJavaRow before the tSAP component to set the value of your highlighted variable with a context variable, e.g.

output_row.row_QUERY_TABLE_1 = context.tableOne;

 

Below are general instructions on using context groups for different environments:

 

Create a context group with variables for each of the database connection parameters, e.g. Client, UserId, Password etc.  To create a context group, right click on the 'Contexts' folder and select 'Create context group'.  You can then create multiple environments for the context group, e.g. dev, test and prod with different values for the variables.  To use your context group in your job's context, click the notepad icon below your job context and select the context group you want and which environment as the default.  Then, in your tSAPBAPI component, instead of hardcoding the connection parameters like you have now, use context.client, context.user_id, context.password etc.

 

See here for documentation on creating context groups:

https://help.talend.com/reader/CZjx_~qx6zHuAklJ3AZ~Tg/Kdi_v5RSFf2UIwuzqLaZ8g

View solution in original post

2 Replies
nfz11
Creator III
Creator III

I am not sure how to put context variables in your highlighted field.  Does context.myParam not work?  How about using a globalMap variable?  Can you put a tJavaRow before the tSAP component to set the value of your highlighted variable with a context variable, e.g.

output_row.row_QUERY_TABLE_1 = context.tableOne;

 

Below are general instructions on using context groups for different environments:

 

Create a context group with variables for each of the database connection parameters, e.g. Client, UserId, Password etc.  To create a context group, right click on the 'Contexts' folder and select 'Create context group'.  You can then create multiple environments for the context group, e.g. dev, test and prod with different values for the variables.  To use your context group in your job's context, click the notepad icon below your job context and select the context group you want and which environment as the default.  Then, in your tSAPBAPI component, instead of hardcoding the connection parameters like you have now, use context.client, context.user_id, context.password etc.

 

See here for documentation on creating context groups:

https://help.talend.com/reader/CZjx_~qx6zHuAklJ3AZ~Tg/Kdi_v5RSFf2UIwuzqLaZ8g

Anonymous
Not applicable
Author

Many thanks for your response & sorry for my delayed reply.
Your solution worked. The fact, that the context variables to not pop up in a selection box does not mean that they can be simply used as described 😉