Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 01 at 11:48 AM

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

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Feb 01 at 10:54 AM

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

    Add comment
    10|10000 characters needed characters exceeded