cancel
Showing results for 
Search instead for 
Did you mean: 

Second Time, RFC execution Problem!

Former Member
0 Kudos

Hi all,

Has any one encountered this problem, when calling RFC First time fine and getting data from BAPI, when i call same RFC again, Second Time, RFC execution Problem!. Any idea!, Now i restarted server, that may cause the problem. Other than this, please give me your idea.

Thanks

Ravi Golla

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

Are you still getting this problem or it is resolved?

If not, please provide more details so we can figure it out where is the issue.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

Yes i am still getting this problem.

I have View a called "Create Projects". Here Users can create their projects and once they click submit button, RFC will execute and stores data in BAPI.

onActionCreateProject()

{

wdThis.wdGetArchController().CreateProject();

wdThis.wdFirePlugOutToResults();

}

Once FirePlugout it takes to Another View called "Results". Here results will appear what they have submitted.

First time you submit project, it stores in database and results will appear in ResultsView.

Once again you come back and you want to submit another project, here RFC is not executing. i found it by Debuging ABAP. first time it hits break point and i see results. Second time, it does not hit break point at all, not even store results.

Really i face strange Problems!

i have to finish project, i am strucked with funny errors.

let me know any idea or sugisstions. I remember you solved one of my problem TableSorter!

Thanks & Regards

Ravi Golla

Former Member
0 Kudos

Hi Ravi,

Provide the code from CreateProject() method.

Regards,

Bhavik

Former Member
0 Kudos

Hi,

Check if you have invalidated the model nodes properly.

Former Member
0 Kudos

Hi Bhavik,

<b>In View Controller:</b>

public void onActionCreateProject(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionCreateProject(ServerEvent)

wdThis.wdGetArchCompController().CreateProject();

wdThis.wdFirePlugOutToProjectCreationResult();

//@@end

}

<b>In Custom Controller:

</b>

wdDoInit()

{

__Arch__Arm_Project_Create_Input create = new __Arch__Arm_Project_Create_Input();

wdContext.node__Arch__Arm_Project_Create_Input().bind(create);

}

public void CreateProject( )

{

//@@begin CreateProject()

try

{

wdContext.current__Arch__Arm_Project_Create_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

}

catch(WDDynamicRFCExecuteException ex)

{

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(ex.toString());

ex.printStackTrace();

}

//@@end

}

I am using other functional modules they all working fine, this is one only has problem

Thanks Bhavic.

Regards

Ravi

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

1) Do not put the code in the init method.

Because this will execute only one in a life cycle of controllers.

2) invalidate the output node before execution.

Regards,

Vijai

Former Member
0 Kudos

HI Ravi,

I am guessing that you have bound your input parameters to the screen elements. And you are setting values from there only.

Now, Leave initiallizing of model node in customer controller wdinit method. But, you have to invalidate your model input node and bind it again when you come back to your first view.

So, you can write following code in the inbound fire plug method in first view (This plug will be fired from your second view):

wdContext.node__Arch__Arm_Project_Create_Input().invalidate();

__Arch__Arm_Project_Create_Input create = new __Arch__Arm_Project_Create_Input();

wdContext.node__Arch__Arm_Project_Create_Input().bind(create);

Now, you have refreshed your model node. So, it will work as you are executing it first time.

Let me know whether it works or not for you.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

Thanks for your reply, my problem has been solved. I am invalidating same node twice. one time in inboundPlug() of my first view, and second time invalidating() in action of second view( that takes me to firstview in Second View). So that causes my problem. i am giving rewarding points for it. Thanks for your time and giving valuable suggestion.

Thanks and Regards

Ravi

Answers (2)

Answers (2)

former_member751941
Active Contributor
0 Kudos

Hi Ravi,

After execution of RFC you disconnect the model.

finally

{

SaveModel svModel = (SaveModel)WDModelFactory.getModelInstance(SaveModel.class);

svModel.disconnectIfAlive();

}

I hope it will work.

Regards,

Mithu

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Can u be more precise, that where ur executing the RFC first and second time.

mostly this will not happen.

Regards,

Vijai

Former Member
0 Kudos

Hi Vijay,

I am calling RFC from one View called "Create Projects", Once i submit data from this view, it is storing data in Backend and it sends me results which are displayed in another view. From this View once i come back to Create Projects and when i try to submit another project, Here RFC is not executing, this i found in by doing Debging. This is really strange problem.

if know anything, give me your idea.

Thanks

Ravi