What is wroing in the follwoing ABAP code.

gram77
gram77 used Ask the Experts™
on
DATA : BEGIN OF line1,
   cola TYPE i,
   colb TYPE i,
   END OF line1.
DATA mytable1 LIKE HASHED TABLE OF line1 WITH UNIQUE KEY colb.
 
DO 4 TIMES.
   line1-cola = sy-index.
   line1-colb = sy-index ** 2.
   INSERT line1 INTO TABLE mytable1.
ENDDO.
 
line1-colb = 80.
MODIFY TABLE mytable1 FROM line1 TRANSPORTING colb
where (colb > 2) and (cola < 5).

 
LOOP AT mytable1 INTO line1.
   WRITE :/ line1-cola, line1-colb.
ENDLOOP.

Error:
".", "ASSIGNING <fs>", "REFERENCE INTO data-reference", or "ASSIGNING            
<fs> CASTING" expected after "COLB".            

Note: Error line is in bold. The error is shown in red.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
colb is a unique key in the hashed table  mytable1.

According to the documentation, it is not possible to transport a unique key column by using: TRANSPORTING colb

However, even if i change the code to the following the error persists:

MODIFY TABLE mytable1 FROM line1 TRANSPORTING cola
where (colb > 2) and (cola < 5).

Author

Commented:
The following works:

MODIFY mytable1 FROM line1 TRANSPORTING cola
where colb > 2 and cola < 5.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial