‎2009 Apr 22 9:18 AM
Hi Experts,
i have the following internal table:
data : it_result1 TYPE crmt_object_guid_tab
and work area
data : wa_result1 type crmt_object_guid.
i have to delete a guid from internal table based on some condition.
loop at it_resul1 into wa_result1
if lv_priority eq priority.
delete this entry from internal table.
endif.
endloop..
i tried using delete table it_result with table key CRMT_OBJECT_GUID = wa_result. but this is giving syntax error.
what should be done to delete the entry?
Thanks and regards
Shilpi
‎2009 Apr 22 10:14 AM
Try this,
Delete table it_result with table key CRMT_OBJECT_GUID = WA_RESULT1.
Regards,
Joan
‎2009 Apr 22 9:20 AM
Hi,
you're in a loop
use
DELETE it_result INDEX sy-tabix.The sintax error that you have could be fixed by
delete table it_result with table key CRMT_OBJECT_GUID = wa_result1-CRMT_OBJECT_GUID. "specify the field and do not use all the work areaRegards,
Ivan
‎2009 Apr 22 9:20 AM
Hi
Check Syntax for DELETE operator on pressing F1
1. DELETE itab.
2. DELETE TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn.
3. DELETE TABLE itab [FROM wa].
4. DELETE itab INDEX idx.
5. DELETE itab FROM idx1 TO idx2.
6. DELETE itab WHERE logexp.
7. DELETE ADJACENT DUPLICATES FROM itab.
delete table it_result with table key CRMT_OBJECT_GUID = wa_result
this is wrong
delete it_result where CRMT_OBJECT_GUID = wa_result
Edited by: Lavanya K on Apr 22, 2009 10:20 AM
‎2009 Apr 22 9:21 AM
Hi,
use the following:
delete table it_result with table key CRMT_OBJECT_GUID = wa_result1.
‎2009 Apr 22 9:22 AM
Use
delete table it_result where CRMT_OBJECT_GUID = wa_result-<fieldname>.(compare with fieldname of workarea not ebntire workarea.)
Thanks
Vijeta Galani
‎2009 Apr 22 9:22 AM
Hi Shilpi,
Delete the entry using the beow syntax.
DELETE TABLE table name FROM work area.
or get the index of the entry from the internal table and delete it
DELETE internal table name INDEX sy-tabix.
Hope this will help ou.
Regards,
Phani.
‎2009 Apr 22 10:14 AM
Try this,
Delete table it_result with table key CRMT_OBJECT_GUID = WA_RESULT1.
Regards,
Joan
‎2009 Apr 22 1:46 PM
Hi,
usually You can use delete statement to delete data from your internal table. For ex.
DELETE ITAB1 WHERE MATNR <> 105024 AND MATNR <> 105023 AND MATNR <> 100010 .
Regards,
Himanshu
‎2009 Apr 22 2:09 PM
Hi Shilpi,
You can try this.
data : it_result1 TYPE STANDARD TABLE OF crmt_object_guid_tab.
data : wa_result1 type crmt_object_guid.
loop at it_resul1 into wa_result1.
if lv_priority eq priority.
delete table it_result1 from wa_result1.
endif.
endloop.
Note: when you use the below syntax, you might face problem in capturing the correct index of the record, since records are being deleted.
DELETE it_result INDEX sy-tabix.