cancel
Showing results for 
Search instead for 
Did you mean: 

Passing table to another component.

former_member215781
Active Participant
0 Kudos

Hi,

I am a newbie in ABAP Web Dynpro. I have a requirment wherein I need to pass values from 1 table into other table in different components.

Brief:

In my component A I have a table with columns A, B, C, D and an 'Add' button which on clicking opens a new pop up window. In this pop up window, I have a table with just one column and I am inporting .csv file to fill the table (1 column). When I click 'OK' in this pop window after importing values, I want these values to be passed to 'C' column in the table in component A.

Pop up window belongs to component B.

I need step by step help regarding how to transfer values from table in componnet B to a specific column of table in component A.

Accepted Solutions (1)

Accepted Solutions (1)

former_member215781
Active Participant
0 Kudos

@ Wahid / Manas - Can you please explain this step by step. I dont have much idea about how to go about this.

Former Member
0 Kudos

Hi,

you can achive this by component usage method as well....

in component A create an interface node...which you want to fill the data from component B....

in component B declare the usage of component A...now you have access to component A node which you want to fill using the values from B.....

that is all...

thanks...

AS...

here are the steps:

1) create component A with following context node at componentController level.:

MyNode

---colA

---colB

---colC

---colD

now select this node "MyNode" and you will see at the bottom half of the screen the properties will appear...

look for this property "Interface Node" check this one....this will make sure that your componentB can see this...

2) now create component B....select this component name....you will see on the right side of the screen two tabs:

"Used component" and "implemented interfaces"

select the "used component" tab...and write any name you like under the "component use" column....now go to second column "component" and do F4...and select your "componentA" component.

3) now go to componentController of "componentB"...and under the context tab hit the button "Controller Usage"

you will see that node you created in componentA is sitting on the right side of the window....just drag and drop to your component B context....on the left side.....

that is all....now you can do some logic to fill only "colC" of node "MyNode".....

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sim,

To my understanding, your component A is the mother component and you want to access the data from Component B and store the same to Component A.

If that is the case,

1. Create an attribute FETCH under the component A of type WDY_BOOLEAN.

2. Once the button is clicked to Fetch the Data from Component B. This can be done by creating an exit plug under the calling window of Component A and pass ABAP_TRUE to FETCH attribute of the Component A along with the URL of the called Component, by using EXPORT <data> SHARED BUFFER TO MEMORY MEM_ID.

3. Make sure that the second component must have the FETCH Attribute.

4. Once the Component Controller of the Component B gets the value for the FETCH attribute using IMPORT, you can get the data and store them in some standard table or customized table, and the moment, OK is pressed, you can get the values from the table and pass them to the column C of the Table from Component A.

Check and think on the logic, if you need further assistance please revert back.

Regards,

-Syed.

former_member215781
Active Participant
0 Kudos

I do not want to use any Z table to store these values. These values will be dynamic values and I need tp pass them from Component B to Component A

Former Member
0 Kudos

Hi Sim,

Then you can define the Component A as the interface to Component B. Adjacently pass the data to the Context node of Component A by mapping the same Context Node to Component B.

Check this, and please let me know.

Regards,

-Syed.

Former Member
0 Kudos

or you can have store the data in one class as a static class attribute and fetch it in diff components.