B4504590 - Pricing Datamap Function and Cache and Workfile

Purpose of Document

The purpose of this document is to explain internal API SetPricingHistoryCacheFlag during Sales Order Entry or Sales Order Processing. However modifying any standard code is discouraged at any cost.

History:
This routine is implemented through enhancement <Bug 10875622>: PRICEHISTORY DATAMAP - SAR: 7500235, which was SOE performance project needs to modify the exisitng data decimal datamap and create new pricing history data map and other related functions in B4504590

Changes:

BSFN B4504590 is comprised of,

Source Module Function Name Description Template Name Usage
B4504590 CreatePricingCatCodesDatamap Create Pricing Cat Codes Datamap D4504590J This function is to create Pricing Category Codes datamap PRICING_CATCODES_DATA_MAP in shared memory DATAMAPCDIST
B4504590 PricingCatCodesDatamapExist Pricing Cat Codes Datamap Exist D4504590I to check whether there is existing datamap for Pricing Category Codes
B4504590 CreatePricingDatamapWrapper Create Pricing Datamap Wrapper D4504590F to check the existence of PricingDecimal, PricingHistory and Pricing Category Codes Datamaps. If these datamaps exist, do not create them again but if datamap does not exist then create it again
B4504590 DestroyPricingDatamapWrapper Destroy Pricing Datamap Wrapper D4504590F to destroy all the datamap created by CreatePricingDatamapWrapper by calling DestroyPricingDecimalDatamap, DestroyPricingHistoryDatamap and DestroyPricingCatCodesDatamap
B4504590 CreatePricingDecimalDatamap Create Pricing Decimal Datamap D4504590E validates input mnJobNumber and create Pricing Decimal at shared memory (or data map) PRICING_DECIMAL_DATA_MAP
B4504590 DestroyPricingDecimalDatamap Destroy Pricing Decimal Datamap D4504590E to destory any data map created through CreatePricingDecimalDatamap above
B4504590 SetPricingHistoryCacheFlag Set Pricing History Cache Flag D4504590B to indicate whether to write cache or workfile. For this example, Cache stands for data structure of F40UI74 whereas workfile stands for a physical table F40UI74. Through this function cache PRICING_HISTORY_DATA_MAP is to be written at shared memory area DATAMAPCDIST
B4504590 PricingHistoryDatamapExist Pricing History Datamap Exist D4504590G to check whether Pricing History Datamap does exit from DATAMAPCDIST for the name PRICING_HISTORY_DATA_MAP however this function does not return whether cPriceHistoryCacheFlag '1' or '2'
B4504590 CreatePricingHistoryDatamap Create Pricing History Datamap D4504590D to create Datamap for Pricing History LPDSF40UI74DAO
B4504590 DestroyPricingHistoryDatamap Destroy Pricing History Datamap D4504590D to destroy datamap PRICING_HISTORY_DATA_MAP created by CreatePricingHistoryDatamap above
B4504590 CreatePricingSharedDatamap Create Pricing Shared Datamap D4504590A Obsolete: replaced by CreatePricingDatamapWrapper
B4504590 DestroyPricingSharedDatamap Destroy Pricing Shared Datamap D4504590A Obsolete: replaced by DestroyPricingDatamapWrapper
GetPricingDecimalDataMapHandle This API has to be called in CreatePricingDatamapWrapper. In order to call this function correctly, calling function needs to call this function first to get handle of the datamap (DATAMAPCDIST). If the handle exists, then call get decimal to get the decimals for data dictionary item or currency
GetDecimalFromDataMapDirect to call this functoin correctly, calling function needs to call GetSharedDataMapHandleDirect first to get handle of the datamap if users like to use datamap logic to improve performance. If the handle is null, this function will call the external function to retrieve decimal as before
GetPricingHistoryCacheFlag to get Datamap for PRICE_HISTORY_CACHE_FLAG in DATAMAPCDIST which is written through API PutDataMapValueCDIST in SetPricingHistoryCacheFlag

Note: To understand relationship eash the sequence has changed

* Important Note:
* For users to use this performance functionality, the calling function must call
* either CreatePricingDatamapWrapper to create the Decimal, Price History and Category Codes datamap
* or call CreatePricingDecimalDatamap, CreatePricingHistoryDatamap or CreatePricingCatCodesDatamap individually.
*
* After the transaction is done, it is the calling function's responsibility
* to call DestroyPricingDatamapWrapper to terminate the data decimal, price history and category codes datamaps
* or call the DestoryPricingDecimaldatamap, DestroyPricingHistoryDatamap and DestroyPricingCatCodesDatamap individually.




Note that API-level functions below is not covered by this document,

handles how to maintain datamap however this note does not cover routine for this. Above routines write shared memory DATAMAPCDIST directly where basic information for Pricing Category Code, Pricing History and Pricing Decimals and more.

And this function has be understood in the context of Master Business Function and Sales Order Workfiles, refer to





Before starts global cache and datamap can be understood as below,





Business Functions which affects Sales Order Entry validation/defaulting through F4211FSBeginDoc and F4211FSEditLine routine:

1. B4504590 - CreatePricingCatCodesDatamap (Create Pricing Cat Codes Datamap)

Structure Member Data Type Req I/O Alias Usage
mnJobnumber MATH_NUMERIC Y I JOBS This parameter has to be determined by calling routine to store job specific data map and cache

2. B4504590 - PricingCatCodesDatamapExist (Pricing Cat Codes Datamap Exist)

Structure Member Data Type Req I/O Alias Usage
mnJobNumber MATH_NUMERIC Y I JOBS mnJobnumber assigned by calling routine this is unique key value to determine existence of datamap for Pricing Category Codes
cPricingCatCodesDatamapExist JCHAR O EV01 0 - Does not exist
1 - Pricing Category Code Datamap Exist

3. B4504590 - CreatePricingDatamapWrapper (Create Pricing Datamap Wrapper)

Structure Member Data Type Req I/O Alias Usage
mnJobnumber MATH_NUMERIC Y I JOBS The mnJobnumber has to be specified from calling routine.

4. B4504590 - DestroyPricingDatamapWrapper (Destroy Pricing Datamap Wrapper)


5. B4504590 - CreatePricingDecimalDatamap (Create Pricing Decimal Datamap)

Structure Member Data Type Req I/O Alias Usage
mnJobNumber MATH_NUMERIC Y I JOBS To store/retrieve Pricing Decimal Datamp (one for Data Dictionary and the other for Currency Decimal)

6. B4504590 - DestroyPricingDecimalDatamap (Destroy Pricing Decimal Datamap)


7. B4504590 - SetPricingHistoryCacheFlag (Set Pricing History Cache Flag)

Structure Member Name Data Type Req I/O Alias Usage
mnJobNumber MATH_NUMERIC Y I JOBS mnJobnumber is determined by calling routine or return value from existence checking
cPriceHistoryCacheFlag JCHAR EV01 This flag is to determine whether to write cache of F40UI74 or work file
1 - Write Workfile F40UI74
2 - Cache

8. B4504590 - PricingHistoryDatamapExist (Pricing History Datamap Exist)

Structure Member Name Data Type Req I/O Alias Usage
mnJobNumber MATH_NUMERIC Y I JOBS This parameter is determined by calling routine in a transaction
cPriceHistoryDatamapExist JCHAR EV01 0 - Not exist
1 - Datamap exists

9. B4504590 - CreatePricingHistoryDatamap (Create Pricing History Datamap)

Structure Member Data Type Req I/O Alias Usage
mnJobnumber MATH_NUMERIC Y I JOBS Based on Job Number from calling routine to create Price History datamap

10. B4504590 - DestroyPricingHistoryDatamap (Destroy Pricing History Datamap)





Below is to describe 3 important internal functions (or APIs) which is to be called in B4504590,

11. GetPricingDecimalDataMapHandle


12. GetDecimalFromDataMapDirect


13. GetPricingHistoryCacheFlag




Note: this document is created based on EnterpriseOne 9.0 release.