Application Development 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: 

table saving all the changes to the document

Former Member
0 Kudos

hi,

scenario is : Sales order is been created and the shipping date is calculated as 2 months from toay ( what what ever reason, but that is not important) now after a couple of days its changed to some other date. I can see the changes in display document changes but some how am not able to find the table where they are getting stored. I want to find the original shipping date/mat avail date. This is important for backorder report.

Please help

Regards

Hrishi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

i am not sure but check with cdhdr,cdpos

13 REPLIES 13

Former Member
0 Kudos

i am not sure but check with cdhdr,cdpos

0 Kudos

Yeah. I already did check both the tables. Just not sure which field is to be mapped to which field ? what selection criterion i should use to find my entry.

Table :- vbep

field:- mbdat

name:-admin

tcode:- va02

Please tell me the corresponding fields in cdhdr or cdpos. I feel its cdpos ( as its item wise)

thanks for the reply

0 Kudos

yes ,it is cdpos...

check with fm related cdpos

Former Member
0 Kudos

Hi Hrishi,

Those tables are CDHDR & CDPOS.

Join CDHDR and CDPOS on Objectclas, objectid and change number where ( Objectclas = 'VERKBELEG' or TCODE = 'VA02' )and Object ID = Sales order number)

You will get the changes made to that particular order.

CDPOS has 2 fields tabname & fname, which will contain the table and field you are trying to search for. And VALUE_OLD and VALUE_NEW will contain old and new values for that field.

Code will be :

SELECT VALUE_OLD INTO G_VALUE

FROM CDHDR AS H

INNER JOIN CDPOS AS P ON

HOBJECTCLAS = POBJECTCLAS

HOBJECTID = POBJECTID

HCHANGENR = PCHANGENR

WHERE (HOBJECTCLAS = 'VERKBELEG' OR HTCODE = 'VA02' )

AND H~OBJECTID = sales order no

AND H~TABNAME = table name(say vbrk)

AND H~FNAME = field name.

Hope this helps.

0 Kudos

hi darshil

thanks for the reply but CHANGENR for CDHDR and CDPOS are not the same. so the selection doesnt work. anyhow, i guess i have got the hint from here.

0 Kudos

that's strange. I checked lot of examples. CHANGENRs are matching in both the tables.

0 Kudos

one more finding !!

for pooled tables, cluster tables & projection views we can NOT use joins !

sad thing !

0 Kudos

hi darshil,

what do you think is this 'changenr' ? how come its not matching over here with me. Seriously, surprising !

hrishi

0 Kudos

You will have to use for all entries for CDPOS after fetching data from CDHDR then.

Changenr is just a unique instance of changing a particular document. So you can say it's a unique number.

But i think in your case you can avoid comparing changenr as you require the first change to the particulare field. Just get the record for the lowest date & time.

0 Kudos

Hi,

I think we dont need to use cdhdr at all.

if i have

Objectclass as : VERKBELEG

OjectID : 0000253106 ( sales order)

tabname: vbep

fname: mbdat

tabkey: 40000002531060000100002 ( sales orderitem nosch. line)

i will be able to find value_old from cdpos.. isnt it ? i am working on the code right now, if it works , I am closing the thread.

thanks a lot darshil !

Regards

Hrishi

0 Kudos

Hey,

I think you will require to fetch data from CDHDR as Update date and time fields are only in CDHDR.

There may be multiple changes to the same sales order and you will have to identify the first change. for this you will need update date and time from CDHDR.

0 Kudos

Thanks mate !

i have got the code working and is fetching correct values !

help is appreciated

Hrishi

0 Kudos

Hi Experts

I need help to developed report for the following

I had gone through the tables there are CDHDR and CDPOS , from this tables

the following items have to be retrive to display the report as in attachement

These standards reports are taken from RVSD100 and RVSD200 reports which allow viewing changes on a single sales document in online mode howver the selection paratmeters for these two standard reports does not allow the selection parameters by plant code, document number, date ranges and also does not allow multiple sales document to be listed at the same time

I need a report that will allow them to list the changes made in the contract documents with more ranges options on the report selection parameters

basically this customised report will retrive all the changes made in sales contract documents within a plat , date ragne and other selection paramters

The report must allow ALV display also

sales office code and sales office description

+ contract document number

sort by date, header data filed name <01> with old and new values changes and username

sort by date, header data field name <02> with old and new values changes and username

etc....

etc...

can you please help me how to start do we required funtional module etc.,I know it is easy but i need some push to start.

regards

Piroz