Solved

Concatinating old value and new value for modified columns.

Posted on 2006-06-15
2
371 Views
Last Modified: 2013-12-26
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
Comment
Question by:venkat4sv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
tr1l0b1t earned 125 total points
ID: 16913320
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
 

Author Comment

by:venkat4sv
ID: 16920397
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question