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

delete modify from ztable

Former Member
0 Likes
654

hi all,

I RETRIVING DATA FROM ZTABLE AND UPDATING OR DELETING FEW RECORDS IN TABLE CONTROL.

Is is advisable to delete and modify the ztable for a particular record.

I have a delete a record with say id number 111

and insert the modified records of id number 111 at the same time when i save it, because when i deleting the records iam just deleting from table control anfd not from ztable.

what iam thinking i would delete all the items that exist in ztable with this id and insert all the modified records of the same id when i save it.

Let me know your advice

Suchitra

5 REPLIES 5
Read only

Former Member
0 Likes
592

Hi,

There is no necessary for deleting a record & then inserting the same record.You can aswell just Modify the record. When you do delete or update operations in a ztable,it will take time for the database to update & it might give you a problem( if you dont use WAIT statement).

Read only

Former Member
0 Likes
592

Suchitra,

In this case, you should always just MODIFY / UPDATE the records in one step... do not ask the app and DB servers to do more work than is necessary.

Read only

Former Member
0 Likes
592

Hi,

Let's say if you are deleting the record from the table control internal table..Mark the record for deletion..

Then if another record is inserted with the same id..Then check if there is a record in the table control internal table that is already marked for deletion..If so raise an error message that there is the same record is marked for deletion..

But if the user saves the changes to the database..Then tries to create a new entry with the same id...Then allow..

This will avoid lot of confusion..

Thanks,

Naren

Read only

0 Likes
592

hi all,

this is my exact requirement

For each record , i have a header info, item details.

for header iam ok , i can use modify.

for item details i have like

itemno material materialdesc quantity

1 m1 pqr 12

2 m2 def 9

3 m3 abc 2

4 m4 xyz 1

item no and material are my primary keys.

so iam retrieving this data from a z table and have to update.

may be i need to delete 3 record and modify 2 record,i would do that based on the selectionfrom table control

itemno material materialdesc quantity

1 m1 pqr 12

2 m2 def 19

3 m4 xyz 1

now i have deleted 3 record and modifed 2 with increase in quantity and the itemno are changed

I have ths data in my internal table.

iAM USING MODIFY STATEMNT WHEN I SAVE THE DATA INTO DATABASE TABLE.

i SEE THE FOLLOWING DAT AIN MY ZTABLE

1 m1 pqr 12

2 m2 def 19

3 m3 abc 2

4 m4 xyz 1

3 m4 xyz 1

THOGHT I NEED ONLY THESE DATA TO BE PRESENT IN MY ZTABLE

1 m1 pqr 12

2 m2 def 19

3 m4 xyz 1

Read only

0 Likes
592

Hi,

There is a problem in the way you are updating the Item in the internal table from the Table control.Unless you specify the item no in the table control, it will take the line no. as the item no & thats why i see this problem while updating.