cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas RFC Returns Wrong Value

awguthrie
Participant
0 Kudos

Greetings,

I am trying to get the Unit of Measure for a material number via RFC in Personas, but for some reason it seems to return the wrong value. When running the function modules on SE37 it looks correct, however from Personas I get a different value. Version 3.09 patch 501

We've tested on a couple different function modules and the same thing happens, but here is a specific example:

Using FM: BAPI_MATERIAL_GET_ALL, the value shown (in SE37) for CLIENTDATA.BASE_UOM is 'CAS'.

However, when getting this field in Personas, it always returns 'CS'.

Why might this be happening?

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert

Don't forget that in SE37 FM test mode, things like input and result value formatting will take place and that doesn't happen when you are calling the same FM from your Personas script. So, if you are calling the FM with a material with no leading zeroes, then it will either not work or return a different value than expected. Or, a date field may look differently and so on.

The easiest way to ensure you are using the same values would be by setting a break point in the FM code and run it from SE37 test mode, then checking what are exactly in the import parameter fields. Those are the ones you need to use in your script when calling the FM.

In the described scenario, i suspect that the internal 'CS' value will be converted to its external representation, via a conversion exit and that turns CS into CAS.

awguthrie
Participant
0 Kudos

Thank you for the prompt response. So when using SE37, there is some processing after the function module that could change the displayed value?

On my example, I set the debugger on BAPI_MATERIAL_GET_ALL. With a breakpoint at the end of the function module, I see that structure 'UNITSOFMEASURE' has the same values I'm getting in Personas, namely, both 'ALT_UNIT' and 'ALT_UNIT_ISO' are equal to 'CS'.

However, once the whole FM executes in SE37, the values displayed are 'ALT_UNIT'='CAS' and 'ALT_UNIT_ISO'='CS'.

What would be the correct way to get the desired value 'CAS' into Personas?

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes, it is pretty common that certain fields are formatted by a conversion routine, be it inwards our outwards. In your case, the BASE_UOM field is tied to domain MEINS which has the output conversion routine CUNIT assigned. To get the equivalent results, you would have to call the corresponding conversion function module, in this case CONVERSION_EXIT_CUNIT_OUTPUT and pass the unit of measure you got after the BAPI call. This happens automatically when you run the BAPI in SE37 test mode, but not when you do the same via a regular RFC.

In some cases, you must even use the equivalent _INPUT conversion routine when calling your RFC, to ensure that it receives the same internal representation of a field value like the FM expects.

You can figure out the details by looking at the FM interface and associated Data Dictionary references.

awguthrie
Participant
0 Kudos

Many thanks for your time and information. I will try this!

Answers (0)