Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

RH_RELATION_MAINTAIN/RH_INSERT_INFTY

Former Member
0 Kudos

I am trying to insert a new HRP1001 Cost Center record in a program and have been trying to use the above Function Modules. The problem I am having is that when they encounter a CONFIG problem, like the Cost Center is not open for posting, instead of coming back with a Return-Code other than 0 they are giving me the message in real time and actually starting the Transaction (PO02) in the first case and exiting the program in the 2nd case. Neither is an acceptable solution. I want it to just let me know it didn't work and keep going. Is this the way these are supposed to work?

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

When you are calling your FM give an extra exception parameter ERROR_MESSAGE i.e. = 9.

Now when some message of type I,S, W will be raised it will automatically be skipped. Messages E, A will trigger that error so you can react accordingly outside FM. Message X will dump the systme out.

This way you can handle old function modules which don't use exceptions or simply call some message inside their body. This is a preety handful way to handle such situations.

As for calling tcode PO02 I am not sure about that. If the processing requires that you will likely be branched to this tcode anyway.

Regards

Marcin

1 REPLY 1

MarcinPciak
Active Contributor
0 Kudos

When you are calling your FM give an extra exception parameter ERROR_MESSAGE i.e. = 9.

Now when some message of type I,S, W will be raised it will automatically be skipped. Messages E, A will trigger that error so you can react accordingly outside FM. Message X will dump the systme out.

This way you can handle old function modules which don't use exceptions or simply call some message inside their body. This is a preety handful way to handle such situations.

As for calling tcode PO02 I am not sure about that. If the processing requires that you will likely be branched to this tcode anyway.

Regards

Marcin