2014 Oct 08 3:07 PM
Hi Experts,
Need an advise on the following codes.
TYPES: BEGIN OF gty_obj,
PLVAR TYPE hrp1001-PLVAR,
OTYPE TYPE hrp1001-OTYPE,
objid TYPE hrp1001-objid,
END OF gty_obj.
TYPES: gtab_obj TYPE STANDARD TABLE OF gty_obj INITIAL SIZE 0.
DATA: gt_obj TYPE gtab_obj.
DATA: candidate type ref to CL_HRRCF_CANDIDATE_PREVIEW_BL.
CALL METHOD candidate->GET_PERSONAL_DATA
EXPORTING
CAND_OBJ = gt_obj.
Keep getting below error message:
"GT_OBJ" is not type-compatible with formal parameter "CAND_OBJ".
2014 Oct 08 5:31 PM
CAND_OBJ is a structure of hrobject. Try this one:
DATA:
o_candidate TYPE REF TO cl_hrrcf_candidate_preview_bl.
DATA
w_cand_obj TYPE hrobject.
START-OF-SELECTION.
CREATE OBJECT o_candidate.
CALL METHOD o_candidate->get_personal_data
EXPORTING
cand_obj = w_cand_obj.
2014 Oct 08 3:20 PM
Looks like CAND_OBJ is a structure and not internal table.
Try declaring any one of below way.
TYPES: gt_obj TYPE gty_obj.
Types: gt_obj type HROBJECT.
Regards,
Karthikeya
2014 Oct 08 5:31 PM
CAND_OBJ is a structure of hrobject. Try this one:
DATA:
o_candidate TYPE REF TO cl_hrrcf_candidate_preview_bl.
DATA
w_cand_obj TYPE hrobject.
START-OF-SELECTION.
CREATE OBJECT o_candidate.
CALL METHOD o_candidate->get_personal_data
EXPORTING
cand_obj = w_cand_obj.
2014 Oct 08 10:12 PM
Hi,
- Not sure why tou have created "types: gty_obj" when SAP has provided HROBJECT see se11. You should also use gt_obj type STANDARD TABLE OF HROBJECT.
- For you coding try passing "get_obj[]".
CALL METHOD candidate->GET_PERSONAL_DATA
EXPORTING
CAND_OBJ = gt_obj[].
Hope it helps.
2014 Oct 09 3:10 AM
Hi All,
Thank you. But receive another error message:
You cannot create an instance of the class "CL_HRRCF_CANDIDATE_PREVIEW_BL" outside the class.
If comment this line: CREATE OBJECT o_candidate and execute the program. The below error message occur:
Pls help
Regards,
TCL
2014 Oct 09 6:47 AM
As the CL_HRRCF_CANDIDATE_PREVIEW_BL is a Private class, create instance as follows..
CALL METHOD cl_hrrcf_candidate_preview_bl=>get_instance
IMPORTING
result = o_candidate.
Regards
2014 Oct 09 8:40 AM