cancel
Showing results for 
Search instead for 
Did you mean: 

Generating alerts in Purchase Requisition >= 3*Lot size of material

Former Member
0 Kudos

Hi Experts,

We want to create alerts in SNP.

Below is the condition.

Heuristics for multiple product-location will run in background.

After the Purchase Requisitions are created, we want to compare the quantity of created purchase requisition at each time bucket with lot size maintained for that product-location.

Alert should get generated if the PR qty is >= 3*lot size of that product-location.

is there any user exist or function module avaialble to call the tabel which contains rounding profile/lot size details in APO?

Thanks for looking at it,,

Rgds/

Jay

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Jayprakash,

You can extract the Lot Size values using the macro function MATLOC()

MATLOC( 'FIELD_NAME' ; <'product'> ; <'location'> ; <'version'> ) returns the content of a numerical field in the location/product master record of the specified product and location. The arguments for product, location, and version are optional. If you do not specify an argument for the product and/or location, the system uses the current product/location. However, it is better for performance reasons to use the functions ACT_LOCATION and ACT_PRODUCT. For example, MATLOC( 'BSTMA' ; ACT_PRODUCT ; ACT_LOCATION ) returns the maximum lot size for this location product.

In your case you can use:

MATLOC( 'BSTFE' ; ACT_PRODUCT ; ACT_LOCATION ), assuming you are using Fixed LOT Size. You can store this value in a layout variable 'V' and raise alerts based on condition:

IF ( KF for PREQ > 3 * Layout Variable V) RAISE Alert

Hope this helps

Cheers!

Abhi

Former Member
0 Kudos

Hi Abhi,

Thanks for your reply.

We are interested about creating alert which compares the value of Rounding Profile (threshold value) with the PR quantity.

e.g. we have rounding profile defined in SPRO is APO. There we also need to maintain Rounding value. It get stored in table - /SAPAPO/RDPR under field name - VORMG.

We want to call this table & field to compare it with PR quantity.

Is it possible through macro to call above table?

Regards/

Jay

Former Member
0 Kudos

Jay,

No, this cannot be achieved with standard macro.

Maybe a user xeit macro can help. See "Note 418801 - Creating a user exit macro" for more details.

Hope this helps.

Abhi

Former Member
0 Kudos

Hi,

We can now able to get the Rounding Profile value through function - matloc_c.

It basically provides the complete rounding profile value. Like R084.

Is there any way to format data in macro function? We want to format input in such a way that auxilary key figure should store only last 2 digits of R084 i.e. 84.

Thanks for looking into this issue.

rgds/Jay

Former Member
0 Kudos

Jay,

I dont think we have a macro function for substring. I think you will have to go for a user function.

Add a function that you have programmed in your own system to the list of possible operators/functions in the MacroBuilder. You have programmed the function with transaction SE37. In the dialog box, which appears after choosing the menu entry, enter the technical name of the user function. Choose Enter. Another screen appears in which you select the export parameters of the function. This selection must be consistent with parameters in the function itself.

You can refer to the "/SAPAPO/STRINGS_CONCATENATE" function for example. A copy of this with a simple code change will rsolve your problem.

Abhi

Former Member
0 Kudos

Hi,

We have applier IF-ELSE logic to get the result.

1. Get rounding profile through matloc_c & store it in auxilary row.

2. if auxilary row is XY12, then conisder value 12 only & store the result in second auxilart row.

3. multiply this value by 3 & store the same in 3rd auxilary row.

4. compare PR with the above value & raise alerts if PR >= the value in last auxilary row.

but we are unable to get this alert when we execute location heuristics for product-location. can some one plz explain us the reason for the same? what kind of alert we keep in last stage of this macro so that we can get the alerts after heuristics exectuin?

thanks in advance for your assistance.

rgds/Jay

Former Member
0 Kudos

Jay,

In SNP SDP alerts are used. SDP alerts are Macro driven alerts. These can either be dynamic or database. In order for you to see these alerts after heuristic run make sure the alert macros are part of the default macro sequence. If you are running the Heuristic in BG then add anotehr step to the job to run the alerts. In this case you would have to use Database alerts.

Abhi

Former Member
0 Kudos

Thanks Abhi for your comment. It was very helpful answer for us.

We have created macro & have included alert condition in that macro. Still, when we execute the macro in b/g or in foreground, we can not see any alerts created (eventhough the data is such that alerts should get generated).

Do we need to add our macro alerts under SDP - Database Macro Alerts in ALERT MONITOR. (like there we have some alerts like Supply Shortage (DB Alert))?

If yes, then how to add our custom developed Alert there?

Thanks in advance for your help!

Regards/Jay

Former Member
0 Kudos

Jay,

If you have created a macro to create an alert then after executing that macro you should definitely get the alert.

Will it possible for you to share the macro with us so I may have a look. You can sanitize the code to remove any confidential info.

Alerts can be viewed in SDP94 as well as AMON1. Adding them to AMON1 will not make a difference. ARE YOU VIEWEING THESE ALERTS IN SDP94 OR AMON1. If Amon1, have you tried in SDP94 and vice versa?

Cheers!

Abhi

Former Member
0 Kudos

Also in SDP94 make sure your alert is assigned to the alert profile you are suing.

GOTO Settings->Assign Alert Profile -> Alert Prfofile SDP -> CHANGE -> assign the alert you are calculating.

Hope this helps..

Abhi