data: cond_syntax type string.
clear: cond_syntax
case pa_werks.
when 'P100'.
lr_vstel-low = 'H110'.
concatenate ' ( D~AUART LIKE ' '''' 'ZCD%' ''''
into cond_syntax.
concatenate cond_syntax 'OR D~AUART LIKE ' '''' 'ZEX%' ''''
into cond_syntax.
concatenate cond_syntax 'OR D~AUART LIKE ' '''' 'ZFB%' ''''
into cond_syntax.
concatenate cond_syntax 'OR D~AUART LIKE ' '''' 'ZFD%' ''''
into cond_syntax.
concatenate cond_syntax 'OR D~AUART LIKE ' '''' 'ZOR%' '''' ' )'
into cond_syntax.
when 'P200'.
lr_vstel-low = 'H210'.
concatenate ' D~AUART EQ ' '''' 'ZA1' ''''
into cond_syntax.
endcase.
select a~edatu c~kunnr a~vbeln a~posnr b~route
b~matnr b~kwmeng b~zieme b~werks a~wmeng
into corresponding fields of table gt_base
from vbep as a inner join vbap as b
on a~vbeln eq b~vbeln
and a~posnr eq b~posnr
inner join vbpa as c
on a~vbeln eq c~vbeln
and c~parvw eq 'WE' "Ship-to-party(SH)
inner join vbak as d
on a~vbeln eq d~vbeln
inner join mara as e
on b~matnr eq e~matnr
where a~edatu in s_edatu
and a~vbeln in s_vbeln
and b~matnr in s_matnr
and c~kunnr in s_kunnr
and b~kwmeng ne ''
and (cond_syntax).
'SAP > ABAP 개발' 카테고리의 다른 글
BAPI_GOODSMVT_CREATE-ABAP (3) | 2010.11.30 |
---|---|
Search help exit (1) | 2010.11.17 |
Function Module to handle Special Character (특수문자 관련) (1) | 2010.11.05 |
ALV Object Model - Simple 2D Table - The Basics (1) | 2010.11.04 |
ABAP Code Sample for ALV Grid (1) | 2010.11.03 |