2012 Jul 10 4:44 PM
Hello gurus,
i'm a financial consultant that sometimes makes some programming....so at this moment i'm making a very simple program that should read both BSIS and BSAS.
but, after reading BSIS when it comes to read BSAS, i get a DUMP DBIF_RSQL_INVALID_RSQL.
I've read that we should be carefull while reading BSAS and BSiS...but as you can see the select parameters are the same..... i'm sending you the code below:
IF p_bsis = 'X'.
*DEPOIS DE DETERMINAR OS DOCUMENTOS E AS CONTAS VAI LER A BSIS.
IF r_hkont[] IS NOT INITIAL.
SELECT bukrs hkont belnr buzei gjahr fipos
INTO TABLE gt_bsis
FROM bsis "FOR ALL ENTRIES IN so_belnr
WHERE bukrs = so_bukrs
AND hkont IN r_hkont
AND belnr IN so_belnr
AND gjahr = so_gjahr
AND monat IN so_monat.
ENDIF.
ELSEIF p_bsas = 'X'.
SELECT bukrs hkont belnr buzei gjahr fipos
INTO TABLE gt_bsas
FROM bsas "FOR ALL ENTRIES IN so_belnr
UP TO 3 ROWS
WHERE bukrs = so_bukrs
AND hkont IN r_hkont
AND belnr IN so_belnr
AND gjahr = so_gjahr
AND monat IN so_monat.
ENDIF.
ENDIF.
Can anyone help?
Thank you,
Nuno Anjos
2012 Jul 10 5:19 PM
The order of fields in itab "gt_bsas" structure should be similar to the the order of the fields selected from table BSAS .Please verify this..
Also as a temporary fix try "INTO CORRESPONDING FIELDS OF TABLE gt_bsas.. Just for u'r understanding
2012 Jul 10 5:04 PM
Hi,
Could you post the content of the dump please ?
Also, is SO_GJAHR a select-options or a parameter ?
2012 Jul 10 5:19 PM
The order of fields in itab "gt_bsas" structure should be similar to the the order of the fields selected from table BSAS .Please verify this..
Also as a temporary fix try "INTO CORRESPONDING FIELDS OF TABLE gt_bsas.. Just for u'r understanding
2012 Jul 10 6:05 PM
Well what ya know... as simple as that.... i switched gjahr with belnr and it's runs great.
*SELECT bukrs hkont belnr buzei gjahr fipos
SELECT bukrs hkont gjahr belnr buzei fipos
Perfect. Thank you.
2012 Jul 10 10:48 PM
it is an urban legend that INTO CORRESPONDING FIELDS OF TABLE costs any performance. It should be used as a default.
Do a performance analysis to see the difference
Regards
Clemens
2012 Jul 13 9:41 AM
Hello Clemens,
I already changed it. It's faster in deed. Thank's for the tips.
Best Regards,
Nuno Anjos
2012 Jul 13 9:41 AM
Hello Clemens,
I already changed it. It's faster in deed. Thank's for the tips.
Best Regards,
Nuno Anjos