on 06-24-2009 3:51 PM
Hi all,
is it possible to retrieve values from multiple fields from the R/3 Table.
Like I need to retrieve the field values Matnr(material number),Storage location and plant .The source is a file which sends these details,the values from the table are retrieved and these are compared with source data,if it is the same then transaction 201k else 201 needs to be send.
can we perform s lookups using a single UDF.
Please let me know.
Thanks,
Srinivasa
Hi Srinivas,
To retrieves the value from the R/3 system, develop the FM in R/3 system.
The importing paramter/ table mention will take the input from the JCO lookup from XI system and Exporting parameters/ Tables will return the values to the XI system.
Develop a UDF to perform the JCO lookup.
JCO.Repository mRepository;
JCO.Client mConnection = JCO.createClient("<Client>", // SAP client
"<USERID>", // userid
"<PASSWORD>", // password
"<LNG>", // language
"<HOSTNAME>", // host name
"<SYSNO>"); // system number
try {
mConnection.connect();
} catch (Exception e) {
// e.printStackTrace();
}
mRepository = new JCO.Repository("SAPLookup", mConnection);
IFunctionTemplate ft =
mRepository.getFunctionTemplate("<FM NAME>");
JCO.Function function = ft.getFunction();
JCO.ParameterList allTables = function.getTableParameterList();
JCO.Table tabMatnrUsed = allTables.getTable("MATNR");
tabMatnrUsed.setValue(Matnr, "MATNR");
mConnection.execute(function);
allTables = function.getTableParameterList();
tabBnkUsed = allTables.getTable("tabMatnrUsed");
for (int i = 0; i < tabMatnrUsed.getNumRows(); i++) {
tabBnkUsed.setRow(i);
String storageLocation =
(String) tabBnkUsed.getValue("Storage_Location");
}
mConnection.disconnect();
In this case i used the Internal Table "MATNR" for both input and output and
"MATNR" and "Storage_Location" are the fields
appreciate if helpful
Edited by: chandra shekhar on Jun 25, 2009 8:01 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
i had a similar situation, and someone else asked the same thing, i have already answered it, please go through these threads.
https://www.sdn.sap.com/irj/scn/profile?editmode=true&userid=3747674
in both these threads check out my answers.
in short write a UDF with a JCO call and this will call an RFC which in turn will call ur tables
Hope this helps
Thanks
SG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
Which version of XI are you using,if it is PI7.1 its very easy to perform RFC LookUp,no need to write any code.
We can retrieve multiple values using RFC lookup.Retrieve three values and store in to 3 variables and compare RFC values with Source Values.
cheers,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Srinivasa,
Check this blog and document:
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
---Satish
Srinvasa,
You can retrieve multiple values from sap. Once retreived you can compare with a udf or with graphical mapping. You can pass as an array and retreive as an array.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.