cancel
Showing results for 
Search instead for 
Did you mean: 

saving web dynpro's dats in a custom db table

Former Member
0 Kudos

Hello I'develop web dynpro component for cproject application. my question is how to save the new dats in a custom database table....where may I find some example?

I'm new to web dynpro technology I need documentation please...

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member226203
Active Contributor
0 Kudos

the process of SAVE will be the same. If u integrate the comp in the cproj, the compoonent will now be visible in the cprojects. so now if u enter some data in the component, u need to have a save button upon which the data enetered here should be saved in the table. so u need to frame the above logic in the SAVE method.

u can also have ur own set of logic for the other things like say on loading this particular component, some action is to be performed.u can hve such logic the on_load method.

former_member226203
Active Contributor
0 Kudos

what u need to do is, there must hve been some binding that u mapped with the custom table in the view of the webdynpro component.

Now,say the method ON_AFTER_SAVE gets triggered when u enter the data in the component and prtess save.

so in this method write the logic of the updation of the custom table.

DATA: Node_table type ref to if_wd_context_node,

elem_table type ref to if_wd_context_element.

node_table = wd_context->get_child_node( 'TABLE_DATA_SOURCE' ).

CALL METHOD node_table->get_static_attributes_table( IMPORTING

table = it_table ). " here it_table will be the internal table of the type as the structure that u created in the view.

now, get the data that u enter on the component into this internal table and modify the ztable from this internal table.

the ztable gets updated.

Former Member
0 Kudos

thank's to all replies!

I will try to apply all your answers.

my next question is: where I find some document who speak about my question? I found some tutorial but not helpful for me.

I've included my wd in cproject and I see my WD in Cproject application but the saving-step integration

is very hard to understand for me...

Former Member
0 Kudos

HI Fabio Coppi ,

You are working on c Projects ,so you have two options for saving the data to custome table.

Either you create a SAVE button on your view and implement the saving logic in that method

Or you can integrate the SAVE logic with the SAVE button present on the top of C project .To do this integration, use the standard SAVE events of c project and map it with your save method or event handler.

Regards

PG

Former Member
0 Kudos

You query is not quite clear. Are you working with table control ? DO you want to read the data from a table control and update your custom DB table ?

If so, you can refer this link for table control []

Former Member
0 Kudos

sorry for my question...I'm not working with table control. I've some fields in my WD and this fields must be saved in a db custum table.

the button 'Save' exist also. I must do the routine to save my new fields from WD to Database

thank's

Former Member
0 Kudos

Ok.

In this case you can read the values from the node using the following code,

Data l_node type ref to if_wd_context_node.

l_node = wd_context->get_child_node( 'NODE NAME' ). "your node name

l_node->get_attribute( exporting name = 'Attribute name'
                             importing value = l_value ).

l_value will have the content of  your field. You can use this to update yout DB table.

arjun_thakur
Active Contributor
0 Kudos

Hi Fabio,

I must have binded these fields with attributes. Now in the OnAction method of the save button, simply read all those attributes , get the values in an internal table and then simply use ABAP append/insert/modify statement to add data to DB table. You can read the attributes with the help of code wizard (ctrl + F7).

Regards

Arjun