Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
fneumann
Contributor III
Contributor III

Subselect with SAP does not work

Hi Folks!

I'm trying to use subselect to create a delta-load for SAP-tables.

I used this script for testing which I found as a solution in another post in this community:

LET vLoadDaysFrom = Date(Today()-50, 'YYYYMMDD');

CDPOS:
SQL SUBSELECT
OBJECTCLAS,
CHANGENR,
TABNAME,
TABKEY,
FNAME,
VALUE_NEW,
VALUE_OLD
FROM CDPOS
WHERE OBJECTCLAS GE 'MATERIAL' AND CHANGENR IN ( SELECT CHANGENR FROM CDHDR WHERE UDATE GE '$(vLoadDaysFrom)' );

The scribt gives me this error-message:

fneumann_0-1667379837435.png

In the Help-area you find information about subselect which states that it cannot be used, if  row-based access control of the SAP connector is activated:

fneumann_1-1667379958363.png

May that be the reason why I get this message and subselect is not working? If yes, can somebody tell me, what needs to be done to get this working (in Qlik and/or SAP)? If not, what might be the reason for this error?

Many thanks in advance!

Frank

 

Labels (2)
2 Replies
iliyansomlev
Partner - Creator II
Partner - Creator II

Hello, I have the same issue.

My SUBSELECT statement was working before an upgrade of SAP HANA environment from SAP s/4HANA to SAP S/4HANA 2022. After the upgrade it stopped working.

SUBSELECT (Fields' names here listed)  FROM BSEG WHERE MANDT RBUKRS GJAHR RLDNR BELNR IN ( SELECT MANDT BUKRS GJAHR RLDNR BELNR FROM BKPF WHERE CPUDT GE '##(fromDate)' OR AEDAT GE '##(fromDate)' )

gives the error 

Error: QVX_UNEXPECTED_END_OF_DATA: Job aborted, check log for Job /QTQVC/READ_DATA in Job Overview (transaction SM37)

I asked the SAP admins and they answered I should define types beforehand but I am not sure how / where to do so. Any help is appreciated, thank you!

They wrote this to me:

>>>> The main problem was that no TYPEs have been defined in the structures. The second parameter after TYPE was missing in each line of the structures.

REPORT /qtqvc/rep212020230504114631.
TYPES:
BEGIN OF t_type,
mandt TYPE bseg-mandt,
bukrs TYPE bseg-bukrs,
gjahr TYPE bseg-gjahr,
belnr TYPE bseg-belnr,
buzei TYPE bseg-buzei,
dmbtr TYPE bseg-dmbtr,
umsks TYPE bseg-umsks,
umskz TYPE bseg-umskz,
augdt TYPE bseg-augdt,
augbl TYPE bseg-augbl,
zuonr TYPE bseg-zuonr,
wrbtr TYPE bseg-wrbtr,
mwsts TYPE bseg-mwsts,
wmwst TYPE bseg-wmwst,
lifnr TYPE bseg-lifnr,
hkont TYPE bseg-hkont,
gsber TYPE bseg-gsber,
saknr TYPE bseg-saknr,
shkzg TYPE bseg-shkzg,
kostl TYPE bseg-kostl,
kokrs TYPE bseg-kokrs,
kunnr TYPE bseg-kunnr,
koart TYPE bseg-koart,
kontl TYPE bseg-kontl,
xnegp TYPE bseg-xnegp,
xref3 TYPE bseg-xref3,
sgtxt TYPE bseg-sgtxt,
zzline_bus TYPE bseg-zzline_bus,
zzbusi_typ TYPE bseg-zzbusi_typ,
END OF t_type,
BEGIN OF t_type1,
bukrs TYPE bseg-bukrs,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
END OF t_type1.
DATA: t_table TYPE STANDARD TABLE OF t_type WITH HEADER LINE,
t_table1 TYPE STANDARD TABLE OF t_type1 WITH HEADER LINE.
FORM sub_select TABLES p_l_table STRUCTURE t_table
p_l_table1 STRUCTURE t_table1.
CLEAR p_l_table. REFRESH p_l_table.
LOOP AT p_l_table1.
SELECT
mandt
bukrs
gjahr
belnr
buzei
dmbtr
umsks
umskz
augdt
augbl
zuonr
wrbtr
mwsts
wmwst
lifnr
hkont
gsber
saknr
shkzg
kostl
kokrs
kunnr
koart
kontl
xnegp
xref3
sgtxt
zzline_bus
zzbusi_typ
FROM
bseg
APPENDING CORRESPONDING FIELDS OF TABLE p_l_table WHERE
bukrs = p_l_table1-bukrs
AND belnr = p_l_table1-belnr
AND gjahr = p_l_table1-gjahr
.
ENDLOOP.
ENDFORM.

 

iliyansomlev
Partner - Creator II
Partner - Creator II

I have raised ticket with Qlik Support, and I hope they will help with this issue