2007 Mar 01 6:15 AM
i need a report in alv that will output customers and vendors with open items. i am new to alv and i need some tutorials on alv
i need a report in alv that will output customers and vendors with open items. i am new to alv and i need some tutorials on alv
2007 Mar 01 6:18 AM
2007 Mar 01 6:18 AM
Hello,
You can display ALV using function modules or oops concepts.
<b>You can start with this:</b>
<b>-->download the PDF from following link.</b>
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
http://help.sap.com/saphelp_46c/helpdata/en/c5/3bd1369f2d280ee10000009b38f889/frameset.htm
<b>TUTORIALS:</b>
http://www.sapbrain.com/TUTORIALS/TECHNICAL/ALV_tutorial.html
http://www.sappoint.com/ppt/alv.ppt
<b>Very Good PDFs:</b>
http://www.esnips.com/doc/259cb6a6-0b6e-49b0-86dd-14b2cd1c3722/ALV-all-in-one-guide
http://www.esnips.com/doc/cf8c3bf7-fffe-4e2a-bdce-e06692f8a0e6/ALV_complete
http://www.esnips.com/doc/71cd736b-74cc-4728-a718-bf27f75eb1c6/ALV-Grid-Control
<b>Few good links with sample programs:</b>
http://www.sap-img.com/abap-function.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid
http://www.sapdevelopment.co.uk/reporting/alvhome.htm
<b>Check this link for classical ALV.</b>
http://www.geocities.com/mpioud/Abap_programs.html
<b>Simple ALV report</b>:
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
<b>Some more:</b>
http://www.sap-hefte.de/download/dateien/1025/087_leseprobe.pdf
http://www.alvgmbh.de/dwnload/gonio_t.pdfhttp://
<b>For DEMO programs:</b>
Go to se80 and type this:BCALV*.
Press F4.You will get all the demo programs.
<b>Also,try the transaction DWDM.</b>Check Grid control under that.
Regards,
Beejal
**reward if this helps
2007 Mar 01 6:33 AM
Hello,
Here is a simple program using ALV OO.
For OOALV,we <b>define a container</b>.Generally we use a <b>custom container</b>.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 <b>CONTAINER</b> (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 CL_GUI_ALV_GRID 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 = '<b>CONTAINER</b>'.
<b>**The ALV object is created here and the parent name is the container object ie cont</b>
CREATE OBJECT ALV
EXPORTING
I_PARENT = <b>CONT</b>.
<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.
Regards,
Beejal
**Reward if this helps
2007 Mar 05 10:31 PM
Hello Willard
Perhaps my sample report ZUS_SDN_THREE_ALV_GRIDS
could give you some ideas how to build your report. Instead of my drill-down (customer -> orders -> order items) you could use <b>two primary ALV lists</b> (customer and vendors) and a <b>single secondary ALV list</b> for drill-down to the open items for which you will find appropriate function modules.
Regards
Uwe
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |