cancel
Showing results for 
Search instead for 
Did you mean: 

OSA - change status depending on content of survey

Former Member
0 Kudos

Hi,

I use OSA for survey. When an employee clicks "Submit" with all the questions in the survey answered as "No", the document status should be "Completed". However, if any of the questions is answered as "Yes", then the status/substatus should change to "In Process/Pending Review". The challenge here is to achieve via a single button, "Submit" which will trigger onto different status/sub-status depending on the content of the survey. Any clues are appreciated. Thanks.

Regards

Kir Chern

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jothi,

Thanks for your reply. I am still on ERP2004, I do not have the BADI HRHAP00_DOC_UPDATE_BODY_AND_SAVE but only HRHAP00_DOC_SAVE.

You wrote, "Before calling the fn module,make changes in the status table", appreciate if you can give me more details regarding your suggested implementation. I tried to change the status within the BADI HRHAP00_DOC_SAVE, but as the document is locked (while the BADI is called), I am unable to amend the status.

Your advise, appreciated. Thanks.

Regards

Kir Chern

Former Member
0 Kudos

Hi,

Use ENQUEUE and DEQUEUE fn modules.


call function 'HRHAP_DOCUMENT_ENQUEUE'
            exporting
              plan_version         = '01'
              s_appraisal_id       = appraisal_id
*          T_BODY_COLUMNS       =
*          PART_LOCK            = ' '
*          IMPORTING
*           S_RETURN             =
            changing
              doc_enqueue          = doc_enqueue
                    .
* Change the header table as per your need
          ls_header_status-ap_status = '5' .
          ls_header_status-ap_status_sub = '1' .
          ls_header_status-ap_status_name = 'Completed' .
          ls_header_status-ap_status_sub_name = 'Approved' .

*&______________________________________________________&*
*&  SAVE the Changes
*&______________________________________________________&*

        call function 'HRHAP_DOCUMENT_SAVE'
            exporting
              plan_version             = '01'
              t_header_appraiser       = lt_header_appraiser
              t_header_appraisee       = lt_header_appraisee
              t_header_others          = lt_header_others
              s_header_texts           = ls_header_texts
              s_header_dates           = ls_header_dates
              s_header_status          = ls_header_status
              s_header_display         = ls_header_display
              t_body_columns           = lt_body_columns
              t_body_elements          = lt_body_elements
              t_body_cells             = lt_body_cells
*            IMPORTING
*              s_return                 = s_return1
            changing
              s_appraisal_id           = appraisal_id
              s_doc_processing         = ls_doc_processing
              t_header_part_appraisers = lt_header_part_appraiser
              t_body_cell_notes        = lt_body_cell_notes.

  call function 'HRHAP_DOCUMENT_DEQUEUE'
            exporting
              plan_version         = '01'
              s_appraisal_id       = appraisal_id
* IMPORTING
*   S_RETURN             =
           changing
             doc_enqueue          = doc_enqueue

Rgds,

Jothi.P

    • You can also use FUNCTION <b>'HRHAP_DOCUMENT_CHANGE_STATUS'</b>

<u>**Reward if useful</u>

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jothi,

I will try. May I confirm that the code is embedded in the BADI HRHAP00_DOC_SAVE ? Thanks.

Regards

Kir Chern

Former Member
0 Kudos

Hi,

We have implented this very recently.

Use the BADIs,

HRHAP00_DOCUMENT_SAVE

HRHAP00_DOC_UPDATE_BODY_AND_SAVE

Before calling the fn module,make changes in the status table (for ex for doc-A, change the status to completed and for Doc-B, change to rejected or whtevr)

Rgds,

Jothi.P

*Reward each useful answer.