cancel
Showing results for 
Search instead for 
Did you mean: 

Need help about initial_stock() macro function for hierarchy location

Former Member
0 Kudos

Dear all,

I have created a location hierarchy in my system.

Location group level 1: plant K110

Location group level 2: Plant K210

The stock on hand in plant K110 is 2000 and in K210 is 100.

In my planning book, i want the value of key figure Stock on hand in location K110 is 2100 (include stock of K110 and K210).

But the stock on hand in K110 is only 2000.

When i go to macro stock balance, step stock on hand (initial), change the macro function initial_stock like bellow:

From INITIAL_STOCK( ACT_VERSION ; ACT_PRODUCT ; ACT_LOCATION )

To INITIAL_STOCK( ACT_VERSION ; ACT_PRODUCT ; ACT_LOCATION ; 'AGGR' )

Then the value of key figure stock on hand in location K110 is 100.

I think that with the argument 'AGGR' the system will calculate the stock on hand in location level 2.

So my question is "Is there any other argument like 'AGGR', with that argument the system will calculate the total stock on hand in K110 and K210?"

Thanks very much,

Thai.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rajesh and Ada,

Thanks a lot for your help, i will try your solution.

Best regards,

Thai

rajkj
Active Contributor
0 Kudos

Hi Thai,

Use location product hierarchy i.e. Product(X)@K110 = aggregation of Product(X)@K110 and Product(X)@K210.

Then, the macro function INITIAL_STOCK will show the aggregated stock value.

Thanks,
Rajesh

Former Member
0 Kudos

Hi Rajesh,

Thanks very much for your reply, but i don't clearly understand your solution.

Do you mean that: "maintain K110 and K210 as location group level 2 of K110"?

I have tried this but the system show the message "1 Object(s) could not be assigned to
hierarchy".

Can you explain more detail about your solution.

Thanks,

Thai

rajkj
Active Contributor
0 Kudos

Hi Thai,

Please check the following link on master data for aggregated planning.

http://help.sap.com/saphelp_SCM700_ehp02/helpdata/en/e6/83320a52280b4f94d45122483aa118/frameset.htm

The initial_stock macro function may work as expected if you pass the location product at header level.

Thanks,
Rajesh

Former Member
0 Kudos

Hi Rajesh,

I really don't know how to set hierarchy

Product(X)@K110 = aggregation of Product(X)@K110 and Product(X)@K210

Because in above hierarchy, location K110 is used in 2 time, and the system does not allow that.

I have gone to SPRO and created a hierarchy myself, but it's not work.

Would you please explain to me more about your solution?

Thanks,

Thai

former_member187488
Active Contributor
0 Kudos

Hello Thai,

I don't think it's possible to create a hierarchy like that.

Not sure why you want the stock K110 = K110+K210 --- this should not be able to reflect the real stock situation.

Maybe you should consider to create a header location HEAD (which is not in ECC system) and then create the hierarchy HEAD = K110+K120.

Best Regards,

Ada

rajkj
Active Contributor
0 Kudos

Hi Thai,

I tried the aggregated planning scenario in my system (one product and multiple locations). It was futile attempt. The system considers only multiple products at one location as explained the SAP help documentation.

My apologies for wrong suggestion as your requirement cant' be met through aggregated planning.

Thanks,

Rajesh

former_member187488
Active Contributor
0 Kudos

Hello Rajesh,

One product at multiple locations should also be able to considered by the system --- this depends on how you create your location product hierarchy. Please refer to note 1669699.

Best Regards,

Ada

rajkj
Active Contributor
0 Kudos

Hi Ada,

Thanks a lot for the useful information. I did not know about the hierarchy related configuration settings.

Probably, the config described by point 2 i.e. location product hierarchy of certain product might be applicable to Thai's case. 

Location hierarchy for a certain product.

    • Product hierarchy:
      Level 1 - HEAD_PROD
    • Location hierarchy:
      Level 1 - HEAD_LOC
      Level 2 ------SUB_LOC1
      Level 2 ------SUB_LOC2
    • Customizing Setting:
      RELS_LOKATIONSPRODUKT 101 RELS_LOKATION 101
      RELS_LOKATIONSPRODUKT 101 RELS_PRODUKT  101
      RELS_LOKATIONSPRODUKT 102 RELS_LOKATION 102
      RELS_LOKATIONSPRODUKT 102 RELS_PRODUKT  101
    • Generated location product hierarchy:
      Level 1 - HEAD_PROD @ HEAD_LOC
      Level 2 ------HEAD_PROD @ SUB_LOC1
      Level 2 ------HEAD_PROD @ SUB_LOC2

HEAD_PROD = Product(x)

HEAD_LOC = A dummy location

SUB_LOC1 = K110

SUB_LOC2 = K210

Best regards,

Rajesh