Skip to Content
Former Member
Sep 12, 2013 at 06:39 AM

ALTER view issue with Sybase ASE



I'm trying to Alter a view on Sybase ASE via ABAP native SQL.

I'm Facing following issues :

I tried using UPPER and Lower case SQL, still results in error.

Sample view SQL :


SELECT bkpf.bukrs AS bukrs,

bkpf.hwaer AS hwaer,

bkpf.budat AS budat,

bkpf.bstat AS bstat,

bseg.kunnr AS kunnr,

bseg.koart AS koart,

bseg.augdt AS augdt,

bseg.madat AS madat,

bseg.mandt AS mandt,

bseg.umskz AS shbkz,

bseg.dmbtr AS dmbtr,

bseg.rstgr AS rstgr,

bseg.manst AS manst,

kna1.name1 AS name1,

kna1.land1 AS land1,

kna1.ort01 AS ort01,

kna1.pstlz AS pstlz,

kna1.stras AS stras,

kna1.regio AS regio,

kna1.brsch AS brsch,

kna1.vbund AS vbund_kna1,

kna1.begru AS begru_kna1,

knb1.begru AS begru_knb1,

knb1.busab AS busab,

t001s.sname AS sname,

knkk.ctlpc AS ctlpc_knkk,

bseg_r.zfbdt AS zfbdt_1,

bseg_r.zbd1t AS zbd1t_1,

bseg_r.zbd2t AS zbd2t_1,

bseg_r.zbd3t AS zbd3t_1,

bkpf.bldat AS bldat_1

FROM bseg

INNER JOIN bkpf bkpf ON bseg.mandt = bkpf.mandt

AND bseg.bukrs = bkpf.bukrs

AND bseg.gjahr = bkpf.gjahr

AND bseg.belnr = bkpf.belnr

LEFT JOIN (bseg bseg_r

INNER JOIN bkpf bkpf_r ON bseg_r.mandt = bkpf_r.mandt

AND bseg_r.bukrs = bkpf_r.bukrs

AND bseg_r.gjahr = bkpf_r.gjahr

AND bseg_r.belnr = bkpf_r.belnr) ON bseg.mandt = bseg_r.mandt

AND bseg.bukrs = bseg_r.bukrs

AND bseg.rebzg = bseg_r.belnr

AND bseg.rebzj = bseg_r.gjahr

AND bseg.rebzz = bseg_r.buzei

LEFT JOIN knkk ON bseg.mandt = knkk.mandt

AND bseg.kunnr = knkk.kunnr

AND bseg.kkber = knkk.kkber

LEFT JOIN t014 ON bseg.mandt = t014.mandt

AND bseg.kkber = t014.kkber

INNER JOIN kna1 ON bseg.mandt = kna1.mandt

AND bseg.kunnr = kna1.kunnr

INNER JOIN (knb1 knb1

LEFT JOIN t001s ON knb1.mandt = t001s.mandt

AND knb1.bukrs = t001s.bukrs

AND knb1.busab = t001s.busab) ON bseg.mandt = knb1.mandt

AND bseg.bukrs = knb1.bukrs

AND bseg.kunnr = knb1.kunnr

Am I missing something ? or Drop - Create is the only option ?