Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Grid Display in User Command need Clasical report........

Former Member
0 Kudos

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.

8 REPLIES 8

Former Member
0 Kudos

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.

former_member188685
Active Contributor
0 Kudos

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

abdul_hakim
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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...

0 Kudos

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

0 Kudos

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.

former_member186741
Active Contributor
0 Kudos

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...'.

Former Member
0 Kudos

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.