Skip to Content
0

Rewriting Code from ABAP 7.45 in obsolete ABAP 7.21 Selection Options Left Join Many Tables

Feb 01 at 10:53 AM

74

avatar image
Former Member

Dear Experts,

we have a small Code which works perfectly fine, however only in the upgraded System with the new SQL/Left Join Features a.s.o. We need to "translate" it into the obsolete Open SQL and joins quiery. Here is the Code:

SELECT mara~matnr,
makt~maktx,
mara~mtart,
mara~matkl,
marc~werks,
mard~lgort,
mard~lgpbe
INTO table @lt_nl_itab
FROM mara left JOIN marc ON ( marc~matnr = mara~matnr )

left JOIN makt ON ( mara~matnr = makt~matnr )

left JOIN mard ON ( mard~matnr = mara~matnr )

WHERE mara~matnr IN @so_matnr and marc~werks IN @so_werksand and mara~mtart IN @so_mtartand and mara~matkl IN @so_matkland and mard~lgort IN @so_lgortand and mard~lgpbe IN @so_lgpbe.

Thank you so much.

10 |10000 characters needed characters left characters exceeded

7.45 and 7.21 !? kernel versions? But you only have ABAP 7.5x, 7.40, 7.02, 7.31 (possibly 7.03, 7.1 or 7.2, etc.), cf ABAP News for Release 7.40

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Uwe Fetzer Feb 01 at 11:48 AM
1

Just delete the @s in front of the variables and the "," (comma) in the selection list. Should work in older systems.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Also add WHERE makt~spras... otherwise be prepared for a BIG surprise when another language gets installed in the system. mard~werks condition wouldn't hurt either.

1
Former Member

@Uwe: it will only solve the Syntax issue. Left outer join still won't allow using Parameters from the right table in Where condition.

0
Matthew Billingham
Feb 01 at 10:54 AM
0

Why not do it using cl_sql_statement, or even EXEC SQL?

Share
10 |10000 characters needed characters left characters exceeded