on ‎2014 Jan 24 10:02 AM
Hi
I have configured the schema ok (using RR_Employee to test the names) and the various process levels are being correctly used ok.
Now, i am trying to create a Badi copy to provide the correct approver names.
I need to grab the cost center from the shopping cart line item detail, and then using that value, will go across to ECC and find the approver from a custom table of approvers and cost centers.
My problem is that if i create a shopping cart and then 'Save', then 'Order', the cost center is found ok for the GUID, but if i create the SC and go straight to 'Next' and then 'Order' (without the intermediate 'Save' step) the cost center comes back as not found for the GUID, I think because at the time I examine the GUID table entry, there isnt one, and so no cost center found, its not yet been updated, could anyone offer some advice?
Thanks
John
Request clarification before answering.
Hi
Thanks for your answer, does this approach ensure that the problem I was seeing, i.e.the table entry not being available when the badi ran, is prevented?
From your code above, How would i then extract the value of the Cost Center?
Thanks
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
I am facing the same issue like you had with the "Migration on SAP HR of document hosted on IXOS" (see your post http://scn.sap.com/thread/1104461). Did you manage to work around that? Could you please help me on that, I am stuck and can´t figure out how to successfully migrate the multipage documents.
Thanks a lot in advance!
Wojtek
Hi John,
You will not see shopping cart in DB until you save or order it. Data storen in memory. With the sc object you can get acces to this buffer via /sapsrm/cl_pdo_factory_sc_adv=>get_buffered_instance() or (in nothing buffered) to db-instance via /sapsrm/cl_pdo_factory_sc_adv=>get_instance()
But always first from memory. For example, yuo ordered a SC, approver opens it and changes cost center, without saving to database, then click on approval preview. Your logic will read wrong (old) data from database.
After you got instance on shopping cart - you can call it's methods.
1. Get guids for not deleted items
2. Get accounting data for selected guids
Regards
Konstantin
Hi
In the schema, If the process level logic is true, and the new Badi runs to bring back an Approver, eg a cost center responsible person, but the cost center hasnt been maintained fully, and no responsible person has been added.
What is the correct way, and how would I implement it, to trap the error, and send error back to the SC creator, saying No Approver' has been found.
Thanks John
Ok thanks for that.
I have most of the approval working now, thanks to your invaluable help.
Two other areas that aren't working yet are, which you may be able to help with , are:
1/ the use of program RSWUWFMLEC to send email notifications. Debugging shows that new tasks are being identified, but then there is a compare against table entries in /SAPSRM/C_WF_100, which all show as Approval Process Framework type = PC (which is correct) but then because of this value, all the new tasks picked up are deleted.
Is this program only for Application controlled tasks? is there another program i should use for sending out emails.
2/ When the SC is Approved or Rejected, no message is sent to the SC requester
Regards
John
Hi John,
I would say - never read standard tables from database. Use classes for that.
- lo_sc = /sapsrm/cl_pdo_factory_sc_adv=>get_buffered_instance( is_document-document_guid ).
- IF lo_sc IS NOT BOUND.
- lo_sc = /sapsrm/cl_pdo_factory_sc_adv=>get_instance( iv_header_guid = is_document-document_guid
- iv_mode = /sapsrm/if_pdo_constants_gen_c=>gc_mode_display ).
- ENDIF.
Regards
Konstantin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.