on 2018 Jun 27 2:14 AM
Hello,
I have a requirement where I have to call a standard remote enabled BAPI FPB_PERS_POST_FOR_DIALOG in IDM
Please see attached snapshot for input parameters for standard BAPI in SAP where I need to pass values
I need to pass values (highlighted yellow in snapshot)
Row
IT_VALUES
Column APPLID | FILEDNAME | F | LOW
Values LO_SRS | PLANT | V | 4060
Row Values
ID_DIALOGID DIA_LO_SRS
ID_PERSKEYTP U
ID_PERSKEY USERID
ID_ORIGIN A
I was able to pass row values for ID_DIALOG, ID_PERSKEY, ID_PERSKEYTYP, ID_ORIGIN without any issue (see code below)
Row Values
ID_DIALOGID DIA_LO_SRS
ID_PERSKEYTP U
ID_PERSKEY USERID
ID_ORIGIN A
// Main function: z_Call_BAPI
function z_Call_BAPI(Par){
var dialog = Par.get("ID_DIALOG");
var perskeytyp = Par.get("ID_PERSKEYTYP");
var perskey = Par.get("ID_PERSKEY");
var origin = Par.get("ID_ORIGIN");
var repName = uGetRepositoryName();
var ASHOST = uGetConstant("rep.JCO_CLIENT_ASHOST");
var CLIENT = uGetConstant("rep.JCO_CLIENT_CLIENT");
var LANGUAGE = uGetConstant("rep.JCO_CLIENT_LANG");
var PASSWORD = uGetConstant("rep.JCO_CLIENT_PASSWD");
var SYSNR = uGetConstant("rep.JCO_CLIENT_SYSNR");
var USERNAME = uGetConstant("rep.JCO_CLIENT_USER");
var MSHOST = uGetConstant("rep.JCO_CLIENT_MSHOST");
var GROUP = uGetConstant("rep.JCO_CLIENT_GROUP");
var R3NAME = uGetConstant("rep.JCO_CLIENT_R3NAME");
try
{
importClass(Packages.com.sap.mw.jco.JCO);
if (MSHOST == "" || MSHOST.length == 0)
{
mConnection = JCO.createClient(CLIENT, USERNAME, PASSWORD, LANGUAGE, ASHOST, SYSNR);
}
else
{
mConnection = JCO.createClient(CLIENT, USERNAME, PASSWORD, LANGUAGE, MSHOST, R3NAME, GROUP) ;
}
mConnection.connect();
}
catch (e)
{
uError(e);
}
mRepository = new JCO.Repository(repName, mConnection);
var func = mRepository.getFunctionTemplate("FPB_PERS_POST_FOR_DIALOG").getFunction();
var importParams = func.getImportParameterList();
uWarning(importParams);
importParams.setValue(dialog, "ID_DIALOG");
importParams.setValue(perskeytyp, "ID_PERSKEYTP" );
importParams.setValue(perskey ,"ID_PERSKEY");
importParams.setValue(origin ,"ID_ORIGIN");
mConnection.execute(func);
mConnection.disconnect();
}
But input field IT_VALUES is an internal table in SAP and have got 4 columns
Row
IT_VALUES
Column APPLID | FILEDNAME | F | LOW
I have to pass below column values in IT_VALUES
Row
IT_VALUES
Column APPLID | FILEDNAME | F | LOW
Values LO_SRS | PLANT | V | 4060
Any suggestion on how to pass IT_VALUES ? 🙂
Hi Ankit,
You need to import some addtional JCo class in your script to meet your requirement, e.g. JCO.Structure or JCO.Table.
Please check JCo3 documentation on how this can be done.
Cheers
Chenyang
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.