‎2006 Jan 25 6:26 AM
original table has column A, now add column B, right now is input A , B will automatically show up. but old data will have B blank, how to make the old data have B automatically refreshed.
thanks kitty
‎2006 Jan 25 6:31 AM
Can you explain your question more clearly.
If you want to refresh an itab then u can use
REFRESH itab.
Abdul
‎2006 Jan 25 6:32 AM
To set e default value,
UPDATE table SET b = value WHERE b IS INITIAL.
Is that what you want?
‎2006 Jan 25 6:38 AM
you have to match the value of col a and col b manually and update the table
‎2006 Jan 25 6:56 AM
‎2006 Jan 25 6:47 AM
Hi,
Use Delete and in the condition where column B = Space
it will work ..
Regards,
PAVAN.
‎2006 Jan 25 6:49 AM
Hi kitty,
1. The old data of B will NOT GET
automaticlly refreshed.
2. Either one needs to etner it via SM30
3. OR
4. Make a new program.
USE THIS KIND OF LOGIC :
*----
Get all B Blank Records
select * from DBTAB into table ITAB.
where B is initial.
*----
Get the value of B from SOURCE TABLE
Loop at ITAB.
select single FIELD
into itab-B
from sourcetable
where primarykey = itab-A.
*----
update in DBTAB
MODIFY dbtab FROM itab.
endloop.
regards,
amit m.
Message was edited by: Amit Mittal
‎2006 Jan 25 6:57 AM
could you pls further explain how to do in SM30? thanks kitty.
‎2006 Jan 25 7:00 AM
Open your table in SE11.
Go to menu Utilities -> Table Maintenance Generator
and create the table maintenance prog.
Now go to SM30 and open your table amd maintain. You can do the changes / insert data to your tables here.
Ps: Reward points if helpful.
‎2006 Jan 25 7:04 AM
I have sm30, but the question is how to update old data.
and you said to create table maintenance prog. where ?
thanks kitty
‎2006 Jan 25 7:09 AM
The table maintenance generator creates the maintenance program for you.
After which you may use SM30 for Table maintenance.
‎2006 Jan 25 7:12 AM
yes, can maintain and insert new record, but how about the old one, you only indicate the normal procedure, but I need get the old data updated.need a program to update?
thanks kitty
‎2006 Jan 25 7:15 AM
Yes then, you may use a program to update like,
Update table SET field1 = value WHERE field1 IS INITIAL.
This updates all the INITIAL VALUES to a constant value.
You may also use logical condition to update values differently for a specified value in other field.
‎2006 Jan 25 7:25 AM
but this is not set to a constant value, the data in B will be displayed automatically as input A.
thanks kitty
‎2006 Jan 25 7:27 AM
but this is not set to a constant value, the data in B will be displayed automatically as input A.
thanks kitty
‎2006 Jan 25 6:56 AM
itab_tmp[] = itab[]
sort itab_tmp .
loop at itab.
read table itab_tmp with key field_a = itab-field_a
binary search.
if sy-subrc = 0 and itab-field_b is initial.
delete itab where field_a = itab_tmp-field_a.
endif.
endloop.
this also works ..
Regards,
PAVAN..
‎2006 Jan 25 7:19 AM
HI
select cola colb into table itab from <table>.
loop at itab.
if itab-colb is initial.
update <table> set colb = value.
endif.
endloop.