Skip to Content
0
Former Member
Jun 25, 2008 at 10:15 PM

Why this simple SELECT is NOT working??

447 Views

Hi Experts,

When I input the P_VKORG the following SELECT is working.

When I did not inut(leaving blank) the P_VKORG the same SELECT is NOT working??

Can u tell me, Why this simple SELECT is NOT working??

selection screen:

PARAMETERS: p_vkorg TYPE mvke-vkorg.

SELECT-OPTIONS: s_prodh FOR mvke-prodh,

s_mvgr2 FOR mvke-mvgr2,

s_matnr FOR mvke-matnr.

PARAMETERS: p_werks TYPE mard-werks.

SELECT-OPTIONS: s_lgort FOR mard-lgort.

select:

SELECT

vmatnr vvkorg vvtweg vvmsta

dlabst dinsme d~speme

INTO CORRESPONDING FIELDS OF TABLE it_itab

FROM mvke AS v

INNER JOIN mard AS d ON dmatnr = vmatnr

WHERE v~matnr IN s_matnr AND

v~vkorg EQ p_vkorg AND

v~vmsta = '33' AND

v~vmstd GE sy-datum AND

v~prodh IN s_prodh AND

v~mvgr2 IN s_mvgr2 AND

d~werks = p_werks AND

d~lgort IN s_lgort.

i tried also with,

SELECT

vmatnr vvkorg vvtweg vvmsta

dlabst dinsme d~speme

INTO CORRESPONDING FIELDS OF TABLE it_itab

FROM mvke AS v

INNER JOIN mard AS d ON dmatnr = vmatnr

WHERE v~matnr IN s_matnr AND

v~vkorg = p_vkorg AND

v~vmsta = '33' AND

v~vmstd GE sy-datum AND

v~prodh IN s_prodh AND

v~mvgr2 IN s_mvgr2 AND

d~werks = p_werks AND

d~lgort IN s_lgort.

thanq