Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sum into Variable

sergio_cifuentes
Participant
0 Likes
412

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 !!!

2 REPLIES 2
Read only

Former Member
0 Likes
372

HI ,

check the value of variable.

if v_cant is not initial. " means sy-subrc eq 0.

else.

endif.

Mahesh

Read only

0 Likes
372

yes that's what i'm doing right now, but what i mean is why sy-subrc doesn't change??