cancel
Showing results for 
Search instead for 
Did you mean: 

acces to XI R/3 table into user-defined function. Is possible?

Former Member
0 Kudos

Hi experts.

We want to do a user defined function in message mapping that reads a value in R/3 table. R/3 table is created in XI r/3.

It´s possible?. How i can do it?.

Thanks for all.

Accepted Solutions (1)

Accepted Solutions (1)

prabhu_s2
Active Contributor
0 Kudos

yes it is possible by means of RFC lookup

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Experts...

I solve my problem with an Abap Mapping. I acces via Abap Mapping to R/3 table and then, pass a normal message mapping to result variable.

thks for all.

Bye

Former Member
0 Kudos

HI Julian

For your scenario, u need to create an rfc in the R/3 system and call that RFC from a user-defined function in XI by using the RFC Lookup facility..

Check out this following code...

com.sap.mw.jco.*;

public String Get_Customerl(String a,String b,Container container){

//write your code here

JCO.Repository mRepository;

// Change the logon information to your own system/user

JCO.Client mConnection = JCO.createClient(

"300", // SAP client

"XYZ" , // userid

"XYZ", // password

"EN", // language

"66.248.225.116", // host name

"00" ); // system number

// connect to SAP

mConnection.connect();

// create repository

mRepository = new JCO.Repository( "SAPLookup", mConnection );

// Create function

JCO.Function function = null;

IFunctionTemplate ft = mRepository.getFunctionTemplate("ZGET_MATERIAL");

function = ft.getFunction();

// Obtain parameter list for function

JCO.ParameterList input = function.getImportParameterList();

// Pass function parameters

input.setValue( a , "CUSTOMER" );

input.setValue( b , "NAME" );

mConnection.execute( function );

String ret = function.getExportParameterList().getString( "CUST");

mConnection.disconnect();

return ret;

}

This takes the customer number and name as input and the rfc maps these values in the table and returns the customer number if it exists in the database...

Hope u find it useful

Regards,

Hari

bhavesh_kantilal
Active Contributor
0 Kudos

Hari,

This is a JCO call.

This is to be avoided as the User id pasword, and SAP system details are maintained inside the code.

Better is to use the RFC LookUp API as mentioned in the blgos/ and articles above.

Regards

Bhavesh

prateek
Active Contributor
0 Kudos

Hi Julian,

U may find the solution to ur problem here

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1...

Regards,

Prateek

manuel_bassani
Contributor
0 Kudos

Hi Julián,

look at this <a href="https://answers.sap.com/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

Regards,

Manuel

inigo_sacramento
Participant
0 Kudos

Hi Julian / Hola Julian

As most of people says, in special Mr XI Man, Michal Krawczyk, is dangerous to use these R/3 lookups in message mapping to R3. If you get errors is difficult to view them.

Instead of that i suggest you to use a send/receive step using RFC's and if your SAP R/3 backend is a WAS 6.20 or above, try with ABAP Proxy.

___________________

Hola Julian.

Los Lookups de XI a R3 no son aconsejables ya que si petan, no va a haber forma de monitorizarlos. Yo los he probado y funcionan, pero no me convencen mucho. Para estos casos y si estás con una 6.20 o superior, utiliza ABAP Proxy o RFC normales, pasándole datos y recuperándolos y luego haciendo un nuevo mapeo. Todo esto es lo que leí en la SDN cuando tuve que hacer algo parecido.

Por cierto, eres Julian el amigo de Eduard?

Un saludo, Regards,

Inigo.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

If you are planning to insert data from your mapping into a R3 table, then this is not recommended as correctly pointed.

But, if the requirement is to read a value from the R3 table in the mapping ( lookup value) you can use the RFC Look Up Concept.

Regards

Bhavesh

Former Member
0 Kudos

Que pasa Iñigo!!!

Claro que soy yo compañero!.

Un saludo.

inigo_sacramento
Participant
0 Kudos

Hi Julian.

If you want, join me as a messenger contact. My email is igusito@hotmail.com or if you want, my skype contact is igusito.

See you.