Skip to Content
0

how to identify when the value of filed got changed in table?

Oct 26, 2016 at 08:44 AM

114

avatar image

Hi All,

I have two z fields in VBAP table name as Delivery date and New Delivery date. I have maintained change history check box while creating data elements. Now my requirement is to identify which filed value has recently modified. That means I should not compare the values of those fields instead of that which filed has been recently changed.

Let's consider in Delivery date we have 10/26/2016 then after I have entered 10/25/2016 in New delivery date. while reporting delivery date I have to display 10/25/2016 as it was updated recently.

Thanks & Regards,

Krishna

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

max bianchi Oct 26, 2016 at 09:17 AM
1

Hi

If your new fields are available for change document and they are updated by standard tool (so standard transactions like VA01,2,.... or Bapis....) you can get the modifications in change documents (so table CDHDR and CDPOS)

Max.

Share
10 |10000 characters needed characters left characters exceeded
Jelena Perfiljeva
Oct 27, 2016 at 05:46 PM
1
Now my requirement is to identify which filed value has recently modified. That means I should not compare the values of those fields instead of that which filed has been recently changed.

Let's consider in Delivery date we have 10/26/2016 then after I have entered 10/25/2016 in New delivery date. while reporting delivery date I have to display 10/25/2016 as it was updated recently.

There is some mismatch here. The requirement, as stated, is to identify the date when the value was changed. ("Recent" is a bit too fuzzy but let's leave it at that.) With this in mind, the next statement "I have to display 10/25/2016" may or may not be correct. You have not shared the date when the field was changed (it might as well be in last year, who knows), we can only see the current values in the fields.

So first thing first you need to get the requirement straight. As Max noted, the change documents would provide the date of change. However, they are very cumbersome to use, so Gaurav's suggestion may have some merit too.

But you also might want to understand where does this requirement come from. Delivery Date is already available in the standard fields and there should already be change documents for them. In many cases such requirements arise when the problem is actually with the business process and the users either don't understand or incorrectly use rescheduling/planning. That's just from my experience.

Share
10 |10000 characters needed characters left characters exceeded
Gaurav Singh Oct 26, 2016 at 08:56 AM
0

Hi Shiva,

Its better you add two more fields in your table i.e AEDAT & AETIM which Last change date and Last change time .

At the time of creating/updating your values just put this two fields values as -

AEDAT = sy-datum.

AETIM = sy-uzeit .

Now , In your table you would be having the values last change date and last change time in your table.

Now you can do your reporting as per your wish, As you can take the latest/recent date & time or oldest date.

Share
10 |10000 characters needed characters left characters exceeded
siva 9533 Oct 26, 2016 at 08:59 AM
0

Hi Gaurav Singh,

Thank you very much quick reply, to do this I have to add 4 more fields in VBAP table.

is there any better way than this ? can you please suggest.

Thanks & Regards,

Krishna

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Why would you need 4 fields? It's just one extra field, as far as I understand. You have some delivery date, then it changes. So Delivery Date goes to New Delivery Date and at this point SY-DATUM would go into Change Date field (1 new field). I doubt you'd actually need time, it's likely date is more than sufficient.

Actually it'd make more sense to have Delivery Date and Old Delivery Date IMHO if you are after the change tracking.

Also consider Max's answer.

0
Kiran K Nov 01, 2016 at 01:53 PM
0

Krishna,

Did you explored the standard internal tables xvbap/yvbap which differentiate the before/after change values ?

K.Kiran.

Share
10 |10000 characters needed characters left characters exceeded