cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while passing data to adaptive RFC from Web Dynpro java

Former Member
0 Kudos

Hi All,

We have one function module being used in Web Dynpro java, whose table parameter is structure as follows:

Function module      ZTS_SAVE_TIMESHEET             Active                                                          
<b>Parameter Name      Type spec.Associated Type     OptionalShort </b> ZTIMESHEET_DATA  LIKE      ZWORKLIST_PERS   
BAPIRET2                LIKE      BAPIRET2                    Return

-


We need to pass data to FM in ZTIMESHEET_DATA structure. For that we have written code :

for(int i=0;i<zzz;i++)
{
 Zworklist_Pers objZworklist_Pers = new Zworklist_Pers();

IPrivateTimeSheetHome.IZtimesheet_DataElement elementTimesheetData== wdContext.nodeZtimesheet_Data().createZtimesheet_DataElement(objZworklist_Pers);
timesheetDataNode.addElement(elementTimesheetData);
}

and we are executing FM. But we are not getting result.

Please guide help us how to go about this...

Thanks and Regards,

Ganga.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ganga,

Where you are calling execute() method on the modelNode ??

Please refer to Sample RFC application .

Regards,ANilkumar

Answers (3)

Answers (3)

monalisa_biswal
Contributor
0 Kudos

Go through following link

former_member197348
Active Contributor
0 Kudos

Hi Gangadhar,

for(int i=0;i<zzz;i++)

{

Zworklist_Pers objZworklist_Pers = new Zworklist_Pers();

// instead of this /*

IPrivateTimeSheetHome.IZtimesheet_DataElement elementTimesheetData== wdContext.nodeZtimesheet_Data().createZtimesheet_DataElement(objZworklist_Pers);

timesheetDataNode.addElement(elementTimesheetData);*/

// use this set all attributes

objZworklist_Pers.set....();

....

// finally pass the structure

wdContext.ZTS_SAVE_TIMESHEET_Rfc_InputElement().modelObject().addZWORKLIST_PERS(objZworklist_Pers);

}

// execute the RFC as usual /* I think you know the way */

If do it properly you will certainly get the result

regards

Siva Rama Krushna

Former Member
0 Kudos

Hi,

Passing the data and capturing the data from R/3 is similar way only.

But Only thinag every functionality would be written in R/3 only.

In Front end based on input fileds out put structures bind to the UI elements like input fields and tables.

Go through the pdf for find the process.

The following procedure is the general execution of the FN modules.

Hi,

Import the model into WD naming supposr RAMA.

register the model into webdynpro using the usedmodels.

Then goto the Customcontroller the model nodes are avail in rightside of your cutomcustomcontrollercontext and do the Model binding.

Once you get the model into your cuctomcontroller u can register the custom controller into viewcontroller and getting the nodes into view context.

And goto the View and apply template and create the Table by using the existing node.

Goto the init method of the View controller and add the following code.

FNModule_Input input = new FNModule_Input();

wdContext.nodeFNModule_Input().bind(input);

// pass the input

input.setZ_Kunnr("0000000001");

try {

wdContext.currentFNModule_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

} catch (WDDynamicRFCExecuteException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

This might helps you.

Thanks,

Lohi.