‎2007 Aug 08 6:42 PM
Hi, i'm trying to make a sum from an user defined table, and retrieve this value into a variable, the problem is when don't satisfy the conditions (where), the variable sy-subrc never goes to 4, i need to know when the select retrieves me a value and where is not.
The select statement is this:
SELECT SUM( cant )
FROM zcmtt_envase
INTO v_cant
WHERE docsap = p_tipo
AND ref = p_ti_zcmtt_envase-ref
AND matnr = ti_sumlips-matnr.
sy-subr it's always 0 !!!
‎2007 Aug 08 6:47 PM
HI ,
check the value of variable.
if v_cant is not initial. " means sy-subrc eq 0.
else.
endif.
Mahesh
‎2007 Aug 08 6:56 PM
yes that's what i'm doing right now, but what i mean is why sy-subrc doesn't change??