Quantcast
Channel: SCN : Blog List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 195

Table Enhancements for AET Views

$
0
0
Several Business requirements require some Z table or view to be created on Accounts or contacts page or in any Assignment block like relationship block in Accounts page. On create of new record in or change of the new record if you need to display some information or you need to capture some change time or created time. This document is meant for guiding the users to achieve the functionality.
Requirement
In the relationship Block of Account page, AET generated Table or view is placed with 4 fields in it
1. Wscode
2. Default(flag)
3. Created date
4. Created Time
When a Record is inserted the created date should be captured automatically.
When a Record is changed the changed date should be captured automatically.
When Record is created and no value is given in the field WScode an error message should populate.
Relationship Assignment Block:
View Name: Test (AET Generated)
1.jpg
Underlying Table Generated: ZATAB00000N
2.jpg
AET generated Component: ZDEX/test_MAIN
3.jpg
You can achieve the functionality by 2 ways

Approach 1:
(Using the BADI) (Best Approach)
Enhancement Spot: AXT_RT_TABLES
BADI: AXT_RT_TABLES.
Create your own implementation 'Z' class and BADI:
4.png
Give the table name in the filter value. (The BADI should only trigger for this AET table and not others)5.jpg
Now click on insert button, so new record or row gets generated, enter the value of wscode and enter or press on done.
The value of the field created on should automatically get triggered as todays date sy-datum.
Go to the Method:
IF_EX_AXT_RT_TABLES_API~ON_CREATE :
Define the field symbol for the wscode and created date and assign them to the respective fields.
Now check if the wscode is not initial and then assign the field symbol for the created date to sy-datum.
6.jpg
Now in Web UI:
7.png
External Break Point:
9.jpg
10.png
Created date Populated.
Underlying Table will have the record value:
11.png
Code in the Interface IF_EX_AXT_RT_TABLES_API~ON_CHANGE:
12.png
Underlying table has the changed date value stored and the change method of the BADI gets triggered.
13.png
Code in the Interface IF_EX_AXT_RT_TABLES_API~ON_CHANGE:
15.png
If you want to display error, if the wscode value is NULL, then code in method.
IF_EX_AXT_RT_TABLES_API~CHECK.
16.png
Output on UI:
17.png
2nd approach:
Using the SET and GET methods.
You can create an event on select and try to caputure date and time.
Best way is to use the BADI and its always easy.

Viewing all articles
Browse latest Browse all 195

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>