on 08-06-2007 7:02 AM
Hi
I want to display messages returned by function modules in message manager.
all the error message returned by function module get displayed in the form of a dump on enterprise portal which is not user friendly. i tried to capture the messages returned in this way: but it didnt worked.
CALL FUNCTION 'HR_GETEMPLOYEEDATA_FROMUSER'
EXPORTING
username = sy-uname
validbegin = sy-datum
IMPORTING
employeenumber = v_pernr
employeesubgroup = v_subgrp
EXCEPTIONS
user_not_found = 1
countrygrouping_not_found = 2
infty_not_found = 3
OTHERS = 4.
IF sy-subrc IS NOT INITIAL.
CALL METHOD l_message_manager->report_t100_message
EXPORTING
msgid = sy-msgid
msgno = sy-msgno
msgty = sy-msgty
p1 = sy-msgv1
p2 = sy-msgv2
p3 = sy-msgv3
p4 = sy-msgv4.
ENDIF.
Kindly get back to me on the same.
Regards
Vishal Kapoor
What is the error you are getting now? Are you still getting a dump?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Nithya
It is just the example i mentioned the way i handled function modules.
the real sceaniro is while using this function module
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = v_infty
number = v_pernr
subtype = stru_leave_type-key
validityend = ls_p2002-endda
validitybegin = ls_p2002-begda
record = ls_p2002
operation = c_op_ins
nocommit = 'X'
IMPORTING
return = ls_return.
Here I am updating infotype 2001 when a person applies for leave.
If it is a holiday or person has already applied leave on that date, it gives a dump on portal but if i do the same activity through transaction "PA30" system displays standard message.
actually when this function module executes, before filling the return structure, it terminates and I dont get the message no and its type.
it is just one of the case, same problem occurs in several function module calls.
Thanks
Vishal Kapoor
Hi Vishal,
You can put this function call in a try-catch block. Find out the name of the exception is raised (from ST22). Then catch this exception and then put your code for the message manager method call inside the catch. However, this will work only if your exception is an exception class.
Regards,
Neha
<i><b>PS:Reward if helpful</b></i>
Hi Neha
The dump which appears on portal, its error message type is:ERROR_MESSAGE_STATE which can be analyze using t code ST11. I checked it but didnt got any clue.
It is not a run time error in that case the error message type would have been RABAX_STATE then we can look for exception from st22 and and can catch it using try and endtry block.
Regards
Vishal Kapoor
Actually the error occurs even before call to message manager method.
While debugging the code if I apply the breakpoint on function module and press F6 it gives dump straightaway on poral hance i cant check the content returned in the structure ls_return. i am enclousing the detailed error.
*********************************************************************************************
Error when processing your request
What has happened?
The URL http://nerpdev.ntpc.co.in:8000/sap/bc/webdynpro/sap/zileave_req/ was not called due to an error.
Note
The following error text was processed in the system ED1 : First day 06.08.2007 of attendance/absence is a day off (att./absence type CL)
The error occurred on the application server nerpdev_ED1_00 and in the work process 1 .
The termination type was: ERROR_MESSAGE_STATE
The ABAP call stack was:
Form: SEND_MESSAGES of program MP200000
Form: GIVE_MESSAGES of program MP200000
Form: EXEC_REAKTION of program MP200000
Form: REAKTION1_2000 of program MP200000
Module: REAKTION1 of program MP200000
What can I do?
If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system ED1 in transaction ST22.
If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server nerpdev_ED1_00 in transaction SM21.
If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 1 in transaction ST11 on the application server nerpdev_ED1_00 . In some situations, you may also need to analyze the trace files of other work processes.
If you do not yet have a user ID, contact your system administrator.
****************************************************************************
Regards
Vishal kapoor
try like this:
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = v_infty
number = v_pernr
subtype = stru_leave_type-key
validityend = ls_p2002-endda
validitybegin = ls_p2002-begda
record = ls_p2002
operation = c_op_ins
nocommit = 'X'
IMPORTING
return = ls_return
exceptions
error_message = 1
others = 2.
If no exceptions in function module is defined or the exception is thrown inside other FM's, with ERROR_MESSAGE you can catch all other exceptions.
regards oliver
Hi Nithya
You got me wrong. i am not using write anywhere in my dynpro program.
I called F.M in a different R/3 program code using se38. I just used "write" to display the message returned in ls_return structure and it worked fine. while the same F.M with same data input does not fill the structure ls_return when executed in web dynpro program.
Thanks
Vishal Kapoor
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.