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

No Edit Button when open object page via custom action (Button) RAP, BTP, ABAP Environment

sebastian_wilhelm1
Participant
0 Likes
2,433

Hi Experts!

I created a custom action with abstract entity (Button: open Product opening a popup) to select and display an entity on an object page.

I implemented a method for the action with some dummy-data.

I tried somethind like %action-edit but the the variable %action is not availabe there.

I can display the object page but the fields are not editable.

Any ideas how I can make the object page editable?

Thanks,

Sebastian

Accepted Solutions (0)

Answers (3)

Answers (3)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Likes

You can use the following syntax in the BDEF or your R-view

internal create;
update;
delete;

and in the BDEF of your projection or interface view you would have to comment out the use create; statement.

// use create;
use update;
use delete;
sebastian_wilhelm1
Participant
0 Likes

Hi Andre!

I tried the coding for managed, unmanaged and custom entity (also unmanaged). Clicking on the custom "createRun" button in the unmanaged scenarios, the object page is still not editable (my initial problem). Clicking on the button in the managed scenario, the page is shown in "edit mode" (with a edit and a save button). But as described above, there must no create or save button.

Is it possible to display an editable object page without a save or create button? There are scenarios, where you don't want to create or save something. Just processing some data. I'm thankful for any information. I'm struggeling whith this since weeks.

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Sebastian,

thank you very much for the nice feedback about my generator :-).

The scenario that you describe sounds like it could be tackeld by using a custom entity.

The custom entity could be used to retrieve the data from the connected on-prem system. (So I assume you are building the app in a Steampunk system ?).

A custom entity could also have the option to deliver some sample data.

How to implement a custom entity in the ABAP RESTful Programming Model using remote function modules...

In the above mentioned blog I used a demo mode in case no real backend is connected.

My generator would also be able to generate a RAP BO based on custom entities provided you define the datasource as an abstract entity.

A second option could be that you use so called virtual elements in your entity. The data for these virutal fields are also calculated by an ABAP class.

Kind regards,

Andre

IF lv_abap_trial = abap_true.
              "fill table with demo data
              lt_product = VALUE #( ( productid = 'HT-1000' name = 'Notebook' )
                                    ( productid = 'HT-1001' name = 'Aotebook' )
                                    ( productid = 'HT-1002' name = 'Notebook' )
                                    ( productid = 'HT-1003' name = 'Notebook' )
                                    ( productid = 'HT-1004' name = 'Notebook' )
                                    ( productid = 'HT-1005' name = 'Notebook' )
                              ).
ELSE.
              CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_LIST'
                DESTINATION lv_rfc_dest_name
*          EXPORTING
*            max_rows              =
                TABLES
                  headerdata            = lt_product
                  selparamproductid     = lt_filter_ranges_productid
                  selparamsuppliernames = lt_filter_ranges_supplier
                  selparamcategories    = lt_filter_ranges_category
                  return                = lt_return.
 ENDIF.
sebastian_wilhelm1
Participant
0 Likes

Hi Andre!

Thanks for the example. I already tried the approach with a custom entity, but the problem stays the same - the display of the create button.

I need an editable object page without a create or save button, as there is nothing to save or create. The user can fill the fields manually or fill them via choosing a Dataset from DB and by pressing a Button "Assemble Product" I'm calling a BAPI on a customer on-premise. Everything works fine so far, except for the display of the button, which is just confusing the user.

Do you have any Ideas? Is this scenario so uncommen? A scenario, where a user can edit the fields in a mask but don't creat or save any dataset.

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Sebastian,

I have created a simple sample myself using a static action to reproduce your problem.

The reason why no edit button is there, is because you have not created an entity with your implementation shown above.

The framework will try to read data from the RAP BO based on the keys that are returned in the result return table.

You would first have to use EML to create a new entity in your RAP business object.

Then you can use the keys returned in mapped to fill the result return table.

Hope this helps.

Kind regards,

Andre

  METHOD createSalesOrder.


    DATA create_sales_order TYPE TABLE FOR CREATE ZR_SalesOrderTP_ACT.
    DATA sales_order_id TYPE i.


    LOOP AT keys INTO DATA(ls_key).


      sales_order_id += 1.


      APPEND INITIAL LINE TO create_sales_order ASSIGNING FIELD-SYMBOL(<create_sales_order_line>).


      <create_sales_order_line>-%cid = ls_key-%cid.
      <create_sales_order_line>-%is_draft =  if_abap_behv=>mk-on.
      <create_sales_order_line>-SalesorderID = sales_order_id.
      <create_sales_order_line>-Description = |Test { sales_order_id }|.




    ENDLOOP.


    MODIFY ENTITIES OF ZR_SalesOrderTP_ACT IN LOCAL MODE
            ENTITY SalesOrder
            CREATE FIELDS ( SalesorderID Description )
                  WITH create_sales_order
            MAPPED   mapped
            FAILED   failed
            REPORTED reported.


    LOOP AT mapped-salesorder INTO DATA(mapped_sales_order).
      APPEND VALUE #( %cid = mapped_sales_order-%cid
                      %param = VALUE #( %is_draft = mapped_sales_order-%is_draft
                                        %key      = mapped_sales_order-%key ) ) TO result.
    ENDLOOP.


  ENDMETHOD.



sebastian_wilhelm1
Participant
0 Likes

Hi Andre,

thanks for you support. Unfortunately the logic only works for managed scenarios. I have an unmanaged scenario.

My actual task is an object page with a button that triggers data processing in a connected on-premise system. The data records can either be loaded from the DB/entity or entered directly. This means that saving the data is not intended or desired. Therefore, no Create or Save button should be displayed. Do you have any idea how such a scenario can be implemented?

Best regards,

Sebastian

By the way, thank you for the RAP Generator and your blog posts! These are an invaluable help to me.