Esse recurso foi utilizado pq o serviço FAR_CUSTOMER_LINE_ITEMS não estava disponível no contexto comercial FINS_JOURNAL_ENTRY_ITEM para fazer via "Campo e Lógica Personalizado" no fiori.
Já avisando q não é uma GAMBIARRA, a SAP tem essa instrução nas notas : 0003431912 e 0003405214.
Existe um doc. em PDF com as instruções.
- Criar append structure na estrutura FAR_IFIARLINEITEM_EX (para caso de cliente)
Colocar outro nome para extended view, não é a mesma do append feito na estrutura acima
No meu caso queria o valor de um campo q já existe na tabela standard, ANFBN
no método IF_SADL_GW_EXTENSION_CONTROL~SET_EXTENSION_MAPPING
Inicio do método
*********
IF iv_entity_set_name = 'Items'.
io_extension_mapping->set_property_mapping(
it_property_mapping = VALUE #(
( property_abap_name = 'ZSOLICITACAO_LC'
business_entity_element = 'SOLICITACAOLC' ) )
).
ENDIF.
- Criar Enhancment na classe CL_FAR_CUSTOMER_LINE_I_MPC_EXT
no método DEFINE - no final do método
lo_entity_type = model->get_entity_type( 'Item' ).
lo_property = lo_entity_type->create_property( iv_property_name = 'ZSOLICITACAO_LC' iv_abap_fieldname = 'ZSOLICITACAO_LC' ). "#EC NOTEXT "#EC NOTEXT
lo_property->set_type_edm_string( ).
lo_property->set_maxlength( iv_max_length = 4 ).
lo_property->set_creatable( abap_false ).
lo_property->set_updatable( abap_false ).
lo_property->set_sortable( abap_true ).
lo_property->set_nullable( abap_true ).
lo_property->set_filterable( abap_true ).
lo_entity_type->bind_structure( iv_structure_name = 'FAR_IFIARLINEITEM_EX' iv_bind_conversions = 'X' ). "#EC NOTEXT
lo_entity_type->set_semantic( /iwbep/if_ana_odata_types=>gcs_ana_odata_semantic_value-query-aggregate ).
lo_property = lo_entity_type->get_property( 'ZSOLICITACAO_LC' ).
lo_annotation = lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=>gc_sap_namespace ).
lo_annotation->add( iv_key = /iwbep/if_ana_odata_types=>gcs_ana_odata_annotation_key-aggregation_role
iv_value = /iwbep/if_ana_odata_types=>gcs_ana_odata_annotation_value-dimension-dimension ).
Limpar o cache antes de abrir o app no fiori
/n/IWBEP/CACHE_CLEANUP
/n/IWFND/CACHE_CLEANUP
Nenhum comentário:
Postar um comentário