Skip to Content
0
Former Member
Jun 01, 2006 at 03:47 PM

Need to call a transaction in R3 from portal component

33 Views

Hi,

The scenario is like this:

I developed a AbstractPortalComponent that stores the User Mapping of a user with a user in R3.

Then I need to call a transaction in R3. How do I do that?

The code I tried is something like this:

//obtain system

String systemalias = "SAP_R3";

// get user from request

IUser iuser = request.getUser ();

// get usermapping service

IUserMappingService iums = (IUserMappingService)

PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);

IUserMappingData iumd = iums.getMappingData (systemalias, iuser);

Map map = new HashMap ();

try {

//set the user name

map.put("user","userID");

//set the password

map.put("mappedpassword","passowrd");

iumd.storeLogonData(map);

} catch (Exception e) {response.write(e.getMessage());}

IPortalComponentURI componentURI = request.createPortalComponentURI();

componentURI.setContextName("com.sap.portal.appintegrator.sap.bwc.Transaction");

String url = componentURI.toString() + "?System=SAP_R3&TCode=RZ10&GuiType=WinGui&WinGui_Type=Shortcut" ;

Let me know is this the correct approach to call a transaction thru Java, if so how do I include that URL to the response?

Regards,

Megha.