cancel
Showing results for 
Search instead for 
Did you mean: 

RFC model values are not shown in table

Former Member
0 Kudos

Hi there,

I can't gather the values from the RFC FM in my table, while this has been done exactly the same way as other tables which do get values... Any reason for this?

I have 2 DC's:

-data DC which acts as a container for the RFC-imported datamodels

-bupa DC in which the implementation is done

Custom Controller CuCoMain (from bupa DC):

Context:

OutputRelContacts (model node bound to model BuPaRelationsModel.__Crm_Bb_Bupa_Rels_Output)

cardinality: 0...n; selection: 0...1

> Rel_Contacts_Result (node of OutputRelContacts)

=> bound to BuPaRelationsModel.__Crm_Bb_Bp_Rel_Res_Ds

cardinality: 0..n; selection: 0...1

There is no context input necessary since 'related contacts' is dependent of the bpnr which I pass as parameter (see below).

Implementation in CuCoMain


public void TriggerAccConSearch( java.lang.String Mode, java.lang.String BuPaNr )
  {
    //@@begin TriggerAccConSearch()
	//also see comments in TriggerBuPaSearch
	accContactsInput = new __Cernum__Crm_Bb_Bupa_Rels_Input();
	accContactsInput.setRel_Mode(Mode);
	accContactsInput.setBp_Number(BuPaNr);
	try{
		accContactsInput.execute();
		wdContext.nodeOutputRelContacts().invalidate();
		accContactsOutput = accContactsInput.getOutput();
		this.wdThis.wdGetContext().nodeOutputRelContacts().bind(accContactsOutput);
	}
	catch(Exception e){
		msgMngr.reportException(e.getMessage(),true);
	}
    //@@end
  }

Context in view

Context node OutputAccContacts (bound to CuCoMain.OutputRelContacts.Rel_Contacts_Result)

cardinality: 0...n; selection: 0...1

Implementation to trigger TriggerAccConSearch:


String SelectedBuPaNr = this.wdThis.wdGetContext().nodeVOutputDetails().currentVOutputDetailsElement().getBpnumber();
 	String RelMode = "C";
 	this.wdThis.wdGetCuCoMainController().TriggerAccConSearch(RelMode, SelectedBuPaNr);

RelMode & SelectedBuPaNr are filled with values.

So what did I do wrong...? I'm out of inspiration; I've reimported the model, rebuilt the entire application, redone the context, redone the implementation but up until now nothing worked.

Any help is greatly appreciated

KR

A

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Allan,

In your 'Implementation in CuCoMain', you invalidate the context after the execution of the input & then you fetch the output from it.

You can try changing the order - first invalidate the context, execute and then get the output & do fresh binding.

Also check if there is really some resultset satisfying the provided input parameters (mode & bpnr).

Hope this works.

Kind Regards,

Nitin

Edited by: Nitin Jain on Jan 13, 2009 8:53 AM

Answers (4)

Answers (4)

Former Member
0 Kudos

Error solved!

In context of CuCoMain, the sypplyingRelationRole was not filled!

Former Member
0 Kudos

Hi there,

Yes, as stated earlier, my RFC is being called by the application and the parameters are correct (input & output). Somehow, these values just don't get transferred to the node.

Also, you can try the following piece of code before the RFC call at the Dynpro end :


IWDMessageManager manager = wdComponentAPI.getMessageManager();
try{
wdContext.current<RFC_Name>_InputElement().modelObject().execute();
wdContext.node<Output_Node_Name>().invalidate();
} catch(WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
}

I don't think that will help in my situation. In my situation there are 3 tables which have to be filled by the nodes.

These 3 tables are all based on the same RFC (with different input parameters). The weird thing is that one of these tables works perfectly and the others just don't work. Even weirder is that all the RFC-uses are implemented the same. (See below)

The working RFC call (table is populated):


public void TriggerAccRelSearch( java.lang.String BuPaNr, java.lang.String Mode )
  {
    //@@begin TriggerAccRelSearch()
	//also see comments in TriggerBuPaSearch
	accRelsInput = new __Crm_Bb_Bupa_Rels_Input();
	accRelsInput.setRel_Mode(Mode);
	accRelsInput.setBp_Number(BuPaNr);
   
	try{
		wdContext.nodeOutputRelationships().invalidate();
		accRelsInput.execute();
		accRelsOutput = accRelsInput.getOutput();
		//wdComponentAPI.getMessageManager().reportWarning("TriggerAccRelSearch Result of RFC START" + accRelsOutput.getRel_Result().listIterator()..toString() + "TriggerAccRelSearch Result of RFC START");
		//wdComponentAPI.getMessageManager().reportWarning("First line: " + accRelsOutput.getRel_Result().get(0).toString());
		//currentRel_ResultElement().getRelationship().toString());
		this.wdThis.wdGetContext().nodeOutputRelationships().bind(accRelsOutput);
		wdComponentAPI.getMessageManager().reportSuccess("test accrelsearch: " + wdContext.nodeOutputRelationships().nodeRel_Result().currentRel_ResultElement().getAttributeAsText("Relationship").toString());
	}
	catch(Exception e){
	 	msgMngr.reportException(e.getMessage(),true);
	}
	finally{
		DynamicRFCModel modelinst;
		modelinst = (DynamicRFCModel) WDModelFactory.getModelInstance(BuPaRelationsModel.class);
		modelinst.disconnectIfAlive();	
	}
	
    //@@end
  }

The non-working RFC-calls (tables are NOT populated):


public void TriggerAccReltdEmpSearch( java.lang.String Mode, java.lang.String BuPaNr )
  {
    //@@begin TriggerAccReltdEmpSearch()
	accReltdEmplInput = new __Crm_Bb_Bupa_Rels_Input();
	//accReltdEmplOutput = new __Crm_Bb_Bupa_Rels_Output();
	accReltdEmplInput.setRel_Mode(Mode);
	accReltdEmplInput.setBp_Number(BuPaNr);
	try{
		wdContext.nodeOutputReltdEmp().invalidate();
		accReltdEmplInput.execute();
		accReltdEmplOutput = accReltdEmplInput.getOutput();
		this.wdThis.wdGetContext().nodeOutputReltdEmp().bind(accReltdEmplOutput);
		
		//wdComponentAPI.getMessageManager().reportSuccess("test accReltEmp: " + wdContext.nodeOutputReltdEmp().nodeReltd_Emp_Result().currentReltd_Emp_ResultElement().getAttributeAsText("Relationship").toString());		
	}
	catch(Exception e){
		msgMngr.reportException(e.getMessage(), true);
		msgMngr.reportSuccess("error: " + e.getCause());
	}
	finally{
		DynamicRFCModel modelinst;
		modelinst = (DynamicRFCModel) WDModelFactory.getModelInstance(BuPaRelationsModel.class);
		modelinst.disconnectIfAlive();		
	}
    //@@end

and:


public void TriggerAccConSearch( java.lang.String Mode, java.lang.String BuPaNr )
  {
    //@@begin TriggerAccConSearch()
	//also see comments in TriggerBuPaSearch
	accContactsInput = new __Crm_Bb_Bupa_Rels_Input();
	accContactsInput.setRel_Mode(Mode);
	accContactsInput.setBp_Number(BuPaNr);
	try{
		wdContext.nodeOutputRelContacts().invalidate();
		accContactsInput.execute();
		accContactsOutput = accContactsInput.getOutput();
		wdComponentAPI.getMessageManager().reportWarning("TriggerAccConSearch Result of RFC START" + accContactsOutput.getRel_Result().toString() + "TriggerAccConSearch Result of RFC START");
		this.wdThis.wdGetContext().nodeOutputRelContacts().bind(accContactsOutput);
	}
	catch(Exception e){
		msgMngr.reportException(e.getMessage(),true);
	}
	finally{
		DynamicRFCModel modelinst;
		modelinst = (DynamicRFCModel) WDModelFactory.getModelInstance(BuPaRelationsModel.class);
		modelinst.disconnectIfAlive();	
	}
	
    //@@end
  }

Parameter definition:

 
__Crm_Bb_Bupa_Rels_Input accRelsInput;
__Crm_Bb_Bupa_Rels_Output accRelsOutput;
__Crm_Bb_Bupa_Rels_Input accReltdEmplInput;
__Crm_Bb_Bupa_Rels_Output accReltdEmplOutput;
__Crm_Bb_Bupa_Rels_Input accContactsInput;
__Crm_Bb_Bupa_Rels_Output accContactsOutput;

The table dataSources have all been bound to the context properly, as well as the table columns. Also, in the backend the correct values have been passed and retrieved.

Former Member
0 Kudos

Hi there,

Yes, the dataSource property is bound to OutputReltdEmp

The table consists of 3 columns with textviews which are bound to OutputReltdEmp.fullname, OutputReltdEmp.Function and OutputReltdEmp.Telephone

No, I'm not getting values when the message is executed, only 'null'.

With the working table above it which has been done in the same way, I do get a result. In the backend the FM is called correctly + results are correct in the FM call, but they somehow don't get transferred to the nodes...

Code:

 
public void TriggerAccReltdEmpSearch( java.lang.String Mode, java.lang.String BuPaNr )
  {
accReltdEmplInput = new __Cernum__Crm_Bb_Bupa_Rels_Input();
	//accReltdEmplOutput = new __Cernum__Crm_Bb_Bupa_Rels_Output();
	accReltdEmplInput.setRel_Mode(Mode);
	accReltdEmplInput.setBp_Number(BuPaNr);
	try{
		wdContext.nodeOutputReltdEmp().invalidate();
		accReltdEmplInput.execute();
		accReltdEmplOutput = accReltdEmplInput.getOutput();
		wdContext.nodeOutputReltdEmp().bind(accReltdEmplOutput);
		
		wdComponentAPI.getMessageManager().reportSuccess("test accReltEmp: " + wdContext.nodeOutputReltdEmp().nodeReltd_Emp_Result().currentReltd_Emp_ResultElement().getAttributeAsText("Relationship").toString());		
	}
	catch(Exception e){
		msgMngr.reportException(e.getMessage(), true);
		msgMngr.reportSuccess("error: " + e.getCause());
	}
    //@@end
  }

Former Member
0 Kudos

Hi,

You can check whether the RFC is being called by the application. You can test this by adding an external breakpoint at the R3 end and then debug. This will help in directly testing what the problem is.

Also, you can try the following piece of code before the RFC call at the Dynpro end :

IWDMessageManager manager = wdComponentAPI.getMessageManager();

try{

wdContext.current<RFC_Name>_InputElement().modelObject().execute();

wdContext.node<Output_Node_Name>().invalidate();

} catch(WDDynamicRFCExecuteException ce) {

manager.reportException(ce.getMessage(), false);

}

Regards,

Divyata

Former Member
0 Kudos

Hi there,

Yes, in the ABAP backend, there are satisfying results.

The results however don't get transferred to the table...

I have already replaced the invalidate() statement, but that didn't help either...

Any suggestions?

PS I also can't java debug the application because we won't receive the SDM password (that's why we work via NWDI).

That's why I tried to find out with following statements:


wdComponentAPI.getMessageManager().reportSuccess("test accrelsearch: " + wdContext.nodeOutputRelationships().nodeRel_Result().currentRel_ResultElement().getAttributeAsText("Relationship").toString());

and


wdComponentAPI.getMessageManager().reportSuccess("test accrelsearch 2: " + wdContext.nodeOutputRelationships().nodeRel_Result().currentRel_ResultElement().getRelationship().toString());

But neither message does clarify the issue (meaning nothing is output).

Former Member
0 Kudos

Hi,

Please check whether you have bound the node that fetches the output values to the 'datasource' property of the table.

When you print the values of the table elements, like

wdComponentAPI.getMessageManager().reportSuccess("test accrelsearch: " + wdContext.nodeOutputRelationships().nodeRel_Result().currentRel_ResultElement().getAttributeAsText("Relationship").toString());

does it print the values?

Hope this works.

Regards,

Divyata