2007 Jul 20 6:49 AM
the particular code on execution giving runtime error as
An exception occurred which is explained in detail below.
The exception, which is assigned to class 'CX_HRRCF', was not caught and
therefore caused a runtime error.
The reason for the exception is:
An exception occurred in the SAP E-Recruiting application
the code is.....
infotypes: 5102 .
tables : hrp9904.
***for passing in as hrobjid***
types: Begin of x_str,
plvar type hrp5102-plvar,
otype type hrp5102-otype,
objid type hrp5102-objid,
end of x_str.
data: wa_str type x_str.
********************************************
***to get other filds into alv******
types: Begin of x_objid,
plvar type hrp5102-plvar,
otype type hrp5102-otype,
objid type hrp5102-objid,
sbu type hrp9904-sbu,
sbulocation type hrp9904-sbulocation,
superior type hrp9904-superior,
dateofjoin type hrp9904-dateofjoin,
basicpay type hrp9904-basicpay,
end of x_objid.
data: it_objid type table of x_objid,
wa_objid type x_objid.
*******************************************************
data: z_candidate_info type ref to CL_HRRCF_CANDIDATE_BUPA_BL.
data: personal_data type BAPIBUS1006_CENTRAL_PERSON.
**********actual alv**********************
types: begin of x_appoint,
firstname type string,
lastname type string,
sex type c,
address type string,
telephone type string,
sbu type hrp9904-sbu,
sbulocation type hrp9904-sbulocation,
superior type hrp9904-superior,
dateofjoin type hrp9904-dateofjoin,
basicpay type hrp9904-basicpay,
app_date type dats,
end of x_appoint.
data: it_appoint type table of x_appoint,
wa_appoint type x_appoint.
*****************************************************
To take id's of candidates **
*clear wa_objid.
select plvar otype objid sbu sbulocation superior dateofjoin basicpay from hrp9904 into table it_objid.
To get candiadates personnel information ****
*TRY.
CALL METHOD CL_HRRCF_CANDIDATE_BUPA_BL=>GET_INSTANCE
RECEIVING
RETURN = z_candidate_info.
*ENDTRY.
loop at it_objid into wa_objid.
move-corresponding wa_objid to wa_str.
*TRY. errorrrrrrrrrrrrrrrrrr...
<u><b>CALL METHOD z_candidate_info->get_pers_data</b></u>
EXPORTING
PS_CAND_HROBJECT = wa_str
IMPORTING
PS_CENTRALDATAPERSON = personal_data
.
if sy-subrc = 0.
wa_appoint-firstname = personal_data-firstname.
wa_appoint-lastname = personal_data-lastname.
wa_appoint-sex = personal_data-sex.
endif.
endloop.
2007 Jul 20 9:00 PM
Hello Vivek
CX_HRRCF is defined as <b>exception class</b> at the interface of method GET_PERS_DATA. Thus, you either have to CATCH the exception yourself or define the exception class at the interface of the method calling GET_PERS_DATA.
Change your coding as following and your program will work:
DATA:
ld_msg TYPE bapimsg,
lo_error TYPE REF TO cx_hrrcf.
...
TRY.
CALL METHOD z_candidate_info->get_pers_data
EXPORTING
PS_CAND_HROBJECT = wa_str
IMPORTING
PS_CENTRALDATAPERSON = personal_data.
wa_appoint-firstname = personal_data-firstname.
wa_appoint-lastname = personal_data-lastname.
wa_appoint-sex = personal_data-sex.
CATCH cx_hrrcf INTO lo_error.
ld_msg = lo_error->get_text( ).
MESSAGE ld_msg TYPE 'I'.
ENDTRY.
...
Regards
Uwe
2007 Jul 23 4:39 AM
2007 Jul 29 7:38 PM
Did you get this to work? Do you have a complete listing?
Thanks