cancel
Showing results for 
Search instead for 
Did you mean: 

Passing changing parameter to RFC of ECC 6.0 from webdynpro java

Former Member
0 Kudos

Hi,

I need to use a simple ZRFC from ECC 6.0 for ESS customization in one of the ESS components (Portal 7.0). There is a changing parameter in the zRFC which should return a set of multiple values. I can see one single parameter under as input parameter (directly under the main node) and i can set a value for it. How to pass the values to changing parameter (it is a structure of multiple fields) while executing the model. Can any one please provide the code sample of executing the model.

Regards

Ramesh

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

This is my Model Node. Ch_Ethnicity is supposed to hold a set of rows (table). It is at both Input and Output. Currently I am passing only Im_Raky which is a code and I should get the table of descriptions into Ch_Ethnicity parameter under the Output Node. But webdynpro Model is expecting some input to the Ch_Ethnicity parameter under the Input Node also. This is the problem and when I have contacted Ababp team, I am asked to send an empty table structure for Ch_Ethnicity parameter under Input Node also. Can you suggest me the code to send an empty table structure as input according to the below given context.

Z_Get_XXXXXX_Input


Ch_Ethnicity

---Zhr_Ethnicity


ethcode


ethdesc


AndSoOn Attrib N


Output


Z_Get_xxxxxx_Output


Ch_Ethnicity


Zhr_Ethnicity


ethcode


ethdesc


AndSoOn Attrib N

|----


Im_Raky

Regards

Ramesh

Former Member
0 Kudos

Hi,

Do as below:


Z_Get_XXXXXX_Input objZ_Get_XXXXXX_Input=new Z_Get_XXXXXX_Input();

//Check one proxy class will be there in the model package for Ch_Ethnicity and create an empty object for that. You have to do this for all the mandatory classes.
ZCh_Ethnicity objZCh_Ethnicity=new ZCh_Ethnicity();

//now set this value in input
objZ_Get_XXXXXX_Input.setZCh_Ethnicity(objZCh_Ethnicity);

wdContext.nodeZ_Get_XXXXXX_Input().bind(objZ_Get_XXXXXX_Input);
wdContext.currentobjZ_Get_XXXXXX_InputElement().modelObject().execute();
wdContext.nodeZ_Get_xxxxxx_Output().invalidate();

Regards,

Charan

Former Member
0 Kudos

Hi,

//For the input class object you can simply set like this

//Input class
Z_Get_XXXXXX_Input objZ_Get_XXXXXX_Input=new Z_Get_XXXXXX_Input();
objZ_Get_XXXXXX_Input.setZCh_Ethnicity(new ZCh_Ethnicity());

Hope this helps you,,.

Regards,

Saleem

Former Member
0 Kudos

Hi All,

I mean the parameter of type "Changing" in RFC. I just want to pass a single "code" value and get back a collection of corresponding Descriptions (through an export parameter of RFC). The Abaper had declared this output parameter as of type "changing" in the RFC, Hence, even I don't have to pass any input values to this Changing parameter and I only want to read list of descriptions from it, When I execute the model, I am getting an exception like "Mandatory parameter CH_ETHNICITY (output parameter of type "Changing") of method Z_EPM_GET_ETHNIC_DESC missing". Hope I am clear this time.

Regards

Ramesh

Former Member
0 Kudos

Hi,

May be "CH_ETHNICITY" is a mandatory field for the input node in the RFC call ...

Just if it is a proxy class which accepts single record write the code like this..

Zentity_Input objZentity_InputObject =new Zentity_Input();

//Create the object for proxy class Z_EPM_GET_ETHNIC_DESC
Z_EPM_GET_ETHNIC_DESC objZ_EPM_GET_ETHNIC_DESC = new Z_EPM_GET_ETHNIC_DESC();
//Set the  empty value 
objZ_EPM_GET_ETHNIC_DESC.setCH_ETHNICITY("");

objZentity_InputObject.setZ_EPM_GET_ETHNIC_DESC(objZ_EPM_GET_ETHNIC_DESC );

wdContext.nodeZentity_Input ().bind(objZentity_InputObject);
wdContext.currentZentity_InputElement().modelObject().execute();

If the proxy class accepts multiple records create an abstract class and bing some empty value to the proxy class object and set this abstract class object to input class object

Hope this helps you,...

Regards,

Saleem

Former Member
0 Kudos

Hi,

If you are not able to solve ur issue if possbile post your context structure here.

Regards,

Charan

Former Member
0 Kudos

do you mean doing this?

//How to set single object which is a seperate node under main node
 ZInputObject1 zInputObject1=new ZInputObject1();
zInputObject1.setInputValue1("InputValue1");
zTestWriteInput.setZInputObject1(zInputObject1);

zInputObject1=new ZInputObject1();
zInputObject1.setInputValue1("InputValue2");
zTestWriteInput.setZInputObject1(zInputObject1);

-This will overwrite-

you say that you have a structure, wich must be cardinality 1..1, so It can only hold one value

what do you mean changing? cant you execute the BAPI several times? ..maybe you need a table on your BAPI

Former Member
0 Kudos

Hi Saleem and Charan,

Thanks for your quick response. Have you ever tried setting object and multiple objects for changing parameter (not table parameter) of ECC 6.0. Does this code holds good for changing parameter.

Ramesh.

Former Member
0 Kudos

Hi,

Can you pls explain me that what do you mean of changing parameter?

Regards,

Charan

Former Member
0 Kudos

Hi,

Z_Table_ZTest_Write_Input zTestWriteInput=new Z_Table_ZTest_Write_Input();

//How to set single value input which is directly under main node

zTestWriteInput.setInputValue1("InputValue1");

//How to set single object which is a seperate node under main node

ZInputObject1 zInputObject1=new ZInputObject1();
zInputObject1.setInputValue1("InputValue1");

zTestWriteInput.setZInputObject1(zInputObject1);

//How to set multiple (set of) objects which is a seperate node under main node

AbstractList zInputMulObject1List=new ZInputMulObject1.ZInputMulObject1List();

//Getting from some value node and setting into list
for(int i=0;i<wdContext.nodeValueInputNode().size();i++)
{
ZInputMulObject1 zInputMulObject1=new ZInputMulObject1();
zInputMulObject1.setInputMulValue1(wdContext.nodeValueInputNode().getValueInputElementAt(i).getValue1());
zInputMulObject1List.add(zInputMulObject1);
}

//Adding the list of objects to input object
zTestWriteInput.setZInputMulObject1(zInputMulObject1List);

wdContext.nodeZ_Table_ZTest_Write_Input().bind(zTestWriteInput);
wdContext.currentZ_Table_ZTest_Write_InputElement().modelObject().execute();
wdContext.nodeOutput_Z_Table_ZTest_Write().invalidate();

Regards,

Charan

Former Member
0 Kudos

Hi,

Correct me wether my understanding is correct or not.

Earlier you had a bapi with single input field and now the modified RFC has multiple input values tobe set right.

If i am correct with my understanding you can set the multiple values like this

//Creating the model Instance
SendMailModel sendMailModelInst = new SendMailModel();
//Input object
Zbapi_Send_Mail_Input sendMailInput = new Zbapi_Send_Mail_Input();
//proxy class which accepts multiple values...
AbstractList mailText = new Solisti1.Solisti1_List();
Solisti1 solistilobj = new Solisti1();
solistilobj.setLine(wdContext.currentFeedbackRemainderNodeElement().getMessage());
mailText.add(solistilobj);
sendMailInput.setMail_Text(mailText);
wdContext.nodeZbapi_Send_Mail_Input().bind(sendMailInput);
wdContext.currentZbapi_Send_Mail_InputElement().modelObject().execute();
wdContext.nodeOutput_Zbapi_Send_Mail().invalidate();
sendMailModelInst = (SendMailModel)WDModelFactory.getModelInstance(SendMailModel.class);	   
sendMailModelInst.disconnectIfAlive();

Hope this code helps you..

Regards,

Saleem