‎2008 Mar 05 1:53 PM
TYPES : BEGIN OF it_bsis,
BELNR type BELNR_D,
BUDAT type BUDAT,
BLDAT type BLDAT,
XBLNR type XBLNR1,
END OF it_bsis.
select BLDAT BELNR into table it_bsis1 from bsis.
When I execute the select statement I get a runtime exception. Do you see anything wrong with this sql query.
Thanks!
Surya.
‎2008 Mar 05 1:58 PM
HI,
How u have declared ur internal table it_bsis1.?
See this sample code....
TYPES : BEGIN OF ty_bsis,
BELNR type BELNR_D,
BUDAT type BUDAT,
BLDAT type BLDAT,
XBLNR type XBLNR1,
END OF ty_bsis.
data : itab type table of ty_bsis,
fs type ty_bsis.
select BELNR BLDAT from bsis into corresponding fields of table itab.
It will work...
<REMOVED BY MODERATOR>
Regards,
Shanthi.
Edited by: Shanthi on Mar 5, 2008 2:59 PM
Edited by: Alvaro Tejada Galindo on Mar 5, 2008 6:18 PM
‎2008 Mar 05 1:58 PM
HI,
How u have declared ur internal table it_bsis1.?
See this sample code....
TYPES : BEGIN OF ty_bsis,
BELNR type BELNR_D,
BUDAT type BUDAT,
BLDAT type BLDAT,
XBLNR type XBLNR1,
END OF ty_bsis.
data : itab type table of ty_bsis,
fs type ty_bsis.
select BELNR BLDAT from bsis into corresponding fields of table itab.
It will work...
<REMOVED BY MODERATOR>
Regards,
Shanthi.
Edited by: Shanthi on Mar 5, 2008 2:59 PM
Edited by: Alvaro Tejada Galindo on Mar 5, 2008 6:18 PM
‎2008 Mar 05 1:59 PM
Hi,
do like this
select BLDAT BELNR into corresponding fields of table it_bsis1 from bsis.
becoz ur declaring 4 fields in internla table and selecting only 2 thats why getting error.
Regards,
Prashant
‎2008 Mar 05 2:01 PM
HI,
YOU SHOULD FETCH THE FEILDS IN THE DEFINED ORDER WHILE USING SELECT QUERY...
TYPES : BEGIN OF IT_BSIS,
BELNR TYPE BELNR_D,
BUDAT TYPE BUDAT,
BLDAT TYPE BLDAT,
XBLNR TYPE XBLNR1,
END OF IT_BSIS.
DATA:INT_BSIS TYPE STANDARD TABLE OF IT_BSIS,
WA_BSIS TYPE IT_BSIS.
SELECT BELNR BUDAT BLDAT XBLNR INTO TABLE INT_BSIS FROM BSIS.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Mar 5, 2008 6:19 PM
‎2008 Mar 05 2:05 PM
Hi
U can write like this:
TYPES : BEGIN OF it_bsis,
BELNR type BELNR_D,
BUDAT type BUDAT,
BLDAT type BLDAT,
XBLNR type XBLNR1,
END OF it_bsis.
data:it_bsis1 type table of it_bsis with header line.
select BLDAT BELNR into corresponding fields of table it_bsis1 from bsis.
In this use into corresponding fileds instead of into table.BSIS table have 77 fields.But u need to retrive 2 fields . In this case into correspondig fields of keyword is suitable one.
<REMOVED BY MODERATOR>
Regards
Pratap.M
Edited by: Alvaro Tejada Galindo on Mar 5, 2008 6:19 PM
‎2008 Mar 05 2:05 PM
You have defined a type, you have to create an internal table before selecting data. Then select the fields in the exact order of appearance in the internal table, or use a INTO CORRESPONDING FIELDS OF.
TYPES : BEGIN OF it_bsis,
belnr TYPE belnr_d,
budat TYPE budat,
bldat TYPE bldat,
xblnr TYPE xblnr,
END OF it_bsis.
DATA it_bsis1 TYPE TABLE OF it_bsis.
SELECT belnr budat bldat xblnr INTO TABLE it_bsis1 FROM bsis
UP TO 100 ROWS.Regards