2018 Oct 09 1:19 PM
Hi All,
I have program which uses conversion routine 'CONVERSION_EXIT_ABPSN_INPUT, which converts WBS Element from external format to internal format like PS-012456-11 to PS01245611.
So my problem occurs when i am passing invalid WBS Element PS-BAS-UBHNX to conversion routine, it gives me an error as follows :
Whenever i get this error from conversion routine, my program terminates without further execution. so any one help me here on how to avoid program termination and continue execution of the program on getting the error.
Note : This standard conversion routine doesn't have any exception maintained.
Thanks in advance,
Avinash
2018 Oct 10 6:50 AM
If the conversion routine sends an error message, you may only handle it according to the context where it happens -> first read https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_message_e..., then read the section corresponding to your context, cf https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_messages_....
In your case, my opinion is that the conversion routine is called outside the PAI, so you might intercept it by wrapping your code into a function module, and handle the classic exception ERROR_MESSAGE (https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/abapcall_function_parameter.htm#!...).
2018 Oct 09 2:04 PM
Hi Avinash, You may have to get the coding mask, and if the WBS element doesn't follow the coding mask don't even pass it to Conversion FM. Please check the Note - 421212.
2018 Oct 10 6:28 AM
Hi Avinash,
If the function module is not returning any value that means the value given as input is not correct. Though the FM is not giving exception for this scenario when used in program but its not ending up in dump also. You can put a IS INITIAL check on the importing WBS element to further stop the processing.
Thanks
2018 Oct 10 6:50 AM
If the conversion routine sends an error message, you may only handle it according to the context where it happens -> first read https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_message_e..., then read the section corresponding to your context, cf https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_messages_....
In your case, my opinion is that the conversion routine is called outside the PAI, so you might intercept it by wrapping your code into a function module, and handle the classic exception ERROR_MESSAGE (https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/abapcall_function_parameter.htm#!...).
2018 Oct 11 6:51 AM
Thanks for the answer,
The classical exception Error_message is worked for me.
With addition of ERROR_MESSAGE = 1, to the conversion routine while calling it, allowed me to avoid termination of the program and there by to show proper error message.