Application Development 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: 

The tilde vs. the dash

Former Member
1,457

What is the deal with the tilde, exactly?

I haven't programmed in ABAP in a long while, and when I tried to change a program, I kept getting "field not found in program" messages on a SELECT statement.

I actually copied some of Rich's code to replace my own, and that's when I noticed the messages changing. I finally deduced that the tilde "" seems to be the required delimiter for TableField construct, but a dash "-" for InternalTable-Field construct.

The program, which is a simple data extract from 2 tables, finally worked.

Thanks for the code, Rich!

Michael G.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
263

The tilde is used in SELECT statements when doing INNER JOINs or LEFT OUTER JOINs, in the field lists, the join conditions, as well as in the WHERE clause.

Use the dash everywhere else.

Regards,

Rich Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
264

The tilde is used in SELECT statements when doing INNER JOINs or LEFT OUTER JOINs, in the field lists, the join conditions, as well as in the WHERE clause.

Use the dash everywhere else.

Regards,

Rich Heilman

0 Kudos
263

So my theory about InternalTable references using dashes was just coincidence, as they were all in the INTO clause, and the ExternalTable refs were in SELECT and JOIN clauses.

It's very clear now. Thanks very much for your help.

FWIW, I spent a lot of time reading the documentation and searching existing forum messages before asking, but I was thinking the error was in the JOIN syntax, so I was looking in the wrong direction.

Former Member
0 Kudos
263

Hi Michael,

Tilde is used while you need a value of some field of a database table at runtime. Mostly we use tilde when we write select quiry using JOIN i.e. extracting data from more than one table.

Thanks & Regards,

Ravikiran.

PS:Consider awarding points for helpful replies.

0 Kudos
263

Ravikiran,

"Consider awarding points for helpful replies."

Thanks for the tip. As this is my first post, I was unaware of the point system.

Regards,

Michael