cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization in Web Dynpro JAVA

Former Member
0 Kudos

Hi All,

I have a Web Dynpro JAVA application, for which an iView has been created and is assigned to a role. Now I have the below requirement,

If two users tries to access this application at the same time then the second user has to get a message stating that "A user is already accessing this application please try later". Basically the thread concept. Is it possible to achieve this in Web Dynpro JAVA. If yes please provide me some pointers on how to achieve this.

Thanks & Regards,

Vishweshwara

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

I don't think sap has this feature by default.

you have to do it with full customization

Former Member
0 Kudos

Hi John,

Thanks for the replay. What do you mean by "full customization". Can you please elobarate on this.

Regards,

Vishweshwara P.K.M

0 Kudos

Hi Vishweshwara,

Create the Custum table with UserID fields.

Create the RFC with UserID fields as input parameters and result field as export parameter.

Write the logic in RFC if Custum table contains any value in UserID Field then return error message like " This application is already using by <UserID>"

else

stor the values UserID and LoginStatus(which you are sending from Webdynpr java app) in custom table and return success message.

Create webdynpro java component and create two iview called main and info view

import the RFC in webdynpro java app and do the binding from model to component controller and component controller to view controller of main.

Write the following code in wdDoInit() method of main view to get the login userid and sending that to RFC.

String userID = null;

IWDClientUser clientUser = WDClientUser.getCurrentUser();

IUser User = clientUser.getSAPUser();

if (User != null)

{

try

{

IUserAccount[] acct = User.getUserAccounts();

if(acct[0] != null)

{

userID = acct[0].getLogonUid();

wdContext.current<RFCNodeName>Element().setUserID(userID);

}

}

catch(UMException e)

{

//Raise some error msg according to your scenario.

}

}

//code for calling the RFC

wdThis.wdGet<ComponentControllerName>().execute();

String msg = wdContext.current<OutputNodeName>Element().getResult();

if(msg != null && msg.lenght() !=0)

{

if(msg.equalsIgnoreCase("This application is already using by <UserID>")

{

wdThis.wdFirPlug<PlugName>();// code for naivigate from main view to info view

}

}

the navigation between main view to info view needs to defined in navigation moduler area.

if you foolow the above specified way u can achive your requerment.

Revert back if you any quaries.

Thanks & Regards,

bhargava.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks a lot John & Bhargavaa.