on 09-20-2012 9:01 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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.
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?
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.
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.
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.
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.
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.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.