Code: Alles auswählen.
data: s type string.
if p_ncncl = 'X'.
s = 'abgru EQ space'.
endif.
if p_cncl = 'X'.
concatenate ' ( abgru NE space OR'
'EXISTS ( SELECT * FROM vbak WHERE vbeln = a~vbeln'
'AND augru = ''121'' ) )'
into s separated by space.
endif.
SELECT *
FROM s733 as a
inner join s731 as b
on a~SSOUR = b~ssour and
a~VRSIO = b~vrsio and
a~SPMON = b~spmon and
a~SPTAG = b~sptag and
a~SPWOC = b~spwoc and
a~SPBUP = b~spbup and
a~VKORG = b~vkorg and
a~VBELN = b~vbeln
INTO CORRESPONDING FIELDS OF TABLE is802
WHERE a~vrsio = '000'
AND a~vkorg IN s_vkorg
AND a~vbeln IN s_vbeln
AND a~matnr IN s_matnr
AND a~pstyv IN s_pstyv
and b~zzdatu_fr in s_bedat
and b~zzdatu_to in s_endat
and (s).