cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Elements from model node

Former Member
0 Kudos

hi all,

i want to remove an element from the model node.

Z_My_RFC

Et_Pri

Output

|

Et_Pri_out

I have displayed the data in table using Et_Pri_out. I want to delete an element from this table and this should reflect in backend.

Is the remove element from valuenode and modelnode is same?

Thanks in advance,

Gopi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Let me try to understand what your question is, before trying to jump to the answer. I have prepared a list of possible questions that you actually wanted to ask:

Question 1

============

a) You have an RFC Function Module

b) This function module deletes value from the backend

c) How do I approach this ?

Answer 1

==========

In order to delete values from back-end using Web Dynpro, you require another function module in R/3 which actually does the job of deleting entries from R/3 table for valid and appropriate business logic. Therefore, if this function module does not exist, request for such a function module and import this model through ADAPTIVE RFC.

Question 2

============

a) You have an RFC Function Module

b) This RFC Function Module fetches a list of values

c) You want to delete one such value(element) from the model and make it reflect in the back-end.

d) How do I approach this ?

Answer 2

=============

Using the same function module, this is not possible. Refer to Answer 1

Question 3

=============

a) You have an RFC Function Module

b) You want to remove an element from the model node so that it will reflect in the database.

c) Is this true ?

Answer 3

=============

False. Removing an element from Model node will not delete the value in the database.

Regards,

Subramanian V.

Former Member
0 Kudos

hi Subramanian,

Thanks a lot. But the problem is still there .I have created a new RFC for delete. I am catching the lead selection of the table and populating the structure of Delete RFC and executing it.

i do not know what is the problem?

Thanks in advance,

Gopi

Message was edited by: gopi nidjelli

Former Member
0 Kudos

Hi Gopi,

a) Check whether the RFC is working properly, are you able to delete the values using the RFC ?

b) If yes, please paste your Web Dynpro code here.

Calling any RFC remains same irrespective of its functionality. Therefore, just debug it as you debug any other function module/ Web Dynpro code.

Regards,

Subarmanian V.

Former Member
0 Kudos

hi subramanian,

Actually my main problem is I am unable to send any data to backend. I have even tested adding a record to the backend. When i test the RFC its working fine. but when i test it from webdynrpo data is not updated.

Code to ADD a record to backend.

<b>IPrivateProdgrp.IEt_PricegrpElement ele = wdContext.createEt_PricegrpElement(new Zvbak_Sapp());

ele.setErnam("GopiTest");

ele.setVbeln("0000011");

ele.setMandt("800");

wdContext.nodeEt_Pricegrp().addElement(ele);

wdThis.wdGetPrigrpcompController().Execute_Method();</b>

Et_Pricegrp is the node which i am populating during runtime. I want this data to be send to backend and append in the database.

Please help me.

Thanks in advance,

Gopi

Former Member
0 Kudos

Hi Gopi,

Please check if you are doing any bind or new element for the given function module in the component/custom controller PRIGRPCOMP.

Please paste the wdDoInit and execute_method code of the component controller as well.

a) You can debug and find out whether the values are really being passed to the required node (Input Node of the table ZVBAK_SAPP)

b) Make sure you have done a proper context mapping

c) In case you need a reference, please have a look at the tutorial Calling ABAP /BAPI function modules in the tutorial section of https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro

Regards,

Subramanian V.

Former Member
0 Kudos

hi,

<b>doinit method code.</b>

Zdelete_Price_Input price = new Zdelete_Price_Input();

wdContext.nodeZdelete_Price_Input().bind(price);

<b>execute_method()</b>

try {

wdContext.currentZdelete_Price_InputElement).modelObject().execute();

wdContext.nodeZdelete_Price_Input().invalidate();

} catch (WDDynamicRFCExecuteException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

Thanks in advance,

Gopi

Former Member
0 Kudos

Hi Gopi,

I see different parts of your code for two function modules you have used in the model.

In your last post, you have pasted the code for Zdelete_Price_Input function module. Please also post the code that you have written in the view to add the elements in the model.

Just to give a headstart,

a) You have created a new object of your function module using the following code :


Zdelete_Price_Input price = new Zdelete_Price_Input();
wdContext.nodeZdelete_Price_Input().bind(price);

Just make sure that in the view, you are referring to this element of your component controller and adding the values to this element. I am also assuming you are not using createNodeElement in your view for Zdelete_Price_Input function module.

Regards,

Subramanian V.

Former Member
0 Kudos

hi subramanian,

<b> Zdelete_Price_Input price = new Zdelete_Price_Input();

wdContext.nodeZdelete_Price_Input().bind(price);</b>

I have create the new object <b>price</b> for the function module in the compcontroll.

What i need is when i click ADD button i want the element to add to the backend. so i have created a new element for the model node in the view and added to it.

I am unable to get the instance price in view, that is the reason i have created the element in view and added it to the node.

how to access this instance price of CC in the view.

Thanks in advance,

gopi

Former Member
0 Kudos

If this is the problem:

a) Remove this code from component controller:


 Zdelete_Price_Input price = new Zdelete_Price_Input();
wdContext.nodeZdelete_Price_Input().bind(price);

b) Directly go to your ADD method


 Zdelete_Price_Input price = new Zdelete_Price_Input();

 
Zdelete_Price_InputElement priceElement = wdThis.wdGet<comp.controller>.wdGetContext().nodeZdelete_Price_Input().createZdelete_Price_InputElement();

 priceElement.setAttribute1("Value1");
 priceElement.setAttribute2("Value2");

wdThis.wdGet<comp.controller>.wdGetContext().nodeZdelete_Price_Input().addElement(priceElement);

wdThis.wdGet<comp.controller>.executeZdelete_Price_Input();

Regards,

Subramanian V.

Former Member
0 Kudos

Hi,

thanks for the quick reply.

I am unable to create element for the node<b>Zdelete_Price_Input</b>.

in the onActionADD method. Is any thing i need to do to create element for the node Zdelete_Price_Input?

Thanks in advance,

Gopi

Former Member
0 Kudos

What is the error do you get or what problem are you facing when you are trying to create the element ?

If it is a program error(compilation error), make sure you have imported the necessary packages. If it is anything else, please put it as detailed as possible.

Regards,

Subramanian V.

Former Member
0 Kudos

hi subramanian,

when iam trying to create an element for

Zdelete_Price_Input its not showing element option.

when i type Zdelete_Price_InputElement it says it cannot be resolved or not type.

Thanks in advance,

Gopi

Former Member
0 Kudos

Use <b><i>IPrivate<ViewName>.IZdelete_Price_InputElement</i></b> if you want to refer an element of type <i><b>Zdelete_Price_InputElement</b></i> from the view. For CC, use <b><i>IPublic<CCName>.IZdelete_Price_InputElement</i></b>.

Answers (0)