cancel
Showing results for 
Search instead for 
Did you mean: 

Creating ALV Webdynpro Application

Former Member
0 Kudos

Hi Experts,

I have a new requirement to create a Webdynpro application , I have read so many document in SDN for this, from which I got to know that they are creating nodes at that time they are giving structure name as table name....and they are fatching data from single table but I have to fetch data from different table how do I create that with selection input parameter could any one give me some documents..in which they are fetching data from different table and showing the ALV outpt..

Please Help me out of his..

Thanks

Abhay Manna.

Accepted Solutions (1)

Accepted Solutions (1)

former_member193460
Contributor
0 Kudos

Hi Abay,

You can create a dictionary structure which contains all the fields which are required for you alv. Use that structure to create the context node attributes(make sure node cardinality is 0:N).

so on click of any action(button clicked), you can do a join operation of tables and then get the data projected into the internal table of type structure.

Bind that structure and your data should be displayed on alv.

Break down in steps:

Create structure with all the fields required(selected fields  from multiple tables)

Use the structure to create node attributes

Do the join operation in abap code and have it in an internal table of type structure.

bind the structure to the context node.

Regards,

Tashi

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Abhay,

If i'm not worng, you need to fetch data from multiple database tables and need to display data into single webdynpro ALV table right?

If that is your requirement, then below is the approach.

1)Double click on the Component controller(of the webdynpro comp). Right click on the CONTEXT and click on
create > node with cardinality 0..n.(Create ALV node with required fields from tables with cardinality 0..n.)

2)In the context tab of the view controller,drag and drop the component controller node into view controller( context mapping and context binding).

3)Double click on the Component name and Go to Properties tab of the component and declare the ALV component (SALV_WD_TABLE).

4) a)Now go to ‘Component usages’ in the left side tree and expand and double click on the INTERFACECONTROLLER_USAGE and click on the    CONTROLLER USAGE Button.

     b)Now the component controller will open in the right side panel . Drag and drop the node(which we want to show in table) into the DATA node of the Interface   Controller. This will declare a mapping. Meaning we have just declared which node is going to be displayed in the ALV.

5)SAVE everything. Double click the link, WINDOWS > WINDOW_NAME. Drag and drop MAIN view onto the Window. Now click on the arrow next to MAIN, you will see the View container(which we have created in view controller layout), Right click on container and click on EMBED VIEW. Embed the Input View in the container.Press F4 on the ‘View To Be Embedded’ input box and enter the TABLE
view of the WDP component.

6)Now this is the most important step of all is CODING.
   a) In WDDOINIT( ) of the view following steps has to be done.
       i) Instantiate the used component(using code wizard).      
       ii)Method call in used controller(usind code wizard).

       iii)And also fetch data from required(multiple) tables based on condition using " for all entries/joins etc(based on requirement)" into itab and bind the itab using bind_table( ) mtd.

Hope this will resolve your issue.

Thanks

KH

Former Member
0 Kudos

Dear Katrice Hawkins, Thank you very much for your helpful answer but I need to create selection input field...How? Thanks Abhay

former_member183073
Active Participant
0 Kudos

Abhay,

Do you mean that you want to have an input field and depending on the input you want to fetch data and project on the ALV?

if yes,

1. Create a Input field and button on the view(after the user enters the value he needs to click the button).

2. In the button properties create a method in onAction and write the code to fetch the value from the selection field which user has entered.

3. fetch the relevant data from the database prepare a final itab and bind it to the ALV.

refer this simple example: http://www.saptechnical.com/Tutorials/WebDynproABAP/SimpleApplication/SimpleApp1.htm

Former Member
0 Kudos

Dear Abhay,

Refer this link  Display web dynpro ALV report using select options . It will give you some idea regarding your requirement.

Thanks

KH