2007 Jun 28 9:55 AM
Hi!
How do I construct my SELECT statement so that I will only have 100 possible entries?
Even if there are 200 entries, I will only select the first 100.
Thanks!
2007 Jun 28 9:58 AM
hi,
make a addition to select statement .
addition: up to 100 rows.
ex:
select *
up to 100 rows
from mara
into table itab.
regards,
Navneeth K.
Hi!
How do I construct my SELECT statement so that I will only have 100 possible entries?
Even if there are 200 entries, I will only select the first 100.
Thanks!
2007 Jun 28 9:56 AM
hi,
Use
select* from table upto 100 rowsstatment
Regards,
Santosh
2007 Jun 28 10:08 AM
Hi,
This is command for entry 100 rows.
select* from table upto 100 rows
2007 Jun 28 9:58 AM
2007 Jun 28 9:58 AM
SELECT * FROM table... UPTO 100 ROWS.. WHERE..
You should be able to get documentation on the addition by doing an F1 on the keyword SELECT.
You need to be aware though that specifying the number of rows will only fetch the first 100 rows out of 200 from the table.
Hope this helps.
Sudha
2007 Jun 28 9:58 AM
hi,
make a addition to select statement .
addition: up to 100 rows.
ex:
select *
up to 100 rows
from mara
into table itab.
regards,
Navneeth K.
2007 Jun 28 11:22 AM
> hi,
>
> make a addition to select statement .
> addition: up to 100 rows.
>
> ex:
> select *
> up to 100 rows
> from mara
> into table itab.
>
> regards,
> Navneeth K.
Hi! I gave the points to this answer because it is the first correct answer.
It should be 'UP TO' and not 'UPTO' but thanks anyways to everyone who answered!
2007 Jun 28 11:31 AM
Nothing to do with points but I think Santosh Kumar P came up with the first correct answer:
select* from table upto 100 rows
His answer should have given you more than enough to go on, if you could not work it out from that then...
2007 Jun 28 9:59 AM
Hello,
Eg.
SELECT * FROM EKPO
INTO TABLE itab up to 100 rows.
regards,
Neelambari
2007 Jun 28 10:00 AM
2007 Jun 28 10:01 AM
Hello,
USe the keyword <b>up to</b>
select* from mara table upto 100 rowsThis up to statement will retrieve first 100 records which matches with the selection criteria.
Vasanth
2007 Jun 28 10:02 AM
2007 Jun 28 10:18 AM
u people have gone mad for points everydby answering the same way cumn people this sdn helps people its not here 2 get points
2007 Jun 28 11:22 AM
> u people have gone mad for points everydby answering
> the same way cumn people this sdn helps people its
> not here 2 get points
Yep! I agree with this one. Haha. _
2007 Jun 28 11:41 AM
hi Ricardo,
I have answered thinking that you would get an idea to proceed not bothering about syntax as there is an F1 help to help you for sorting it out ... but i am embarrased to know that people need spoon feeding sort of answers.
Regards,
Santosh
2007 Jun 28 10:24 AM
The select command is the most fundamental function of writing ABAP programs allowing the retrieval ofdata from SAP database tables. Below are a few examples of the various ways ofselecting data.
*Code to demonstrate select command
*Code to demonstrate select into internal table command
TYPES: BEGIN OF t_bkpf,
* include structure bkpf.
bukrs LIKE bkpf-bukrs,
belnr LIKE bkpf-belnr,
gjahr LIKE bkpf-gjahr,
bldat LIKE bkpf-bldat,
monat LIKE bkpf-monat,
budat LIKE bkpf-budat,
xblnr LIKE bkpf-xblnr,
awtyp LIKE bkpf-awtyp,
awkey LIKE bkpf-awkey,
END OF t_bkpf.
DATA: it_bkpf TYPE STANDARD TABLE OF t_bkpf INITIAL SIZE 0,
wa_bkpf TYPE t_bkpf.
TYPES: BEGIN OF t_bseg,
*include structure bseg.
bukrs LIKE bseg-bukrs,
belnr LIKE bseg-belnr,
gjahr LIKE bseg-gjahr,
buzei LIKE bseg-buzei,
mwskz LIKE bseg-mwskz, "Tax code
umsks LIKE bseg-umsks, "Special G/L transaction type
prctr LIKE bseg-prctr, "Profit Centre
hkont LIKE bseg-hkont, "G/L account
xauto LIKE bseg-xauto,
koart LIKE bseg-koart,
dmbtr LIKE bseg-dmbtr,
mwart LIKE bseg-mwart,
hwbas LIKE bseg-hwbas,
aufnr LIKE bseg-aufnr,
projk LIKE bseg-projk,
shkzg LIKE bseg-shkzg,
kokrs LIKE bseg-kokrs,
END OF t_bseg.
DATA: it_bseg TYPE STANDARD TABLE OF t_bseg INITIAL SIZE 0,
wa_bseg TYPE t_bseg.
*Select directly into an internal table
SELECT bukrs belnr gjahr buzei mwskz umsks prctr hkont xauto koart
dmbtr mwart hwbas aufnr projk shkzg kokrs
FROM bseg
INTO TABLE it_bseg.
* Select directly into an internal table where fields are in a
* different order or not all fields are specified
SELECT bukrs belnr gjahr buzei mwskz umsks prctr hkont xauto koart
dmbtr mwart hwbas aufnr projk shkzg kokrs
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg.
*Select... endselect command
SELECT bukrs belnr gjahr buzei mwskz umsks prctr hkont xauto koart
dmbtr mwart hwbas aufnr projk shkzg kokrs
FROM bseg
INTO wa_bseg.
APPEND wa_bseg TO it_bseg.
ENDSELECT.
*Select FOR ALL ENTRIES command
<b>SELECT bukrs belnr gjahr bldat monat budat xblnr awtyp awkey
UP TO 100 ROWS
FROM bkpf
INTO TABLE it_bkpf.</b>
IF sy-subrc EQ 0.
* The FOR ALL ENTRIES comand only retrieves data which matches
* entries within a particular internal table.
SELECT bukrs belnr gjahr buzei mwskz umsks prctr hkont xauto koart
dmbtr mwart hwbas aufnr projk shkzg kokrs
FROM bseg
INTO TABLE it_bseg
FOR ALL ENTRIES IN it_bkpf
WHERE bukrs EQ it_bkpf-bukrs AND
belnr EQ it_bkpf-belnr AND
gjahr EQ it_bkpf-gjahr.
ENDIF.
reward points if it is usefull .....
Girish
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |