cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow for Qaulification Profile creation

Former Member
0 Kudos

Hi,

I have a workflow requirement for skill profile create via ESS. The data should be active once manager approve it. There is no standard workflow available for skill profile creation.

I am not sure how to stop the data update in HRP1001 table before approval steps. By default data uapdate in HRP1001 for qaulifction object link with person. I understand that we can trigger the event if change happen in IT1001. But not sure how to make the record in-active and active before approval and after approval steps.

We are using ECC 5 system. Please advice if any one have some idea.

Thanks,

VP

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Mhmd Fredj for you input. I used same BO and make the subtype. I found one BADI and used that to create an event. I have used FM BAPI_QUALIPROF_CHANGE to update the qualification profile.

Have you enhanced the field of struucture object_key as per your BO Key in function module or You have have changed coding of funciton module as well. It would be good if you please provide more detals of function module.

Thaks,

VP

Former Member
0 Kudos

Hi,

When I copied BUS7019 to ZSKILL...I deleted the key field "PersonType "

since I don't need it and I replaced in the source of the BO all the OBJECT-KEY-PersonType by 'P' and then deleted the events and created one

"CHANGEDSUBPROFILE".

So my key fields of BO are now :

ZSKILL.PlanVersion

ZSKILL.PersonID

ZSKILL.QualificationID

ZSKILL.EndDate

Now in my copy of the function HR_EVENT_WF_SUBPROFILE_DEFICIT that I called ZHR_EVENT_WF_SUBPROFILE

I adapted the structure

DATA: BEGIN OF object_key,

planversion LIKE objec-plvar,

PersonID LIKE p1001-sobid,

QualificationID like objec-objid,

EndDate like objec-endda,

END OF object_key.

and then I added this code before calling the function 'SWE_EVENT_CREATE'

MOVE plog_tab_record-plvar TO object_key-planversion.

MOVE plog_tab_record-varyf+2(8) to object_key-PersonID.

MOVE plog_tab_record-OBJID to object_key-QualificationID.

MOVE plog_tab_record-endda to object_key-EndDate.

and I deleted what I don't needed in the function since my relationship between a person and Qualifiction will always be '032'.

I've put the whole function in the bottom.

Of course to make this work you have to create an entry in the table T777IBO

to link a qualification to your new BO.

(Q-1001-B032-ZSKILL).

And then the table T779X to link a qualification creation to your BO and to a function module (your copy ZHR_EVENT_WF_SUBPROFILE)

Object Type Q

Infotype 1001

Subtype B032

Update op. INS

Activity PDSP

Sequence no. 0

Object type ZSKILL

Event

Function Module ZHR_EVENT_WF_SUBPROFILE

so normally now when you create a qualification for your employee you should have your BO ZSKILL in the SWEL with your event.

Now I have also adapted to have more info and function.

For example a virtual attribute VALSCALETXT to have the text value of the scale of the qualification (ex: Fluent for a langage)

Creation : VALSCALETXT like T77TN-RAT_TEXT.

Source :

GET_PROPERTY VALSCALETXT CHANGING CONTAINER.

DATA : partic_tab like HRSOBID occurs 0 with header line,

QUALIF_TAB like HRVQUALIF occurs 0 with header line,

Q_SCALE_TAB like SCALE_STRU occurs 0 with header line,

SCALEID like SCALE_STRU-SCALE,

valscale like PT1045-RATING.

clear : QUALIF_TAB,QUALIF_TAB[],partic_tab,partic_tab[].

refresh : QUALIF_TAB,QUALIF_TAB[],partic_tab,partic_tab[].

partic_tab-plvar = OBJECT-KEY-PlanVersion.

partic_tab-otype = 'P'.

partic_tab-sobid = OBJECT-KEY-PersonID.

append partic_tab.

CALL FUNCTION 'RH_GET_QUALIFICATION'

EXPORTING

begda = '19000101'

endda = '99991231'

TABLES

partic_tab = partic_tab

qualif_tab = QUALIF_TAB

EXCEPTIONS

no_qualif_found = 01.

IF SY-SUBRC EQ 0.

LOOP AT QUALIF_TAB where QUAID eq OBJECT-KEY-QualificationID.

CALL FUNCTION 'RHPE_Q_SCALE_READ'

EXPORTING

PLVAR = OBJECT-KEY-PlanVersion

OTYPE = 'Q'

OBJID = OBJECT-KEY-QualificationID

BEGDA = '19000101'

ENDDA = '99991231'

TABLES

Q_SCALE_TAB = Q_SCALE_TAB.

IF SY-SUBRC EQ 0.

LOOP AT Q_SCALE_TAB where begda le sy-datum and

endda GE sy-datum.

move Q_SCALE_TAB-scale to SCALEID.

ENDLOOP.

move QUALIF_TAB-CHARA to valscale.

CALL FUNCTION 'RHPS_SCALE_PROFCY_TEXT_READ'

EXPORTING

SCALE_ID = SCALEID

RATING = valscale

IMPORTING

PROFC_TEXT = OBJECT-VALSCALETXT.

ENDIF.

ENDLOOP.

ENDIF.

SWC_SET_ELEMENT CONTAINER 'VALSCALETXT' OBJECT-VALSCALETXT.

END_PROPERTY.

Now I added also a method to delete the relationship between the qualification and the person (if the manager reject it in my workflow)

Source :

BEGIN_METHOD DELETERELATIONSHIP CHANGING CONTAINER.

DATA : TABPROF like HRPE_RELAQ occurs 0 with header line.

CLEAR : TABPROF,TABPROF[].

refresh : TABPROF,TABPROF[].

SELECT * from HRP1001 where plvar eq OBJECT-KEY-PlanVersion AND

otype eq 'P' AND

OBJID eq OBJECT-KEY-PersonID AND

RSIGN eq 'A' AND

RELAT eq '032' AND

endda eq OBJECT-KEY-ENDDATE and

SCLAS eq 'Q' and

SOBID eq OBJECT-KEY-QualificationID.

ENDSELECT.

IF SY-SUBRC EQ 0.

move 'Q' to TABPROF-TTYPE.

move OBJECT-KEY-QualificationID to TABPROF-TBJID.

move HRP1001-begda to TABPROF-SBEGD.

move HRP1001-endda to TABPROF-SENDD.

move HRP1001-begda to TABPROF-VBEGD.

move HRP1001-endda to TABPROF-VENDD.

append tabprof.

CALL FUNCTION 'RHPP_Q_PROFILE_DELETE'

EXPORTING

PLVAR = OBJECT-KEY-PlanVersion

OTYPE = 'P'

OBJID = OBJECT-KEY-PersonID

BEGDA = HRP1001-begda

ENDDA = HRP1001-endda

VTASK = 'D'

TABLES

PROFILE = TABPROF.

ENDIF.

END_METHOD.

And now this is the whole function : ZHR_EVENT_WF_SUBPROFILE

  • Corrections

  • DATE Correction Note Description User

  • 05.12.02 ABAK013608 525980 no triggering of workflow for PZ31 Ludwig

  • 22.07.03 ABAK017234 593025 no triggering for other otypes than 'P '

  • 11.02.05 PABK008687 817979 Wrong object type in workflow container

FUNCTION ZHR_EVENT_WF_SUBPROFILE.

*"----

-


""Local Interface:

*" IMPORTING

*" VALUE(BUSINESSOBJECT) LIKE T779W-BUSOB

*" VALUE(OPERATION) LIKE T779W-WFOPR

*" VALUE(LFCOD) LIKE T779W-LFCOD OPTIONAL

*" VALUE(PLOG_TAB_RECORD) LIKE HRDBTAB STRUCTURE HRDBTAB

*" TABLES

*" EVENTS_PER_OPERATION STRUCTURE HREVENTS

*" BEFORE_IMAGE STRUCTURE BEF_IMAGE

*" AFTER_IMAGE STRUCTURE AFT_IMAGE

*"----

-


  • Tables

DATA: BEGIN OF object_key,

planversion LIKE objec-plvar,

PersonID LIKE p1001-sobid,

QualificationID like objec-objid,

EndDate like objec-endda,

END OF object_key.

DATA: objkey LIKE sweinstcou-objkey.

DATA: l_objects LIKE hrsobid OCCURS 1 WITH HEADER LINE.

DATA: l_pos_objects LIKE hrsobid OCCURS 1 WITH HEADER LINE.

DATA: l_positions LIKE hrpe_profl OCCURS 1 WITH HEADER LINE.

DATA: l_pos_holder LIKE hrpe_prozt OCCURS 1 WITH HEADER LINE.

DATA: l_p_holder LIKE hrsobid OCCURS 1 WITH HEADER LINE.

DATA: l_quali_profiles LIKE hrpe_profq OCCURS 1 WITH HEADER LINE.

DATA: l_defizit_tab LIKE hrpe_profq OCCURS 1 WITH HEADER LINE.

DATA: l_requi_profiles LIKE hrpe_profq OCCURS 1 WITH HEADER LINE.

DATA: l_profil_old LIKE hrpe_profq OCCURS 1 WITH HEADER LINE.

DATA: l_profil_new LIKE hrpe_profq OCCURS 1 WITH HEADER LINE.

*----

-


  • Variables

*----

-


DATA: l_defizit.

DATA: before_image_flag.

DATA: after_image_flag.

DATA: help_tabix1 LIKE sy-tabix.

DATA: help_objects_tabix LIKE sy-tabix.

DATA: h_tabix LIKE sy-tabix.

DATA: subrc LIKE sy-subrc.

DATA: dynpro_nr LIKE sy-dynnr.

DATA: repid_nr LIKE sy-repid.

DATA: profile_view LIKE t77pp_view-profile_view.

DATA: partid LIKE t77pp_part-partid.

  • ----------------------------------------------------------------------

  • Zuweisung der Profilsicht

CALL FUNCTION 'RHP6_PROFILE_TECHNIC_INFO_GET'

IMPORTING

e_profile_view = profile_view.

  • E_VIEW_REPID =

  • E_HEAD_DYNNR =

  • E_HEAD_REPID =

  • E_PART_DYNNR =

  • E_PART_REPID =

  • E_PART_TEXT =

  • E_MAINTAIN =

  • E_COMMIT_FLG =

  • E_POPUP =

  • case PLOG_TAB_RECORD-subty+1(3). "Verknüpfung

PERFORM read_t77s0_parameters_for_pe.

READ TABLE before_image INDEX 1 TRANSPORTING NO FIELDS.

IF sy-subrc = 0.

before_image_flag = 'X'.

ELSE.

READ TABLE after_image INDEX 1 TRANSPORTING NO FIELDS.

IF sy-subrc = 0.

after_image_flag = 'X'.

ENDIF.

ENDIF.

IF before_image_flag = 'X'.

  • Alle Planstellen von Stellen lesen

LOOP AT before_image.

l_objects-plvar = before_image-plvar.

l_objects-otype = before_image-varyf(2).

l_objects-sobid = before_image-varyf+2(8).

APPEND l_objects.

ENDLOOP.

ELSE.

LOOP AT after_image.

l_objects-plvar = after_image-plvar.

l_objects-otype = after_image-varyf(2).

l_objects-sobid = after_image-varyf+2(8).

APPEND l_objects.

ENDLOOP.

ENDIF.

$plvar = plog_tab_record-plvar.

$gdate = sy-datum.

CASE plog_tab_record-subty+1(3). "Verknüpfung

WHEN '032'.

dynpro_nr = '2100'.

repid_nr = 'SAPLRHPP'.

PERFORM read_profile_partid(saplrhp6)

USING profile_view

l_objects-otype "Object_Key-OBJTYPE

dynpro_nr

repid_nr

partid

subrc.

IF sy-subrc <> 0.

dynpro_nr = '2101'.

repid_nr = 'SAPLRHPP'.

PERFORM read_profile_partid(saplrhp6)

USING profile_view

l_objects-otype "Object_Key-OBJTYPE

dynpro_nr

repid_nr

partid

subrc.

IF sy-subrc <> 0.

dynpro_nr = '2102'.

repid_nr = 'SAPLRHPP'.

PERFORM read_profile_partid(saplrhp6)

USING profile_view

l_objects-otype "Object_Key-OBJTYPE

dynpro_nr

repid_nr

partid

subrc.

  • Correction: ABAK013608 525980

  • Correction for the workflow for the web transaction PZ31 and PZ32.

  • With the dummy partid '0001' and dynpro_nr '0003' the internet

  • transactio PZ31 is working for changed subprofile.

IF sy-subrc <> 0.

dynpro_nr = '2101'. "Dynpro of PZ31/PZ32 Web transaction

repid_nr = 'SAPLRHPP'. "Just defined as dummy id for Workfl

profile_view = 'PD'.

PERFORM read_profile_partid(saplrhp6)

USING profile_view

l_objects-otype "Object_Key-OBJTYPE

dynpro_nr

repid_nr

partid

subrc.

ENDIF. "dynpro_nr = '2101' for simulation of Web Ta PZ31

ENDIF. "dynpro_nr = '2101'.

ENDIF. "dynpro_nr = '2102'.

ENDCASE. "case PLOG_TAB_RECORD-subty1(3)

IF dynpro_nr <> '3100' AND dynpro_nr <> '3101'

AND NOT partid IS INITIAL.

  • Mohamed FREDJ

MOVE plog_tab_record-plvar TO object_key-planversion.

MOVE plog_tab_record-varyf+2(8) to object_key-PersonID.

MOVE plog_tab_record-OBJID to object_key-QualificationID.

MOVE plog_tab_record-endda to object_key-EndDate.

MOVE object_key TO objkey.

CLEAR before_image_flag.

READ TABLE before_image INDEX 1 TRANSPORTING NO FIELDS.

IF sy-subrc = 0.

before_image_flag = 'X'.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = businessobject

objkey = objkey

event = 'CHANGEDSUBPROFILE'

EXCEPTIONS

OBJTYPE_NOT_FOUND.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ELSE.

READ TABLE after_image INDEX 1 TRANSPORTING NO FIELDS.

IF sy-subrc = 0.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = businessobject

objkey = objkey

event = 'CHANGEDSUBPROFILE'

EXCEPTIONS

OBJTYPE_NOT_FOUND.

IF sy-subrc = 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDFUNCTION.

Hope this helps.

Good Luck.

Former Member
0 Kudos

Hi Mohamed,

I just want to know from which transaction or service do you call the function (ZHR_EVENT_WF_SUBPROFILE ) that triggers the workflow event. Do you call it from ESS (portal)?

I was thinking of doing the same thing but I am using PZ31/PZ32 ITS service to change the person's qualification and proficiency. This in turn calls Fm RHPP_COMMON_QUALI_PROF_WRITE that triggers the CREATEDWITHVALIDITY or RENEWED events of BO BUS7019. But in this function module, after the event was triggered, it then calls the Fm RH_INSERT_INFTY_1001_EXT to write the record but I only want to do this after the the workflow has been approved. Hence I want to code my own function module to trigger the workflow so I'm just curious as to where do you call this new Fm that you created.

Thanks,

Miles

Former Member
0 Kudos

Hi Miles, are you from New Zealand? Were or Are you working for EDS in W'ton??? This is ravi here....

Former Member
0 Kudos

Hi Ravi.

Yes, still with EDS and in Wgtn. How are you? You can send me email to my work address.

Cheers,

Miles

Former Member
0 Kudos

Hi Kjetil Kilhavn ,

Thanks for your input. Looks like not very straight forward options.

I have checked with functional folk and they said that for skill profile service it is not possible to store data as an in-active mode. We can't use ISTAT and PLVAR filed as well.

The Last resort need development work from scratch.

We are exploring to incorporate some coding in skill update RFC module.

With Rgds,

VP

Former Member
0 Kudos

Hi Vinod,

Well looks like we have the same issue...and even if I want to create my own method to delete the qualification ..I just can't cuz we don't have the ID of the Qualification in the BUS7030...

Did you find a solution for this ?

Thanks.

Former Member
0 Kudos

I found a solution to my problem....because it was the BUS7030 who was generated in the swell and it didn't have the Qualification ID....

I created a BO ZSKILL(copy of BUS7019) that has as object key what I need(QualificationID) and then I copied the function HR_EVENT_WF_SUBPROFILE_DEFICIT and I changed the structure obj_key

by adapting this one to the keys of ZSKILL.

and then I adapted the table T777IBO(to link Q-1001-B032-ZSKILL) and

T779x to link to the function.

KKilhavn
Active Contributor
0 Kudos

Not my cup of tea this, but some general tips:

Check 1: Is it possible to register a skill profile and mark it as inactive using the standard R/3 transactions or ESS functionality. If the answer is no, you will have to do a bit of coding (or more likely more than just a bit).

Check 2: Does the ISTAT field in HRP1001 have any effect on whether the skill profile is considered active or not? That is the intention of the field, but solutions unfortunately sometimes ignore this. Perhaps you will be able to use the field if you have to code your own solution. May be the path of least resistance....

Check 3: Ditto for the PLVAR field? It is not intented for this purpose, but perhaps you can manipulate it if you have to do your own coding. The plan variant should have an effect on how data are interpreted, but perhaps you will have problems using the data if you change it. I have no experience in using different plan variants myself, so I really don't know if this is a feasible solution.

Last resort: either provide your own input screen or prevent the data from being saved, transfer them to your workflow container and only update HRP1001 after approval takes place.