Skip to Content
Author's profile photo Martin Grob

Extracting factory calendar data to a DSO in #SAP #BW

Introduction

In order to work with factory calendar information it is sometimes helpful if the information would be stored in a datastore object for each day factory calendar and company code if it is a working day or not. The information is extracted after the “factory calendar” have been replicated via “Transfer global settings”

Howto extract the factory calendar information

To achieve this two function modules are needed FISCPER_FROM_CALMONTH_CALC and DATE_CONVERT_TO_FACTORYDATE.

The target DSO contains those key fields / data fields. The data fields aside from the working days keyfigure are optional but might be useful aggregated views are of intrest.

/wp-content/uploads/2013/11/21_11_328408.png

The dataflow in this example forsees to load the required company code / factory calendar assignments from the enhanced masterdata object 0COMP_CODE. This can also be altered to suit e.g. 0PLANT and those factory calendar informations.

/wp-content/uploads/2013/11/21_111_328407.png

The attached expert routine determines for each company code and factory calendar ID if the individual calendarday is a working day or not. The information is stored in the DSO.

Result

/wp-content/uploads/2013/11/20_11_328406.png

Each day is either 0 (no working day) or 1 (working day).

Attached are both the FM and the required expert routine.

Assigned tags

      21 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Vikrant Mohite
      Vikrant Mohite

      Hi Martin,

      Snaps are broken.

      Can you please fix it

      Cheers,

      Vikrant.

      Author's profile photo Martin Grob
      Martin Grob
      Blog Post Author

      thanks for the hint I'll fix them later today.

      Martin

      Author's profile photo Former Member
      Former Member

      Great work again Martin, thanks for sharing

      KR,

      Manna Das

      Author's profile photo Prashanth konduru
      Prashanth konduru

      one more good piece of info from Martin ... Thanks for sharing

      Author's profile photo Martin Grob
      Martin Grob
      Blog Post Author

      you're welcome thanks!

      Author's profile photo CH Raman
      CH Raman

      Good doc and useful one. Are you loading to DSO by using master data source of comp code?

      Author's profile photo Martin Grob
      Martin Grob
      Blog Post Author

      yes in our case we have a factory calendar per company code which is attached to 0COMP_CODE and we derive the working days from there. you could also do the same from 0PLANT where you have the factory calendar attached from bi content.

      Author's profile photo CH Raman
      CH Raman

      That sounds good. Thanks for the clarification Thank Martin

      Author's profile photo Suman Chakravarthy K
      Suman Chakravarthy K

      Hi Martin,

      This is innovative post from you. Seems to be nice code 🙂 . I suggest you to come up with such blogs. Thanks for sharing.

      If possible, please keep the code opened. I mean don't put in ZIp file.

      Regards,

      Suman

      Author's profile photo Martin Grob
      Martin Grob
      Blog Post Author

      Hi Suman

      Thanks for your comment. I actually uploaded the texts as TXT but somehow it seems they get zipped automatically. 🙂

      Martin

      Author's profile photo Former Member
      Former Member

      Hey Martin,,,

      great blog. We also derive almost the same way 🙂

      Thanks for making such useful information on SCN.

      Author's profile photo Former Member
      Former Member

      Thanks for sharing .

      Regards,

      Sushant

      Author's profile photo abilash n
      abilash n

      Nice blog Martin as always....

      Author's profile photo Josh Reithofer
      Josh Reithofer

      Hi, nice Blog!

      Question: How did you got the (user input variables) l_start_date & l_end_date (see Expert routine) into this Expert routine (Source in ZIP is not complete).

      Plz. give exact required coding including the decleration of the variables & other steps/actions if required.

      By the way: By using 0Plant instead of 0Comp_code you get directly a value for the Calendar ID from the field 0Plant-Factcal_id. Which you can using when calling the custom FM in the expert routine. Here we used a custom datasource to add Company code (BUKRS) from ECC (R/3 6.0) to 0Plant. Which makes (BW-) live a bit easier here... 😉

      See also table T001W (* T001K / T001) in ECC & table TFACD (Factory Calendar) in ECC/BW.

      cheers, Josh

      Author's profile photo Former Member
      Former Member

      Brilliant blog thanks a lot, where is the attachment?

      Author's profile photo Simon Kußmann
      Simon Kußmann

      Hi Martin,

      I cannot find the attached as well. Could you help us here? 🙂

      Thanks!

      Author's profile photo Former Member
      Former Member

       

      Hi Martin,

      I cannot find the attached file. Could you help us here?

      this is my email shoker_eg1@hotmail.com

      Thanks!

      Author's profile photo Former Member
      Former Member

      Hi Martin,

      I cannot find the attached file. Can you help please?

       

      Thanks!

      Author's profile photo Christian Kunes
      Christian Kunes

      Hello Martin,

       

      Thanks for sharing.

       

      I can't find the attached file.Can you help us please ?

       

      Thanks in advance.

      Author's profile photo Judith Hansbauer
      Judith Hansbauer

      Hello,

      I would also like to see the routines, could anybody copy the code in here?

      Thanks in advance

      Judith

      Author's profile photo Mirko Alay
      Mirko Alay

      I can't see any of the attachments.  Were they removed?