on 06-22-2012 5:09 PM
Hi APO Gurus,
I am looking for a macro to read one CVC's key figure value and assign to rest of all CVCs in the selection as shown below. Any Idea how todo it? This is going to be within SNP time series key figure. And I need to run this in background job and not interactively. The original value is going to be always at ZFAMX22 CVC.
Before running the macro all the CVCs and key figure value for one CVC ZFAMX22.
NA | APO Product | Unit | M 06/2012 | M 07/2012 | M 08/2012 |
NTDM | Total | UNT | 2000 | 4000 | 1000 |
NTDM | A912340 | UNT | |||
NTDM | A912350 | UNT | |||
NTDM | A912360 | UNT | |||
NTDM | A912370 | UNT | |||
NTDM | ZFAMX22 | UNT | 2000 | 4000 | 1000 |
After running the macro values should be copied to all CVCs
NA | APO Product | Unit | M 06/2012 | M 07/2012 | M 08/2012 |
NTDM | Total | UNT | 10000 | 20000 | 5000 |
NTDM | A912340 | UNT | 2000 | 4000 | 1000 |
NTDM | A912350 | UNT | 2000 | 4000 | 1000 |
NTDM | A912360 | UNT | 2000 | 4000 | 1000 |
NTDM | A912370 | UNT | 2000 | 4000 | 1000 |
NTDM | ZFAMX22 | UNT | 2000 | 4000 | 1000 |
Thanks and appreciate your time.
Raj
Raj,
Try using SUM_CALC macro function. The following pseudo code might work for both interactive and background execution.
Step 1: 1 iteration - Initialize a variable
IF ( LAYOUTVAR_VALUE( 'VAR1' ) = 0 )
LAYOUTVARIABLE_SET( 'VAR1' ; 1 )
ELSE
LAYOUTVARIABLE_SET( 'VAR1' ; EVAL( LAYOUTVAR_VALUE( 'VAR1' ) + 1 ) )
ENDIF
Step 2: 1... n iterations
NTDM = EVAL( SUM_CALC( NTDM ) / LAYOUTVAR_VALUE( 'VAR1' )
Thanks,
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajesh,
Thanks for the helpful information. Yes, your suggestion also should work if it is only one node of hierarchy. I have multiple nodes means many families SKUs and related child SKUs. For my purpose I have used TS_SET and TS_GET macro functions and able to populate required key figure values to required SKUs. This part is done.
However when I use TS_SET to save all ZFAM* CVCs key figure values system is going to save these to a TS DB table /SAPAPO/ADV_SERI as shown below. Few questions on this table:
1. For each CVC I save data using TS_SET it saving as two records. The EXT 001 & 002. The values are only in EXT 001. What is EXT and how 002 being used?
3. What are these 3 parameters we are passing TS_SET & GET: KEY1, KEY2, KEY3 where I am using A, B, C values. What is the purpose these values?
2. Is there any report to manage (delete or purge) when no more required or in case of increased number of CVCs are saved?
Thanks and appreciate your time.
Raj
Hi Raj,
TS_SET and TS_GET are functions for creating and accessing database time series (different from classical time series key figures) similar to those used in phase in/out, weighting, and trend-dampening profiles as well as time series for MLR variables.
Since the entries do not depend on the CVC values, there might be chances of inappropriate data read if concurrent use is allowed in interactive planning.
1. EXT denotes the iteration or update counter. Somehow, TS_SET was being executed twice in your case. First time with proper CVC and hence, the key figure values were copied correctly.
2. KEY1, KEY2, and KEY3 allow you to distinguish your entry and easy retrieval using TS_GET
3. In the corresponding function modules, I could see delete statement. Probably, your ABAP expert could explain better on deleting the records.
FM: /SAPAPO/TS_SET
/SAPAPO/TS_GET
Thanks,
Rajesh
User | Count |
---|---|
8 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.