cancel
Showing results for 
Search instead for 
Did you mean: 

Search ALV using another window and view

Former Member
0 Kudos

Hi All - I develop an ALV (in main view) that is embedded to a main window that has multiple columns also I develop a second view that is embedded to a second window.

In the first view I have a button (search) that is calling a popup window(second window and showing the second view), in the popup window the view has multiple input fields (all the fields in the ALV that is in the main view but the input fields are not mapped to the ALV, I create a new context node similar to the ALV context now with the exception of the mapping) and if the user enter one of the many input field, once the "OK" button is being click I need to return a row in the alv that contain that value(main window and main view).

i.e. if I have multiples row (let say 100 row) in my ALV(main window & main view) and I want to do a search.....(search by closing date or search by Purchase Requisition Number, etc), I will click the search button and the pop up window will show, and in the closing date or PR NUMBER input fields or other input field, I enter something and I click the "OK" button, I need to see the the row that contain the values that I search for.

How I can communicate between two windows? How I can do the search?

Thanks!

-Jason P-V

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you designed another window for 2nd view. I guess this 2nd view is also not requried.

I think it is not requried. Embed the Main view in Main window and on click of the columns in MAIN view

use the code wizard to generate the Popup for the ALV component usage. In this popup you can have buttons and close of this you can return to main view.

In the code wizard, there is a option to open a ALV in a popup - create_window_for_cmp_usage of if_wd_window_manager.

Then you can avoid 2nd view, 2nd window also which is not required in your case.

About your requriement, can you be more clear.

Hope this is clear.

Regards,

Lekha.

Former Member
0 Kudos

My requirement is I need to have a button above the ALV (in a tray separate to the ALV that will display "SEARCH") the functionality of this button is once the user click the SEARCH button, a pop up with most of the fields of the ALV will come up as INPUT FIELDS i.e Smart NUmber,PR Number, CAGE, PAR Number, PAR Status, Due Date, etc. The user will enter input to one or many inputfield and once he click ok the ALV needs to show the return value of that search.

You are correct, I dont need the window but I do need the second view because the second view is the one that hold the inputfields the way the requirement says.

I dont know how to show a second view without a window because the wizard call window manager and ask for a window name.

If you could explain me how to call a popup view without a newwindow it would be great also how to return the values on the ALV once the user enter values in the inputfield.

Thanks!

-Jason P-V

Former Member
0 Kudos

Hi,

The second view that you want to display is in the form of the table(ALV) or like columnar format.

In the same window you embed the view.

If it is in columnar format, then you need to have a Modal Popup.ie separate window and seprate view.

Create a other node with 0:n cardianality with similar structure as ALV becasue they are shown in teh 2nd view.

One the user finds a record in the 2nd view, On the Ok button try to read these values and save to this new node and bind this

data to the node to which the ALV is bound.

Is there any case that the search returns more than one record.

Regards,

Lekha.

Edited by: Lekha on Oct 1, 2009 7:21 PM

Former Member
0 Kudos

The second view is not an ALV is only (label & input field) the lines _________ simulate input field for your reference.

i.e.

Smart Number: _________________ CAGE: ________________

SAP Number: __________________ etc: ___________________

another field: __________________

(OK button)

Once I enter a value in one or more of those inputfields and I click ok I need to return the rows that contain those values.

My status right now: I already create the POPUP without needing a second window using the wizard popup, now I need to read the values entered and validate the data in order to display the correct one in the ALV

Thanks

Jason P-V

Former Member
0 Kudos

Hi,

Create a context node(lo_nd_search_ with 0:1 cardinality that have all the necessary fields and map these to the 2nd views fields. Hope this is clear.

I assume that there is some table (LT_TABLE) which has all the data in it and also that some node is already bound to the ALV node right. (lo_nd_node).

Create an action for this OK button.

In the OK button action handler,

Try to read the lo_nd_search using get_static_attributes of if_wd_context_node/element(if is 0:1/1:1 cardinality) use the code wizard into some workarea ls_nd_search.

loop at lt_table into ls_table where smart = ls_nd_search-smart.

ls_table1 = ls_table.

append ls_table1 to lt_table1.

endloop.

Now, bind this lt_table1 to the lo_nd_node as it is bound to ALV .

Is this clear....

Regards,

Lekha.

Former Member
0 Kudos

Thanks Lekha!!!!

Solved!

Answers (0)