cancel
Showing results for 
Search instead for 
Did you mean: 

My inbox PO enhancement with approvers as a composition

c_drancourt
Explorer
0 Kudos

Hello,

My requirement is quite classic: after upgrading to S/4, I need to reimplment old specifics we had on Fiori application Purchase order approval. Among this: I need to enhance the my inbox app (Purchase order approval) with the list of approvers and the status of approval. Here is a sample of what we had before switching to S/4 using custom UI5 development and what I want to achieve:

To do so, my idea was to extend the standard CDS C_PurchaseOrderFs with a composition on a specific CDS that fetches the information I want to display (description processor and status):

I was expecting to receive a table very similar to the standard item table

Sadly nothing happens and I can't find why. Maybe associations cannot be added through the extension process?

Some ideas/thoughts about it:

  • When checking the metadata, I was expecting to see the association but there is none. (But the dummy field I created can be seen there):
  • The association works fine when testing the CDS through Eclipse. So I guess the issue must be on the annotation part
  • I'd like to avoid transforming this table in single fields like approver1 aprover2 etc...

Any one has an idea of what goes wrong here?

Thanks for your ideas / help

View Entire Topic
Micha_Reisner
Explorer
0 Kudos

Hi Christophe,

the Purchase Order task UI is controlled by the gateway service C_PURCHASEORDER_FS.
So in order to get your newly added association, the SEGW project C_PURCHASEORDER_FS (mainly the runtime artifact classes CL_C_PURCHASEORDER_FS_MPC_EXT and CL_C_PURCHASEORDER_FS_DPC_EXT) has to reflect your requirement.

There are two important points for this:

  1. You need to get your new association into the exposed data model (check transaction SEGW, project C_PURCHASEORDER_FS ---> Data Source References ---> Exposures via SADL ---> select CDS-entity Exposures:I guess in order to get your new association into the model you had to check the "selected" checkbox of your association under C_PurchaseOrderFs. I didn't manage to do this using a "redefinition" of the project (or a modification). So probably you have to create a completely new project in SEGW with the same SADL-data source?
  2. DEFINE method of your MPC_EXT class:
    The UI facets of the Purchase Order Task UI are defined in the MPC_EXT class (at least in our release).
    This is class CL_C_PURCHASEORDER_FS_MPC_EXT in the standard service.
    So I would expect that you have to add your facet annotation here (DEFINE method).

    I assume the facet annotation in the CDS view has no effect / is overwritten by the definition in the MPC_EXT-class.

    Perhaps something like the following coding could help (without guarantee):
...
"define new facet
    lo_record2 = lo_collection1->create_record( iv_record_type = 'UI.ReferenceFacet')   ##NO_TEXT.
    "Label
    lo_property_value3 = lo_record2->create_property( 'Label' )    ##NO_TEXT.
    lo_property_value3->create_simple_value( )->set_string_from_otr( '00505xxxxxxxxxxxxxxxxx' ).  " <<---- replace with the appropriate OTR label
    "Target
    lo_property_value3 = lo_record2->create_property( 'Target' )    ##NO_TEXT.
    lo_property_value3->create_simple_value( )->set_annotation_path( 'to_PurchaseOrderApproval/@UI.LineItem' )   ##NO_TEXT.

Please also note :

If you create your own custom PO service as a copy from the standard, check the DPC-EXT class adaptations! There are redefinitions in the class CL_C_PURCHASEORDER_FS_DPC_EXT which you have to handle on your own when copying. Therefore a redefinition would always be the better option - in case you solve point 1.

c_drancourt
Explorer

I could solve it using your 2, thanks

Micha_Reisner
Explorer
0 Kudos

Hi Christophe
happy you were able to solve it. 🙂


Do I understand you correctly that you didn't have to copy or redefine the SEGW service?
Have you implemented an implicit enhancement to the MPC_EXT class or how did you adapt the method?

Regards
Michaela