cancel
Showing results for 
Search instead for 
Did you mean: 

Material Ledger BADI_ENDING_INV

eric_buining
Explorer
0 Kudos

Hi guys/girls,

does anyone know this BAdI. We need it, but the documentation is so unclear that I have difficulty to

understand what needs to be done.

Any additional non-SAP documentation/eplanation would be very helpful.

Thanks,

Eric

Accepted Solutions (1)

Accepted Solutions (1)

declan_curley
Active Participant
0 Kudos

Hi Eric,

When you complete single-/ or multilevel price determination with standard price control, the ending inventory is valuated during the period using the standard price. Single-/ multilevel price determination returns differences, sometimes in u201Crolled up formu201D, which are proportionally distributed according to quantity to the consumption and the ending inventory.

Currently, you also have the option of valuating the ending inventory during single-/ multilevel price determination, using an externally entered price (with or without standard price cost component split) which is taken from table CKMLPR_EB (and can be checked there; e.g. whether there has a price been set or is still set for a certain material). This means the system assigns differences to the ending inventory until the externally entered price is reached. The remaining differences are then assigned to consumption.

In addition to the existing solution, where you enter a static external price, you are now offered the new option of entering an external ending inventory value, including the cost component split, which is based on dynamically calculated values.

For cycle materials, the BAdI for the ending inventory valuation is not called as during the calculation of the cycle result (iteration) the use of an external inventory value does not make sense from a calculation/ mathematical point of view.

Therefore the BAdI cannot be used to set an external value for materials within a cycle.

! Attention: If the BAdI is active in case of a cycle material the single level price determination still runs through the BAdI and distributes the single level price differences according to the BAdI, although afterwards in the next step u2013as mentioned above - the multi level price determination does NOT consider the BAdI and distributes the multi level price differences according to the standard. As a result the price of the ending inventory can get a price which reflects neither the price of the BAdI nor the price of the standard PUP calculation. Therefore the user needs to make sure that, if the material belongs to a cycle, also the single level price determination does NOT use the BAdI !

The BADI implementation gets all the info about the material. So the program can easily be designed the way that it treats only materials from certain plants and leaving the results of the other plants unchanged.

Method GET_INVENTORY - Enter Ending Inventory Value (with Cost Comp. Split)

Parameter:

GENDATA General Data for Ending Inventory Valuation BAdI, (Structure): General data regarding costing run, indicator whether call up takes place during an iteration

MATDATA Material Data for Ending Inventory Valuation BAdI (Structure)

PRICEDATA Prices for Ending Inventory Valuation BAdI (Structure): Standard price, ending inventory price, calculated ending inventory price before external valuation (only differs from ending inventory price when the price is read from an external ending inventory price table)

ALTN Procurement Alternatives for Ending Inventory Valuation BAdI (Table); (see Method SET_ALTN_FLAG)

CATEG Categories for Ending Inventory Valuation BAdI (Table): Price determination structure categories for material (beginning inventory, receipts, cumulative inventory, consumption and ending inventory)

Additionally, when the cost component split is active:

ALTN_CCS CComp Split (Alternatives) for Ending Inv. Valuation BAdI (Table): Cost component split of differences for the material's procurement alternatives, if required (see Method SET_ALTN_FLAG)

CATEG_CCS Cost Comp Split (Categories) for Ending Inv. Valuation BAdI (Table): Cost component split of differences for material's categories

PRICE_CCS CCSplit (Standard Price) for Ending Inventory Valuation BAdI (Table): Cost component split for standard price

HEADERDATA_CCS S Price Cost Comp Split (Header) for Ending Inv. Val. BAdI (Structure)

You can enter an ending inventory value with cost component split based on this data (or data from other sources). This takes place using the following export parameters:

ENDINV_VALUE (Structure): Ending inventory value based on the quantity entered in the structure

ENDINV_VALUE (Table): Cost component split (Price) for ending inventory value based on the quantity entered in ENDINV_VALUE

Price determination adopts this ending inventory value, and calculates the value of consumption from the differences between the cumulative inventory value and the ending inventory value.

Warning: A negative ending inventory value or a ending inventory value that is equal to zero leads to an error. Negative consumption prices are also not allowed.

Method SET_ALTN_FLAG - Set Flag for Reading Procurement Alternatives

Parameter:

READ_ALTN Read Procurement Alternatives: NO = ' ', Yes = 'X'

Method SET_ALTN_FLAG includes Changing parameter READ_ALTN, which states whether the tables ALTN and ALTN_CCS from Method GET_INVENTORY should be populated or not. If READ_ALTN is blank, the procurement alternatives will not be delivered in order to improve system performance.

Method SET_ACTIVE_FLAG - Set Active Flag for Using BAdI

Parameter:

USE_BADI Use BAdI: No = ' ', Yes = 'X'

Method SET_ACTIVE_FLAG has the Changing Parameter USE_BADI, which indicates whether the Business Add-In is to be used or not. If USE_BADI is blank, the data procurement for the interface does not take place in order to improve system performance.

Regards,

Declan

Answers (0)