Additional info on S2 View / S3 View In Fiori Apps
Problem: We wanted to show additional details on the left pane where the document number is displayed like What is the value of the document and who created it etc.Although this information is shown on the right side but when user logs in to the system via Mobile app only the left navigation pane is shown and it would save time if the approver knows with a glance at it as to which document should be approved on priority.
Analysis: I did a thorough analysis and there was an option to extend the Odata services or adding more information from Web Ide which was quite a bit of a challenge specifically for the MY inbox app as it has information received from different other systems.
The View on the left side is S3 Summary View and on the right side is S2 detail view
The My inbox app in particular has a lot of services which are coming from the different versions of app like my SC , My Purchase orders etc. .. and hence makes it a bit complicated to be able to provide a solution for this .
There can be multiple ways of realizing this change but I found this one to be the easiest.
Solution : I referred the App extensibility document http://help.sap.com/fiori_bs2013/helpdata/en/dd/fc595461fce630e10000000a44538d/content.htm
In that look for Section ‘BAdIs in the Gateway System’ I found in the App extensibility document 2 BADI’s which can be used as below:
- Task Gateway: Change subject in query (/IWPGW/BADI_TGW_TASK_QUERY)
You can use this BAdI to change the task title for all items on the list screen.
- Task Gateway: Modify task data (/IWPGW/BADI_TGW_TASK_DATA)
You can use this BAdI to change the task title or task description on the detail screen.
Now we need to ensure that both the BADI’;s are being used .
- During initial Launch When we launch the URL for the my Inbox app It triggers the BADI interface it will list all inbox items .
This is the trigger point for below BADI
BADI : /IWPGW/IF_TGW_TASK_QUERY and
Method : /IWPGW/IF_TGW_TASK_QUERY~MODIFY_ITEMS
Pass new data in CT_MODIFIED_TASKS which lists all task in inbox
- Click on any Inbox Item When you click on any of the items it will then trigger the BADI interface as mentioned below
BADI : /IWPGW/BADI_TGW_TASK_DATA
Method : /IWPGW/IF_TGW_TASK_DATA~MODIFY_TASK_TITLE
Pass new data in CV_TASK_TITLE it is a single value since user selects one task at a time.
If you want to show additional information in the right pane as well we can use the other methods of this BADI also .
To be able to edit the data on the left Pane you ideally would need to write the same piece of code in both the BADI’s.I faced an issue still when tried using these BADI and was fixed by the below note released by SAP to fix the issue in the BADI behavior.
NOTE 2299362 – BADI implementation of /IWPGW/BADI_TGW_TASK_DATA returns wrong values in case of $expand request
Current Scenario: If your backend and gateway system is in the same box things become easier but in my case we had it in different boxes so we had to call the FM to fetch additional details like BAPI_CONTRACT_GETDETAIL and BAPI_PO_GETDETAIL etc
Sometimes you will not find the structure type in the gateway system of these RFC enabled Function modules so in that case create a wrapper FM and call this FM from backend system and only send the relevant fields.
I have used the below commands to replace the text which I do not need .
REPLACE ALL OCCURRENCES OF REGEX lc_required IN lv_task_title WITH ‘ ‘.
REPLACE ‘.000’ in lv_quantity WITH ‘ ‘.
Below is the code piece to fetch the document number for the PO/PR / Contract Document.
lv_po_no = LS_TASKs–TASK_TITLE+14(9).
lv_pr_no = LS_TASKs–TASK_TITLE+3(8) .
Lv_line_no = ls_tasks–task_title+12(5) .
Similar thing can be done for the Other APPS as well to modify the content of each of the sections in the Fiori App . I am yet to explore all the other BADI’s and will come up with more documents. Thank you for reading through do leave me a comment if you find this useful / not useful .