cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in the execution of BAPI

Former Member
0 Kudos

Hi All

I am facing a very strange problem while inserting into table using a bapi.

I have two DC one is component DC and other one is View DC.

I have mapped context of component controller of component dc using model, which is having Tb_Aritemin also I have created a value node of localItem. I have mapped context of view of view dc from context of interface controller of component dc.

Now when I write the coode for populating the table view using localItem at view, my bapi is getting executed perfectly and header and item table is inserted perfectly, but when i write the code to populate the view inside component dc(populating the view means transfering the data from localItem to Tb_Aritemsin) and then I call it in view dc before executing the model My tables at backent is not getting inseserted perfectly, header table is getting inserted but only 1 record of item table is getting inserted that too with initial values I meaan 000 for numeric fields and space for non numeric fields.

Can any body help me regarding this, if more information is required please ask me. Kindly help me out. I really want to know the reason for this.

Thanks & regards

Sandeep

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

<b>Hi

Plz Check The Cardinality Value for the context.

Change the Cardinality to 0..n..

Regards

Chandran S</b>

Former Member
0 Kudos

Hi Chandran

It is o:n only as I mapped it with context of Component controller of Component DC.

Also it is working fine when I am writing the code for table view at view implemnetation.

Here is the code which will give you the idea

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

{

//@@begin onActionAdd(ServerEvent)

Zbt_Aritem_Rout itemRout = new Zbt_Aritem_Rout();

ITb_AritemsElement itemElement = wdContext.nodeTb_Aritems().createTb_AritemsElement(itemRout);

ILocalItemElement localElement = wdContext.nodeLocalItem().currentLocalItemElement();

WDCopyService.copyCorresponding(localElement,itemElement);

if (i==0)

wdContext.nodeTb_Aritems().bind(itemElement);

else

wdContext.nodeTb_Aritems().addElement(itemElement);

i = i+1;

//wdThis.wdGetArcompInterface().addItem();

//@@end

}

with The above code every thing is fine

But when I write the same code inside the implementation of component controller of compnent dc, and call it in view dc as below

wdThis.wdGetArcompInterface().addItem(); (This is called inplace of code above)

I am having the problem

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Sandeep

what is your context structure.?

what is variable i, which is always zero?

Regards

Abhimanyu L

Answers (0)