Skip to Content
author's profile photo Former Member
Former Member

Macro for identify a bucket to a special calendar date in SNP Planning Grid

Hello Friends,

I'm looking for a macro function which identifies the bucket of a SNP Planning Grid for a special calendar date - can you help me?

I know that several Bucket-Functions exist, but I cannot identify the function for my issue.

Example:

Date: 01/01/2011

I want to identify the bucket -> Bucket: W 01.2011

Thanks for your help

H.Becker

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Aug 17, 2011 at 11:37 AM

    Hi,

    I think it can be acheived by macro functions BUCKET_DATE_IN() and BUCKET_DESCRIPTION().

    I assume you use the weekly bucket in your planning book.

    Using BUCKET_DATE_IN(), you can check the given date is falling in which bucket. Then if the date falls in the specific bucket, using BUCKET_DESCRIPTION(), you can get the text of that bucket.

    Please check and revert.

    Regards,

    Manimaran M.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2011 at 12:41 PM

    Hello,

    thanks for your help! I construct the macro as you recommend but I am not sure whether you are right. That is the structure of my macro:

    .....

    CELL: RSFC (initial) =

    BUCKET_DESCRIPTION(

    BUCKET_DATE_IN(

    MATLOC('PRODH' ; ACT_PRODUCT ; ACT_LOCATION)

    +

    TODAY

    )

    )

    .....

    Now, I expect that in the cell RSFC initial I will find the name of the determined Bucket - but there is no entry.

    Altogether, I want to realize the following issue:

    The cells in planning grid which are in the SNP Production horizon are coloured in the Planning Grid and are not free for inputs. Now, the last cell of this SNP Production horizon should be free for inputs. Therefore I determine the production horizon of the current product and identify the bucket in which the horizon ends. This bucket must be free for entries (via CELL_INPUT()).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2011 at 12:52 PM

    I forgot one further remark:

    BUCKET_DATE_IN () delivers value 1 or 0 as result. I think this function does not give a bucket as result....

    Can you confirm this fact?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      yes,macro function BUCKET_DATE_IN() returns 1 or 0.

      and macro funtion BUCKET_DESCRIPTION( X ) returns for the specified column X the text that appears in the column of that period in the planning table.

      So it only returns the description of column eg W 11.2013.

      instead of this you can use BADI macro.

      Regards,

      Sunitha

  • author's profile photo Former Member
    Former Member
    Posted on Aug 18, 2011 at 11:46 AM

    Yes, you are right about the functionality of BUCKET_DATE_IN and BUCKET_DESCRIPTION!

    I solved my issue via an if-clause with a comparison of the end and start date of the buckets. You can realize this with the functions BUCKET_BDATE and BUCKET_EDATE.

    Thanks for your help again!

    Kind regards

    Heinz

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.