cancel
Showing results for 
Search instead for 
Did you mean: 

Number of Working days

Former Member
0 Kudos

Hi experts,

Could you please help me how can find no of working days in a month.

I want to display those working days in a Planning book.

Thanks and regards,

naga.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

or simply use the standard  function WDAYS and set macro to execute at all levels.

Thanks

Guru.

Former Member
0 Kudos

Hi All,

Could you please help me on this.

Thanks and Regards,

Naga.

rajkj
Active Contributor
0 Kudos

Hi Naga,

Hope you have a key figure in your data view to show the work days. You can define a macro to assign the value as shown in the fig.

Calendar macro function retrieves the time stream associated with location master with id SC (represents shipping calendar). If you don't wish to use the calendar function, you can directly pass the time stream id value. If there is no valid value, the system defaults to the storage bucket profile's time stream id.

The data source of the selected row or column or cell should be column attributes.

Thanks,
Rajesh

Former Member
0 Kudos

Hi Rajesh,

Appreciate your promptness.

I wrote the macro like this...

am not getting the accurate results.

Could you please help me on this.

Thanks and regards,

naga.

Former Member
0 Kudos

Hi Naga,

What does calendar 'DK' represent?  It should be 'SD' if you use the shipping calendar or 'RC' if you use the receiving claendar.

Best Regards,

Mike

Former Member
0 Kudos

Hi Mike,

DK represents denmark factory calendar

what is sd and rc ...

am not able to get the accurate result with "sd".

Could you plz suggest me.

Thanks and Regards,

Naga.

Former Member
0 Kudos

Hi Naga,

SD and RC are the shipping and receiving calendars (time streams) entered into the location master calendars tab.  It is not the factory calendar.

Best Regards,

Mike

rajkj
Active Contributor
0 Kudos

Hi Naga,

You need to create a time stream (t.code /SAPAPO/CALENDAR) and assign the factory calendar DK to it. This time stream id needs to be passed to BUCKET_WDAYS macro function:

BUCKET_WDAYS( <timestream_id> ; cell/column/row )

Thanks,
Rajesh

Former Member
0 Kudos

Hi Rajesh,

I passed the timestream id i did not get the result.

Thanks and regards,

Naga.

former_member187488
Active Contributor
0 Kudos

Hello Naga,

What you should do is:

1)Create a time stread id in /sapapo/calendar, and define working days and non-working days.

2)In /sapapo/loc3, assign the above time stream id to your location in 'Calendars' tab.

   It depends on you which calendar (shipping, production, receiving) you want to us.

3)Then you use the above proposed macro.

May I know that whether you're working with DP or SNP planning book?

If you're using DP planning book, ACT_LOCATION and ACT_PRODUCT will not work.

You must pass the real value of location/product number to the macro function.

Best regards,

Ada

Former Member
0 Kudos

Hi Ada,

am using the dp plg book.

ACT_LOCATION and ACT_PRODUCT not wkng.

what i have to pass the real value of location/product number to the macro.

could you please provide me the format.

Thanks,

Naga.

former_member187488
Active Contributor
0 Kudos

Hello,

Have you done location/product assignment in your MPOS?

If you're not using standard 9ALOCNO and 9AMATNR in your MPOS, you'll need to go to /sapapo/msdp_admin, open the MPOS, and selection from 'Edit' menu -> Location/Product assignments, and assign your own characteristic as location and product.

Best Regards,

Ada

Former Member
0 Kudos

Hi Ada,

we r using std 9ALOCNO and 9AMATNR.

what can i pass to macro.

Thanks and regards,

naga.

former_member187488
Active Contributor
0 Kudos

Hello Naga,

As soon as you use 9AMATNR and 9ALOCNO, the macro should work.

One thing you need to notice is for the last paramter of the macro function (in your case, the 'final forecast' row) should be set as 'column attribute' in the datasource field, in the screen that pops up when you double click the paramter. Please refer to the below figure.

I have tested the macro in DP planning book and it works fine.

Best Regards,

Ada

Former Member
0 Kudos

Hi Ada,

Could you please send me the snap shot of macro and "results".Its a great help fro me.

Thanks and Regards,

naga.

former_member187488
Active Contributor
0 Kudos

Hi Naga,

Please refer below:

1)POS setting

2)'Work Days' macro

3)Row setting for 'Additional Fiels 1' (the last parameter of BUCKET_WDAYS)

4)Planning book result -- See key figure 'Auxiliary'

Please notice that the location (9ALOCNO) must be able to be determined for the macro function to work. You can use the below test macro:

5)Test ACT_LOCATION macro:

6)The result of macro 'TEST'

And you should have set shipping calendar set for the location - this should be optional I think.

7)Location setting for 'LOC1' in /sapapo/loc3

8)Time stream is defined in /sapapo/calendar

Best Regards,

Ada

Former Member
0 Kudos

Hi Ada,

I got the result.

Appreciate your promptness.

Thanks for your inputs(clair,rajesh,guru,sudhir,mike...)

You guys Rocking!!!!!!!!!!!

Thanks and Regards,

naga.

Former Member
0 Kudos

Hi Ada,

I have to consider only weekdays i.e.,5 per week.where can i consider..

Thanks,

naga.

former_member187488
Active Contributor
0 Kudos

Hello Naga,

Please set periods for working days, and exclude periods for non-working days in time series calendar (/sapapo/calendar) if you set shipping calendar in location master.

If any reply helps here, please kindly rate them.

Thank you.

Regards, Ada

Former Member
0 Kudos

Hi Ada,

Could you please suggest me  about non working days time series calendar.

am getting this result...

i want the output like this

Please help me on this.

Thanks and Regards,

naga.

former_member187488
Active Contributor
0 Kudos

Hello Naga,

You need to set this in /sapapo/calendar.

Open your time stream and set the calculation rules like below:

Then press 'Periods' button to trigger calculation.

And you can go to 'Periods' tab to see whether the periods are correctly generated.

With the above setting, there should be no periods for weekends.

Regards, Ada

Former Member
0 Kudos

Hi Ada,

thanks for your valuable time.

am not able to get the accurate result.I done these changes.

My output is.......

Thanks,

naga.

former_member187488
Active Contributor
0 Kudos

Hello Naga,

Have you checked the generated periods?

Please attach it ('Periods' tab in /sapapo/calendar), the relevant periods (year 2012).

Please also make sure you only load one location.

And please attach your macro definition too.

Regards,Ada

Former Member
0 Kudos

Hi Ada,

please find the attached periods &  macro

Thanks and regards,

naga.

former_member187488
Active Contributor
0 Kudos

Hi Naga,

Please change the NZSC to SC !!!

You should always use SC as long as you respect shipping calendar, no matter which timestream id you are using.

Regards,Ada

Former Member
0 Kudos

Hi Ada,

no accurate result.

Thanks,

Naga.

former_member187488
Active Contributor
0 Kudos

please attach your scenario again.

After regenerate macro, please go out from planning book and enter again.

Former Member
0 Kudos

Hi Ada,

my scenario is I WANT TO DISPLAY NO OF WORKING DAYS LIKE YOUR OUTPUT.

Thanks,

naga.

former_member187488
Active Contributor
0 Kudos

Hello Naga,

Please calm down.

Sorry that please use 'SD' instead of 'SC'. Sorry for the mistake.

Please also try the below test macro:

After load data, you can run this macro, to see whether the calendar 'NZSC' is displayed in the pop up dialogue.

If this is correct, I think your 'Determine workdays' macro should work.

Best Regards,

Ada

kenneth_snyder
Active Contributor
0 Kudos

Is there anyway to read the actual factory calendar versus a time stream in the location master?

Answers (5)

Answers (5)

Former Member
0 Kudos

macro which is used to find the  day of the week .

Former Member
0 Kudos

Could you please  help us to find out the day function macro?

Former Member
0 Kudos

we cannot use below function to find out workday , because SD (shipping calendar ) and RD (receiving  CAlander ), WD our client are using 7 days per week  , is there anyone to help us to find the WEEKDAY ( TODAY ) = 5 .

Former Member
0 Kudos

Hi Naga,

Working days are may differ plant to plant so assuming plant is a part of your data you can implement following logic for get it.

Steps:

1) Get factory id from your plant master data

2) Get holiday id from table TFACD for your factory ID

3) Get no of days(NDAYS) in that month using FM "/SDF/RBE_GET_DAYS_PER_MONTH" or some

    other FM's are also avaliable

4) Get holidays using FM "HOLIDAY_GET " (pass holiday id, factory id, month start & end date)

5) above FM will return a table (say TAB1) with all holidays between start and end date passed.

6) Take a count of records of TAB1 (say CNT)

7) No of working days = NDAYS - CNT

Regards:

Jitendra

former_member182546
Contributor
0 Kudos
claire_yang
Contributor
0 Kudos

Hi Naga,

You can use macro. For example, please refer to the macro "Determine workdays" in transaction /SAPAPO/ADVM [SNP planning book 9ASNP94, Dataview SNP94(2).]

Claire