Helo everyone,
I struggle with a topic that has came up twice now in different data models:.
Following scenario with the folowing data model:
gMSEG] N --- 1 1MARC]1 --- N NMARC]
I have a frontend table with different MARA and MARD information. It showcases each Material, their storage location inside a plant and several other information.
Now I want to add a certain field from MSEG: The last time a material was moved inside a storage location (inside plant).
Now I have to use a PU-function since MSEG and MARD are not connected, only through the MARC-Table.
The issue is, that MARC aggregates all data on the plant level, but I want to have the date on storage location level.
Example:
Material A is stored in storage locations 10 and 20 in plant X. (Info in the MARD and MSEG table)
Material A in storage location 10 and plant X was last moved on the 01.01.2023. (Info in MSEG table)
Material A in storage location 20 and plant X was last moved on the 03.01.2023. (Info in MSEG table)
A simple function like this: PU_MAX("MARC", "MSEG"."LASTMOVEDDATE") gives me the same date in the table: 03.01.2023 for Material A in storage location 10 and 20. Since it aggregates through the MARC table wich does not contain any storage locations. MARC only contains the information that Material A and B are in plant X. So it gives the the MAX Date for that plant and not for the more in depth level: storage location.
Therefore giving me the wrong date for Material A in storage location 10.
Is there a way to solve this through the FrontEnd? Or do I have to do it in the backend?
The obvious solution is to put the Last Moved Date into the MARD table and be done with it.
I Want to know if something like this is possible without touching the backend.
I tried several things like Bind function or DomainTables. Nothing worked. Getting the "Last Moved Date" for a Material per storage location seems quite hard here.
Any ideas or creative ways?
Thank you!