Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
qliker2
Contributor II
Contributor II

BAPI connection imput table is initial

I am using the BAPI connection to invoke a SAP Function Module. Since you cannot use the importing parameters, I use a table to pass a date_range.

The function module checks, if this table is initial. If yes a default date_range is set. 

In the qlik script, if i pass a table row as input, the function module sets the default date anyhow additionaly. So the data is fitered by both date_rages. 

Does anybody know, why the input table is interpreted as initial by the funtion module?

5 Replies
Hakan_Ronningberg

Hi,

Are you using a correct input syntax for a table row? Here is an an example of a table TAB with input values for three columns:
TAB = TABLEROW('VBAP', 'VBELN', 'VBELN01')

What connector release are you using? Before release 7.0.0 there were problems with input to a table.

Regards,
Håkan

qliker2
Contributor II
Contributor II
Author

Hi,

thanks for your help!

We are using Release 7.0.2. 

We are using the syntax as you mentioned: WHERE I_WLDAT = TABLEROW('I', 'GT', '20210101', '00000000'). The funny thing is, that if I look at the input table in the qlik data model (after I invoked the function module) both rows (the one I passed by qlik and the default from the function module) are in the table. 

Hakan_Ronningberg

Hi,

Are you using a standard SAP BAPI? Which one in that case? Is the table defined under the 'Tables' tab? Is there an 'Associated Type' ?

Regards,
Håkan

qliker2
Contributor II
Contributor II
Author

It is a custom BAPI.

The table is defined under 'Tables' an is of type range_date.

Hakan_Ronningberg

Hi,

I created a similar BAPI with script:

SELECT
RANGE_TAB.SIGN
RANGE_TAB.OPTION
RANGE_TAB.LOW
RANGE_TAB.HIGH
FROM [ZBAPI_GET_TEST_TABLES]
WHERE
GET_DD03L = ' '
GET_ZDATATYPE_TEST = 'X'
GET_ZHRGTEST_T = ' '
GET_ZHRGTEST_T1 = 'X'
MAXROWS_DD03L = '1000'
RANGE_TAB = TABLEROW('I', 'GT', '20210101', '00000000');

It is working:

Hakan_Ronningberg_0-1611303279703.png

I think the problem might be in the ABAP code of the BAPI. For example this IF statement to check if there are rows in the table does not work:

  IF NOT range_tab IS INITIAL.
*   Table contains rows 
  ENDIF.

An option that is working is to do it this way:

 DATA l_lines TYPE i.
  
  DESCRIBE TABLE range_tab LINES l_lines.

  IF l_lines > 0.
*   Table contains rows 
  ENDIF.

Regards
Håkan