‎2006 Nov 29 2:20 PM
Hi ,
I have an issue.
I have a screen field which stores data into a database table for the screen guid .the problem is s stores only one value .Every time it is saved with a new value it should add the new value to the old one and replace the field value with it.
Example if the
field_val = 10 and is saved with 20 again It shows only 20.but I have to code it like it shows 30 and this must be saved into the DB table.
Anyone help me out.
Thanks
‎2006 Nov 29 2:27 PM
Hi
what i understand is u have to add ur old value to new value then u want to save it.
if i m right then,
select single <oldvalue> from <tab1> into v_oldvalue where......
v_newvalue = v_newvalue+v_oldvalue.
update .......with v_newvalue......
like this u have to code
Regs
Manas Ranjan Panda
‎2006 Nov 29 2:24 PM
You will have to take care of that in your code to get the old value and add that to the new value.
Have you written any code?
Regards,
Ravi
note - Please mark all the helpful answers
‎2006 Nov 29 2:25 PM
Hi,
U can fetch the old value from DB table and try like this:
select single value from into l_value dbtab where = .
L_value = l_value + field_val.
so it will store value as 30.
Modify dbtab .
clear l_value.
Hope this helps.
‎2006 Nov 29 2:26 PM
hi Bharat,
1.read the value into your program using a select statement from DB
2. add the value with the value coming from screen field
3.modify the database table.
if you are dealing with multiple records:
1.select the value into internal table from the DB
2. loop the tbale and add the screen field value to the internal table field value
3.modify the database table using internal table.
Hope this helps.
Sajan.
‎2006 Nov 29 2:27 PM
Hi,
I think you can do some thing like this
Initially fetch the value form the db table and then assign the value to the variable and add the new screen value to it
ur table value will be stored in itab-x
ur screen value will be stored in y
itab-x = itab-x+ y
modify itab transporting x
Regards
Yamini
‎2006 Nov 29 2:27 PM
Hi
what i understand is u have to add ur old value to new value then u want to save it.
if i m right then,
select single <oldvalue> from <tab1> into v_oldvalue where......
v_newvalue = v_newvalue+v_oldvalue.
update .......with v_newvalue......
like this u have to code
Regs
Manas Ranjan Panda
‎2006 Nov 29 2:35 PM
How do I modify the DB table.What is the syntax for that?
Message was edited by:
bharat pkm
‎2006 Nov 29 2:38 PM
Hi
Update <tab1> set <fieldname> with v_newvalue where <primary_keyfield> = <fieldvalue> and <fieldname> = v_oldvalue.
Regs
Manas Ranjan Panda
Message was edited by:
MANAS PANDA
Message was edited by:
MANAS PANDA