Application Development 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: 

Dump for a select query

flowers_candys
Participant
0 Kudos

Hi Gurus,

I have a select query as follows:

SELECT

vbap~vbeln

vbap~posnr

vbap~matnr

vbap~arktx

vbap~pstyv

vbap~abgru

vbap~prodh

vbap~netwr

vbap~werks

vbap~kwmeng

vbap~prctr

vbap~ps_psp_pnr

FROM vbap

INTO TABLE i_item_vbap

FOR ALL ENTRIES IN i_reg_vbak

WHERE

vbap~vbeln EQ i_reg_vbak-vbeln AND

vbap~matnr IN s_matnr AND

vbap~werks IN s_werks .

However, when I execute the program, I get the dump saying as:

I get this exception "DBIF_RSQL_INVALID_RSQL", assigned to CLASS "CX_SY_OPEN_SQL_DB"

Please help me in understanding this.

Also, there are only 85 entries in i_reg_vbak, plus not many values are there for s_matnr and s_werks.

I tried executing this query w/o for all entries, but still it gave a dump.

Waiting for your reply, thanks!

11 REPLIES 11

Former Member
0 Kudos

hi,

Make sure that fields in i_item_vbap match with the order you are retrieving in the SELECT query or try out using

INTO CORRESPONDING FIELDS OF TABLE i_item_vbap.

Hope this is informative

Thanks

Sharath

Former Member
0 Kudos

hi.....

the table should have same field names which you have given in sql quary

or else

you can use

into corresponding fields of like as follows

SELECT

vbap~vbeln

vbap~posnr

vbap~matnr

vbap~arktx

vbap~pstyv

vbap~abgru

vbap~prodh

vbap~netwr

vbap~werks

vbap~kwmeng

vbap~prctr

vbap~ps_psp_pnr

FROM vbap

INTO CORESSPONDING FIELDS OF TABLE i_item_vbap

FOR ALL ENTRIES IN i_reg_vbak

WHERE

vbap~vbeln EQ i_reg_vbak-vbeln AND

vbap~matnr IN s_matnr AND

vbap~werks IN s_werks .

Former Member
0 Kudos

Hi,

When ever we are using select queries better take the fields in the same order as in the table.or u can define a structure of necessary fields and fetch data from there.

Then u may not get dump.

Regards,

Jaya

Former Member
0 Kudos

hi ,

To avoid the dump you can use --- " INTO CORRESPONDING FIELDS OF TABLE i_item_vbap .... ". As because INTO CORRESPONDING is a costly statement you can declare the structure of the i_item_vbap as & in same order as in your select query .

Regards

Pinaki Mukherjee

rejish_balakrishnan
Contributor
0 Kudos

HI,

Clearly there is a mismatch betwen field mapping between vbap and i_reg_vbak table . Copy paste fields of both table and compare the order of fields .

Also check in SAP library about field mapping of tables .

Former Member
0 Kudos

Hi,

bettet You define a structure for the required fields and then you use the internal table i_item_vbap of that structure and then you can use select filds from vbap into corresponding fields of table i_item_vbap

and then try .

Thanks,

Rajendra

Former Member
0 Kudos

hi,

i think the table i_reg_vbak is having problem.

please check that table document number entries. i think some of values are not having same data type are not mach to the data type of vbap. chek it once.

regds:

rajesh.k

Former Member
0 Kudos

TRY THIS.

SELECT

vbap~vbeln

vbap~posnr

vbap~matnr

vbap~arktx

vbap~pstyv

vbap~abgru

vbap~prodh

vbap~netwr

vbap~werks

vbap~kwmeng

vbap~prctr

vbap~ps_psp_pnr

FROM vbap

INTO CORRESPONDING FIELDS OF TABLE i_item_vbap

FOR ALL ENTRIES IN i_reg_vbak

WHERE

vbap~vbeln EQ i_reg_vbak-vbeln AND

vbap~matnr IN s_matnr AND

vbap~werks IN s_werks .

Former Member
0 Kudos

Hi

Make sure that the field sequence of internal table i_item_vbap should be same as of select statement fields or visa versa

regards

Shiva

Former Member
0 Kudos

hello

SELECT

vbap~vbeln

vbap~posnr

vbap~matnr

vbap~arktx

vbap~pstyv

vbap~abgru

vbap~prodh

vbap~netwr

vbap~werks

vbap~kwmeng

vbap~prctr

vbap~ps_psp_pnr

from vbap into corresponding fields of table it_vbap.

if u use any fields of vbap on selection scrren then mention as

eg: where vbeln in s_vbeln etc.

with regards,

sumanth reddy

Former Member
0 Kudos

Hi,

In the select query mention the field in the order same as that of internal table,

or use into corresponding fields of table .

Regards,

Manoj Kumar P