Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Copying goals/objectives from appraisal documnt : FM not working...

Former Member
0 Likes
1,909

I have a requirement in which all the "Goals/Objectives" from the previous years appraisal documents are to be copied to the newly created appraisal documents for the current year.

I take the details of the previous years appraisal document using "HRHAP_DOCUMENT_GET_DETAIL" .

I use the exact data of the previous years document making only minor changes (document header dates) and then create a new appraisal document using FM "HRHAP_DOCUMENT_SAVE".

The error is that the Goals/Objectives do not get copied completely....

eg. The previous years document has 3 goals

"xxx

yyy

zzz"

The newly created will have 3 goals but the texts of the goals will not get copied and will display the default text. eg:

"New Goal

New Goal

New Goal"

Using Other FM's like HRHAP_DOCUMENT_CREATE or HRHAP_DOC_UPDATE_BODY_AND_SAVE also give the same results.

The problem might be because I am directly using "body_elements" from the previous document in the new document w/o any edits.

Any n all suggestions highly welcome....

p.s. kindly notify me if this query should be posted in another forum other than ABAP Development.

I have a requirement in which all the "Goals/Objectives" from the previous years appraisal documents are to be copied to the newly created appraisal documents for the current year.

I take the details of the previous years appraisal document using "HRHAP_DOCUMENT_GET_DETAIL" .

I use the exact data of the previous years document making only minor changes (document header dates) and then create a new appraisal document using FM "HRHAP_DOCUMENT_SAVE".

The error is that the Goals/Objectives do not get copied completely....

eg. The previous years document has 3 goals

"xxx

yyy

zzz"

The newly created will have 3 goals but the texts of the goals will not get copied and will display the default text. eg:

"New Goal

New Goal

New Goal"

Using Other FM's like HRHAP_DOCUMENT_CREATE or HRHAP_DOC_UPDATE_BODY_AND_SAVE also give the same results.

The problem might be because I am directly using "body_elements" from the previous document in the new document w/o any edits.

Any n all suggestions highly welcome....

p.s. kindly notify me if this query should be posted in another forum other than ABAP Development.

12 REPLIES 12
Read only

daniel_kaoro
Product and Topic Expert
Product and Topic Expert
0 Likes
1,807

Hello,

I'm not sure if I could help you further, but I checked these 4 FMs in SE37 and they all has the attribute 'Not released' which means that SAP does not claim to the release independencies of the interfaces and the continued existence/functionality of the modules.

HRHAP_DOCUMENT_GET_DETAIL

HRHAP_DOCUMENT_SAVE

HRHAP_DOCUMENT_CREATE

HRHAP_DOC_UPDATE_BODY_AND_SAVE

I'm afraid that you have applied a support package or a note that made some modifications on these FMs consequently changed their behavior.

Best regards,

Daniel

Read only

Former Member
0 Likes
1,807

Hello,

I am facing the same demands here, so I am wondering whether and if so: how you have managed to copy all the data in the new appraisal document.

In the documents I need to copy and fill there are both requirements that come from the catalog and objectives that are free format. Is there any difference in how to manage these in the copying process?

Thanks in advance for sharing

Remco

Read only

0 Likes
1,807

Hi,

I have implemented the same by first calling FM:

CALL FUNCTION 'HRHAP_DOCUMENT_GET_DETAIL'

In the output of the above perform the following

-Replace all the element ID's in "t_body_elements" with the corresponding element ID's from the document to be created.

(It is probably best to maintain the element Id's in a Z table as mapping the element Id's to be replaced will be difficult)

-The columns not required in the document to be created are to be deleted from appropriate tables ( t_body_columns, t_body_cell_notes, t_body_cells ).

Call the FM : 'HRHAP_DOCUMENT_CREATE and pass all modified and unmodified o/p of HRHAP_DOCUMENT_GET_DETAIL to it.....

Hope this helps....

Reply if you need more detail....

Edited by: Beginner_1135 on Aug 28, 2009 10:46 AM

Read only

Former Member
0 Likes
1,807

Hi,

Try like this ...

To get all the templates use this FM

CALL FUNCTION 'HRHAP_TEMPLATE_GET_LIST'

EXPORTING

add_on_application = 'PA'

plan_version = '01'

IMPORTING

t_templates = tb_templates.

Data : tb_s_with_or_without TYPE hap_s_sel_with_or_without.

tb_s_with_or_without-sel_display_existing = 'X'.

*--To get the list the documents

CALL FUNCTION 'HRHAP_DOCUMENT_GET_LIST_XXL'

EXPORTING

add_on_application = ' '

plan_version = '01'

t_templates = tb_templates

s_sel_status = tb_hap_status-----> mandatory table to pass --just pass it

t_sel_status_sub = gt_1000_status_sub---->pass this if u r considering the Sub statuses also

s_sel_with_or_without = tb_s_with_or_without---->check above

t_appraisees = tb_appraisees---> get all appraisal Ids into this table form HRHAP table

IMPORTING

t_documents = tb1_docs.---> will get all the documents

Regards,

Padmasri.

Read only

Former Member
0 Likes
1,807

Hi,

Try like this ...

To get all the templates use this FM

CALL FUNCTION 'HRHAP_TEMPLATE_GET_LIST'

EXPORTING

add_on_application = 'PA'

plan_version = '01'

IMPORTING

t_templates = tb_templates.

Data : tb_s_with_or_without TYPE hap_s_sel_with_or_without.

tb_s_with_or_without-sel_display_existing = 'X'.

*--To get the list the documents

CALL FUNCTION 'HRHAP_DOCUMENT_GET_LIST_XXL'

EXPORTING

add_on_application = ' '

plan_version = '01'

t_templates = tb_templates

s_sel_status = tb_hap_status-----> mandatory table to pass --just pass it

t_sel_status_sub = gt_1000_status_sub---->pass this if u r considering the Sub statuses also

s_sel_with_or_without = tb_s_with_or_without---->check above

t_appraisees = tb_appraisees---> get all appraisal Ids into this table form HRHAP table

IMPORTING

t_documents = tb1_docs.---> will get all the documents

Regards,

Padmasri.

Read only

Former Member
0 Likes
1,807

Hi,

Try like this ...

To get all the templates use this FM

CALL FUNCTION 'HRHAP_TEMPLATE_GET_LIST'

EXPORTING

add_on_application = 'PA'

plan_version = '01'

IMPORTING

t_templates = tb_templates.

Data : tb_s_with_or_without TYPE hap_s_sel_with_or_without.

tb_s_with_or_without-sel_display_existing = 'X'.

*--To get the list the documents

CALL FUNCTION 'HRHAP_DOCUMENT_GET_LIST_XXL'

EXPORTING

add_on_application = ' '

plan_version = '01'

t_templates = tb_templates

s_sel_status = tb_hap_status-----> mandatory table to pass --just pass it

t_sel_status_sub = gt_1000_status_sub---->pass this if u r considering the Sub statuses also

s_sel_with_or_without = tb_s_with_or_without---->check above

t_appraisees = tb_appraisees---> get all appraisal Ids into this table form HRHAP table

IMPORTING

t_documents = tb1_docs.---> will get all the documents

Regards,

Padmasri.

Read only

Former Member
0 Likes
1,807

I have the same task and I have implemented it.

The only problem is I am not able to refresh the screen (appraisal document) once the body is updated. Any clue?

Read only

0 Likes
1,807

Anyone get this working?

Read only

0 Likes
1,807

Not working! Please help.

Read only

Former Member
0 Likes
1,807

I think you should use the Function Module 'HRHAP_DOCUMENT_PREPARE'.

Because by using this FM, it will behave the same way as the tcode phap_prepare.

And when this function module is used, then all the BADI's are triggered which adds the company objectives and team goals in the appraisal document.

Edited by: sandeepkprusty on Apr 1, 2011 9:41 AM

Read only

0 Likes
1,807

Hi,

although this is an old topic, i though why not answer it

You will need to implement 2 badi's.

One. A fix enhancement (HRHAP00_ENHANCE_FIX) that reads the old elements (via indeed hrhap_document_get_detail) and adds them to the document .

Two. a value determination (HRHAP00_VAL_DET) that fills the added elements with the contain (notes, rating etc).

Thats all you need to do.

Regards and Groetjes,

Maurice Hagen

Read only

0 Likes
1,807

This message was moderated.