Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Syntax error when executing code, why?

0 Likes
2,112

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.

4 REPLIES 4
Read only

Ryan-Crosby
Active Contributor
2,033

You have a typo of holyday that should be holiday

Read only

Sandra_Rossi
Active Contributor
2,033

Pay attention around the place. Statements must all end with a dot.

Read only

abhawsinghka-1
Explorer
0 Likes
2,033

Hi Juan,

Please add a dot after the statement 'LOOP AT day'

Read only

RichB
Participant
0 Likes
2,033

No period after "Loop at day"