Everyday we are using lot’s of application to sharing our information (personal, professional..etc). But what about business information, our work information, process information, yes information, it could be any type of. let’s take an example, some time a end user has to inform another business user related to created document, then he makes call or mail to deliver the same.
Here i have made a simple program is a kind of chat program, where a user can see who all are logged in system and also send a message to them instantly and make a conversation without make any call or mail.
yes, for the privacy, the program is storing every chat information in customize table for later use.
In below steps, i have explain logic and steps.
I made initial screen size same as other chat application.
In above screen, two users are logged in. In this screen i have use CL_GUI_TIMER class and it’s check the online user information every second.(interval value set in class attributes), The login chat screen will only refresh, if any new user found or vise versa.
If any new user logged in or any user left the system. respective user information will add or remove from the above screen.
Means, the above screen will only provide the logged / online users or bookmarked users.
In login exit, a logic has been maintained to check the user is already using the chat program or not, or if any reason user’s SAPGUI crashed. the old login information will be deleted from customize table.
Exit Information: SUSR0001 [User exit after logon to SAP System].
attached code in ZXUSRU01.txt
Make the first chat:
To do chat with user, select the any user from above chat screen.
After select an user, a chat screen will open.
Selected user name will be the title of the screen, as display in above screen. (i have selected Rohan Sen).
To send message the selected user, enters the respective text in open text window.
After press ‘ENTER’ button. System will check for the selected user is logged-in or not and chat screen is open or not.
If chat screen is not open for the selected user. A pop-message will open to selected user screen as below.
Used Function Module: TH_POPUP
Else message will be store in maintained table.
After executing the chat t-code, user will get initial screen (as above), but though user has received a message from user, then blue chat icon will be displaying at the place of yellow chat icon, as below screen.
Suppose user is not online, then all received message will be store in maintained table and while login into the system, a pop-up message box will appear as below screen, which will have message sender and date information.
User can only send message to off-line users if they have bookmarked.
When both users are using application and sharing information the view will be as below.
It’s same like other chat screen, user enters will be at the right side of the chat screen and receiver enters will be at the left side. (as above).
with other necessary information like time and date.
Here if date is current date, then it will display as “today”.
One more tool has provided to see the earlier conversation.
By clicking the above button, the very next day available conversation will be display in chat screen as below.
If you see, the conversation details are more, so automatic a scroll bar will be appear (as above screen in red area), which is very thin and only display when user scroll the screen.
even only the current conversation will display in screen, mean scroll will always be on the bottom of chat screen.
Though all solution is depends on HTML, CSS and java script, some additional installation requires from the SAPGUI, Local system side.
1. SAPGUI Installation, Please find below screen about SAPGUI.
For more information, please go through with below discussion.
2. Java Script setting, internally SAP used IE in CL_GUI_HTML_VIEWER class, to make available java script functionality enable setting in IE.
3. MIME setting
Created a new folder inside SAP->PUBLIC->SAP_CHAT and imported jpg & png file from attached zip file.
All respective programs, include and class are in attached zip in below google drive link for further analysis.
Program Name : zcommunication
Class Name : zcl_communication
Tables Name : zcom_books (bookmark information)
zcom_run (Communicator execution information)
zcommun (Current Communication Information)
zcommun_his (Communicator history)
attached Nugget File in above link
File Name: NUGG_ZCOMM.nugg
Note: The application made in SAP Netweaver 740 Version.
New version link with some more advance option to make communication better way.
Thanks & Regards,