Application Development 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: 

I want to update the Custom table using the data available in ITAB.

Former Member
0 Kudos

Hi,

I want to updaste the Custom Table which is created by me (Ztable) using the data available in itab.(which i got from defferent standard tables)

I want to update the custom table using the itab data How is it possible?

Is any possible by using Modify ?

DPK.

5 REPLIES 5

Former Member
0 Kudos

Hi,

Do like this

MODIFY dbtable FROM TABLE itab.

Regards,

Satish

Former Member
0 Kudos

Hi

yes you can do like this

MODIFY ztable FROM TABLE internaltable

BEFORE MODIFYING THE DATBASE TABLE YOU NEED TO LOCK THAT TABLE

AND MODIFY IT

AND UNLOCK IT AGAIN

Former Member
0 Kudos

example here

modifying datbase table useing internal table

advises before updating this datbase table plz lock that table to avoid incosistency

write the logic for modifying

Modify the database table as per new dunning procedure

MODIFY fkkvkp FROM TABLE lt_fkkvkp .

and finally unlock the table

example

*To lock table for further operations

constants: lc_tabname TYPE rstable-tabname VALUE 'FKKVKP' . "FKKVKP

CALL FUNCTION 'ENQUEUE_E_TABLE'

EXPORTING

tabname = lc_tabname

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc EQ 0.

To fetch all the contract accounts for customers of the segment

Households/SME.

PERFORM fetch_contract_accounts using lc_tabname .

ENDIF. " IF sy-subrc EQ 0.

*wrote the logic

Modify the database table as per new dunning procedure from internal table

MODIFY fkkvkp FROM TABLE lt_fkkvkp .

*unlock the tbale

CALL FUNCTION 'DEQUEUE_E_TABLE'

EXPORTING

TABNAME = uc_tabname .

Former Member
0 Kudos

Hi,

the following will insert the values of itab into the database table(Z table)

INSERT into <Z table name> values <itabname>.

reward points if helpful,

teja.

Former Member
0 Kudos

Hi,

Considering that you have ZTABLE and internal table as ITAB

After getting the required records into the ITAB...

you may write the following code

MODIFY ZTABLE FROM TABLE ITAB.

This will update the ZTABLE with the data contained in ITAB.

Regards,

Saurabh