‎2008 May 07 3:51 PM
Hi All,
All of you must be wondering for such a basic question. Could anyone please tell me what is sign ~?
what is the difference between - and ~ sign while writing ABAP?
e.g:
mara-matnr
mara~matnr
‎2008 May 07 4:06 PM
Hi Yogesh,
~ This is used when we are using Joins in a select query.
eg: SELECT amatnr bmaktx
INTO TABLE i_mara
FROM mara AS a INNER JOIN makt AS b
ON a~matnr EQ bmatnr
WHERE a~matnr IN so_matnr.
Here this symbol is used to link the connection between table and field in data base level.
- This is used to identify the field from work area.
eg: wa_mara-matnr. i.e wa_mara is a structure having many fields. This - symbol is just to get the required field from the work area.
Hope this is clear.
Thanks,
Vinod.
‎2008 May 07 3:59 PM
the symbol ~ is only used in SELECT statement via JOIN:
Example:
select * from mara inner join marc
on maramatnr = marcmatnr
into corresponding fields of table itab
where mara~matkl = '19'
and marc~werks = 'C001'.
there is no difference with -, it's only the sintaxis of select with joins.
‎2008 May 07 4:00 PM
Hello,
Every time you use and alias in a join you need to use ~, otherwise you use -.
Regards,
‎2008 May 07 4:06 PM
Hi Yogesh,
~ This is used when we are using Joins in a select query.
eg: SELECT amatnr bmaktx
INTO TABLE i_mara
FROM mara AS a INNER JOIN makt AS b
ON a~matnr EQ bmatnr
WHERE a~matnr IN so_matnr.
Here this symbol is used to link the connection between table and field in data base level.
- This is used to identify the field from work area.
eg: wa_mara-matnr. i.e wa_mara is a structure having many fields. This - symbol is just to get the required field from the work area.
Hope this is clear.
Thanks,
Vinod.