cancel
Showing results for 
Search instead for 
Did you mean: 

SNP Alerts

Former Member
0 Kudos

Hi Guys,

There is a need to write a customized alert for a scenario which is as follows:

If the 'Sales Order' bucket value > 'Stock on Hand' bucket value, but only within 'SNP Stock Transfer Horizon' then it should generate a alert:

"Sales Order increase inside lead time"

I am stuck at how to incorporate the Stock-Transfer-Horizon within the macro logic?

It should give an alert only if Sales Orders > Stock on Hand within this Horizon

Outside the Horizon if this happens it should not generate any alerts.

Thanks

Sooraj

Accepted Solutions (0)

Answers (1)

Answers (1)

rajkj
Active Contributor
0 Kudos

Hi Sooraj,

You need to use the macro functions matloc and matloc_c to read the location product master's SNP Stk Transfer horizon and period types as shown below.

  • matloc( 'SHIPH' ; ACT_PRODUCT ; ACT_LOCATION ; ACT_VERSION )
  • matloc_c( 'PKZSHIPH' ; ACT_PRODUCT ; ACT_LOCATION ; ACT_VERSION )

Then check a condition as follows. ( For brevity, I did not consider the period type. )

IF( BUCKET_EDATE( column attributes) < ( TODAY + SHIPH ) )

.... check sales order qty and stock on hand

ENDIF

Thanks,
Rajesh

Former Member
0 Kudos

Hi Rajesh,

I tried using this macro :

For now I tried running this as it is (This one was recommended by SAP as a note for changing the buckets color based on stock transfer horizon)

However this doesn't works! I have copied this as it is but it gives the logic-error "Incorrect logical expression: Operator (e.g. "AND") or end of expression, expected" !?

I tried another approach of using LAYOUTVARIABLE_SET inside a action box, instead of using the earlier used AUXILIARY CELL method. Do you think this should work? It gives another error "The syntax for a method specification is "objref->method" or "class=>method"."objref->method" or "class=>method". "class=>method"?!

rajkj
Active Contributor
0 Kudos

Hi Sooraj,

  • In the first step, you set an value only for the initial column. However, in the second step, the macro tries to access unassigned cells of workdays row.
    • You can either copy the same value (SHIPH) to all the cells of workdays row or use a variable i.e. LAYOUTVARIABLE_SET(preferred way).

  • To avoid the error, make use of EVAL macro function. Pl try the following macro code snippet

EVAL( BUCKET_BDATE[i] < LAYOUTVAR_VALUE( 'shiph' ) )

AND

DET_LEVEL( '9AMATNR' ; 'X' ) = 1

AND

DET_LEVEL( '9ALOCNO' ; 'X' ) = 1

  • To make sure, your logic works without any error, you need to consider the periodicity of your horizon.

- Rajesh