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

Modify Ztable Problem

Former Member
0 Likes
1,014

Hi Experts .

I have following Requirement .

i have Z table with Field F1 F2 F3 F4 in My program i am calculting F2 Value if this entry exists in the Ztable I am modifying that record.

When I modify i am able to modify only f2 wher as F3 F4 vales are getting Reset to blank .

I tried .

Modify Dbtab from WA statement Nogo . Modify transporting wont work

Please assit if i can change only F2 value without reseting the F3 F4 .

thanks In Advance

Badari

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
831

Hi,

i think first u need to read the contents of the internal table into the workarea. and then make the changes of the field f2. update the workarea. then u can use the modify statement using the wa.

MODIFY dbtab FROM wa.

i think it will help u out.

else u can just use transporting the fields to the database table.

Regards

vamsi

6 REPLIES 6
Read only

Former Member
0 Likes
831

hi,

I think u are using control break statements for calculating F2. example

at new f2...if that is the case your work area wouldnt carry the values for the f3 and f4 components.

any how check the values in wa in the modify statement that will answer many questions of yours.

santhosh

Read only

Former Member
0 Likes
832

Hi,

i think first u need to read the contents of the internal table into the workarea. and then make the changes of the field f2. update the workarea. then u can use the modify statement using the wa.

MODIFY dbtab FROM wa.

i think it will help u out.

else u can just use transporting the fields to the database table.

Regards

vamsi

Read only

Former Member
0 Likes
831

hi badari

sorry..... follow the abow

Naresh Reddy

Message was edited by:

Naresh Reddy

Read only

Former Member
0 Likes
831

Hello,

Can you paste your code,then it will be easier to lcaote the exact issue in program.

Actually field value will be reset if there another activity check is there in program (or control working in the loop e.g. at first,at new field etc.).If your code has something simialr to it,then transfer contents of those fields in other variables defined globally.& then after control statement transfer these value to your reqd fields for print.

Thanks.

Mark points if helpful.

Read only

Former Member
0 Likes
831

Use the statement as below

UPDATE Ztable SET f2 = wa-f2

f3 = wa-f3

f4 = wa-f4

WHERE f1 = wa-f1.

commit work.

Read only

Former Member
0 Likes
831

I wanted Solution to modify sigle field whitout having other fields .

EX : I have following table

This is my Z table

Studno Maths Sci Eng

1 10

i get student number and SCi Eng marks in flat file if i upload for respective student number sci and eng has to be updated . with out resetting the Maths Marks .

Solution is not select that record from table add Sci Maths and Eng then Modify . i was seraching for only Sci eng fields to be updated without writing select on the table .

Thanks & regards

badari

Message was edited by:

Badarinarayan Patil