cancel
Showing results for 
Search instead for 
Did you mean: 

HCM P&F Changes to field value in generic service are not reflected back to the screen

Former Member
0 Kudos

Hello,

I have an odd issue. I am trying to set a couple of fields on a check event in P&F using a generic service in the DO_OPERATIONS part of the generic service. When I loop through and set the field values the field values do get set but that change isn't reflected back on to the screen. I know that the correct information is in the field value because I have a validation that runs on it and it is passing that validation.

Any ideas?

Thank you,

Ryan

Accepted Solutions (1)

Accepted Solutions (1)

ChrisSolomon
Active Contributor
0 Kudos

This can be due to a FEW things. What is the field you are trying to change during "check"?

Some things that often cause this....

1. you have an issue in ANOTHER service that is making your service fail too. This one is HARD to catch at times because as you saw, in debugging, you see the field has changed. However, if ANY other backend service fails or has some unhandled error, your change gets "backed out" too...it is an "all or nothing" type deal. You need to make sure NONE of your services has problems,

2. If you are changing an infotype field (say one that is mapped to SAP_PA) you MUST look at the "decoupled infotype" configuration. The field you want to use from some infotype may be set as "read only" in configuration for decoupled infotypes (and HCM P&F folks don't often look/work over there).

3. you have set the field in HCM P&F config as "read only" (this is possible now and more strictly controlled than in the past).

If you check those two and all is well, then we can move on to some of the other things to check. But my guess is that it is one of those three.

Former Member
0 Kudos

Hi Chris,

1. All other services are working.

2. This one is tricky to answer. I am changing a field that is from an infotype but I haven't mapped it to SAP_PA (I am having the user type an email and bringing in pernr, last name, first name). I was just using a select statement to load the field but not mapping it in PA.

3. Set to "Can Be Edited".

Thank you for the help!

Former Member
0 Kudos

Hi Chris,

Figured it out today with the help of a coworker. I ended up using something I learned from your blog talking about user events and thought you may be interested in the solution.

After investigation I decided to make my event a user event rather than a check event (but all the same reasoning will apply).

Basically what was happening is I have a 2nd service that runs validations that uses message_handler to give the user any relevant messages. The generic service that contained my validations was listed before my generic service to populate values. The operations that were tied to my fields were run in order and when it got to the validations service it hit a message, completed that service, ran the next service, and then tried to apply all the changes. But because a message existed the sap variable is_ok was false which caused the form fields to not update.

So in conclusion be very careful with messages.

Former Member
0 Kudos

Hi Ryan,

Okay, I do not know you this only occurs when you have error message.

Yes you are right, once you have error message in any of your service, your form field(s) will not get updated Even for SAP_PA.

Good job.

regards,

Xiang Li

ChrisSolomon
Active Contributor
0 Kudos

Ah ok.... I was going to mention that in my things to check but didn't want to list it yet until we checked off the others. But YES.....you got GOTCHA'd by that oldy but goody. haha Glad you worked it out.

Answers (3)

Answers (3)

sahirn
Active Contributor
0 Kudos

Hello Ryan,

If you are using an user event of type CHECK, ensure the fields that you are setting are included in the field group corresponding to the event.

If you still continue to face the issue, please share screenshots of the process config.

Hope this helps.

With regards,

Sahir.

Former Member
0 Kudos

Hi Sahir,

I have included the fields in the field groups.

Unfortunately it would not be possible to share screenshots.

Ryan

Former Member
0 Kudos

Hi Ryan,

Can you please help to test this?

Use tcode hrasr_test_process, plug in all the values for application, process, personnel number, role of initiator and run it.

If this is at approval stage, get put in work item from your workflow log; else ignore Execute Dialog Step of Process section

You should able to see value that is passing from backend services / generic services without form involvement. You can similate initialize event using "Initialize" button, whereby form is first loaded or  "Check" button to trigger DO_OPERATIONS

By doing this, just to narrow the scope to track the root cause; whether it is at form level or generic services.

I found this tcode is useful this to test the functionality of your generic service / backend service without form involvement, during start of development or to do debugging .

Thanks. Hope to hear you will get something out of this test.

regards,

Xiang Li

sahirn
Active Contributor
0 Kudos

Hi Ryan,

That's fine. Field group will come into picture only if you are using user events.

If the fields are included and not mapped any of the standard services - the config should work. Debug the generic service do operations method. Ensure that the fields are not op excluded.

Regards,

Sahir.

Former Member
0 Kudos

Hi Xiang Li,

I should have mentioned this tcode is actually what I have been using to test. The issue is certainly at the generic services level not the form level.

Ryan

sahirn
Active Contributor
0 Kudos

Yep...

Yes, the framework does not populate the data container when there are errors.

@Everyone out here: Any way to work around this?

Thanks.

ChrisSolomon
Active Contributor
0 Kudos

It is an "all or nothing" kinda thing. One error or unhandled exception and it all goes off the rails. haha

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Ryan,

Might be caused by few things.

Can you please cehck you have append the same field in IF_HRASR00GEN_SERVICE~GET_SPECIAL_FIELDS method , SPECIAL_FIELDS table?

As if it is one of the special field you can never change the field value in initialize/do_operation method.

Hope this helps.

Thanks.

regards,

Xiang Li

Former Member
0 Kudos

Hi Xiang Li,

The fields are not in GET_SPECIAL_FIELDS. The only field I have in there is a field that I use to do a lookup and I do not change that field's value.

Ryan

Former Member
0 Kudos

Hi Ryan,

Okay.

Please check if i understand your issue correctly.

IN DO_OPERATION, you changed couples of fields value in SERVICE_DATASETS.

On form you don't see the value get changed, but you did some client scripting on form to validate the value, it passes.

Am I right?

So, meaning to say those values are already passed to the form, somehow form is still displaying the form first loaded value instead of latest value from bound field(s)?

regards,

Xiang Li