on 11-15-2005 4:00 PM
how i can delete from it_table
I WANT TO DELETE STAT FRO TABLE JEST
I HAVE 2 PARAMETRS STAT_I AND STAT_E
IF THE USER WRITE ECUS IN STAT_I AND ESTO IN STAT_E
I WILL GET ONLY THE RECORDS WHIT ECUS
ANY IDEA?
THANKS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I am understanding what you are trying to do, based on what I see on the selection screen of IE05 tcode. There are two select-options on the selection screen one that says include these status and the other says exclude these. You want to know how to write the select statement.
SELECT ..... FROM JEST
WHERE STAT IN INCLSTAT
AND NOT STAT IN EXCLSTAT.
Here INCLSTAT is your select-option for include status and EXCLSTAT is for the opposite.
Hope this is what you are looking for.
Srinivas
Hi,
report ztest no standard page heading.
data: begin of itab occurs 0,
field1(6) type c,
end of itab.
start-of-selection.
itab-field1 = 'apple'. append itab. clear itab.
itab-field1 = 'ectram'. append itab. clear itab.
itab-field1 = 'fxectr'. append itab. clear itab.
delete itab where field1 cs 'ectr'.
Regards,
Sailaja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi braha,
while looping the internal table, check for the condition where you find 'ectr' then after that stmt say delete itab.
thats it.
Loop at itab.
check for the condition.
delete itab.
endloop.
Regards,
Vinod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
check this it may help you...
1. DELETE FROM dbtab WHERE cond.
DELETE FROM (dbtabname) WHERE cond.
2. DELETE dbtab.
DELETE *dbtab.
DELETE (dbtabname) ...
3. DELETE dbtab FROM TABLE itab.
DELETE (dbtabname) FROM TABLE itab.
4. DELETE dbtab VERSION vers.
DELETE *dbtab VERSION vers.
http://help.sap.com/saphelp_46c/helpdata/EN/06/aafd54fc4011d195280000e8353423/frameset.htm
hope this may help you
regards,
venu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yehiel,
To Delete whole Internal Table:
<b> Delete iTab.</b>
or
<b>refresh iTab[].</b>
To Delete a single enrty:
<b> delete table iTab from waTab.</b>
Thank
Kam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Numerous ways...
Example: delete my_itab where field1 = 'SOME_VALUE'.
OR
delete my_itab where field1 = 'ectr'.
Suggestion - In ABAP Editor, click on the word DELETE in your source code and press F1. This will expose SAP's on-line help for the DELETE command.
Reward points accordingly.
Message was edited by: John Jakabcsin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the documentation below.
DELETE itab
Syntax
DELETE {itab_line|itab_lines|duplicates}.
Effect
This statement either deletes one or more rows itab_line or itab_lines, specified with the table key or table index, or it deletes neighbouring duplicate rows duplicates.
System Fields
sy-subrc Meaning
0 At least one row was deleted.
4 No row was deleted, since no suitable row was found using the table key or logical condition; or the specified index was larger than the current number of rows; or no duplicate neighbouring rows were found.
eg:
PARAMETERS p_carrid TYPE scarr-carrid.
DATA: scarr_tab TYPE SORTED TABLE OF scarr
WITH UNIQUE KEY carrid,
scarr_wa LIKE LINE OF scarr_tab.
SELECT *
FROM scarr
INTO TABLE scarr_tab.
IF sy-subrc = 0.
scarr_wa-carrid = p_carrid.
DELETE TABLE scarr_tab FROM scarr_wa.
ENDIF.
2)
PARAMETERS p_carrid TYPE scarr-carrid.
DATA scarr_tab TYPE SORTED TABLE OF scarr
WITH UNIQUE KEY carrid.
SELECT *
FROM scarr
INTO TABLE scarr_tab.
DELETE TABLE scarr_tab WITH TABLE KEY carrid = p_carrid.
3)
PARAMETERS: p_carrid TYPE sflight-carrid,
p_connid TYPE sflight-connid.
DATA: BEGIN OF seats,
fldate TYPE sflight-fldate,
seatsocc TYPE sflight-seatsocc,
seatsmax TYPE sflight-seatsmax,
seatsfree TYPE sflight-seatsocc,
END OF seats.
DATA seats_tab LIKE STANDARD TABLE OF seats.
SELECT fldate seatsocc seatsmax
FROM sflight
INTO TABLE seats_tab
WHERE carrid = p_carrid AND
connid = p_connid.
LOOP AT seats_tab INTO seats.
seats-seatsfree = seats-seatsmax - seats-seatsocc.
MODIFY seats_tab INDEX sy-tabix FROM seats.
ENDLOOP.
ENDLOOP.
SORT seats_tab BY seatsfree DESCENDING.
DELETE seats_tab FROM 4.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do this a couple of different ways.
Loop at it_table.
If condition.....
Delete it_table.
endif.
endloop.
If you want to clear the whole thing, you can...
clear it_table. refresh it_table.
or
Free it_table.
You can also do stuff like this...
http://help.sap.com/saphelp_46c/helpdata/EN/06/aafd54fc4011d195280000e8353423/frameset.htm
Regards,
RIch Heilman
Message was edited by: Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just say
"DELETE IT_TABLE.
THE CURRENT RECORD IN THE INTERNAL TABLE GETS DELETED.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.