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: 

SQL Syntax Problem - Filling Internal Table

Former Member
0 Kudos

This code passes syntax check but short-dumps. Any help would be appreciated.

REPORT ZGS_JOINTST2.

DATA it_kickouts TYPE rssm_t_seldone.

DATA wa_kickouts TYPE zbw_kickouts.

SELECT rsseldone~rnr

rsseldone~source

rsseldone~seldate

rsseldone~seltime

rsseldone~oltpsource

rserrorlog~msgv1

rserrorlog~msgv3

INTO TABLE it_kickouts

FROM rsseldone INNER JOIN rserrorlog

ON rsseldonernr = rserrorlogrequest

WHERE rsseldone~source = 'ZCC_0001'.

I'm simply trying to read the joined of the two RS tables and populate the custom table it_kickouts.

Geoff Stuart

1 ACCEPTED SOLUTION

Former Member
0 Kudos

DATA it_kickouts TYPE rssm_t_seldone.

DATA wa_kickouts TYPE zbw_kickouts.

With these statements it_kickouts and wa_kickouts are created as the field strings(structure but not as table).

So the problem is .

So what you have to do is declare the statement as ,

DATA it_kickouts like table of rssm_t_seldone.

or

DATA it_kickouts TYPE rssm_t_seldone occurs 0 with header line.

8 REPLIES 8

Former Member
0 Kudos

HI Geoff,

What does the error analysis says in Sshort-dump?

Can you paste it here?

Regards,

Vicky

Former Member
0 Kudos

What does the dump say? Make sure that you don't have less number of fields in your "it_kickouts" than your select field list(which is 7 in your example). Also make sure that the fields of it_kickouts have compatibility with the fields of the table you are selecting from.

Former Member
0 Kudos

Does w_kickouts have the same structure as rssm_t_seldone?

Rob

0 Kudos

I take it back. Does it_kickouts have the same structure and order as the fields you are selecting?

If not, try:


SELECT rsseldone~rnr 
rsseldone~source 
rsseldone~seldate 
rsseldone~seltime 
rsseldone~oltpsource 
rserrorlog~msgv1 
rserrorlog~msgv3 
INTO <b>corresponding fields of</b> TABLE it_kickouts 
FROM rsseldone INNER JOIN rserrorlog 
ON rsseldone~rnr = rserrorlog~request 
WHERE rsseldone~source = 'ZCC_0001'. 

Rob

Message was edited by: Rob Burbank

Former Member
0 Kudos

Hi Geoff,

How about something like this...

SELECT a~rnr

a~source

a~seldate

a~seltime

a~oltpsource

b~msgv1

b~msgv3

INTO TABLE it_kickouts

FROM rsseldone as a INNER JOIN rserrorlog as b

ON arnr = brequest

WHERE a~source = 'ZCC_0001'.

Regards,

Den

former_member186741
Active Contributor
0 Kudos

I suspect that rssm_t_seldone does not contain all the fields or if it does they are in a different sequence to the select. If they are in a different sequence use the 'CORRESPONDING' option (as Rob suggests) if it does not have all the fields

try this:

types: begin of ty_in,

rnr type rsseldone-rnr,

source type rsseldone-source ,

seldate type rsseldone-seldate,

seltime type rsseldone-seltime ,

oltpsource type rsseldone-oltpsource ,

msgv1 type rserrorlog-msgv1 ,

msgv3 type rserrorlog-msgv3 ,

end of ty_in.

DATA it_kickouts TYPE table of ty_in with header line.

  • and it will still be safer to use the 'CORRESPONDING' option in the select

Former Member
0 Kudos

DATA it_kickouts TYPE rssm_t_seldone.

DATA wa_kickouts TYPE zbw_kickouts.

With these statements it_kickouts and wa_kickouts are created as the field strings(structure but not as table).

So the problem is .

So what you have to do is declare the statement as ,

DATA it_kickouts like table of rssm_t_seldone.

or

DATA it_kickouts TYPE rssm_t_seldone occurs 0 with header line.

former_member186741
Active Contributor
0 Kudos

Geoff,

I don't understand how the code passed syntax but the solution was to make the definition a table. Surely type rssm_t_seldone must be defined as a table already to pass syntax.