Skip to Content
0
Jan 31, 2023 at 04:41 PM

SAP Dependency - Can we use a function in a procedure which returns multiple values?

303 Views

Hello All,

We have the following scenario involving material master data classification and dependencies:

When a new product is created, a reference code is entered in one of the characteristics. This triggers a dependency where in turn a function is called to obtain/calculate,...a set of values which are then stored as part of the material master's classification data.

This is all working fine for single value characteristics, but we also have a few multi-value characteristics. Let's say for example one the characteristics is the multi-value list of colors. Inside the match object of the function we would for example see two records:

VARNAM ATFOR ATWRT

COLOR CHAR Red
COLOR CHAR Blue

In the CU02 dependency we have something like:
FUNCTION ZGET_CHARS(......,
COLOR = $SELF.COLOR,
......)

The logic is working fine for single-value characteristics, but not for multi-value characteristics.
No errors or dump, but as soon as we return more than one value for a multi-value characteristic, all characteristics that were supposed to be populated are blanked out.


Is there a way to make this work for multi-value characteristics? It's key that we can keep the multi-value char on the material master, so we do not want to split it up into COLOR1, COLOR2,.... I no clean solution is found we can set it during saving via the CLFM UE, but then the user doesn't see the result while initially maintaining the product and she would need to enter the material again after saving to see the results. It's an option, but hope there are better ones :-)

Thanks in advance,
Erik