cancel
Showing results for 
Search instead for 
Did you mean: 

Sending table data to a BAPI

Former Member
0 Kudos

Hi,

This has been covered in other threads, but I can't seem to get this to work - please help!

My context node for the model is:

ZGBHEP_GET_GEN_JOB_FOR_MULTPOS_INPUT

---GroupInputT_Positions

-


Gen_Job_Desc

-


Gen_Job_No

-


Position_No

---GroupJobDescOutput

-


GroupOutputT_Positions

-


Gen_Job_Desc

-


Gen_Job_No

-


Position_No

And my code to populate it is:

for(int x = 0; x < wdContext.nodeT_Positions().size(); x++){

IGroupInputT_PositionsNode myNode = wdContext.nodeGroupInputT_Positions();

Zhrobjid newLine = new Zhrobjid();

IGroupInputT_PositionsElement myEl = myNode.createGroupInputT_PositionsElement(newLine);

myEl.setPosition_No(wdContext.nodeT_Positions().getT_PositionsElementAt(x).getObjid());

myNode.addElement(myEl);

}

wdComponentAPI.getMessageManager().reportSuccess("Node val:" + wdContext.nodeGroupInputT_Positions().size());

try {

wdContext.currentZGBHEP_GET_GEN_JOB_FOR_MULTPOS_INPUTElement().modelObject().execute();

wdContext.nodeGroupOutputT_Positions().invalidate();

} catch (WDDynamicRFCExecuteException e) {

wdComponentAPI.getMessageManager().reportException("Error retrieving generic job information", false);

e.printStackTrace();

}

wdComponentAPI.getMessageManager().reportSuccess("Jobs:" + wdContext.nodeGroupOutputT_Positions().size());

-


The centre message shows 60 so I know its added them, but in my back end FBGENDAT shows the table parameter as empty. Any ideas?

Cheers.

Accepted Solutions (1)

Accepted Solutions (1)

former_member214651
Active Contributor
0 Kudos

Hi Jo,

As I see, both the model node and the Value node has the same structure. In that case try using the copy service API for copying sll the values from ur model node to value node. The statement is

WDCopyService.copyElements(wdContext.node<ModelNodename>,wdContext.node<ValueNodename>);

This should work

Regards,

Poojith M V

Answers (2)

Answers (2)

Former Member
0 Kudos

I solved it by binding it to a List instead!

Thanks!

Former Member
0 Kudos

Hi,

check this:

Regards,

Naga