on 01-11-2013 8:11 AM
My scenario looks like this
My source table is as follows:
Key Field | Data Field | Key Figure1 | Key Figure2 | Key Figure3 | Key Figure4 |
1 | Key Figure2 | 1 | 5 | 3 | 2 |
2 | Key Figure1 | 8 | 3 | 17 | 6 |
3 | Key Figure4 | 65 | 76 | 67 | 43 |
4 | Key Figure2 | 56 | 97 | 887 | 21 |
I need records in Target table as follows:
Key Field | Key Figure |
1 | 5 |
2 | 8 |
3 | 43 |
4 | 97 |
i.e. to get the key figure value for target record we need to identify which key figure need to be accessed from source table. The second field(i.e. Data field) in the source table provides this information. This "Data Field" stores the Key Figure field names/lables in it.
For example, for the first record i.e. with key field value '1', the key figure need to be accessed is Key Figure2, for the first record Key Figure2 value is 5, so it has to be stored as Key Figure value in this record
I have the solution to achieve this using CASE statement, in the example I have shown 4 key figures but it is not static , the number of key figures are not known in advance.. it may increase …so case statement will not do in this case..
Please provide me the dynamic ABAP code to achieve this.
Regards,
Hari Prasad Balija
Plz do not post same threads on multiple forums.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.