on 06-10-2016 11:15 AM
Hi,
I need to delete records in the source_package while loading from 1 dso to another dso, based on the below condition. The records are not getting deleted.
Do we need to handle it through looping on the source_package ? Please advise.
Delete source_package where SO_ORDER_TYPE NE 'A'or SO_ORDER_TYPE NE 'B'.
Basically I do not want any SO's other than these 2 order type's.
Please advise how to handle this in start routine.
Thank You
DR
Hi Daniel,
No LOOP should be necessary. Try a AND rather than a OR:
Delete source_package where SO_ORDER_TYPE NE 'A' AND SO_ORDER_TYPE NE 'B'.
Regards,
Frederic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cincet/Amit,
thanks for the reply. Are you sure it will work fine ? I have not yet tried, Will try on Monday and update this trail....but is it same as handling it through a loop ? I mean will a single delete, work with AND. Can you please explain, how AND can check both the values in a single field. Im not an abaper.
thanks
DR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes source package holds the records and you need to loop on this source package and bring the data in to an internal table to perform the deletion.
loop at source_package assigning source_fields
if <source_fields>-SO_ORDER_TYPE NE 'A'.
delete SOURCE_PACKAGE.
elsif
<source_fields>-SO_ORDER_TYPE NE 'B'.
delete SOURCE_PACKAGE.
endif.
endif.
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel
Yes, you need to use loop. Please try this
LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.
IF <SOURCE_FIELDS>-SO_ORDER_TYPE NE 'A'.
delete SOURCE_PACKAGE.
ELSEIF <SOURCE_FIELDS>-SO_ORDER_TYPE NE 'B'.
delete SOURCE_PACKAGE.
ENDIF.
ENDLOOP.
Regards
Karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.