07-29-2009 8:45 AM
HI ALL, i have;
DATA gt_results TYPE sp_data_type OCCURS 0 WITH HEADER LINE .
......
......
FORM X .
.....
EXPORT gt_results TO DATABASE sp_ver_dat ID INDXKEY.
.....
ENDFORM .
FORM Y .
...
IMPORT gt_results FROM DATABASE sp_ver_dat ID INDXKEY.
...
ENDFORM .
I coded this for storing alv datas as a version . Suppose i executed "form x" in 2008. After 1 year later, i would like to see this 2008 record. But my internal table type (sp_data_type) was changed (This change is obligatory). In example new 2 fields were added and 1 field was deleted. In spite of this, i have an error when i am attempting to run "form y" because clustered data in database does not fit gt_results anymore.
How can i run such old stored versions of this alv report? How should i design this subroutines so there will be no problems even if internal table type frequently change in future..?
I am expecitng your suggestions..
Thanks..
07-29-2009 9:12 AM
Hi!
I think you have to update the cluster data with a report.
This may import the cluster in a temporary internal table (old version), transfered to the new structure and inserted to the cluster.
SAP does so in upgrades with XPRAs.
Kind regards
Peter
07-29-2009 9:12 AM
Hi!
I think you have to update the cluster data with a report.
This may import the cluster in a temporary internal table (old version), transfered to the new structure and inserted to the cluster.
SAP does so in upgrades with XPRAs.
Kind regards
Peter
07-29-2009 12:41 PM
Yes you are right but i have to achieve this dynamically. I mean that, I should get the previous version of structure (of internal table) in program. Is there any method to get old versions of structure in code?
Thanks..
07-30-2009 6:20 AM
Hi!
I suggest, the only way will be to save the version of the structure of the saved data to the db as well.
Wenn retreiving the data, you have to read this structure data first, build a structure dynamically and fill this internal table for output.
It's a lot of coding you have to create!
Kind regards
Peter
07-30-2009 1:26 PM
I think this is good solution for the versions which we will be created . Unfortunately there is no way to save (excute) old versions in which structure of internal table has changed many times. We have to handle them manually..
It means, we can save future but not past..
ISN'T IT?
Thanks all
08-11-2009 8:17 AM
Hi!
You've to store the old version of the structure to reload the data.
The other way is, at every change of the structure to update the stored cluster data. This could be a very long task!
Which of the two described solution would be better is up to you!
Kind regards
Peter