cancel
Showing results for 
Search instead for 
Did you mean: 

Access JAVA API from Abap web dynpro on EHP4

Former Member
0 Kudos

Hi,

I have a specific requirement. I need to display different KM Document iviews based on the LDAP group of the user.

This is fairly easy to do via Java web dynpro as you have access to the UME information at runtime, however I want to do this in ABAP web dynpro.

I am able to call the KM Iviews dynamically via the abap web dynpro, however I need to know how to access the UME information of the user or call the JAVA API's from abap?

There is very little information available for the above, any suggestions or answers will be rewarded.

-Sumeet

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hallo Sumeet,

This is kind of complex to realize. We did something like this. See if its suits for you.

We have created a J2EE application with several stateless beans init , each bean has a function like create document or create folder.

we call this beans using destination (r3 to netweaver).

For example:

Bean name is : ABAPKMInsertDocumentBean

It has a business method : process_function( function:com.sap.mw.jco.JCO.Function)

	public void processFunction(Function function) throws J2EEAbapException {

		//retrieve input, output structure
		ParameterList input = function.getImportParameterList();
		ParameterList output = function.getExportParameterList();

		//Implement logic
		String pdlkde = input.getString("IC_PDLKDE");
		String pdmkde = input.getString("IC_PDMKDE");
		String targetFolder = input.getString("IST_TARGETFOLDER");
		String folderName = input.getString("IST_NAME");
		String description = input.getString("IST_DESCRIPTION");
		byte[] content = input.getByteArray("IX_CONTENT");
		String extension = input.getString("IC_EXTENSION");
		
		try {
			String newGuidRid = KMServiceUtil.insertDocument(pdm, targetFolder, folderName, description, content, extension);
			output.setValue(newGuidRid, "EST_GUIDRIDNEW");
			output.setValue(" ", "EB_ERROR_FOUND");
		}
		catch (KMException e) {
			log.log(CivLogSeverity.ERROR, e.getMessage(), e);
			AbapJavaUtil.setErrorFound(
				output,
				true,
				e.getMessage(),
				AbapJavaUtil.SEVERITY_ERROR);
			return;
		}
	}
}

You need to add a JNDI name to the ejb- j2ee-engine.xml like (KM_I_INS_DOCUMENT) This name should be the same as your Function module name.

Generate a FM with this name with exactly the same importing and exporting and exception parameters. Do not implement any logic.

Define your J2EE system in the RFC destination using sm59.

Call the function module with destination of the j2ee. This would query the JNDI service and the KM bean would be called.

You can pretty much use this technique to get your JAVA API calls realized.

Former Member
0 Kudos

Hi Baskaran,

This is a very interesting suggestion!!

Couple of queries to both of you:

Isnt there a standard mechanism to access JAVA API's via rfc calls from r3?

Do you know the JAVA API to access LDAP information?

Has SAP come up with anything in EHP 4 for communication within the web AS?

cheers!

Former Member
0 Kudos

Hi Baskaran,

Thanks for the prompt response. I am not a Java developer and I tried playing around with the API today.

Is there a way the api's can be called via a web service or is there a way to capture the html header authentication details at run time, or the sso ticket details?

-Sumeet

Former Member
0 Kudos

Hi,

I think it is should be possible to get the api calls via Webservice. For example KM webservices.

Again, it should be possible to read the header details from Webservice. This very high over suggestion, you need to get some good Java/webservice developers to realize this. Good luck with that.

Former Member
0 Kudos

Hi Dale,

There is a connection frame work to work around these area.

Check this out [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a7b5ba90-0201-0010-4dbc-8f999dcd2798?quicklink=index&overridelayout=true|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a7b5ba90-0201-0010-4dbc-8f999dcd2798?quicklink=index&overridelayout=true]

I do not have any knowledge about the LDAP information.

Former Member
0 Kudos

Baskaran,

Cant we access http session details in abap web dynpro? There is very little information on the same.

-Sumeet

Former Member
0 Kudos

Yes, i think that should be possible. I am not experienced on this area so i would suggest you to go on searching in the area .

You can have a look at here [http://help.sap.com/saphelp_banking50/helpdata/EN/71/1cd240cfd7742ae10000000a155106/content.htm|http://help.sap.com/saphelp_banking50/helpdata/EN/71/1cd240cfd7742ae10000000a155106/content.htm]