Skip to Content
-1
Jan 18, 2023 at 05:57 PM

Syntax error when executing code, why?

79 Views Last edit Jan 18, 2023 at 06:29 PM 3 rev

Hello community!

I am doing an exercise on internal tables, and when writing the following code I have a syntax error.

The syntax error that it generates is the following: "USING" expected, not "READ TABLE HOLIDAY WITH".

could someone guide me?

thanks!

TYPES:

BEGIN OF ty_reg,

id(3) type n,

text(20) type c,

END OF ty_reg.

DATA:

day TYPE STANDARD TABLE OF ty_reg WITH HEADER LINE,

holiday TYPE STANDARD TABLE OF ty_reg WITH HEADER LINE.

SORT: day BY id, holiday BY id.

LOOP AT day

READ TABLE holiday WITH KEY id = day-id INTO day BINARY SEARCH.

IF sy-subrc EQ 0.

day-text = holiday-text.

MODIFY day INDEX sy-tabix.

ENDIF.

ENDLOOP.