02-05-2009 1:44 PM
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!
02-05-2009 1:58 PM
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
02-05-2009 3:58 PM
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 .
02-06-2009 3:44 AM
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
02-06-2009 4:29 AM
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
02-06-2009 4:52 AM
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 .
02-06-2009 5:23 AM
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
02-06-2009 5:56 AM
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
02-06-2009 7:14 AM
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 .
02-06-2009 7:24 AM
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
02-06-2009 8:29 AM
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
02-06-2009 10:15 AM
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