Skip to Content
-2
Jul 24 at 03:57 PM

Syntax error

109 Views Last edit Jul 24 at 04:02 PM 2 rev

Hi Experts,

I'm getting below syntax error while saving the program. Kindly share your inputs.

Error : "if the new open SQL syntax is used, it must be used throughout. This includes @ to escape host variables.

Getting error in line "INTO TABLE IT_mseg".

tables : bkpf , acdoca , mseg.

types : begin of ty_mseg,
          bukrs type bkpf-bukrs,
          belnr type bkpf-belnr,
          mblnr type mseg-mblnr,
          blart type bkpf-blart,
          hsl   type  acdoca-hsl,
        end of ty_mseg.

data : it_mseg type table of ty_mseg,
       wa_mseg type ty_mseg.

select-options :  s_bukrs for bkpf-bukrs,
                  s_gjahr for bkpf-gjahr,
                 s_blart for bkpf-blart.

start-of-selection.

  select  bkpf~bukrs , acdoca~belnr , mseg~mblnr , bkpf~blart , acdoca~hsl
          from bkpf inner join acdoca
          on bkpf~belnr = acdoca~belnr
          inner join mseg
          on bkpf~xblnr = mseg~mblnr
          INTO TABLE IT_mseg
          where bkpf-bukrs in s_bukrs
          and  bkpf-gjahr in s_gjahr
          and  bkpf-blart in s_blart.

  loop at : it_mseg into wa_mseg.

    write : / wa_mseg-bukrs , wa_mseg-belnr , wa_mseg-mblnr , wa_mseg-blart , wa_mseg-hsl.
  endloop.