‎2006 Sep 05 5:39 AM
hi friends
i want to fetch data from (zean)z table and do modification to that fields outside and insert this into standard data base table .can any one explain procedure...most urgent..
regards
veera
‎2006 Sep 05 5:42 AM
YOu can fetch the data from Ztable into ITab and then use BDC.
thnx
‎2006 Sep 05 5:42 AM
data : IT_ZEAN type standard table of ZEAN with header line.
*--fetch all records from your Ztable ZEAN into internal table IT_ZEAN.
SELECT * FROM ZEAN INTO TABLE IT_ZEAN.
LOOP AT IT_ZEAN.
*-do your changes to the IT_ZEAN.
modify it_ZEAN. "to update the changes in the it_zean.
ENDLOOP.
now you have all modified data in IT_ZEAN.then update the database table from this IT_ZEAN.
MODIFY ZEAN FROM TABLE IT_ZEAN.or you can use (Instead of MODIFY above)
UPDATE ZEAN FROM TABLE IT_ZEAN.
Regards
Srikanth
Message was edited by: Srikanth Kidambi
‎2006 Sep 05 5:45 AM
<b>Dont use direct update to SAP standared table.</b>
if u want...use
syntax :
ist select recreds from ztab to internal table modify recored as ur requrirment.after that insert recored from internal table to dbtab.
insert <DBtable> from <workarea>
insert <DBtable> from table <internal table>
e.g.
INSERT kna1 FROM TABLE itab ACCEPTING DUPLICATE KEYS.
<b>
Proiorities</b>
1) Check if transaction exists that will help you update the table.
2) Check Bapi/ FM which will be helpful in updating the table standard way.
3) Use modify command with by making internal table which is having same columns as of table.
4) Use native commands.
‎2006 Sep 05 5:44 AM
Hi Veera ,
Do a simple select on the Ztable and store in an internal table .
Loop over the internal table and modify the fields which you want and add into a workarea or internal table declared as per standard database table where you have to insert or try to find a function module which inserts the records into the standarad table .
And if you find it helpful ..
do reward.
Dinesh Malhotra
‎2006 Sep 05 5:49 AM
select the all fields from the Z table
SELECT (all) from dbtab into table itab
where key = k1.
do the necessary changes and insert into t_modify
Modify dbtab
IF NOT t_modify IS INITIAL.
MODIFY ztab from table t_modify.
COMMIT WORK.
ENDIF.