Continues......
Pre-requisite: ( Please go through the below link before you continue )
Step 18 :
For new attachments, we need to create a menu with options - Create Note & Create Attachment
Create a toolbar and add the toolbar ui element "ToolBarLinkChoice" as below
Add menu action item "ATTACH_NOTE" and create an action "CREATE_ATT" and bind it as below
Step 20:
Similarly, add another menu action item "ATTACH_FILES" and bind the action "CREATE_ATT" as below
Step 20A:
Write the below code in event handler method of ONACTIONCREATE_ATT
ONACTIONCREATE_ATT |
---|
METHOD onactioncreate_att . wdevent->get_data(
lo_view_ctrl ?= wd_this->wd_get_api( ). |
Create a new view V_ATTACH_FILES to view/change the attachment of files
Step 21:
Go to the context tab and map the context node "ATTACHMENT_CONTENTS" from component controller to the view context as shown below
Step 22:
Go to the layout of view and create an ui element "InputField" for the attachment title / name as below
Create an ui element "FileUpload" and bind the context attributes as below
Create an ui element "FileDownload: and bind the context attributes as below
Write the below logic to hide/show, the ui elements based on user action as below
WDDOMODIFYVIEW |
---|
METHOD wddomodifyview . CASE wd_comp_controller->gv_user_action.
"get transparent container
|
Create a new view V_ATTACH_NOTES to view/change the attachment of files
Go to the context tab and map the context node "ATTACHMENT_CONTENTS" from component controller to the view context as shown below
Create an ui element "InputField" and bind the context attributes as below
Insert an TextEdit ui element and bind the properties to context attributes as below
Write the below logic to hide/show, the ui elements based on user action as below
WDDOMODIFYVIEW |
---|
METHOD wddomodifyview . CASE wd_comp_controller->gv_user_action.
DATA lo_inp TYPE REF TO cl_wd_input_field.
|
Create a new window W_ATTACH_FILES and embed the view V_ATTACH_FILES as below
Create a new window W_ATTACH_NOTES and embed the view V_ATTACH_NOTES as below
Now, save and activate the whole component YDEMO_ATTACH_FILES_GOS
Create an application as below
Now, test the application:
Output:
The initial out put screen looks as below
Now, enter a policy number "6000031601" and click on button "Get Attachment List", and list of attachments shown as below
Click on menu "New Attachments" to attach a note or a file
Choose the Create Note option from menu as below .
Now, a popup window opens up as below
Provide the title of notes & enter some contents into notes text box and click on OK button as below
The attachment of Note to GOS is successful and it can be seen as below
Similarly, we can create an attachment of files
Choose, CreateAttachment option from menu as below
A popup window appears for create an attachment of a file as below
Now, enter the attachment name and browse a file from your system and click on OK button as below
We can see the attachments created as below
We can also, display or change or delete the attachments
To Display an attached file:
Click on display button of a particular record as below
a popup window opens up and shows the available contents in Display mode
To Change an attached file:
Click on change button of a particular record & a popup window opens up and can change the attachment as below
To Delete an attached file:
Click on delete button of a particular record & a popup window for deletion of attachment opens up and click on OK button to complete the deletion
Similarly we can perform the display or change or delete actions on Notes as well
Click on display button of a particular record as below
a popup window opens up and shows the available contents in Display mode
To Change an attached Notes:
Click on change button of a particular record & a popup window opens up and can change the notes as below
Click on delete button of a particular record & a popup window for deletion of Notes opens up and click on OK button to complete the deletion
Hope this helps for those looking for attaching files / notes to GOS .
Your comments / Feedback / suggestions are highly appreciable & always welcome
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
7 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |