...
new JSON field processing logic added to scheduler programs (0616Fields “0616_IC_Operation_MDLP_period_allall”, 1031“1031_IC_Period_Week_allall”). Field value is filled automatically based on internal date calculation logic
new selection screen field “Source type” added to into task scheduler programs
new report field support (field “Source type”) added to CSV file parse
New interfaces added to receive response ZIP file from Java part by chunks to support massive ZIP files processing.
...
to restrict analytic report with additional filter:
/K3T/RU_MAR_SCD_GEN_MD - Russia MDLP Analytics: Task scheduler General Report on Disposal
K3T/RU_MAR_SCD_GEN_ON_MV - Russia MDLP Analytics: Task scheduler General Report on Movement
/K3T/RU_MAR_
...
SCD_GEN_
...
New MDLP Analytic reporting methods added to the 3Keys MDLP connector Add-On:
GENERAL_PRICING_REPORT
GENERAL_REPORT_ON_MOVEMENT
GENERAL_REPORT_ON_REMAINING_ITEM
GENERAL_REPORT_ON_DISPOSAL
Corrections for transaction /K3T/RU_MAR_MONITOR Russia MDLP Analytics: Task monitor:
new function “Download ZIP from MDLP” to download ZIP file for provided GUID. Function is available if user has authorities for object /K3T/RU005 field /K3T/RU005 value “10”. Processing logic:
request MDLP GUID and Configuration ID with Popup window
read first selected item to check if selected report is General report
get result ID from MDLP
get file from MDLP for result ID and save file to PC
new fields “Period type”, “Period from”, “Period to” at report output
some technical hidden fields deleted from output for memory optimization
New database tables added to store analytic reporting data.
/K3T/RU_R_G_MD - Russia MDLP Analytics: General report Medicine disposal
/K3T/RU_R_G_MV - Russia MDLP Analytics: General report on Movement
/K3T/RU_R_G_PR - Russia MDLP Analytics: General Pricing report
/K3T/RU_R_G_RM - Russia MDLP Analytics: General report Remaining medicines
To compress identical entries Business partner data as fields FEDERAL_SUBJECT, CITY, AREA and etc. are stored at existing table /K3T/RU_R_BP Russia MDLP Analytics: Business partner. Database table (for example, /K3T/RU_R_G_MD) contains BP_ID key only and database views /K3T/RU_R_G_MD_V contains all fields from MDLP analytic report
/K3T/RU_R_FILE - Russia MDLP Analytics: CSV File as String (help table to split CSV file into several parts on ZIP file processing)
New fields added into database table /K3T/RU_R_TSK and report /K3T/RU_MAR_MONITOR output:
period type (values “1” - Week, “2” - Month from report task JSON)
period from (period first day from report task JSON)
period to (period last day from report task JSON)
New selection screen fields “All GTINs” and “Select GTINs” added into task scheduler programs to allow run without GTIN specification:
/K3T/RU_MAR_SCD_GEN_MD - Russia MDLP Analytics: Task scheduler General Report on Disposal
K3T/RU_MAR_SCD_GEN_ON_MV - Russia MDLP Analytics: Task scheduler General Report on Movement
/K3T/RU_MAR_SCD_GEN_PR - Russia MDLP Analytics: Task scheduler General Pricing Report
/K3T/RU_MAR_SCD_GEN_RM - Russia MDLP Analytics: Task scheduler General Report on Remaining Items
Error corrections for program /K3T/RU_MAR_REP_PROC - Russia MDLP Analytics: Task processor (General Report):
error with API time limit - in some cases task is not created due to API time limit violation. Default delay set to 65 seconds (can be redefined with parameters /K3T/MDLP_API_TSK_RDEL_DELAY (delete file), /K3T/MDLP_API_TSK_R_DP_DELAY (create disposal report), /K3T/MDLP_API_TSK_R_MV_DELAY (create movement report), K3T/MDLP_API_TSK_R_PR_DELAY (create price report), /K3T/MDLP_API_TSK_R_RM_DELAY (create remaining report), /K3T/MDLP_API_TSK_R_RGET_DELAY (get result id), /K3T/MDLP_API_TSK_R_FILE_DELAY (get file), /K3T/MDLP_API_TSK_R_SRCH_DELAY (get all task status), /K3T/MDLP_API_TSK_R_STAT_DELAY (get single task status)
ABAP code errors
New function module /K3T/RU_MAR_EXEC_GEN_SAVE created to parse ZIP from task database table and save to relevant database table (can be used as processor at configuration transaction /K3T/RU_MAR_CONF or as example for custom function module). Processing logic:
Check there is no previous data at database for this task
Decode ZIP file to files as string
Split file to parts with 100000 entries (can be redefined with parameter MR_CSV_FILE_PART_SIZE)
Save file to database table /K3T/RU_R_FILE (to reduce memory consumption)
For each file from database table /K3T/RU_R_FILE:
read file header and file content as string
split file content by packages with number 20000 (can be redefined with parameter MR_CSV_PACKAGE_SIZE)
parse and save file package to database tables
repeat until file is not empty
commit changes
Delete entries from table /K3T/RU_R_FILE
New logic to parse response with ZIP file from connector:
in case response is not empty check first character. If it is not “{“ it means connector returns file as base64 without JSON and JSON parse is not required. Return response without correction
Otherwise response is JSON and JSON transformation is required. Read parameter MR_JSON_ZIP_PARSE_MODE and transform JSON to ABAP structure fields depending on specified parse mode:
empty or “1” - use parse mode based on string search. Reduce string length after search
“3” - use ID transformation (recommended approach to transform JSON). In case of big size files runtime error occurs because of memory consumption
3. Solution
Import related to the transport request.
3.1 Correction instruction ATTP 3.0
...
Transport request
...
Description / Dependencies
A1DK900621
...
3Keys MDLP Add-On 3.0 Note 2024_01_02
Required transport A1DK900554
3.2 Correction instruction ATTP 3.1
...
Transport request
...
Description / Dependencies
...
A2DK900691
...
3Keys MDLP Add-On 3.1 Note 2024_01_02
Required transport A2DK900615
3.3 Correction instruction ATTP 3.2
...
Transport request
...
Description / Dependencies
...
A3DK900276
...
3Keys MDLP Add-On 3.2 Note 2024_01_02
Required transport A3DK900190
3.4 Correction instruction ATTP 3.3
...
Transport request
...
Description / Dependencies
...
A4DK900080
...
3Keys MDLP Add-On 3.3 Note 2024_01_02
Required transport A4DK900045 or SAPK-303COINK3T
4. Recommendation
...
PR - Russia MDLP Analytics: Task scheduler General Pricing Report
/K3T/RU_MAR_SCD_GEN_RM - Russia MDLP Analytics: Task scheduler General Report on Remaining Items
new report field support (field “Source type”) added to CSV file parse and database tables:
/K3T/RU_R_G_MD - Russia MDLP Analytics: General report Medicine disposal
/K3T/RU_R_G_MV - Russia MDLP Analytics: General report on Movement
/K3T/RU_R_G_PR - Russia MDLP Analytics: General Pricing report
/K3T/RU_R_G_RM - Russia MDLP Analytics: General report Remaining medicines
New interfaces added to receive response ZIP file from Java part by chunks to support massive ZIP files processing. Default chunk size is 30 Mb. This size could be changed using parameter MR_DOWN_PART_SIZE = new number in Kb (transaction /K3T/RU_PARAM). If for some reasons you would like to ignore new interfaces to receive file with single interface call than parameter MR_ZIP_SPLIT_INACTIVE need to be activated (transaction /K3T/RU_PARAM).
In some scenarios ZIP file could not been processed due to runtime error STRING_SIZE_TOO_LARGE related to response ZIP file size. To correct this problem new approach implemented to function module /K3T/RU_MAR_EXEC_GEN_SAVE to decode response ZIP file with Application server:
save file to application server (default folder is logical file path Z3K_MR_UNPACK_PATH could be changed using parameter MR_UNPACK_PATH = <new logical file path> (transaction /K3T/RU_PARAM)).
unzip file using OS command Z_UNZIP, command must exist at SM69 transaction and allow unzip actions
split file (using OS command Z_SPLIT (if parameter MR_CSV_SPLIT_OS_COMMAND is activated) or using stream file reading). Several CSV files with fixed entries number (default value is 100000, could be redefined with parameter MR_CSV_FILE_PART_SIZE) will be created with file name containing postfix “_XX” where “XX” - number from “00” to ”99”
process file sequentially
clear application server folder (delete ZIP file, unzipped files, splitted CSV files)
This approach is active by default and could be deactivated using parameter MR_PARSE_ZIP_IN_MEMORY (transaction /K3T/RU_PARAM).
3. Solution
Import related to the transport request.
3.1 Correction instruction ATTP 3.0
Transport request | Description / Dependencies |
A1DK900621 | 3Keys MDLP Add-On 3.0 Note 2024_01_02 Required transport A1DK900554 |
3.2 Correction instruction ATTP 3.1
Transport request | Description / Dependencies |
A2DK900691 | 3Keys MDLP Add-On 3.1 Note 2024_01_02 Required transport A2DK900615 |
3.3 Correction instruction ATTP 3.2
Transport request | Description / Dependencies |
A3DK900276 | 3Keys MDLP Add-On 3.2 Note 2024_01_02 Required transport A3DK900190 |
3.4 Correction instruction ATTP 3.3
Transport request | Description / Dependencies |
A4DK900080 | 3Keys MDLP Add-On 3.3 Note 2024_01_02 Required transport A4DK900045 or SAPK-303COINK3T |
4. Recommendation
Implement new methods for analytic data processing from MDLP as old methods marked as obsolete at MDLP API documentation. Update MDLP connector java part to the latest version.
Create application server folder to process analytic reports and customise logical file path. Use predefined logical path Z3K_MR_UNPACK_PATH value or create own logical path and maintain parameter MR_UNPACK_PATH = <new logical file path> (transaction /K3T/RU_PARAM).
Create OS command Z_UNZIP using transaction SM69:
windows system:
linux system
In case you use Linux system create OS command Z_SPLIT using transaction SM69. Activate parameter MR_CSV_SPLIT_OS_COMMAND (transaction /K3T/RU_PARAM).
5. Source code objects
...