<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Function import is not unique for actions in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700412#M4765571</link>
    <description>&lt;P&gt;Hi Andre, &lt;/P&gt;&lt;P&gt;ZIS_I_Training hasn't been published in the service defintion but has been used as a value help in one of the published views. After I corrected this, duplicate action error is not there any more and everything works fine. Thanks a lot for help. &lt;/P&gt;&lt;P&gt;Kind regards, &lt;BR /&gt;Ivan&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2023 09:19:39 GMT</pubDate>
    <dc:creator>ivansofronic</dc:creator>
    <dc:date>2023-05-09T09:19:39Z</dc:date>
    <item>
      <title>Function import is not unique for actions</title>
      <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaq-p/12700405</link>
      <description>&lt;P&gt;I am playing around with RAP so I created some demo app. I defined root entity ZIS_I_Training and projection of it in ZIS_C_Training. &lt;/P&gt;
  &lt;P&gt;Here is the definition of these entities&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;define root view entity ZIS_I_Training&lt;BR /&gt; as select from zis_a_training as Training&lt;BR /&gt; composition [0..*] of ZIS_I_Participant as _Participant&lt;BR /&gt; composition [0..*] of ZIS_I_TrainingTask as _Task&lt;BR /&gt; association [1..1] to ZIS_I_Status as _Status on $projection.Status = _Status.Status&lt;BR /&gt;{&lt;BR /&gt; @ObjectModel.text.element: ['Name']&lt;BR /&gt; @Search.defaultSearchElement: true&lt;BR /&gt; key training_uuid as TrainingUuid,&lt;BR /&gt; @Search.defaultSearchElement: true&lt;BR /&gt; name as Name,&lt;BR /&gt; @Search.defaultSearchElement: true&lt;BR /&gt; @ObjectModel.foreignKey.association: '_Status'&lt;BR /&gt; @Consumption.valueHelpDefinition: [{entity:{name: 'ZIS_I_Status', element: 'Status' }}]&lt;BR /&gt; status as Status,&lt;BR /&gt; valid_to as ValidTo,&lt;BR /&gt; created_by as CreatedBy,&lt;BR /&gt; created_at as CreatedAt,&lt;BR /&gt; last_changed_by as LastChangedBy,&lt;BR /&gt; last_changed_at as LastChangedAt,&lt;BR /&gt; local_last_changed_at as LocalLastChangedAt,&lt;BR /&gt; /* Associations */&lt;BR /&gt; _Participant,&lt;BR /&gt; _Status,&lt;BR /&gt; _Task&lt;BR /&gt;}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Here is the projection:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@EndUserText.label: 'Training projection view'&lt;BR /&gt;@AccessControl.authorizationCheck: #NOT_REQUIRED&lt;BR /&gt;@Metadata.allowExtensions: true&lt;BR /&gt;@Search.searchable: true&lt;BR /&gt;define root view entity ZIS_C_Training&lt;BR /&gt; provider contract transactional_query&lt;BR /&gt; as projection on ZIS_I_Training&lt;BR /&gt;{&lt;BR /&gt; @Search.defaultSearchElement: true&lt;BR /&gt; key TrainingUuid,&lt;BR /&gt; @Search.defaultSearchElement: true&lt;BR /&gt; Name,&lt;BR /&gt; @Search.defaultSearchElement: true&lt;BR /&gt; @ObjectModel.text.element: ['StatusText']&lt;BR /&gt; Status,&lt;BR /&gt; ValidTo,&lt;BR /&gt; @Search.defaultSearchElement: true&lt;BR /&gt; CreatedBy,&lt;BR /&gt; CreatedAt,&lt;BR /&gt; LastChangedBy,&lt;BR /&gt; LastChangedAt,&lt;BR /&gt; LocalLastChangedAt,&lt;BR /&gt; _Status._Text.StatusText as StatusText : localized,&lt;BR /&gt; _Participant : redirected to composition child ZIS_C_Participant,&lt;BR /&gt; _Task : redirected to composition child ZIS_C_TrainingTask,&lt;BR /&gt; _Status &lt;BR /&gt;}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I think that definition of associated entites is not relevant for the problem, so I will not write it here. &lt;/P&gt;
  &lt;P&gt;I wanted to check how would it be possible to grab the input from the user described in the &lt;A href="https://blogs.sap.com/2021/01/18/abap-rap-enabling-custom-actions-with-a-dialog-with-additional-input-fields/"&gt;Blog post&lt;/A&gt;, so I introduced new action extendValidity and defined behavior for the interface entity as follows:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;managed implementation in class zbp_is_i_training unique;&lt;BR /&gt;strict ( 2 );&lt;BR /&gt;define behavior for ZIS_I_Training alias Training&lt;BR /&gt;persistent table zis_a_training&lt;BR /&gt;lock master&lt;BR /&gt;authorization master ( instance )&lt;BR /&gt;etag master LocalLastChangedAt&lt;BR /&gt;{&lt;BR /&gt; create;&lt;BR /&gt; update;&lt;BR /&gt; delete;&lt;BR /&gt; association _Participant { create; }&lt;BR /&gt; association _Task { create; }&lt;BR /&gt; action extendValidity parameter ZIS_I_TrainExtend result [1] $self;&lt;BR /&gt; field ( numbering : managed, readonly ) TrainingUuid;&lt;BR /&gt; field ( readonly ) CreatedBy, CreatedAt, LastChangedBy, LastChangedAt, LocalLastChangedAt;&lt;BR /&gt; field ( mandatory ) Name;&lt;BR /&gt; determination setInitialValues on modify { create; }&lt;BR /&gt; determination setReadFieldOnChange on save { field Name; field Status; }&lt;BR /&gt; mapping for zis_a_training&lt;BR /&gt; {&lt;BR /&gt; TrainingUuid = training_uuid;&lt;BR /&gt; Name = name;&lt;BR /&gt; Status = status;&lt;BR /&gt; ValidTo = valid_to;&lt;BR /&gt; CreatedBy = created_by;&lt;BR /&gt; CreatedAt = created_at;&lt;BR /&gt; LastChangedBy = last_changed_by;&lt;BR /&gt; LastChangedAt = last_changed_at;&lt;BR /&gt; LocalLastChangedAt = local_last_changed_at;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;and the projection&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;projection;&lt;BR /&gt;strict ( 2 );&lt;BR /&gt;define behavior for ZIS_C_Training alias Training&lt;BR /&gt;use etag&lt;BR /&gt;{&lt;BR /&gt; use create;&lt;BR /&gt; use update;&lt;BR /&gt; use delete;&lt;BR /&gt; use action extendValidity;&lt;BR /&gt; use association _Participant { create; }&lt;BR /&gt; use association _Task { create; }&lt;BR /&gt;}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;The problem is that I am getting following error after I enter date in the popup window and confirm input. &lt;/P&gt;
  &lt;P&gt;Error is: Function import 'extendValidity' is not unique for actions ZIS_I_TRAINING-EXTENDVALIDITY and ZIS_C_TRAINING-EXTENDVALIDITY&lt;/P&gt;
  &lt;P&gt;What should be the reason for this?&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 13:54:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaq-p/12700405</guid>
      <dc:creator>ivansofronic</dc:creator>
      <dc:date>2023-05-03T13:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Function import is not unique for actions</title>
      <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700406#M4765565</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;andre.fischer&lt;/SPAN&gt; do you maybe have a hint? &lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 10:00:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700406#M4765565</guid>
      <dc:creator>ivansofronic</dc:creator>
      <dc:date>2023-05-04T10:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Function import is not unique for actions</title>
      <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700407#M4765566</link>
      <description>&lt;P&gt;One addition. I've just added feature control for this action and implemented it&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action ( features : instance ) extendValidity parameter ZIS_I_TrainExtend result [1] $self;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and now there is another error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Action name: 'extendValidity' already exists&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;By debugging I see that loads both entites, ZIS_I_Training and projection of it, ZIS_C_Training and therefore it thinks that action already exists. Shouldn't it load only action from ZIS_C_Training?&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 10:45:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700407#M4765566</guid>
      <dc:creator>ivansofronic</dc:creator>
      <dc:date>2023-05-04T10:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Function import is not unique for actions</title>
      <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700408#M4765567</link>
      <description>&lt;P&gt;I've just tried to create OData V4 service and found out that this works perfectly fine. Maybe this will help someone who has the same problem. Still, would be interested to know how to solve this for OData V2. &lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 14:06:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700408#M4765567</guid>
      <dc:creator>ivansofronic</dc:creator>
      <dc:date>2023-05-04T14:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Function import is not unique for actions</title>
      <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700409#M4765568</link>
      <description>&lt;P&gt;Which release are you working on ? &lt;BR /&gt;SAP BTP ABAP Environment or SAP S/4HANA on premise (e.g. 2022) ?&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 08:40:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700409#M4765568</guid>
      <dc:creator>Andre_Fischer</dc:creator>
      <dc:date>2023-05-05T08:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Function import is not unique for actions</title>
      <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700410#M4765569</link>
      <description>&lt;P&gt;SAP S/4HANA on premise 2022&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 09:13:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700410#M4765569</guid>
      <dc:creator>ivansofronic</dc:creator>
      <dc:date>2023-05-05T09:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Function import is not unique for actions</title>
      <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700411#M4765570</link>
      <description>&lt;P&gt;Hi Ivan,&lt;/P&gt;&lt;P&gt;have you published ZIS_I_TRAINING as well as the projection ZIS_C_TRAINING in your service definition?&lt;/P&gt;&lt;P&gt;If yes, try to remove ZIS_I_TRAINING.   &lt;/P&gt;&lt;P&gt;Another possible reason could be that ZIS_I_TRAINING is used as a value help of one of the published views?&lt;/P&gt;&lt;P&gt;Kind regards, &lt;/P&gt;&lt;P&gt;Andre&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 13:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700411#M4765570</guid>
      <dc:creator>Andre_Fischer</dc:creator>
      <dc:date>2023-05-08T13:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Function import is not unique for actions</title>
      <link>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700412#M4765571</link>
      <description>&lt;P&gt;Hi Andre, &lt;/P&gt;&lt;P&gt;ZIS_I_Training hasn't been published in the service defintion but has been used as a value help in one of the published views. After I corrected this, duplicate action error is not there any more and everything works fine. Thanks a lot for help. &lt;/P&gt;&lt;P&gt;Kind regards, &lt;BR /&gt;Ivan&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 09:19:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/function-import-is-not-unique-for-actions/qaa-p/12700412#M4765571</guid>
      <dc:creator>ivansofronic</dc:creator>
      <dc:date>2023-05-09T09:19:39Z</dc:date>
    </item>
  </channel>
</rss>

