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

regarding select stm

Former Member
0 Likes
978

hi experts,

when im executing this code it is giving me runtime error but the same with standard table is working.why...

please explain me.

DATA: WA TYPE SPFLI,

ITAB TYPE sorted TABLE OF SPFLI with unique key carrid .

SELECT connid FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE ITAB.

LOOP AT ITAB INTO WA.

WRITE: / WA-CARRID,wa-connid.

ENDLOOP.

SKIP 1.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
941

hi

use this code

tables : spfli.

DATA: WA TYPE SPFLI,

ITAB TYPE standard TABLE OF SPFLI .

SELECT carrid connid FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE ITAB.

LOOP AT ITAB INTO WA.

WRITE: / wa-carrid,wa-connid.

ENDLOOP.

SKIP 1.

reward if useful........

7 REPLIES 7
Read only

Former Member
0 Likes
941

u must fetch carrid fom SPFLI since u have defined the internal table as uniques key of carrid.

alternatively , define internal table as type standard table of spfli.

reward points if helpful

Read only

Former Member
0 Likes
941

Hi,

I could execute your given report.

Why do you require whole SPFLI table as you are selecting only connid?

Take only like,

data: itab like spfli-connid occurs...

and then

select connid into (--)

Reward if useful!

Read only

jaideeps
Product and Topic Expert
Product and Topic Expert
0 Likes
941

hi,

itz because spfli already conatins carrid as the key..in unique key..the field occurance should be once..i think they may be a clash between spfli and itab...

thanks

jaideep

Read only

Former Member
0 Likes
941

Hi

Why cant u try like thi s

REPORT  ZSDN1                                   .

data : begin of itab occurs 0,
       connid like spfli-connid,
       carrid like spfli-carrid,
       end of itab.

SELECT connid carrid FROM SPFLI INTO CORRESPONDING FIELDS OF itab.
LOOP AT ITAB .
WRITE: /  itab-carrid, itab-connid.
ENDLOOP.
*endselect.
SKIP 1.
endselect.

Reward all helpfull answers

Regards

Pavan

Read only

Former Member
0 Likes
941

HI,

DATA: WA TYPE SPFLI,

ITAB TYPE sorted TABLE OF SPFLI with unique key carrid .

SELECT <b>Carrid connid</b> FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE ITAB.

LOOP AT ITAB INTO WA.

WRITE: / WA-CARRID,wa-connid.

ENDLOOP.

SKIP 1.

Regards

Sudheer

Read only

Former Member
0 Likes
942

hi

use this code

tables : spfli.

DATA: WA TYPE SPFLI,

ITAB TYPE standard TABLE OF SPFLI .

SELECT carrid connid FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE ITAB.

LOOP AT ITAB INTO WA.

WRITE: / wa-carrid,wa-connid.

ENDLOOP.

SKIP 1.

reward if useful........

Read only

Former Member
0 Likes
941

data: itab like spfli-connid occurs...

and then

select connid into (--)

Reward if useful!