cancel
Showing results for 
Search instead for 
Did you mean: 

SRM 3.0 - Historical version of documents and related bindings

matteo_montalto
Contributor
0 Kudos

Hello gurus,

I'm working on documents in SRM 3.0 (PO, CTR) which have an historical version, that is, in BBP_PD, a version signed with an 'H'.

As far as I've seen, an historical version uses a set of dictionary table which is different from a "change" or active version; in particular:

- no entries are available for the historical version in CRMD_ORDERADM_H; table BBP_PDHAD_V is used instead;

- no entries are available for the items of an H version in CRMD_ORDERADM_I; table BBP_PDIAD_V is used instead;

tables BBP_PDHGP and BBP_PDIGP are used in the same way.

Now... my problem is that, given a GUID of an historical version (header GUID), I don't know how to retrieve all the item positions contained in BBP_PDIAD_V. On a simple, active version, I used a lot of times a query done as follows:

SELECT * FROM CRMD_ORDERADM_I
   INTO TABLE my_items_itab
    WHERE header = document_guid.

but this doesn't work on BBP_PDIAD_V since I've seen in debug mode that fields like HEADER or PARENT are always blank in this table.

So... how can I realize a binding between the "H" guid of the document and the related positions in BBP_PDIAD_V ? My guess is I have to pass through BBP_PDIGP, but actually I don't know how to pass from header structures to these position tables.

Looking for your help, thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

my problem is that, given a GUID of an historical version (header GUID), I don't know how to retrieve all the item positions

It's always recommended to retrieve document details by using standard FMs than going through the set of DB tables. For your requirement, you could call FM BBP_PD_PO_GETDETAIL or BBP_PD_CTR_GETDETAIL with historical GUID. And the returning table E_ITEM contains the item that belongs to the historical document.

Former Member
0 Kudos

Hi

I completely agree with Jay.

Regards,

Virender Sinhg

matteo_montalto
Contributor
0 Kudos

Hello Jay, hello Virender,

I know, I always tried to manage document's data via standard FM, but the requirement I'm working on is quite complex and must access/manage any change directly on the dictionary tables (well, it's quite complex to explain, let's say we have to modify huge amount of data without the need of consistency check provided by FM).

An idea could be to get the items guid by means of a BBP_PD_PO_GETDETAIL call, I'll try asap.

Thanks again for your help & suggestions.

M.

Former Member
0 Kudos

Hi Matteo,

When you call the FM BBP_PD_PO_GETDETAIL with the PO header GUID, the table E_VERSION should give you the list of all versions for the PO. From that list you can get the historical versions by version type "H". From this list you can get the GUID for the historical version which you can then read.

Regards

Saravanan.

matteo_montalto
Contributor
0 Kudos

Hi gurus,

there's a problem... I have the GUID of the historical version; calling the FM BBP_PD_PO_GETDETAIL I can extract the items in an internal table; I can then use the position's GUID to access directly the table BBP_PDIAD_V. So far, so good.

The problem is that as far as I've seen via transaction BBP_PD, the same item position in BBP_PDIGP has a different GUID from the one the item has in BBP_PDIAD_V. So... how can I reconstruct item data? I have:

- historical version's GUID (header's guid);

- items guid (via FM BBP_PD_PO_GETDETAIL);

how can I get the corresponding entries in BBP_PDIGP?

Thanks once again

Former Member
0 Kudos

The problem is that as far as I've seen via transaction BBP_PD, the same item position in BBP_PDIGP has a different GUID from the one the item has in BBP_PDIAD_V. So... how can I reconstruct item data?

Use the item GUID returned to you from BBP_PD_PO_GETDETAIL. This GUID represents an entry in BBP_PDIGP.

matteo_montalto
Contributor
0 Kudos

>

> Use the item GUID returned to you from BBP_PD_PO_GETDETAIL. This GUID represents an entry in BBP_PDIGP.

False, that GUID represents an entry in BBP_PDIAD_V. I did a bit of debug and found the relationship between an item position in BBP_PDIAD_V and the corresponding in BBP_PDIGP is given by an entry in table BBP_PDLINK_V. The latest is a table that maps relationship between guid from the two tables.

Thanks anyway for your support! I can now close the message

Answers (0)