cancel
Showing results for 
Search instead for 
Did you mean: 

Add Value Help to SAP Fiori Elements App

Attila
Active Participant

Hello,

I simply added 3 fields to the C_ProductPlant entity. So far so good, the new fields available in the Manage Product Master Data app, under Plants section. But I need value helps for the new fields, it is really simple requirement, but seems complicated with Fiori Elements and standard SEGW service with CDS as reference model implementation. If the value help CDS entity or the required association is not already part of the CDS reference model, it is not working. You are not allowed to touch or regenerate SEGW services of course to expose them. So extending CDS views with associations and new value helps never become active.

(INFO: I Expose standard fields with Z alias, due SAP is not exposing them from MARC (KZAUS,AUSDT,NFMAT), therefore UI Adaptation and Custom Fields and Logic is not playing here, so that adding Value Help is not possible that way. Syncronization of custom Z fields back to standard would invole not only enhancing the Draft Handler of BOPF Object I_ProductWD, but also legacy transactions and MARC update functions to sync the content of standard fields also to the Z fields, so that the up to date values from MM transactions are sync to the Z fields, would be neverending and unsafe solution).

I added value help annotations also, and here comes the problem.

Since the C_Product CDS consumption is inlcuded only as a reference into the SEGW project MD_C_PRODUCT_MAINTAIN, without generating or changing the standard project, the value help will never be available.

So I have a problem like described here:

https://answers.sap.com/questions/13115363/extended-standard-fiori-element-app-valuehelp-for.html

But in my opnion enhancing the genarated SADL metadata in the Model Provider class is hacky, like Maximilien is explaining in the above post, because everything is genareated based on the CDS views as Model Base Class. What happens if someone enhance the standard service lateron, there may be be a collision. Searching for entities existence in the above text is quite unreadable and unmaintainable coding.

CL_MD_C_PRODUCT_MAINTA_MPC - IF_SADL_GW_MODEL_EXPOSURE_DATA~GET_MODEL_EXPOSURE

So it is not like a safe solution, but of course may work, enhancing and adding local types and bunch of other stuff.

Maybe the model exposure ro_model_exposure interface can be used for that, to add entities and associations, full with manual entity configuration ?
It could be quite demanding to deal with annotation helpers in extension, but any example if working could be a great help, or at least the info it worked for someone within standard enhancment ( examples could be taken from the system).

Alternatively the standard service in SEWG could be extended as a Z service, and everything manually added, but this would involve to replace the reference of MD_C_PRODUCT_MAINTAIN OData service with a ZMD_C_PRODUCT_MAINTAIN within the Fiori app. Unfortuanetly no extension can be made for this Fiori app MD_PROD_MAS_S1 project in WebIDE (even the import from ABAP repository dies, beacuse the project is huge), to check whats inside and the possibilities for service replacement.

(Incident has been opened to SAP with the Import error, but I've feeling it wont help me importing into WebIDE)

So I am screwed. Do I create a Fiori elements app from scratch, reaplacing the most complex transctional Fiori application made by SAP so far, just to be able to add value help for the end users.

Any experience or suggestion is welcome.

Best regards

View Entire Topic
pivvu_1978
Discoverer

Hi Attila, if you haven't solved my solution below yet: In case you have already solved it I would like to know your solution.

In my case I had the same problem in the "Manage Purchase Requisition Professional" App (which has nothing of professional!) Unfortunately the only way I found is to define a new ODATA Service and modify the standard Application.

Create an ODATA service;

Redefine the GET_ENTITYSET mehod to extract the values of the ValueHelp;

Publish it to custom service ZXXXXX_SRV;

Edit the standard App: Insert the pointing to your custom service in the Manifest.json file Create a custom view where to insert a new field (same label as the standard field) like CustomData.view.xml (In my case only code and description).

Create the CustomData.controller.js file where you can implement two functions:

onInit-> where you have to take the initial value of the standard field and bring it back into your custom field

onCustomDataChange-> where to take the selected value and return it to the standard field.

Publish your custom view using UI Adaptation.

After checking that the data is correctly transferd from custom to standard and from standard to cutom, hide the standard field (in my case from CDS via annotation @ UI.hidden).

I know it is a dirty job and it involves changes to the standard but by now I can confirm that it is not a rarity that the standard apps do not work properly.

Best regard

Attila
Active Participant

Hi Paolo,

I solved using the traditional way - as I explained above already- to inject value help annotations into the standard service. As result the value helps were assigned to the new Z properties in the OData entity ( which I added previously within the confines of CDS View extension) . This demands manual value help list data retrieval (I was almost going to do the same like you did, and in lot of cases you don't have any other choice, but finally after some trial,It worked).


To enhace standard via the this lane and through contrainted marriage of CDS, BOPF with Gateway by SADL is quite stressful to enhance safely. I hope the new RAP model brings something new in terms of extensibility to the plate. Anyway it is very promising, because it is designed to solve the most painful points. There is easy to play in different layers on top of standard implementations , but I don't still know how to realize there enhancements instead of new service definition, because there is no such at the moment, and we cannot track standard changes with new releases automatically. At the moment no information about enhancement concept in RAP.

In thel ast 5-6 years we had to deal with variety of approaches to enhance the standard Fiori apps, all different methods due the standard implementations improved and realized differently. Just looking at HCM Fiori apps, or ERP apps and S/4 apps with BOPF, all different solutions in terms of UI and backend implementation combination and solution. It requires a men to solve all customer needs in thet fast changing environment. But I saw you taken up the challenge like me :D.


Here are the enhancments I did in the standard service, Cheers, Attila:

1. Added implicit enhencement at the end of the standard service Model Provider Extension class
CL_MD_C_PRODUCT_MAINTA_MPC_EXT->DEFINE:

ENHANCEMENT 2  .
  zcl_star_ext=>define_mpc_ext(
    EXPORTING
      i_model = model
      i_anno_model = vocab_anno_model
  ).
ENDENHANCEMENT.

2. Added implicit enhencement ath the end of standard service Data Provider Extension

CL_MD_C_PRODUCT_MAINTA_DPC_EXT->/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET

ENHANCEMENT 2  .
    TRY.
        zcl_star_ext=>get_entityset_dpc_ext(
          EXPORTING
            i_entity_name           = iv_entity_name
            i_entity_set_name       = iv_entity_set_name
            i_source_name           = iv_source_name
            i_filter_select_options = it_filter_select_options
            i_order                 = it_order
            i_paging                = is_paging
            i_navigation_path       = it_navigation_path
            i_key_tab               = it_key_tab
            i_filter_string         = iv_filter_string
            i_search_string         = iv_search_string
            i_tech_request_context  = io_tech_request_context
          IMPORTING
            e_entityset             = er_entityset
            e_response_context      = es_response_context
            e_request_processed     = DATA(zz_processed)
        ).

        IF zz_processed = abap_true.
          RETURN.
        ENDIF.
      CATCH cx_root.
    ENDTRY.
ENDENHANCEMENT.


3. The class/methods invoked on static manner within the enhancements as follows:

zcl-star-ext.txt