11-25-2005 1:45 PM
Hi,
My requirement is to display Clasical report(as secondary list) when an user clicks a line in ALV grid Display(Basic list).
I know how to display secondary report in ALV, but my requirement is to display Clasical report.
Can any body suggest me what to do in User command form.
Thanks in advance.
11-25-2005 1:49 PM
It is juts like another ALV list processing. Suppose user clicks on DISPLAY in first screen. code in user command event will go like this.
When DISPLAY
Get the selected record or do processing to populate secondary list internal table
Populated field catalog for this table
call alv function module for this. You can use same pf-status but don't forget to exclude DISPLAY from this pf-status while displaying secondary list.
11-25-2005 2:02 PM
Populate secondary list internal table
and use <b>leave to list-processing.</b>
if your problem solves Please Close and reward points for helpful answers.
regards
vijay
Message was edited by: Vijay Babu Dudla
11-25-2005 3:07 PM
Hi
When the user presses the display button on the application toolbar then you code in the PAI of the corresponding ALV screen(hope u r using OO Approach through containers) LEAVE TO LIST-PROCESSING after stroring your result in a resultant itab..Then you will get a classical list..
Regards,
Abdul
11-25-2005 3:26 PM
Hi,
Thanks for the suggestions...
I am able to collect the data which I neet to output.
I am using <b>leave to list processing</b> and my code is executing when I check in debuging mode
But I could not see the output.
if I call another ALV grid display it is working fine but that is not my requirement.
I am not using the OO Approach through containers...
11-25-2005 3:41 PM
Hi
Satish.
Use OO approach it is quite simple
Create a screen in se51 say 100.
then define a variable in the data declaration.
DATA: doc TYPE REF TO CL_GUI_DOCKING_CONTAINER,
alv TYPE REF TO CL_GUI_ALV_GRID.
In the PBO of the screen do the below things.
CREATE OBJECT doc EXPORTING extension = 3000."grid size
CREATE OBJECT alv EXPORTING i_parent = doc.
CALL METHOD alv->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'structname'
CHANGING
IT_OUTTAB = int_final.
'structname' is nothing but create a structure in the ddic which will contain all the fields which you want to display in the alv..
Define SET PF-STATUS as well.
There you add some button named 'DISPLAY' in the application toolbar.
In the PAI of the screen let say 100
write the below code..
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'DISPLAY'.
LOOP AT ITAB.(table containing sec list data)
WRITE:/ ITAB-NUM1,
ITAB-NUM2.
ENDLOOP.
LEAVE TO list-processing.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
This will help you a lot...
Regards,
Abdul
Message was edited by: Abdul Hakim
11-25-2005 4:00 PM
hi satish,
You can also try this approach. Create a blank screen. From the USER_COMMAND form , call this screen with size parameters provided. In PBO of that screen, use leave to list processing followed by write statements. Your list will be shown in separate screen.
11-28-2005 3:08 AM
sorry if I'm stating the obvious... but you have got a WRITE statement somewhere haven't you? The following works for me:
FORM user_command
USING i_ucomm LIKE sy-ucomm
i_selfield TYPE slis_selfield.
CASE i_selfield-fieldname.
Business name.....
WHEN 'BUSINESS'.
LEAVE TO LIST-PROCESSING.
WRITE:/ 'HERE WE HAVE AN EXAMPLE OF A CLASSIC REPORT...'.
11-28-2005 6:00 AM
after clicking the display button,
1.Clear the Itab using for the list display.
2.Get the values in the same internal table u are using to display the first Display.
3.Clear the fieldcat and Build it again for the new internal table and display using Reuse_ALV_LIST_DISPLAY
Another method is u can display it thru' 'REUSE_ALV_POPUP_TO_SELECT'
If it helps u, reward points.