2008 Aug 26 1:29 PM
Hi All,
I am getting the following SLIN error for my report.
Code Snippet.:
LOOP AT i_ekes INTO wa_ekes WHERE ebeln = wa_po-ebeln
AND ebelp = wa_po-ebelp.
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.
SLIN Error:
The LOOP statement processing will be limited
(FROM, TO and WHERE additions in LOOP)
Interaction with group change processing (AT NEW, ...) is undefined
Points Assured,
Regards,
Viji.
2008 Aug 26 1:46 PM
Hi,
As per SAP documentation u should not use AT events with where clause. SAP will not give guarenty on the functionality.
Replace the logic like below.
SORT i_ekes BY ebelp.
LOOP AT i_ekes INTO wa_ekes.
CHECK wa_ekes-ebeln = wa_po-ebeln
AND wa_ekes-ebelp = wa_po-ebelp.
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.
ENDLOOP.
Also at what position is the field EBELP?
If it is not the first field then till that field it takes the key.
eg: EBELP is 3rd field in ur itab then when ever field1 or 2 or 3(EBELP) changes then control enters to AT event.
Another way could be like this.
i_ekes_temp [] = i_ekes[].
DELETE i_ekes_temp WHERE wa_ekes-ebeln NE wa_po-
ebeln AND wa_ekes-ebelp NE wa_po-ebelp.
SORT i_ekes_temp BY ebelp.
LOOP AT i_ekes_temp INTO wa_ekes.
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.
ENDLOOP.
I feel first approach is better.
Hope it is clear.
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Aug 26, 2008 6:17 PM
Hi,
As per SAP documentation u should not use AT events with where clause. SAP will not give guarenty on the functionality.
Replace the logic like below.
SORT i_ekes BY ebelp.
LOOP AT i_ekes INTO wa_ekes.
CHECK wa_ekes-ebeln = wa_po-ebeln
AND wa_ekes-ebelp = wa_po-ebelp.
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.
ENDLOOP.
Also at what position is the field EBELP?
If it is not the first field then till that field it takes the key.
eg: EBELP is 3rd field in ur itab then when ever field1 or 2 or 3(EBELP) changes then control enters to AT event.
Another way could be like this.
i_ekes_temp [] = i_ekes[].
DELETE i_ekes_temp WHERE wa_ekes-ebeln NE wa_po-
ebeln AND wa_ekes-ebelp NE wa_po-ebelp.
SORT i_ekes_temp BY ebelp.
LOOP AT i_ekes_temp INTO wa_ekes.
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.
ENDLOOP.
I feel first approach is better.
Hope it is clear.
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Aug 26, 2008 6:17 PM
2008 Aug 26 1:32 PM
generally we use AT Statement inside a Sorted Loop inder to have a structured block output. So just try with the code removing the where condition.
2008 Aug 26 1:34 PM
Hi,
I cant able ot remove the WHERE condition. Its necessary as part of my code.
Thanks,
Viji
2008 Aug 26 1:35 PM
HI
LOOP AT i_ekes INTO wa_ekes WHERE ebeln = wa_po-ebeln
AND ebelp = wa_po-ebelp.Because of the above loop statement you are not reading all the values from the internal table that means you are filtering the data ,
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.and inside the loop you are using control break events and since you are filtering the data in the internal table and suppose if the read records are not full ie the AT END OF <FIELD > reached or not it is not assured. so remove WHERE Condition
Regards
Pavan
2008 Aug 26 1:37 PM
The LOOP statement processing will be limitedyour code looks like will be execute only for one value wa_po-ebelp untill you are not using nested loops.
LOOP AT i_ekes INTO wa_ekes WHERE ebeln = wa_po-ebeln
AND ebelp = wa_po-ebelp."<-- holding only single value
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.Interaction with group change processing (AT NEW, ...) is undefinedyou are using
AT END OF ebelp means we can say it works as at last in your case.cause ebelp have only one value.
your query seems interesting
Amit.
2008 Aug 26 1:41 PM
Hi Vijaya,
Do not use AT - ENDAT(Control Break Statements) in a LOOP-ENDLOOP with WHERE condition.
Regards,
Chandra Sekhar
2008 Aug 26 1:46 PM
Hi,
As per SAP documentation u should not use AT events with where clause. SAP will not give guarenty on the functionality.
Replace the logic like below.
SORT i_ekes BY ebelp.
LOOP AT i_ekes INTO wa_ekes.
CHECK wa_ekes-ebeln = wa_po-ebeln
AND wa_ekes-ebelp = wa_po-ebelp.
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.
ENDLOOP.
Also at what position is the field EBELP?
If it is not the first field then till that field it takes the key.
eg: EBELP is 3rd field in ur itab then when ever field1 or 2 or 3(EBELP) changes then control enters to AT event.
Another way could be like this.
i_ekes_temp [] = i_ekes[].
DELETE i_ekes_temp WHERE wa_ekes-ebeln NE wa_po-
ebeln AND wa_ekes-ebelp NE wa_po-ebelp.
SORT i_ekes_temp BY ebelp.
LOOP AT i_ekes_temp INTO wa_ekes.
AT END OF ebelp.
V_CARRY_501 = c_x.
ENDAT.
ENDLOOP.
I feel first approach is better.
Hope it is clear.
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Aug 26, 2008 6:17 PM
2008 Aug 27 6:43 AM
Hi All,
Thanks alot. My issue got solved.
Points awarded.
Thanks Vinod.
Regards,
Viji
Edited by: VijayaLakshmi Krishnaswamy on Aug 27, 2008 7:43 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |