Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 380
  • Last Modified:

Concatinating old value and new value for modified columns.

We have 10 detail rows in detail window. If the user double clicks one particular row then it opens the response window with all the 15 columns. So he can modify any values of 15 columns. Once he finished that then he press ok button. So the response window is automatically closed and the modified column/s value/s displayed on the detail window.
Right now the existing program is doing as
Suppose he double clicks on one row and does some modifications out of 15 columns and press ok button, it automatically closed and modified that particular row.
Let’s say he did modifications on two rows out of 10 rows. The existing program is passing 2 rows { ls_uc_row [1]  , ls_uc_row [2] } to update procedure, the remaining values {{ ls_uc_row [3]  , ls_uc_row [4]…ls_uc_row [10]  }are spaces.
Each row like ls_uc_row [1]  { ls_field[1] + ls_field[2] + …. + ls_field[15] }

I need to do find the old value and new value for modified values as well as description of that particular column out of 15 columns. So each modified row I need to add modified fields as [column_desc(char20)+old_value(char10)+new_value(char10)]. If he modified 4 columns out of 15, I need to add 4 more fields for the particular row like the above format.

Thanks for your advance help.
0
venkat4sv
Asked:
venkat4sv
1 Solution
 
tr1l0b1tCommented:
Hi,

Assuming you'd like to fill 'ls_uc_row' array with dw_1 changes ...

String ls_uc_row[]
Long ll_idx = 1

String ls_format, ls_old, ls_new, ls_colname
Long ll_col, ll_cols, ll_row, ll_rows

ll_rows = dw_1.RowCount()      // Nº of rows should be always 1
ll_cols = Long(dw_1.Describe("DataWindow.Column.Count"))

For ll_row = 1 To ll_rows
     For ll_col = 1 to ll_cols
          If dw_1.GetItemStatus(ll_row, ll_col, Primary!) = DataModified! Then
               ls_colname = dw_1.Describe("#" + String(ll_col) + ".name")
               // We'll get the data in same format as defined in dw
               ls_format = dw_1.GetFormat(ll_col)
               // Get old and new values
               ls_old = String(dw_1.Object.Data.Primary.Original[ll_row, ll_col], ls_format)
               ls_new = String(dw_1.Object.Data.Primary.Current[ll_row, ll_col], ls_format)
               // Fill in the array and right pad values with spaces
               ls_uc_row[ll_idx] = ls_colname + Fill(" ", 20 - Len(ls_colname)) + &
                                            ls_old + Fill(" ", 10 - Len(ls_old)) + &
                                            ls_new + Fill(" ", 10 - Len(ls_new))
               ll_idx ++
          End If
     Next
Next

Hope it helps
Regards
0
 
venkat4svAuthor Commented:
But I’m not getting proper values.
We have One window(w_master) and two datawindows (dw_1 & dw_2) with in the window. The second dw has detail rows. The maximum detail rows are 10 and each one has 15 columns. If we click one particular row it will open one response window with previous values. Here we are changing the value/s and click ok then it closes automatically and goes to our first window(w_master) with modified value/s in detail row. When we hit save button on first window they are passing only changed rows (15columns) as an array type to update procedure. I need to add modified columns at the end of each modified row like desc+prev_value+new_value.
Thanks for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now