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

Variable value not getting updated

Former Member
0 Likes
731

Hi all,

Iam passing one value through select statement into a variable " v_knumv ".

In debugging mode, the variable getting the value updated.

But when I run the program normally (without debug mode), the value not getting updated, it is showing empty value.

What might be the problem.


   SELECT SINGLE knumv FROM vbak INTO v_knumv
      WHERE vbeln = salesdocument.

Please look into this

Thanks

Murali

4 REPLIES 4
Read only

Former Member
0 Likes
676

Are you sure?

Use return codes to check if it found a record (sy-subrc)

Also maybe it did find the record but the field was empty .

Kind regards, Rob Dielemans

Read only

0 Likes
676

Hi Rob,

Thanks for the reply.

Checked the sy-subrc value. it is initial only.

But after the select query, I have used commit work .

Now my problem is resolved.

I think, while debugging, the select query is taking some time to update from database. that s why after commiting, it is getting the value.

Thanks,

Murali

Read only

0 Likes
676

Hi,

Please check the below code. working fine.

data v_knumv like vbak-knumv.

PARAMETERS docnum like vbak-vbeln.

SELECT SINGLE knumv FROM vbak INTO v_knumv

WHERE vbeln = docnum.

write: v_knumv.

Read only

Former Member
0 Likes
676

Hi,

Check if the field is being cleared later on in the code.

Regards,

Ernesto.