Skip to Content

BOPF : Dialog box with comments from Action Button in Fiori List Report

Hello,

We have created action buttons using BOPF in CDS and we are able to perform action using our Fiori custom app to change the status in backend. Below are the steps :

  1. Open the List report app, select the row -> Perform action on click of button.
  2. Popup opens, enter comments and comment is saved as long text in Backend transaction. This popup is not created in UI5, BOPF framework auto generates the dialog box to enter the comments. The field in the dialog box comes from structure which is mapped in Importing parameter in BOBX transaction.

Now the issue is :

The input field area is very small, and we want to increase the area to enter the text so that user can see the text properly. (Similar to text area in UI5, scrollable).

Thanks, let us know in comments below.

(Update) : Action method works fine as expected. Comment is properly updated in long text.

/BOBF/IF_FRW_ACTION~EXECUTE

bopf-action.jpg

Oliver Jaegle Xinyu Shu Alfred Barzewski Jocelyn Dart Request your assistance here.

bopf-action.jpg (19.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 27, 2018 at 08:21 AM

    Hey,

    you can try the following:

    When you add the multiline annotation to the function import's parameter, the corresponding UI control should be rendered as multiline text area.

    The annotation looks as follows:

    <Annotations Target="Description">
        <Annotation Term="com.sap.vocabularies.UI.v1.MultiLineText"/>
    </Annotations>

    The target of the annotation is - as said - the path the the function import's parameter.

    This is now the "OData-only way" of defining it.

    I unfortunately have no idea how that needs to be annotated on CDS level.

    Somebody out there who can help out?

    BR
    Alex

    Add comment
    10|10000 characters needed characters exceeded

    • Hey Alex, That's great solution, though i achieved this using custom ui5 code of disabling the function import dialog and overriding it with ui5 dialog (sap.m.dialog).

      I tried this in my annotation modeler to attach this to my action coming from CDS BOPF. But I still see the string input. May be i am missing something ? Added MultiLineText = true

      Will update if this works out.

      Regards,

      Tejas

  • Jan 07 at 02:29 PM

    Hi Tejas

    If you want to annotate a function import parameter you will have to describe the target as follows:

    <Annotations Target="{AppNamespace}.{AppNamespace}_Entities/{FunctionImport}/{Parameter}">
      <Annotation Term="com.sap.vocabularies.UI.v1.MultiLineText"/>
    </Annotations>

    For example, if you have an application generated by a CDS consumption view named Z_C_MyView and a BOPF action ADD_COMMENT for the corresponding node with a parameter structure that holds the field COMMENT, the generated application namespace will be Z_C_MYVIEW_CDS and the name of the function import will be Z_C_MyViewAdd_comment.
    Then the target will be as follows: Z_C_MYVIEW_CDS.Z_C_MYVIEW_CDS_Entities/Z_C_MyViewAdd_comment/Comment

    In the annotation modeler you will have to switch to the code editor in order to add such an annotation. The better way to achieve this is by the MPC (for the above example SADL would have generated a class named ZCL_Z_C_MYVIEW):

    DATA(lo_ann_target) = vocab_anno_model->create_annotations_target( iv_target = 'Z_C_MYVIEW_CDS.Z_C_MYVIEW_CDS_Entities/Z_C_MyViewAdd_comment/Comment' ).
    lo_annotation = lo_ann_target->create_annotation( iv_term = 'com.sap.vocabularies.UI.v1.MultiLineText' ).
    

    Regards
    Gabriel

    Add comment
    10|10000 characters needed characters exceeded