cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Add Value Help to SAP Fiori Elements App

Attila
Active Participant
12,265

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

Accepted Solutions (1)

Accepted Solutions (1)

Attila
Active Participant

I tried to alter the lv_sadl_xml file extending with the Halue Help CDS View unsuccessfully. The values were not derived from the CDS, but instead the system raised an error for missing get_entityset method implementation for the CDS View. The time spent and the and complexity to to alter the SADL XML with XML nodes processing was too much. Not really transparent at all, therefore I decided to manually enhance the MPC_EXT and DPC_EXT classes to implement everything with one concept, and to have a clean implementation, due the SADL Model Exposure interface (ro_model_exposure) does not let drive and control externally. There are BAdI-s, but can be implemented by SAP internally only. I added enhancements at the end of the _MPC_EXT->define() and start of _DPC_EXT->/iwbep/if_mgw_appl_srv_runtime~get_entityset() methods.

Here all the well known model and annotation definition can be added, referring SADL CDS Entities and Properties. I created manually an entity and entityset in define method+ added these as Common.ValueList annotations also here. After I implemented the select at the beginning of get_entytyset to populate data. So the goal was achiedved, but not from the CDS and SADL side with data modelling, but with programming of Model and Data. After the dropdown list appeared in the standard app.

Best regards

Attila

0 Likes

Hi Attila,

Thanks for sharing the details.. I followed your approach, on the search help the column headings are missing.The values are populated are correctly. secondly free style search function for the field is not working any annotation to make it available.

Did you managed to find any standard helper class to generate the value help entity.

Thanks,

Jo.

0 Likes

Hello Atilla,

Thank you for sharing,

I followed your solution and It worked for 3 fields and it is not working for another field. This is strange!

I am getting a blank list and this error in the console List Binding is not bound against a list for /ZC_shipToPaty_vh and EntityType for path /ZC_shipToPaty_vh could not be found!.

I can see the entity type ZC_shipToPaty_vhType in the metadata. however, If I run the app and I check the metadata in network I only found the 3 new entity types not 4! I can see the association there but not the entity type ZC_shipToPaty_vhType.

I am kinda confused. Could you please help.

Best Regards,

Chiraz.

Answers (3)

Answers (3)

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

0 Likes

Hi Attila,

Not worked for me also.

I also tried in the same manner, but i found newly added value help(entity set) is not being called in DPC_EXT enhancement when i load standard application, so data in value help is not getting appeared. If value help entity set flows into DPC_EXT enhancement then we can see values in standard app search help.

I am not able to figure it out where i missed.

former_member750083
Discoverer
0 Likes

Dear attila.berencsi,

Thank you so much for the sharing the implicit enhancement idea and codes.

I tried doing in same way, its reflecting in metadata as well, But still my value help is not getting displayed.

Kindly Help. The codes and metadata is attached mpc-class-code-enhancement.txt

new-metadata-for-value-help.png