cancel
Showing results for 
Search instead for 
Did you mean: 

Start Routine

Former Member
0 Kudos
55

Hello

I am writing a start routine where i want to delete the records which are not of status closed.

now if i write this code

delete SOURCE_PACKAGE WHERE CRM_USSTAT eq '0005'

Will this delete the records or will i have to write this code

loop at SOURCE_PACKAGE assigning <source_fields>.

if <source_fields>-CRM_USSTAT eq 'E0005'.

delete SOURCE_PACKAGE.

endif.

endloop.

Please can someone tell me the difference in this.

thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

delete won't work in BI 7, try this:

loop at SOURCE_PACKAGE

if CRM_USSTAT eq '0005'.

raise exception type CX_RSROUT_SKIP_RECORD.

endif.

endloop.

ie u have to use raise exception type CX_RSROUT_SKIP_RECORD to delete a record.

Narendra Reddy

Former Member
0 Kudos

Hi,

well normally this one will do.

delete SOURCE_PACKAGE WHERE CRM_USSTAT eq '0005'

But it deletes all records with status '0005' and I think you will keep only one status. So if '0005' is the status you like to keep you need to change eq to ne.

regards

Siggi

Former Member
0 Kudos

Sieg

Would this code work for BI7 as well or we need to do what narender is saying.

Thanks

Former Member
0 Kudos

Hi,

I am working in a 7.0 system also. I just tried that statement and it worked. What I am not sure about is if you can just enter the field name in that way. You might need to give it dynamically.

regards

Siggi

PS: the DELETE itab WHERE... is not on the list of obsolete statements.

Former Member
0 Kudos

This is good enough. You do not need to loop through.

delete SOURCE_PACKAGE WHERE CRM_USSTAT eq '0005'