Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SELECT FROM BSAS

Former Member
0 Likes
1,174

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,101

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

6 REPLIES 6
Read only

Former Member
0 Likes
1,101

Hi,

Could you post the content of the dump please ?

Also, is SO_GJAHR a select-options or a parameter ?

Read only

Former Member
0 Likes
1,102

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

Read only

0 Likes
1,101

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.

Read only

0 Likes
1,101

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

Read only

Former Member
0 Likes
1,101

Hello Clemens,

I already changed it. It's faster in deed. Thank's for the tips.

Best Regards,

Nuno Anjos

Read only

Former Member
0 Likes
1,101

Hello Clemens,

I already changed it. It's faster in deed. Thank's for the tips.

Best Regards,

Nuno Anjos