Application Development and Automation 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: 
Read only

ALV Reports

Former Member
0 Likes
1,359

Hi i am working on ALV reports for the first time.

Can anyone porvide me an elaborate study material also a material on ALV using object oriented .

Can anyone tell me ho to recognise whether a report is simple , hierarchial or blocked alv.

14 REPLIES 14
Read only

Former Member
0 Likes
1,302

Refer this wil be of more help

http://www.sapdevelopment.co.uk/reporting/alvhome.htm

Reward poinst if this helsp,

Read only

Former Member
0 Likes
1,302

Hello,

<b>Sample programs:</b>

http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm

http://www.sapdevelopment.co.uk/reporting/alvhome.htm

http://www.sap-img.com/fu015.htm

http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm

http://www.sap-img.com/abap/reincarnation-of-reuse-alv-fieldcatalog-merge.htm

<b>-->download the PDF from following link.</b>

<b>www.abap4.it/download/ALV.pdf</b>

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf

<b>Some more:</b>

http://www.sap-hefte.de/download/dateien/1025/087_leseprobe.pdf

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d97...

http://www.alvgmbh.de/dwnload/gonio_t.pdfhttp://

<b>Hierarchial</b>:http://www.sap-img.com/abap/how-to-use-alv-for-hierarchical-lists.htm

<b>Block Display</b>:http://www.sap-img.com/abap/reuse-alv-block-list-display.htm

<b>You can get all demo programs for ALV:

Go to se38 and type BCALV* and press F4 for all demo porgrams.</b>

<b>a basic sample program:</b>

In your screen,you should create a control area for the custom controller and name it as <b>'CONTAINER'</b>.

REPORT SAMPLE.

DATA: alv type ref to cl_gui_alv_GRID,

cont type ref to cl_gui_custom_container,

itab_spfli type table of spfli,

ok_code type sy-ucomm.

START-OF-SELECTION.

select * from spfli into table itab_spfli.

call screen 100.

END-OF-SELECTION.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

seT PF-STATUS 'GUI'.

  • SET TITLEBAR 'xxx'.

if cont is initial.

CREATE OBJECT cont

EXPORTING

CONTAINER_NAME = 'CONTAINER'.

CREATE OBJECT ALV

EXPORTING

I_PARENT = CONT.

CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

I_STRUCTURE_NAME = 'SPFLI'

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT =

  • IS_LAYOUT =

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

  • IR_SALV_ADAPTER =

CHANGING

IT_OUTTAB = itab_spfli

  • IT_FIELDCATALOG =

  • IT_SORT =

  • IT_FILTER =

  • EXCEPTIONS

  • INVALID_PARAMETER_COMBINATION = 1

  • PROGRAM_ERROR = 2

  • TOO_MANY_LINES = 3

  • others = 4

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

case ok_code.

when 'BACK'.

leave to screen 0.

when 'EXIT'.

leave to screen 0.

when 'SAVE'.

MODIFY spfli from table itab_spfli.

ENDCASE.

Regards,

Beejal

**Reward if this helps

Read only

Former Member
0 Likes
1,302

hi,

chk these:

http://www.geocities.com/victorav15/sapr3/abap_ood.html

/people/thomas.jung3/blog/2005/09/08/oo-abap-dynpro-programming

http://www.erpgenie.com/abap/index.htm

regards,

keerthi

Read only

Former Member
0 Likes
1,302

hi , beejal can u explain a little bit about the concept of ooalv

Read only

0 Likes
1,302

Hello Aman,

For OOALV,we define a container.Generally we use a custom container.The class used is <b>cl_gui_custom_container</b>.In the layout of your screen,make a custom container (icon with C written) and name it CONTAINER (in caps).Now create the container by going to the PATTERN button->ABAP objects.

We can now attach a control to the container.ALV,text editor,picture control are different types of controls.For ALV,we use the class <b>cl_gui_alv_grid</b>.Again you can create an instance by using the pattern button.The container name is given as the parent of the ALV in the constructor method.

We can use several methods of the ALV class to display data and for various functionalities.To display the data first time,we use <b>SET_TABLE_FOR_FIRST_DISPLAY</b> method.You can go to se24,type <b>CL_GUI_ALV_GRID</b> and click DISPLAY button.There you can see all the methods and attributes of the ALV class which you can use.

REPORT SAMPLE.

<b>**alv and cont are references to the respective classes.However,the objects are not created yet.</b>

DATA: alv type ref to cl_gui_alv_GRID,

cont type ref to cl_gui_custom_container,

itab_spfli type table of spfli,

ok_code type sy-ucomm.

START-OF-SELECTION.

<b>**I fill my internal table itab_spfli with the data that i want in my ALV display</b>

select * from spfli into table itab_spfli.

<b>**I call the screen.In the screen layout,i have made a container named CONTAINER</b>

call screen 100.

END-OF-SELECTION.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

seT PF-STATUS 'GUI'.

  • SET TITLEBAR 'xxx'.

<b>**If the container is being made for the first time,i create a container object.I m passing the name CONTAINER that i used in the screen layout here</b>

if cont is initial.

CREATE OBJECT cont

EXPORTING

CONTAINER_NAME = 'CONTAINER'.

<b>**The ALV object is created here and the parent name is the container object ie cont</b>

CREATE OBJECT ALV

EXPORTING

I_PARENT = CONT.

<b>**SET_TABLE_FOR_FIRST_DISPLAY method is called to display the data.I give the structure name SPFLI and the internal table which conatins the actual data ie itab_spfli</b>

CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

  • I_BUFFER_ACTIVE =

  • I_BYPASSING_BUFFER =

  • I_CONSISTENCY_CHECK =

I_STRUCTURE_NAME = 'SPFLI'

  • IS_VARIANT =

  • I_SAVE =

  • I_DEFAULT =

  • IS_LAYOUT =

  • IS_PRINT =

  • IT_SPECIAL_GROUPS =

  • IT_TOOLBAR_EXCLUDING =

  • IT_HYPERLINK =

  • IT_ALV_GRAPHICS =

  • IT_EXCEPT_QINFO =

  • IR_SALV_ADAPTER =

CHANGING

IT_OUTTAB = itab_spfli

  • IT_FIELDCATALOG =

  • IT_SORT =

  • IT_FILTER =

  • EXCEPTIONS

  • INVALID_PARAMETER_COMBINATION = 1

  • PROGRAM_ERROR = 2

  • TOO_MANY_LINES = 3

  • others = 4

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

case ok_code.

when 'BACK'.

leave to screen 0.

when 'EXIT'.

leave to screen 0.

when 'SAVE'.

MODIFY spfli from table itab_spfli.

ENDCASE.

-


Also try the transaction <b>ABAPDOCU</b> for simple ALV programs.

<b>For ALV:</b>

http://help.sap.com/saphelp_erp2005/helpdata/en/99/49b844d61911d2b469006094192fe3/frameset.htm

<b>For OO concepts:</b>

http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

Regards,

Beejal

**Reward if this helps

Read only

Former Member
0 Likes
1,302

Hi Aman,

Reports

http://www.sapgenie.com/abap/reports.htm

http://www.allsaplinks.com/material.html

http://www.sapdevelopment.co.uk/reporting/reportinghome.htm

How can I use ALV for reports that are going to be run in background?

http://www.sapfans.com/forums/viewtopic.php?t=83243

http://www.sapfans.com/forums/viewtopic.php?t=19224

http://www.geocities.com/mpioud/Abap_programs.html

http://www.sapdevelopment.co.uk/reporting/reportinghome.htm

Simple ALV report

http://www.sapgenie.com/abap/controls/alvgrid.htm

http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox

Go thru these programs they may help u to try on some hands on

ALV Demo program

BCALV_DEMO_HTML

BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode

BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode

BCALV_GRID_DEMO Simple ALV Control Call Demo Program

BCALV_TREE_DEMO Demo for ALV tree control

BCALV_TREE_SIMPLE_DEMO

BC_ALV_DEMO_HTML_D0100

General Tutorial for OOPS

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20ea...

OOPS ALV:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a41...

Regards,

Priyanka.

Read only

Former Member
0 Likes
1,302

what is d difference between a list , grid and tree.

Read only

Former Member
0 Likes
1,302

Hi Beejal

u gave me a demo program on ooalv.

can u plz explain it a little bit , tht is d procedure.

also i want to ask is the module pool programming to be done while working with object oriente alv

Kindly reply

Read only

0 Likes
1,302

Hello Aman,

The difference between list,grid,tree:

ALV lists are made using function modules whereas OOPS concept is used for ALV grids.

1. For all practical purposes, they are the same.

2. Some differences:

a) from abap coding point of view,

alv list is done with Function modules,

alv gris can also be done with FM,

but can also be done using OO concepts.

b) Alv grid (using oo concept) requires

designing the screen layout .

Hence, in one screen, we can show more

then one alv grid

(we cannot show more than

one alv list on one screen)

c) ALV grid uses ActiveX controls

present on the Presentation Server.

Hence, it consumes More Memory

on the presentation server.

d) ALV LIST is Display Only.

Whereas

ALV Grid Can Be made EDITABLE for entry purpose.

e) In alv grid, these options are possible,

but not in alv list.

without horizontal lines

without vertical lines

without cell merging during sorts

display total lines above the entries

ALV LIST Can be coded using only FMs

ALV GRID Can be coded using FMs and object oriented concepts

ALV LIST Can be displayed hieraicharlly

ALV GRID cannot be displayed hierarichally

ALV tree is another kind of control for which the class used is cl_gui_Alv_tree

Regards,

Beejal

**reward if this helps

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,302

Hi aman

Go to se 38 -> give balv* -> you can get the number of programs on ALV which can give you the clear idea on ALVs with all ALV functionality.

Regards,

kumar

Read only

Former Member
0 Likes
1,302

Hi,

if you are new to ALV try to use the link

http://www.alv-grid-display.de/alv_grid_en.html

this link is a automatic code generator and will be help full for the beginers.

also, goto se30 and type BCALV* and click F4,

you will get whole lot of sample programs of SAP on ALV's and if you look into them carefully, you will find the right code for your requirement.

Cheers

Ajay

Read only

Former Member
0 Likes
1,302

hi intellects ,

actually there is a requirement .

i am working on object oriented ALV.

after i get a primary list i have to generate secondary list too by clicking on a item,so can i use the event AT LINE SELECTION.

Read only

0 Likes
1,302

Hello Aman,

See this link;

http://www.sap-img.com/abap/display-secondary-list-using-alv-grid.htm

regards,

Beejal

**Reward points and please close the link if ur queries are answered

Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
1,302

Hi Aman,

I dont think, you can use AT LINE SELECTION in OO_ALV, Following is the List Of Events whic you can use:-

<b>Event Application</b>

button_click Query a click on a pushbutton in the ALV Grid Control

&#56256;&#56377;

double_click Query a double-click on a cell of the ALV Grid control

&#56256;&#56377;

hotspot_click Query a hotspot click on columns defined for this purpose in

advance

&#56256;&#56377;

onDrag Collect information when elements of the ALV Grid Control

are dragged

&#56256;&#56377;

onDrop Process information when elements of the ALV Grid Control

are dropped

&#56256;&#56377;

CHECK:-

www.abap4.it/download/ALV.pdf

for details.

Thanks and regards,

Ravi :).

NOTE: Points keep me alive on SDN .