on 10-26-2012 11:04 AM
Hi all,
As I am having mismatch with stock amounts in 0IC_C03, I am applying a solution according to OSS note. My issue is implementing lines in the start routine
The part I am adding is
loop at SOURCE_PACKAGE.
if SOURCE_PACKAGE-stockcat eq 'V' or
SOURCE_PACKAGE-stocktype eq 'V'.
delete SOURCE_PACKAGE.
endif.
endloop.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.
* INSERT END
and the error message I got at the bottom is
E: At "LOOP AT itab", one of the additions "INTO", "ASSIGNING", or "TRANSPORTING NO FIELDS" is required. in the 00 context.
My aim is to define a code part to delete some records. I am poor with ABAP skills. I appreciate your help on that.
Regards.
Eddy.
Hello,
the correct syntax is LOOP AT itab ASSIGING <source_fields>.
But: Try this:
DELETE SOURCE_PACKAGE WHERE stockcat = 'V' OR stocktype = 'V'.
Kind regards,
Hendrik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Eddy,
i just try this in my system:
METHOD start_routine.
*=== Segments ===
FIELD-SYMBOLS:
<SOURCE_FIELDS> TYPE _ty_s_SC_1.
DATA:
MONITOR_REC TYPE rstmonitor.
*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
* raise exception type CX_RSROUT_ABORT.
delete source_package where calmonth = '012012'.
*$*$ end of routine - insert your code only before this line *-*
ENDMETHOD.
and this could by compiled without any problems.
You do not have to specify any structure/workareas when using delete-statement directly. Just specify your fields from _ty_s_sc_1.
Kind regards,
Hendrik
Hello Eddy,
I think you are getting error because the place where your are putting your code is incorrect i.e. SOURCE_PACKAGE is used out of scope of class lcl_transform.
put your code between lines
METHOD start_routine.
and
ENDMETHOD.
you will find a line with comment that
*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
inside start_routine method.
Your code should work there.
hope this helps.
Regards,
Purvang
Hi Eddy,
Please use below code:
LOOP AT SOURCE_PACKAGE ASSIGNING SOURCE_FIELDS.
IF SOURCE_FIELDS-STOCKCAT EQ 'V' OR
SOURCE_FIELDS-STOCKTYPE EQ 'V'.
DELETE SOURCE_PACKAGE.
ENDIF.
ENDLOOP.
Regards,
Deepak Chavan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak,
Thank you for the response, when I update the lines per your prompt, I receive this message:
E:Field "SOURCE_PACKAGE" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
I am seeing
CHANGING
SOURCE_PACKAGE type _ty_t_SC_1
so I expect there would no be a "SOURCE_PACKAGE is unknown" issue.
By the way my code part is as below:
loop at SOURCE_PACKAGE ASSIGNING <source_fields>.
if SOURCE_fields-stockcat eq 'V' or
SOURCE_fields-stocktype eq 'V'.
delete SOURCE_PACKAGE.
endif.
endloop.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.