In last blog, http://scn.sap.com/community/aif/blog/2014/12/26/enhancement-toolbar-on-view3-and-view5-for-monitoring-and-error-handling-in-aif,

I wrote how to enhance toolbar on View3. Today, i`d like enhance the editability of cells on View3.

As you know, we could set cells editable or not by Customizing,

/AIF/CUST -> Error Handling  -> Define Interface-Specific Features/Define Namespace-Specific Features -> Define Changeable Fields.

Except this, we could do more by implement BADI ‘/AIF/V5_CHANGEABLE_FIELDS’, like according record type to set editable,

or according a certain value of other cells to set current cell editable. Let`s do it.

1, Create BADI Implementation,  ‘/AIF/V5_CHANGEABLE_FIELDS’.

/wp-content/uploads/2015/01/2_621021.png

2, There are three methods, which is independence.

/wp-content/uploads/2015/01/3_621023.png

4,  The Method ‘INIT’, it is called before every displaying data. we could write code in it like below:

  /wp-content/uploads/2015/01/4_621037.png

The result as below, ‘ADD_DATA1’ the whole column become editable. ‘ADD_DATA_KEY’ is editable, due to i set it in Customizing:

  /wp-content/uploads/2015/01/5_621045.png

5, The method ‘GET_FIELDS_PER_RECTYPE’, will be called for record type under structure in View2.

    CR_DATA containing the whole data of current message which you double click.

   6.PNG

   The result as below, ‘ADD_DATA2’ become editable:

   7.PNG

6, The method ‘GET_FIELDS_PER_LINE’, will be called for each data in View3. CT_DATA is current data in View3.

    How many data rows in View3, this method will be called how many times. In my example, it will be called twice.

8.PNG

  The result as below, ‘ADD_DATA3’ column, only the cell which ‘ADD_DATA1’ equal ‘CNN’ become editable :

/wp-content/uploads/2015/01/9_621059.png

With this BADI, you could dynamical set cells editable, it make Error Handling more flexible. 🙂

Regards,
Archer

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply