Application Development and Automation 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: 
Read only

How to customize production version error message

Former Member
0 Likes
1,020

Hi Friends,

I copied the BAPI_REPMANCONF1_CREATE_MTS into Z FM and when I test the Z FM, I wantedly entered the wrong production version say ABCD instead of 1234. The message field of my return bapi BAPIRET2 is populated with an error message saying that "Production version not found". Till here it is working fine.

I need to modify my code in such a way that if I enter the wrong production version, my bapi should error me in such a way that "ABCD Production version not found" in the message field of BAPIRET2.

Please sugesst me ideas for solving this.

Thanks.

6 REPLIES 6
Read only

Former Member
0 Likes
911

This text is contained in message class RM and message number 149.

If your return contains the above combination modify your message to include 'PRODUCTION VERSION'. However this is the best way to achieve it...

Thanks,

Read only

0 Likes
911

Hi gvsastry,

Thanks for the response.

Can you brief me how to do achieve this? This is a SAP automated message and I don't have acess to modify it. Is there any way that I can assign my Z message class to this return bapi instead of RM 149?

Read only

0 Likes
911

Nani,

Please follow approach suggested by Suman.

All you have to do is validate production version ( of that material/product?) against DB Tables before calling you ZFM or Std BAPI.

If you would like to go by my approach.. you will have to do something like this..

option1:

IF RETURN-TYPE = 'E' AND RETURN-ID EQ 'RM' AND RETURN-MESSAGE = '149'.
CONCATENAT  'XXXX' RETURN-MESSAGE INTO RETURN-MESSAGE.
ENDIF.

Option2: Create a Z class.

IF RETURN-TYPE = 'E' AND RETURN-ID EQ 'RM' AND RETURN-MESSAGE = '149'.
RETURN-ID = 'ZID'.
RETURN-NUMBER = 'XXX' -> Number in Z class.
RETURN-MESSAGE = 'your message'.
ENDIF.

Read only

0 Likes
911

Thank you Sastry. I got that one.

Read only

Former Member
0 Likes
911

You can check for the Production version before passing it to BAPI, Instead of creating a Z for this.

Read only

0 Likes
911

Suman:

Thanks for the reply.

Can you please brief me how to achieve this functionality?