cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: HCM Processes and Forms

pramod_gopisetty1
Active Contributor
0 Kudos

Hello Guru's,

I am doing a New Hire and want to populate fields in Infotype 315 - LIFNR, EBELP, EBELN, and LSTNR.

For the same we have custom Generic Service and different operations are involved.

We have 3 different field groups defined in the Backend Service.

And I have added the fields to one of the field group.

Now for populating the value I have added my code to the BADi.

Added the fields in Field Info in method GET_FIELD_INFO.

I can see the field in Service Data Set

     LOOP AT service_datasets ASSIGNING <service_dataset_wa>
            WHERE fieldname = c_fieldname_i315_lifnr.
      EXIT.
    ENDLOOP.

    IF sy-subrc = 0. "entry found; must not necessarily exist
      <service_dataset_wa>-fieldvalue = I315_LIFNR. 
    ENDIF.

And we have 2 level approval, while debug I can see the values in the Service_Datasets.

But after the final processing the values are not updated in backend.

Please help me in resolving this issue.

I am not getting where is the issue.

Thanks & Regards,

Pramod

Accepted Solutions (1)

Accepted Solutions (1)

ChrisSolomon
Active Contributor
0 Kudos

Where is your "final processing"? I mean is it done per a user or in the background?

If you have an "approve form" step, you will then need the "backend update step" in workflow with "send variation" bound correctly to make the update. In this case, the "system" will be making the update.

If your last step is a "process form" step, you can set the binding for "send variation" there on that workflow step to make the actual backend update. In this case, the last "approver" will be making the update.

pramod_gopisetty1
Active Contributor
0 Kudos

Thanks for reply Christopher.

Final processing is done in the background.

I have a working form and I have added additional fields as mentioned in the message.

Now I have the values populated and I can see values in SERVICE_DATASETS while debugging.

But the values are not populated in the backend.

I have 'Send Variation' bound to 'A' to update in the backend.

Not sure where the values are overwritten.

Thanks & Regards,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

Does WF-BATCH (or whatever ID you are using for your backend update) have the correct security?...especially for access to CASE Mgmt (which we had to add to our system user). This can be an issue if not.

Past that, are you sure you other services are working ok. Although you see your correct values in your "service dataset" within your GS....it might be a later service that is getting an error and then backing everything out. Backend Services are "all or none". If an error occurs anywhere along the way, they ALL will fail/be backed out.

pramod_gopisetty1
Active Contributor
0 Kudos

Hello Christopher,

The other values are populated except the one's which I have added to the Generic Service Fields.

And coming to WF-BATCH will check on security and Access to case Management what exactly is that?

Can you please elaborate on the same.

Thanks & Regards,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

Wait...you say the other values are "populated"....do you mean you see the actual infotype update go through and see all other fields updated except what is in your GS?

pramod_gopisetty1
Active Contributor
0 Kudos

Yes Christopher,

All other fields are updated to backend except the fields from Infotype 315 which I have added.

I have some other fields in same GS and those are updated in the backend fine.

Thanks,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

OK.....haha this one might be MUCH easier than I thought....can you look at your decoupled infotype config in the IMG....check the settings for IT0315.....I have a hunch those fields are marked "read only" in your config for the structure being used. I am HOPING it is just something that silly and easy....sometimes, it is! haha

pramod_gopisetty1
Active Contributor
0 Kudos

Hello Christopher,

I have done the changes as below: Please review the same and let me know where I have done wrong.

I315_EBELN Sending PO Can Be Edited
I315_EBELP Sending PO Item Can Be Edited                                                                                                                                                                                                                                                          
I315_LIFNR Vendor  Can Be Edited
I315_LSTNR Activity Number Can Be Edited

In Default Value Selected the Generic Service - Operation-FieldName

In GS BADi implementation Coding is as below:

In Method GET_FIELD_INFO

WHEN C_FIELDNAME_I315_LSTNR.

        CLEAR field_info.
        field_info-fieldname = C_FIELDNAME_I315_LSTNR.
        field_info-field_data_element_name = C_DTEL_I315_LSTNR.
        field_info-supports_value_help = false.
        field_info-supports_default_value = false.
        APPEND field_info TO field_infos.

Added the fields to Field Info

In Method DO_OPERA_GET_DETAILS_FOR_POS
We are calling method get_details_for_position to get the values of the fields

WHEN 'ECH'.
          I315_LIFNR = '10125473'.    
          I315_EBELN = '4504000000'.  
          I315_EBELP = '10'.          
          I315_LSTNR = '3000000'.     

        WHEN 'ECS'.
          I315_LIFNR = '10125473'.    
          I315_EBELN = '4504000000'.  
          I315_EBELP = '10'.          
          I315_LSTNR = '3000000'.     

After the method call the values are available in SERVICE_DATASETS.

And below code is used:
*    store Sending PO(EBELN)
    LOOP AT service_datasets ASSIGNING <service_dataset_wa>
            WHERE fieldname = c_fieldname_i315_ebeln.
      EXIT.
    ENDLOOP.

    IF sy-subrc = 0. "entry found; must not necessarily exist
      <service_dataset_wa>-fieldvalue = I315_EBELN.   "'4504000000'.
    ENDIF.

Till here the values are there in Service_datasets.

But after executing the process the values are not posted to the backend.

pramod_gopisetty1
Active Contributor
0 Kudos

Hi Christopher,

Do you see any issue with the above coding I did to populate?

Let me know if you need any more information.

Thanks & Regards,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

Ok.....so are you saying that after....

[code]

*    store Sending PO(EBELN)

    LOOP AT service_datasets ASSIGNING <service_dataset_wa>

            WHERE fieldname = c_fieldname_i315_ebeln.

      EXIT.

    ENDLOOP.

    IF sy-subrc = 0. "entry found; must not necessarily exist
      <service_dataset_wa>-fieldvalue = I315_EBELN.   "'4504000000'.
    ENDIF.

[/code]

and as execution is leaving your "DO_OPERATIONS" method, that you DO see ALL values in your "service_datasets" structure (not just some values but missing others)?

So then, where does control go? What does your backend services config look like? I mean is it just....

1. my_custom_gs

2. SAP_PA

.....or different?

Also, what does your mapping to SAP_PA look like? Are you sure you are NOT excluding those fields in SAP_PA config?

pramod_gopisetty1
Active Contributor
0 Kudos

Hello Christopher,

Yes the values are existing in the SERVICE_DATASETS after the DO_OPERATIONS method.

Sequence of Operations are :

1. my Custom GS

2. SAP_PA

and do I need to define the fields again in the SAP_PA Service too?

Thanks,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

haha yep....you have to map them to SAP_PA as well so SAP_PA knows what to do with them. You have your infotype operation for IT0315 in the SAP_PA config right? Then, in the "fields" config, you have to map ALL fields needed to SAP_PA....otherwise, how does it know what you intend to do?

Think of each backend service as it's own "black box"....it knows nothing of the "outside world"....you send in what it needs to get back what you expect.

I think this might be your issue.

pramod_gopisetty1
Active Contributor
0 Kudos

Hi Christopher,

While trying to add the fields to SAP_PA service I am getting this error.

Identical binding to service field EBELN is already defined

The field mapping in my Custom GS is as below:

Thanks & Regards,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

Show your mapping of fields for SAP_PA without the "wizard" pop up in the way (I never use that damnned wizard). I want to see what your form scenario fields map to on the SAP_PA IT0315 fields structure side.

The mapping to your GS does not matter now if you are in fact seeing the fields populated and coming out of the GS via service_datasets. I think your SAP_PA mapping is the issue.

ChrisSolomon
Active Contributor
0 Kudos

Also, not sure why you are mixing all your operations for various infotypes into ONE generic service. Not the best idea, but that is a matter of preference I suppose. NOT related to your issue now.

pramod_gopisetty1
Active Contributor
0 Kudos

HI Christopher,

Please see below the SAP_PA field mapping:

I have added the fields manually now and tried executing the process with no luck.

Let me know if you need any more information.

Thanks & Regards,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

I see your form fields side of it in the screenshot, but please scroll to right and show how your "left side" fields map to the "right side" SAP_PA fields in the structure.

Also, if you have OTHER operations going on, you might want to deactivate those (use a rule on them like "if sy-username="DO_NOT_RUN"" to make them not execute). You might have errors in other operations that are "blocking" this one from working. I make sure each one is working before adding a new one.

ChrisSolomon
Active Contributor
0 Kudos

also, what does your "infotypes and operations" config look like for SAP_PA (the node under "fields" mapping)?

pramod_gopisetty1
Active Contributor
0 Kudos

Hi Christopher,

Here is the screenshot :

Thanks & Regards,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

So is IT0315 creating at all?

pramod_gopisetty1
Active Contributor
0 Kudos

Yes the record is creating and updating values KOKRS and KOSTL.

But not the fields I have added. And also if you observe the values are populated from the My Custon GS.

Do you see any issue with the coding I have done?

is there anything else I am missing?

Thanks & Regards,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

OK....then again, I say look at your decoupled infotype config....check also your "check" class(or classes) for your DIT structure and see if the "input" conversions are "blocking" those fields. And of course, check your IT0315 class itself. That would be about the last place to check now.....last before the update would normally happen.

ChrisSolomon
Active Contributor
0 Kudos

Look at class CL_HRPT_INFOTYPE_0315...specifically at the SPECIFIC_COMPUTATIONS and CHECK_INPUT_DATA methods. I see this code in there for example....

* Check input data of IT 0315

  IF p0315-werks IS NOT INITIAL OR

     p0315-lifnr IS NOT INITIAL OR

     p0315-ebeln IS NOT INITIAL OR

     p0315-ebelp IS NOT INITIAL OR

     p0315-lstnr IS NOT INITIAL.

    CALL METHOD check_input_data

      EXPORTING

        p0315           = p0315

        message_handler = message_handler

      IMPORTING

        is_ok           = is_ok.

    CHECK is_ok = true.

  ENDIF.

pramod_gopisetty1
Active Contributor
0 Kudos

Hey Christopher,

Thanks for the help.

The issue is with the fields mapping to SAP_PA service. I see that the feilds are showing up twice with no proper mapping.

I have added the fields which need to be populated to SAP_PA service and it did the trick

Thanks for the support.

Best Regards,

Pramod

ChrisSolomon
Active Contributor
0 Kudos

haha so it was something pretty simple after all? yeh...you got to watch out for those things....actually, just had a client do the same thing and I corrected them today on it.

Answers (0)