cancel
Showing results for 
Search instead for 
Did you mean: 

HCM Process & Forms Update Custom Infotype

Former Member
0 Kudos

Hi All,

Is there any way to update custom infotype in HCM Forms. I am working on Create Position form where i need to update some custom infotypes. The standard service SAP_PD is updating only standard infotypes. Is it possible to update by implementing the basic BADI : HRASR00GEN_SERVICE_BASIC or Do i have to implement HRASR00GEN_SERVICE_ADVANCED.

I have seen a method called FLUSH in HRASR00GEN_SERVICE_ADVANCED but i dont know how to call the method.

Any input on this is highly appreciated.

Thanks

VJ

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

@Chris: From my understanding it's quite easy to write custom infotypes. An issue is, that with the Decoupled IT Framework you loose all the logic implemented in the module pool, the user exits as well as the dynamic actions. Do you agree, that you actually have to refactor this functionality?

Edited by: Pete42 on Feb 26, 2010 11:48 AM

nathan_pierce
Discoverer
0 Kudos

I work with Kristene, and I'll just follow up a bit on what she posted. We are NOT updating anything in the DO_OPERATIONS method. What she is showing us doing in DO_OPERATIONS with the code snippets she provided is loading global class attributes (g_pernr, pa9004 etc) in that operation from the values in the SERVICE_DATASETS parameter since that table is not a parameter in the FLUSH method. We do all of our updating in the FLUSH method, we use the global class attributes to store the data that we need to use there.

Yes you do have to implement HRASR00GEN_SERVICE_ADVANCED and use its FLUSH method.

ChrisSolomon
Active Contributor
0 Kudos

@Kristene Vaughn

That's a very wrong and dangerous way to do it. If you do this in a generic service, it will update EVERY time the "check" event or operation is fired/triggered/called. To make matters worse....if the user does a "check" then goes back to change something and does "check" again, it will update yet again!!! It is better to do this via an Advanced/Enhanced Generic Service. The update will not actually occur until the "flush"....much like a regular LUW. Past that though, you should REALLY make use of the decoupled infotype framework.

In your example above, I see what you are trying to do. I would guess you are leaving off some important parts there from the config. Your operation above isn't actually doing anything by itself.

@Vijay

If you want to control "when" the updates are actually done, this is set through workflow binding on that task/step. You can have your form "pretend" to do an update without doing it at all for the purposes of checking/validating data or you can set workflow to say "when the form is done, save the data". It's all up to your workflow config (except with the NO_WORKFLOW undocumented option which ALWAYS saves)

@ All

This is very possible and well documented in the HCM P&F docs. For custom infotypes, you simply need to make sure they have been defined for the decoupled infotype framework (ie, have a "screen structure" associated and have been config'd in the decoupled IF section). This is VERY easy. Once done, you can simply add your infotype(s) into the HCM P&F config for operations (SAP_PA for example). I have done this a LOT and this is probably your safest/best way to do it. Again, if this is not possible or not meeting your needs, then (and only then) would I look at doing this in an Advanced Generic Service.

Former Member
0 Kudos

I suggest to use Advance Generic Service only if updating of any infotype is not possible thru SAP_PA/SAP_PT/SAP_PD services, for example custom tables or any table outside HR. SAP_PD service is available with EhP4 and can be used to update Om infotypes.

If you are on EhP4, you can find SAP delivered Adv Gen service for eRecruit.

regards

Sridhar

Former Member
0 Kudos

Hi Chris,

Just want to share, screen structure and in the decoupled IF is not worked with SAP-PD. I am not sure why SAP need to block that.

Visut

Former Member
0 Kudos

Hi All

Is there any way to Read/Update a custom table or cluster using backend service in HCM Processes and Form.

Please share your views on this.

Thanks

Sarath

Former Member
0 Kudos

Hello Vijay,

Yes, we've been able to update a custom infotype (9004) via HCM forms, via a generic service.

More info below.

Good luck,

Kristene Vaughn

In config for Generic services, each fieldon the infotype is defined in field group UPDINFY, operation UPD_INFY_9004.

In Get Operation:

CLEAR OPERATION.

OPERATION-OPERATION = C_READ_INFY_9004.

OPERATION-FIELDNAMES = FIELDNAMES.

APPEND OPERATION TO OPERATIONS.

  • For Update Infotype 9004

APPEND 'ADD_PENSION' TO FIELDNAMES.

APPEND 'CHANGE_PENSION' TO FIELDNAMES.

APPEND 'MODIFY_PENSION' TO FIELDNAMES.

....

In the do operation,

WHEN c_upd_infy_9004.

LOOP AT special_fields INTO special_field_wa WHERE fieldname = 'PERNR'.

g_pernr = special_field_wa-fieldvalue.

pa9004-pernr = special_field_wa-fieldvalue.

g_9004_key-PERNR = special_field_wa-fieldvalue.

ENDLOOP.

LOOP AT service_datasets INTO service_dataset_wa WHERE fieldname = 'SUBTYPE_9004'.

pa9004-subty = service_dataset_wa-fieldvalue.

ENDLOOP

....

LOOP AT service_datasets INTO service_dataset_wa WHERE fieldname = 'ADD_PENSION'.

IF service_dataset_wa-fieldvalue EQ '1'.

g_oper = 'INS'.

ENDIF.

ENDLOOP.

Former Member
0 Kudos

Hi Kristene,

Thanks for your reply!! I would like to know when are you calling this operation : UPD_INFY_9004.

Is it called from Form or is it called when the form is approved? Only the form is approved then only we need to

update the infotype. So how do u know that the form is approved.

Thanks

VJ

Former Member
0 Kudos

Hi,

Any help on this!!