cancel
Showing results for 
Search instead for 
Did you mean: 

Error msg during Factory Action - Copy execute in RAP application (BTP)

Neil_Lee_057
Explorer
0 Kudos
257

Dear Experts,

BTP - ABAP Environment

I am currently testing the Factory Action - Copy of RAP.

When I select a record in the ListReport screen and click the CopyInstance button, it automatically navigates to the ObjectPage, which is in Draft status.

After clicking Save and returning to the ListReport, if I select the same record again and click the CopyInstance button, the error shown in the attached image appears.

Neil_Lee_057_0-1710833592518.png

Neil_Lee_057_1-1710833632614.pngNeil_Lee_057_2-1710833683245.png

 

However, the Copy action still executes successfully.

I would like to confirm the cause of this issue.

 

Please find the reference code snippet below.

factory action copyInstance[1];
 METHOD copyInstance.

    DATA: lt_head TYPE TABLE FOR CREATE znei_guia02head.

    READ ENTITIES OF znei_guia02head IN LOCAL MODE
    ENTITY a02head
    ALL FIELDS WITH CORRESPONDING #( keys )
    RESULT DATA(Headers)
    FAILED DATA(Faileds).

    LOOP AT Headers ASSIGNING FIELD-SYMBOL(<lfs_header>).

      APPEND VALUE #(
                      %cid = keys[ KEY entity %key = <lfs_header>-%key ]-%cid
                      %is_draft = keys[ KEY entity %key = <lfs_header>-%key ]-%param-%is_draft
                      %data = CORRESPONDING #( <lfs_header> EXCEPT HeadID )
       ) TO lt_head ASSIGNING FIELD-SYMBOL(<lfs_newHeader>).

    ENDLOOP.

    MODIFY ENTITIES OF znei_guia02head IN LOCAL MODE
    ENTITY a02head
    CREATE FIELDS ( Canl SumFg criticality3 NetFg Bukrs Belnr Budat Mwskz Hwbas Hwste )
    WITH lt_head
    MAPPED DATA(mapped_create).

    mapped-a02head = mapped_create-a02head.

  ENDMETHOD.

 

View Entire Topic
Maciej__Galica
Explorer
0 Kudos

Hello @Neil_Lee_057 ,

below are the following points I would check:
1. Factory data action is to be given in UI.Identification For Ex. type: #FOR_ACTION, label:'Copy', dataAction: 'copy' or at UI.Lineitem depending on where you want to position it.
2. Check if Redirection to parent is working as expected in the entity.
3. Check if alias mapping is properly assigned.