![]() |
|
|||||||
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Update termination error while calling FM in Update task | ERP | SAP ABAP | 2 | 12-29-2011 10:53 PM |
| Where and Why do we use "for all entries" in select statement | nblogs | News in SAP blogs | 0 | 12-29-2011 06:52 PM |
| not getting actual value in loop on select statement | SAPMM | SAP ABAP | 2 | 03-26-2011 11:19 PM |
| Select statement not working on table ADRC? | Mirna | SAP ABAP | 2 | 02-16-2011 11:53 PM |
| How to transport set values only (and not the whole set)? | Zoom | SAP ABAP | 2 | 08-30-2010 04:57 PM |
| Aprenda SAP! |
|
|
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello experts,
After doing some research, it appears as if it's possible to use a SELECT subquery in the SET of an UPDATE statement. I did find some examples and here is my code: Code:
LOOP AT IT_DATA
UPDATE /BIC/AZDP_O0140
SET /BIC/ZCOUNTER = (SELECT COUNT( DISTINCT MATERIAL )
FROM /BIC/AZDP_O0140
WHERE MATERIAL EQ IT_DATA-MATERIAL
GROUP BY MATERIAL).
ENDLOOP.
Do I have a syntax issue or is there another reason why it's not taking this as a valid statement? Thanks for the help! Best regards, Zoom |
| Sponsors |
|
#2
|
|||
|
|||
|
Hi,
Do you still get the error if you remove the GROUP BY? Regards, Portal |
|
#3
|
|||
|
|||
|
Hi Zoom,
I cannot find supporting documentation that subqueries are allowed in this spot. You can use a dynamic "(expr_syntax)", but this would contain syntax of the fields to be updated. Also, is it correct that your UPDATE statement does not have a WHERE-condition, as you are updating all rows this way? Regards, Golfi |
| Entre a los Links relacionados |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|