Skip to main content
Question

PLSQL Routing - error message

  • January 23, 2020
  • 2 replies
  • 342 views

dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 906 replies

Hi All,

We use PLSQL routing for our inbound integrations and have a question regarding error handling.

When using Error_SYS, it shows the error stack in the Error Text field instead of the error message.

Is there a way to format the Error Text?

App version: IFS 10 UPD 3

Eg:

 

Cheers!

Damith

 

2 replies

Forum|alt.badge.img+1
  • Do Gooder (Partner)
  • 1 reply
  • January 24, 2020

Hi, 

I had similar issue while integrating IFSAPPS with our scanning application. We just want to show the IFS error message (in case of any error/exception) while performing IFS transaction (like move part, PO Receive ) using handheld device(e.g. CK device ). To overcome this  I created a function(as below) which returns the IFS error message when we pass the Oracle trace message. 

FUNCTION Get_Error_Message(error_msg_ IN VARCHAR2) RETURN VARCHAR2 
IS
  error_ VARCHAR2(32767) := '';
BEGIN
    error_ := substr(error_msg_, instr(error_msg_,':') +1, length(error_msg_));
    
    WHILE instr(error_, ':') > 0 loop
        error_ := substr(error_, instr(error_,':') +1, length(error_));
    end loop;
    
    return error_;
END Get_Error_Message; 

 

Used the function as below: 

PROCEDURE PO_RECEIVE( order_no_ IN VARCHAR2, 

                                                   -----

                                                  X_RETURN_STATUS      OUT VARCHAR2,
                                                  X_MSG_DATA                  OUT VARCHAR2) IS

BEGIN

--Perform IFS transaction (Call IFS API)

EXCEPTION WHEN OTHERS THEN
        ROLLBACK;
        X_RETURN_STATUS := 'E';
        X_MSG_DATA :=   SUBSTR(SQLERRM,1,230);
        X_MSG_DATA := Get_Error_Message(X_MSG_DATA); 

END PO_RECEIVE;

 

Hope this helps. 


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Author
  • Ultimate Hero (Partner)
  • 906 replies
  • January 25, 2020

Hi, 

I had similar issue while integrating IFSAPPS with our scanning application. We just want to show the IFS error message (in case of any error/exception) while performing IFS transaction (like move part, PO Receive ) using handheld device(e.g. CK device ). To overcome this  I created a function(as below) which returns the IFS error message when we pass the Oracle trace message. 

FUNCTION Get_Error_Message(error_msg_ IN VARCHAR2) RETURN VARCHAR2 
IS
  error_ VARCHAR2(32767) := '';
BEGIN
    error_ := substr(error_msg_, instr(error_msg_,':') +1, length(error_msg_));
    
    WHILE instr(error_, ':') > 0 loop
        error_ := substr(error_, instr(error_,':') +1, length(error_));
    end loop;
    
    return error_;
END Get_Error_Message; 

 

Used the function as below: 

PROCEDURE PO_RECEIVE( order_no_ IN VARCHAR2, 

                                                   -----

                                                  X_RETURN_STATUS      OUT VARCHAR2,
                                                  X_MSG_DATA                  OUT VARCHAR2) IS

BEGIN

--Perform IFS transaction (Call IFS API)

EXCEPTION WHEN OTHERS THEN
        ROLLBACK;
        X_RETURN_STATUS := 'E';
        X_MSG_DATA :=   SUBSTR(SQLERRM,1,230);
        X_MSG_DATA := Get_Error_Message(X_MSG_DATA); 

END PO_RECEIVE;

 

Hope this helps. 

Hi @EnsPrabhP ,

 

Thanks a lot.

In your example, you seems to out X_RETURN_STATUS and X_MSG_DATA.

Do you have an example where it’s used afterwards to pack in the return message?

 

Cheers!