13

How to populate custom field for app Manage Customer Line Items ?

 1 year ago
source link: https://answers.sap.com/questions/13611272/how-to-populate-custom-field-for-app-manage-custom.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Mar 25, 2022 at 10:47 AM

How to populate custom field for app Manage Customer Line Items ?

783 Views

I'm trying to populate a custom field in the Manage Customer Line Items app. I've redefined method ITEMSET_GET_ENTITYSET to loop over the entity set to update the custom field, but the changes are not reflected in the Fiori App where the custom field remains blank. However, updating any standard field (like ASSIGNMENTREFERENCE) does work.

Here are the steps I've followed so far:

Create APPEND structure to FAR_IFIARLINEITEM_EX containing custom field ZZTXT.

Create APPEND structure to INCL_EEW_FAR_CLI_ITEM_MD containing custom field ZZTXT.

Create SEGW project ZFAR_CUSTOMER_LINE_ITEMS and redefine data model of OData service (SAP GW) FAR_CUSTOMER_LINE_ITEMS.

Add a custom property ZZTXT to the "Item" entity type, ABAP field matching the custom field. "Creatable" "updatable" "sortable" "filterable" and "nullable" are unchecked.

Redefine ZCL_ZFAR_CUSTOMER_L_01_DPC_EXT~ITEMSET_GET_ENTITYSET to call the super method, loop over the entityset and update the ZZTXT.

Activate the project in SEGW (without errors).

This is the code in the redefined ITEMSET_GET_ENTITYSET method:

 method ITEMSET_GET_ENTITYSET.

CALL METHOD super->itemset_get_entityset
EXPORTING
iv_entity_name = iv_entity_name
iv_entity_set_name = iv_entity_set_name
iv_source_name = iv_source_name
it_filter_select_options = it_filter_select_options
is_paging = is_paging
it_key_tab = it_key_tab
it_navigation_path = it_navigation_path
it_order = it_order
iv_filter_string = iv_filter_string
iv_search_string = iv_search_string
io_tech_request_context = io_tech_request_context
IMPORTING
et_entityset = et_entityset
es_response_context = es_response_context.
* loop at result set and calculate the new field(s)
LOOP AT et_entityset ASSIGNING FIELD-SYMBOL(<fs_es>).
<fs_es>-zztxt = 'TEST 1234'.
<fs_es>-assignmentreference = 'ABABA'.
ENDLOOP.
endmethod.
1 comment
Dec 01, 2022 at 04:06 AM

Hi Mathieu,

We have similar requirement, when you redefined the data model, have you picked all the models from the service FAR_CUSTOMER_LINE_ITEMS or only redefining the item models is sufficient.

I tried to redefine only the items models with overwrite base or extended service option , the additional field are visible but after that the search help on the standard fields on the app stop working.

Thanks,

Jino.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK