cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with BAPI_ALM_ORDEROPER_GET_LIST DURATION_NORMAL_UNIT

Former Member
0 Kudos

I am using this BAPI to return a list of PM work order operations from SAP using a JRA connector. I have had good success with the BAPI so far, but have noticed a problem with the DURATION_NORMAL_UNIT returned by the BAPI. If the duration unit is set to "DAY" for an operation in SAP, the BAPI returns the text "TAG" instead of "DAY" in its return table. If the duration unit is set to "D" in SAP, the BAPI returns the text "10" instead of "D" in it's return table.

Anyone have thoughts on a potential cause for this behavior?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I just tested this BAPI in SE37, and it works just fine. It returned the correct text for the duration unit in each case I tried. I tested units of "H", "D", "DAY", and "WK".

When I run the same BAPI through MII, here are the results:

"D" returns "10"

"DAY" returns "TAG"

"WK" returns "WCH"

"H" returns "H" (it got this one correct)

Thanks,

John

agentry_src
Active Contributor
0 Kudos

Hi John,

Just a couple of more things.

Are you in the workbench for the testing or in a webpage. In either case, what is the locale (language) for both the NW/MII ID and if in the webpage, what is the language set to? Depending upon your set up, check to see if you have UME Locale selected (it is in Display Templates for sure).

What is the default language of the user ID used to connect to ECC? Can you change it and see if that affects the results? It really looks like you are using English versions as inputs and they are being interpreted (or converted) to Deutsch terms. You may want to look at the equivalent localization tables in ECC.

And what version of MII and NW are you running?

Regards,

Mike

Edited by: Michael Appleby on Mar 2, 2011 3:25 PM

former_member4529
Active Contributor
0 Kudos

Hi,

I think there is an user exit for unit conversion which is activated for the BAPI, hence it's changing the units when called as RFC. You can search and deactivate the unit conversion user exit and check. I BAPI documentation should have the user exit info otherwise you need to debug the BAPI to find it.

Thanks,

Dipankar

Former Member
0 Kudos

I have tested in the workbench, in a webpage, and by calling the webservice from .NET. I got the same results with all three methods.

One thing I realized is that when I am executing the BAPI inside SAP, I am using my own user ID, whereas when executing it through MII, it is using an SAP application account. This difference seems like it is probably causing the problem.

The logon language for the account that MII is using is blank. I am having Basis change it to english to see if that fixes the problem.

MII version is 12.0.11 Build(14). Not sure where to look up the NW version, and I probably do not have access. I have asked this question of our Basis team.

John

Former Member
0 Kudos

I do not see anything in the BAPI documentation about user exits. I also don't see any selection options for user exits that are inputs to the BAPI.

I am not an ABAPer, so when using the debug mode in SAP while executing the function, I don't really know what to look for. Any hints?

Can you explain a little more how I would go about deactivating this unit conversion user exit when executing the RFC?

Thanks,

John

agentry_src
Active Contributor
0 Kudos

John,

I suspect you have found the problem and already have the fix in process with assigning the language to the ID.

I would not mess with the user exits as this is a standard BAPI and once you modify it, it will need to be renamed, it would also not be supported specifically (it is now customized) and there are a lot of folks who already use this BAPI without the problems you are reporting.

Regards,

Mike

former_member4529
Active Contributor
0 Kudos

Hi,

As I can see at the end of the BAPI code there is an enhancement point which I think is doing the unit conversion. Please check with the user language first and if that doesn't solve the issue then you need to check this with the help of an ABAPer. If this is the cause then you need to deactivate the enhancement-point BAPI_ALM_ORDEROPER_GET_LIST_G7 for the BAPI.

Mike, the enhancement points can be activated or deactivated from SE18 t-code without changing the BAPI (that's why it is called user-exits, so that customers can enhance the standard BAPI without touching the original code) and SAP has provided this framework for customers to enhance standard SAP objects and support that as well from framework point of view. I have also noticed user-exits doing unit conversions in other BAPIs as well. For some installations the enhancement-points may be deactivated already that's why the user may not get the units converted when calling it as a RFC.

Thanks,

Dipankar

agentry_src
Active Contributor
0 Kudos

Hi Dipankar,

Thanks for the information. As you can tell, I am not that familiar with ABAP and tend to avoid having to make changes in the code for Function Modules (including BAPI and RFCs). Part of that is trying to stay within the standard objects.

Best Regards,

Mike

Former Member
0 Kudos

Thanks for all the replies guys. I decided to use another work-around for this. There is also a DURATION_UNIT_ISO property which returns the names of the units in an ISO standard format. This should be the same regardless of any language changes or user-exit settings. I am using this now successfully.

Thanks,

John

agentry_src
Active Contributor
0 Kudos

Hi John,

Thanks for posting your solution.

Regards,

Mike

agentry_src
Active Contributor
0 Kudos

Try it in SE37 or BAPI in your ECC system. If it exhibits the same behavior there as you see from MII, then it is a "feature" of the function module itself. From your description, that is what I would suspect is the problem.

But please let us know the results of your testing.

Regards,

Mike