Skip to Content
author's profile photo Former Member
Former Member

how to avoid ERROR_MESSAGE_STATE exception?

Hi gurus,

in our wda application, we call an abap funcion module,under certain cases, the funciton module will issue a statement like

message exxx.

then our webdynpro will dump ,with message show:

termination :ERROR_MESSAGE_STATE

...

could you please tell me how to avoid this?

thanks and best regards.

Jun

Add a comment
10|10000 characters needed characters exceeded

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 11:06 AM

    Hi Jun,

    Catch the error message in some variable, like

    call function xxxx

    importing

    error = i_error_variable.

    then

    if i_error_variable is not initial.

    call logic to display error.

    else.

    logic to be continued

    endif.

    Regards

    Sarath

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 12:21 PM

    Hi,

    pls try with the following code by replacing that particular code in FM

    PERFORM <method> USING '<message class>' '<message type>' <msg no> msgvar space space space

    regards,

    kishor.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 03:33 PM

    Hi

    Create a structure of type symsg let's say ls_msg.

    when you call the function module, in the if sy-subrc<> 0 endif block, store message id, message no and message type into

    ls_msg-msgid, ls_msg-msgty, ls_msg-msgno.

    then call the error message from code wizard in the same block and pass the structure

    Regards

    Vishal kapoor

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2008 at 07:28 PM

    There are couple of way you can avoid the ERROR_MESSAGE_STATE exception.

    1. Handle all the exception when you call the FM. For example:

    Sample code:

    <div class="jive-quote">

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    CLIENT = SY-MANDT

    id = im_textid

    language = im_textlanguage

    name = l_textname

    object = 'TEXT'

    ARCHIVE_HANDLE = 0

    LOCAL_CAT = ' '

    IMPORTING

    header = ex_header

    TABLES

    lines = li_tline

    EXCEPTIONS

    id = 1

    language = 2

    name = 3

    not_found 4

    object = 5

    reference_check = 6

    wrong_access_to_archive = 7

    OTHERS = 8.

    </div>

    2. If it doesnt have exception: If its custom FM, make it as remote enabled, In case of SAP FM, try to wrap up the FM into remote enabled FM.

    Hope this helps you.

    Raja T

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 05:10 AM

    hi jun,

    make the standard FunctionModule as Z (copy the Standard into new Z Or Y Function module)

    then enable the RFC .

    Regards,

    janakiram.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 03:38 PM

    hi, buddies,

    i found a solution that is:

    append the destination 'none' to the call function.

    eventhough the called function module is not rfc ready, it will not dump in WDA anyway,

    but,

    the sy-msgid will set to a message says , the function module is not an rfc.

    any idea on how to solve this?

    the solutions you proposed will not work, the WDA will dump if the called funciton module issue a message E statement directy.

    br.jun

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2008 at 03:51 PM

    i think i found the solution from

    /people/mark.finnern/blog/2003/09/16/bsp-in-depth-message-statement-handling

    it' s for bsp, but i think wda is the same, i will try it tomorrow in the office.

    thanks for your help anyway.

    jun

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 12:32 AM

    hi,

    i tried, but i still can not find the solution

    1. i tried to add exception error_message = 98 when calling the function module, but the webdynpro still dump with the same exception, it seems that this is not working for webdynpro

    2. Sarath Satheesan ,

    call function xxxx

    importing

    error = i_error_variable.

    will not dump the program because there is error in the importing parameter list

    3. the called funciton module is sap standard , so i can not change its way on how to handling error messages

    4. for some reasons i can not create a wrapper RFC around the function module (rfc does not allow generic data type as parameters)

    so , i have no idea on how to do further to solve this,

    could you please help me on this?

    br.

    jun

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Jun, you can wrap the function by changing all the LIKE to TYPE in the parameter definition. Unfortunately if your RFC-enabled function simply wraps the normal FM it will not help: you will still get the ERROR_MESSAGE_STATE error. I think the only way is to actually copy the entire FM including the implementation and remove the MESSAGE commands. Depending on how the FM depends on global variables available only inside the standard Function Group this may not be possible. I'm still looking for a solution...

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.