cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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?

former_member583013
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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()).

m_manimaran
Active Contributor
0 Kudos

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.