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: 

regarding select stm

Former Member
0 Kudos
104

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

Former Member
0 Kudos
67

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

Former Member
0 Kudos
67

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

Former Member
0 Kudos
67

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!

jaideeps
Advisor
Advisor
0 Kudos
67

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

Former Member
0 Kudos
67

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

Former Member
0 Kudos
67

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

Former Member
0 Kudos
68

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........

Former Member
0 Kudos
67

data: itab like spfli-connid occurs...

and then

select connid into (--)

Reward if useful!