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

inserting standart database table

Former Member
0 Likes
620

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

5 REPLIES 5
Read only

Former Member
0 Likes
576

YOu can fetch the data from Ztable into ITab and then use BDC.

thnx

Read only

Former Member
0 Likes
576
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

Read only

0 Likes
576

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

Read only

Former Member
0 Likes
576

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

Read only

Former Member
0 Likes
576
  • 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.