on 05-13-2006 6:16 PM
Dear Gurus,
I was trying to modify a KF data field (ODS) with following code to update on itself but the field is not modified apparently.
LOOP at data_package.
data_package-/BIC/KF2 = data_package-/BIC/KF1.
modify data_package transporting /BIC/KF2.
ENDLOOP.
This is in start routine. Subsequently, update rules will aggregate the records. Each record has more than 1 KF as data fields.
The aggregated record (new record) shows the change in field KF2 but the source records are not showing the change as KF2 remains with old values!
Any ideas how this can be explained? Have I missed something?
Should I have used internal data_package ?
What is the difference if I do not use it?
Must I refresh the package?
What is the difference between using the syntax 'transporting' and not using it?
Must I do anything to the other KFs if their values should remain unchanged?
Best Regards,
Suzie
Hi Suzie:
You don't need the Clear statement.
What is does it, it will clear the current line from Work Area. There are times that you need it, not in this case within a loop becasue when the loop goes to new Record, it will overwrite the old record.
Also, it does different tasks depending on where you write it.
This line will add unnecessary additional time. So, don't use it.
Ram Chamarthy.
Message was edited by: Ram Chamarthy
Message was edited by: Ram Chamarthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can try removing the 'Transporting' addition.
LOOP at data_package.
data_package-/BIC/KF2 = data_package-/BIC/KF1.
modify data_package.
clear data_package.
ENDLOOP.
Removing it wont affect the other data fields.
Regards,
Prema
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suzie:
Remove 'transporting /BIC/KF2'. You don't need it.
The Remaining Code is correct.
Ram Chamarthy.
Message was edited by: Ram Chamarthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Suzie,
When you say, source records are not showing changed value, where you are checking this value?
Please check this from F1 help on the syntax of modify
... TRANSPORTING comp1 comp2 ...
Effect
The TRANSPORTING addition has the effect that only the specified comp1 comp2 ... components of the work area are assigned to the corresponding components of the line(s) to be changed. For sorted tables and hashed tables, no table key components may be specified after TRANSPORTING.
The comp1 comp2 ... component specifications are made in accordance with the rules specified in Component specification, with the constraint that after TRANSPORTING, no attributes of classes can be addressed using the object component selector.
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Praveen,
I am checking on the same ODS. Its both the source and target as I am doing a update on itself.
Please give me more help.
I just want to modify a data field without creating additonal records. There are some other data fields but they should not be modified. So, no code is added for these.
So, it was right to use 'transporting'. Any idea why the field was not modified?
Thanks in advance,
Suzie
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.