Skip to Content

Hi

For my SNP planning book, I have a requiredment to add multiple vector areas in a vector variable using vec_layoutvariable_app() function. I belive this macro function appends area key figures into vector like a two dimentional data. For instance I am going to use:

Action: Attach values to my_vector variable for a group of Products in the planning table

Step 1: Append group totals

VEC_LAYOUTVARIABLE_APP( ‘MY_VECTOR’ ;

Area:  [ $Sales Order ( INITIAL ) ; $Sales Order (  M 12/2014 ) ]

)

This will generate a vector variable MY_VECTOR which have values like:

M01/12 M02/12 M03/12 M04/12 M05/12 M06/12
1200 1300 5000 2000 1200 2000
1500 2000 3000 1000 1000 1500
2000 1500 2500 1000 2000 2200

But I do not know how to read this and assing to a Area: Key figure. If I use layoutvariable as shown below:

Area: Total Demand  (Forecast/Sales Order) ( INITIAL ) =

VEC_LAYOUTVARIABLE( ‘MY_VECTOR’ )

The above laoutvariable reads only the first row value.

I want to all three rows added and assign to Total Demand Key figure like:

M01/12 M02/12 M03/12 M04/12 M05/12 M06/12
4700 4800 10500 5000 4200 5700

Any idea on this? Appreciate your time and thanks in advance.

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Rajesh Jagadeeswaran

    Hi Raj,

    You should have posted this query as ‘Start Discussion’.

    Anyways, your assumption is wrong. The advanced vector based macro functions work on  1XN matrix.

    To achieve your objective, follow the procedure below

    1. Initialize the vector

    VEC_LAYOUTVARIABLE_SET( ‘MY_VECTOR’ ;

    Area:  [ $KF1 ( INITIAL ) ; $KF1 (  M 12/2014 ) ] )

    2. Add the values

    VEC_LAYOUTVARIABLE_SET( ‘MY_VECTOR’ ; VEC_SUM(

    VEC_LAYOUTVARIABLE( ‘MY_VECTOR’ ) ;

    Area:  [ $KF2 ( INITIAL ) ; $KF2 (  M 12/2014 ) ] )

    )

    3. Repeat that for all rows

    Thanks,

    Rajesh

    (0) 
    1. Raj Kakarala Post author

      Hi Rajesh,

      Thanks for update. Sorry for late reply.

      Yes, I tried in the past this way what you shown in your example with three steps in one single macro, and did not work. Today I tried differently by splitting in to three different macros and clubbed together in a collective macro. This works perfectly fine as expected when I run in the interactive mode in planning view.

      But it does not work the same way when I run in the background using DP background job & activity. I have put the same collective macro in the activity of the background job and scheduled the job. In the log it shows the collective macro is executed for each location product combination but values are not populated.

      Any idea? Vectors do not retain/pass values between macros in the background jobs?

      Appreciate your time and sharing intelligence.

      Thanks

      (0) 
      1. Rajesh Jagadeeswaran

        Hi Raj,

        I am not sure why it requires a composite macro. Probably, if you post a screenshot of your macro implementation, I can analyze that and comment. However, background execution results depends on the way you setup the activity i.e. all the dependent macros for example start event macros must be included and executed first (based on dependency order).

        You also can try it in a different way (without any variables).

        Step 1: 1 iteration

        Area:  [ $KF_TOTAL ( INITIAL ) ; $KF_TOTAL(  M 12/2014 ) ] =

        VEC_SUM(

        Area:  [ $KF_TOTAL ( INITIAL ) ; $KF_TOTAL(  M 12/2014 ) ],

        Area:  [ $KF1 ( INITIAL ) ; $KF1 (  M 12/2014 ) ] )

        )

        Area:  [ $KF_TOTAL ( INITIAL ) ; $KF_TOTAL(  M 12/2014 ) ] =

        VEC_SUM(

        Area:  [ $KF_TOTAL ( INITIAL ) ; $KF_TOTAL(  M 12/2014 ) ],

        Area:  [ $KF2 ( INITIAL ) ; $KF2 (  M 12/2014 ) ] )

        )

        …..

        …..

        ….

        Area:  [ $KF_TOTAL ( INITIAL ) ; $KF_TOTAL(  M 12/2014 ) ] =

        VEC_SUM(

        Area:  [ $KF_TOTAL ( INITIAL ) ; $KF_TOTAL(  M 12/2014 ) ],

        Area:  [ $KFn ( INITIAL ) ; $KFn (  M 12/2014 ) ] )

        )

        Thanks,
        Rajesh

        (0) 
  2. Rajesh Jagadeeswaran

    Raj,

    In the planning job, use all the characteristics so as to work at detailed level.

    Aggregation Level: 9ALOCNO,9AMATNR (assigns default based on selection id)

    Thanks,

    Rajesh

    (0) 
    1. Raj Kakarala Post author

      Hi Rajesh,

      Yes, I lhave checked and left the fefualt 9ALOCNO, 9AMATNR only option comes based on the selection profile. It copyies only to Family Level sku. Somehow in the batch mode it’s considering VECtor variable as CVC based. Hence it’s copying the Vector variable value to only Family Level where it assigned originally. Is it true that VECtor variable is NOT global and it’s at CVC level like any other key figures? I don’t think so, as it’s working correctly in interactive mode.Please share your thoughts on this.

      Thanks

      Raj

      (0) 

Leave a Reply