Need to help in alv grid graph
Hi All,
I made alv grid report.I put graph button in screen using pf status(&graph).
Now when I execute the report output come and my graph button is also working fine.But when I click
the graph button, the graph shows defalut column wise.Now I right click on graph and select chart type and then select LINES wise then graph shows LINES wise. Can we do default LINES wise so that
when I click on graph button then it should come LINES wise default.
Thanks,
Rakesh
HI,
You can do this using the FM GFW_PRES_SHOW
Check the sample program : DEMO_GFW_PRES_SHOW.
For more infomation:
refer to links:
Re: How to plot graph in ALV?
http://help.sap.com/saphelp_erp2005/helpdata/en/7e/daf830b46411d2961200a0c9308b1f/frameset.htm
hope this infromation helps you.
Thanks!
Similar Messages
-
F4 Help in ALV GRID class based
hi
you have any idea about how to invoke the F4 help in ALV GRID Class based program.,
if u have any other related document or program using F4 function in ALV GRId please send to me for reference
Thanks & Regards
K.Ghi for what kind of fields you need to give f4.
are they std or custom...
please let me know about the fields..
try to check my logic which i gave in the below post..
it will give f4 help to the fields(if thet are standard table fieldS)
Message was edited by: Vijay Babu Dudla -
F4 help in ALV grid by using function module?
Hi,
I need to get f4 search help in ALV grid for a certain fields by using function module method.
Please guide me.
Thank You.Hi
F4IF_INT_TABLE_VALUE_REQUEST use this fm to get f4 search help for a certain fields .
Regards
Divya -
How to get f4 help in alv grid in container-urgent
hi,
how to get f4 help in alv grid in container using abap objects
ganeshHi Ganesh,
Did you have a look at sample report BCALV_TEST_GRID_F4_HELP ?
Here is part of the header documentation:
*& Report BCALV_GRID_F4_HELP *
Purpose:
~~~~~~~~
This report illustrates the use of f4-Help in an alv grid control.
Background:
~~~~~~~~~~~
There a two possibilities to implement an f4-Help in the alv grid
control: one can either use standard f4-help or write one by Hand.
For the former there is nothing to do at all. This report shows how
to implement user-defined f4-help.
I am sure you will find within this report the solution you are looking for.
Reward points if this Helps.
Manish -
F4 help in ALV grid using existing search help
Hi All,
It would be appreciable , if some help on problem. Thanks in advance.
How to provide user defined F4 help in ALV grid using existing search help?
ALV grid has developed using OOPS concept.
Thanks,
Sudhakar.Hi,
if you already developed using OO concept, it should be possible to:
create a handler for event ONF4
The interface will tell you actual field name and value where F4 is pressed. This will enable you to call your own routine (see FM F4-IF....).
Please check how the standard handles F4 - if you have standard and customer-F4 mixed you shouldtake care that the standard handling is triggered.
Regards,
Clemens -
What is shortest way to attach particular Search Help in ALV grid using OOPS ?
Thanks Gurpreet,
Through search helps attached to data element it is possible but is there any other way to attach searchhelp differet from from the search help attached to the data element ? The new search-elp is not customized search help as given in the above threads ?
Eg. - If I want to attach MAT2 to a field named MATNR in the table instead of the MAT1 which is standard.
Thanks in advance -
Hi,
I am displaying Header and Item details in an ALV Grid. The first row will be having Header info and the next rows contains Item Details. I want to hide some of the columns of the first record only. The titles and the Item Details should remain same.
Can any body help me.
Regards,
SrinivasHello,
That cannot be done as you are displaying the header and item level data together. Let the fields you do not want to display be blank while you display.
Hope it helps.
Thanks,
Jayant -
Help on ALV grid needed...
HI, I am a new comer to SAP and I have some material on ALV grid but not enough to write code to display from an internal table to the grid. I have written the code using 2 methods:
1. set_table_for_first_display and
2. reuse_alv_grid_display
The code with reuse_alv_grid_disply works fine but am not able to add more functionality to the code as I dont have any material explaining the methods to be used with it. The code with set_table_for_first_display has some problem in it. The code for it is:
tables kna1.
data: BEGIN OF itkna1 OCCURS 0,
ktokd like kna1-ktokd,
kunnr like kna1-kunnr,
name1 like kna1-name1,
name2 like kna1-name2,
end of itkna1.
*creating an instance of grid
data it_custom_control_name type scrfname value 'CC_ALV'.
data it_container type ref to cl_gui_custom_container.
data it_alvgrid type ref to cl_gui_alv_grid.
data it_lyo type lvc_s_layo.
Selection-screen begin of block Enter_data with frame title text-001.
PARAMETERS pktokd like KNA1-ktokd OBLIGATORY.
SELECT-OPTIONS skunnr FOR KNA1-kunnr.
Selection-screen end of block Enter_data.
SELECT ktokd kunnr name1 name2
FROM kna1 into CORRESPONDING FIELDS OF TABLE itkna1
WHERE ktokd = pktokd AND kunnr IN skunnr.
*loop at itkna1.
write:/ itkna1-ktokd, itkna1-kunnr, itkna1-name1, itkna1-name2.
*ENDLOOP.
*prepare field catalog
data it_fcat type lvc_t_fcat.
data tmp_fcat like LINE OF it_fcat.
clear: it_fcat, tmp_fcat.
tmp_fcat-fieldname = 'KTOKD'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KTOKD'.
tmp_fcat-col_pos = '1'.
*tmp_fcat-inttype = 'C'.
*tmp_fcat-coltext = 'Customer Group'.
*tmp_fcat-seltext = 'Customer Group'.
*tmp_fcat-outputlen = '4'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'KUNNR'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KUNNR'.
tmp_fcat-col_pos = '2'.
*tmp_fcat-inttype = 'N'.
*tmp_fcat-coltext = 'Customer Number'.
*tmp_fcat-seltext = 'Customer Number'.
*tmp_fcat-outputlen = '10'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'NAME1'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'NAME1'.
tmp_fcat-col_pos = '3'.
*tmp_fcat-inttype = 'C'.
*tmp_fcat-coltext = 'name'.
*tmp_fcat-seltext = 'name'.
*tmp_fcat-outputlen = '12'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'NAME2'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'NAME2'.
tmp_fcat-col_pos = '4'.
*tmp_fcat-inttype = 'C'.
*tmp_fcat-coltext = 'name2'.
*tmp_fcat-seltext = 'name2'.
*tmp_fcat-outputlen = '12'.
append tmp_fcat to it_fcat.
*prepare layout
it_lyo-grid_title = 'Custormer details'.
*creating an instance of container class
create OBJECT it_container
EXPORTING
container_name = it_custom_control_name
EXCEPTIONS
cntl_error = 1
create_error = 2
OTHERS = 3.
*creating an instance of the grid
create OBJECT it_alvgrid
EXPORTING
i_parent = it_container
EXCEPTIONS
error_dp_create = 1
OTHERS = 2.
*displaying the grid
call METHOD it_alvgrid->set_table_for_first_display
EXPORTING
is_layout = it_lyo
i_structure_name = 'KNA1'
CHANGING
it_outtab = itkna1[]
it_fieldcatalog = it_fcat
EXCEPTIONS
invalid_parameter_combination = 1
others = 2.
It would be really helpful if some one could tell me what is wrong with this code and tell me where to get the material for extending code using type-pools-slis.
Thanks in advance!!!i cant see any call screen in your prog... if you have to display an alv first you have to create a screen and in that screen you have to create a custom control which will contain the grid... pls go thrugh the prog
here i have changed your code and it is working in my system just try this..
tables kna1.
data: BEGIN OF itkna1 OCCURS 0,
ktokd like kna1-ktokd,
kunnr like kna1-kunnr,
name1 like kna1-name1,
name2 like kna1-name2,
end of itkna1.
*creating an instance of grid
data it_custom_control_name type scrfname value 'CC_ALV'.
data it_container type ref to cl_gui_custom_container.
data it_alvgrid type ref to cl_gui_alv_grid.
data it_lyo type lvc_s_layo.
DATA : OKCODE LIKE SY-UCOMM.
Selection-screen begin of block Enter_data with frame title text-001.
PARAMETERS pktokd like KNA1-ktokd OBLIGATORY.
SELECT-OPTIONS skunnr FOR KNA1-kunnr.
Selection-screen end of block Enter_data.
SELECT ktokd kunnr name1 name2
FROM kna1 into CORRESPONDING FIELDS OF TABLE itkna1
WHERE ktokd = pktokd AND kunnr IN skunnr.
*loop at itkna1.
* write:/ itkna1-ktokd, itkna1-kunnr, itkna1-name1, itkna1-name2.
*ENDLOOP.
*prepare field catalog
data it_fcat type lvc_t_fcat.
data tmp_fcat like LINE OF it_fcat.
clear: it_fcat, tmp_fcat.
tmp_fcat-fieldname = 'KTOKD'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KTOKD'.
tmp_fcat-col_pos = '1'.
*tmp_fcat-inttype = 'C'.
*tmp_fcat-coltext = 'Customer Group'.
*tmp_fcat-seltext = 'Customer Group'.
*tmp_fcat-outputlen = '4'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'KUNNR'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KUNNR'.
tmp_fcat-col_pos = '2'.
*tmp_fcat-inttype = 'N'.
*tmp_fcat-coltext = 'Customer Number'.
*tmp_fcat-seltext = 'Customer Number'.
*tmp_fcat-outputlen = '10'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'NAME1'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'NAME1'.
tmp_fcat-col_pos = '3'.
*tmp_fcat-inttype = 'C'.
*tmp_fcat-coltext = 'name'.
*tmp_fcat-seltext = 'name'.
*tmp_fcat-outputlen = '12'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'NAME2'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'NAME2'.
tmp_fcat-col_pos = '4'.
*tmp_fcat-inttype = 'C'.
*tmp_fcat-coltext = 'name2'.
*tmp_fcat-seltext = 'name2'.
*tmp_fcat-outputlen = '12'.
append tmp_fcat to it_fcat.
*prepare layout
it_lyo-grid_title = 'Custormer details'.
call screen 100.
*creating an instance of container class
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ZSPD'.
* SET TITLEBAR 'xxx'.
create OBJECT it_container
EXPORTING
container_name = it_custom_control_name
EXCEPTIONS
cntl_error = 1
create_error = 2
OTHERS = 3.
*creating an instance of the grid
create OBJECT it_alvgrid
EXPORTING
i_parent = it_container
EXCEPTIONS
error_dp_create = 1
OTHERS = 2.
*displaying the grid
call METHOD it_alvgrid->set_table_for_first_display
EXPORTING
is_layout = it_lyo
*i_structure_name = 'KNA1'
CHANGING
it_outtab = itkna1[]
it_fieldcatalog = it_fcat
EXCEPTIONS
invalid_parameter_combination = 1
others = 2.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
call method cl_gui_cfw=>dispatch.
CASE OKCODE.
WHEN 'EXIT' OR 'BACK'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
regards
shiba dutta -
Hi,
I have written a program to display the details of customer in ALV Grid. I have also added code to add a hyperlink to the field name - KTOKD of the table KNA1. It would be helpful if anyone could tell me what is wrong with the code. The list is correctly displayed but the hyperlink is not working.
tables kna1.
data: BEGIN OF itkna1 OCCURS 0,
ktokd like kna1-ktokd,
kunnr like kna1-kunnr,
name1 like kna1-name1,
name2 like kna1-name2,
ktokd_hdl type int4,
end of itkna1.
*creating an instance of grid
data it_custom_control_name type scrfname value 'C_C_ALV'.
data it_container type ref to cl_gui_custom_container.
data it_alvgrid type ref to cl_gui_alv_grid.
data it_lyo type lvc_s_layo.
data it_fcat type lvc_t_fcat.
data tmp_fcat like LINE OF it_fcat.
data it_hype type lvc_t_hype.
data tmp_hype type lvc_s_hype.
Selection-screen begin of block Enter_data with frame title text-001.
PARAMETERS pktokd like KNA1-ktokd OBLIGATORY.
SELECT-OPTIONS skunnr FOR KNA1-kunnr.
Selection-screen end of block Enter_data.
SELECT ktokd kunnr name1 name2
FROM kna1 into CORRESPONDING FIELDS OF TABLE itkna1
WHERE ktokd = pktokd AND kunnr IN skunnr.
*prepare field catalog
clear: it_fcat, tmp_fcat.
tmp_fcat-fieldname = 'KTOKD'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KTOKD'.
tmp_fcat-col_pos = '1'.
tmp_fcat-web_field = 'ktokd_hdl'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'KUNNR'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KUNNR'.
tmp_fcat-col_pos = '2'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'NAME1'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'NAME1'.
tmp_fcat-col_pos = '3'.
append tmp_fcat to it_fcat.
tmp_fcat-fieldname = 'NAME2'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'NAME2'.
tmp_fcat-col_pos = '4'.
append tmp_fcat to it_fcat.
data: c_lines type I, count type I.
DESCRIBE table itkna1 LINES c_lines.
loop at itkna1.
count = count + 1.
tmp_hype-handle = count.
tmp_hype-href = itkna1-ktokd.
APPEND tmp_hype to it_hype.
itkna1-ktokd_hdl = count.
MODIFY itkna1.
ENDLOOP.
*prepare layout
it_lyo-grid_title = 'Custormer details'.
call screen 200.
module status_0200 OUTPUT.
*creating an instance of container class
CREATE OBJECT it_container
EXPORTING container_name = it_custom_control_name.
*creating an instance of the grid
create OBJECT it_alvgrid
EXPORTING i_parent = it_container.
*displaying the grid
call METHOD it_alvgrid->set_table_for_first_display
EXPORTING
is_layout = it_lyo
it_hyperlink = it_hype
CHANGING
it_outtab = itkna1[]
it_fieldcatalog = it_fcat
EXCEPTIONS
invalid_parameter_combination = 1
others = 2.
ENDMODULE.Try this..
give the field name in CAPITAL LETTERS..
*prepare field catalog
clear: it_fcat, tmp_fcat.
tmp_fcat-fieldname = 'KTOKD'.
tmp_fcat-ref_table = 'KNA1'.
tmp_fcat-ref_field = 'KTOKD'.
tmp_fcat-col_pos = '1'.
tmp_fcat-web_field =<b> 'KTOKD_HDL'.</b>
REGARDS,
SAI RAMESH -
Hi ihave a problem in alv grid i want display the longtext which was very long in characters it contains of more than 20 lines as shown below now i want the output the material number and shorttext description only one time but not as many times as there are lines in the long text that is i want to delete the remaining short text and material number for a single material number.
I'm posting here my ALv grid code also pla consider it and give me solution
FORM field_catalog.
***MATERIAL NO no
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'MATNR'.
int_cat-reptext_ddic = 'MATERIAL NO'.
APPEND int_cat .
*vender name
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'MAKTX'.
int_cat-reptext_ddic = 'MATERIAL SHORT DESCRIPTION'.
APPEND int_cat .
** PO No
int_cat-tabname = 'INT_OUT'.
int_cat-fieldname = 'TDLINE'.
int_cat-reptext_ddic = 'MATERIAL LONG DESCRIPTION'.
int_cat-outputlen = '100'.
APPEND int_cat .
endform.
*& Form display_data
* text
FORM display_data.
DATA : X_SORT TYPE SLIS_SORTINFO_ALV.
DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV.
X_SORT-SPOS = '1'.
X_SORT-FIELDNAME = 'MATNR'.
X_SORT-TABNAME = 'INT_OUT'.
X_SORT-UP = 'X'.
APPEND X_SORT TO IT_SORT.
CLEAR X_SORT.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = int_cat[]
* I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
* I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
** IS_LAYOUT = X_LAYOUT
** IT_FIELDCAT = IT_FIELDCAT
** IT_EVENTS = IT_EVENT
* IT_SORT = INT_OUT
TABLES
t_outtab = int_out
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "display_data
<b>
1000100000 Test material 1 1. DataSet vs DataReader
1000100000 Test material 1 # DataReader
1000100000 Test material 1 # Object to access data in a connected, forward-only, read-only
1000100000 Test material 1 fashion
1000100000 Test material 1
1000100000 Test material 1 # DataSet
1000100000 Test material 1 # Data structure to store schema and data in a disconnected fashion
1000100000 Test material 1 # Useful for editing data offline and later update to data source
1000100000 Test material 1
1000100000 Test material 1 2. What is Microsoft .NET?
1000100000 Test material 1 .NET represents an advanced new generation of software that will
1000100000 Test material 1 drive the Next Generation Internet. Its purpose is to make information
1000100000 Test material 1 available any time, any place, and on any device.
1000100000 Test material 1 Quick Definition
1000100000 Test material 1 .NET is an initiative to integrate all Microsoft products with
1000100000 Test material 1 the #Next Generation# web.
1000100000 Test material 1
1000100000 Test material 1 3. Recordset
1000100000 Test material 1
1000100000 Test material 1 ? Recordsets are generated one per table. This does not support
1000100000 Test material 1 hierarchical structure of data access. It will be programmer#s
1000100000 Test material 1 responsibility to define relationships among different recordsets.
1000100000 Test material 1 ? Rercordsets can not support data accessing from multiple sources.
1000100000 Test material 1
1000100000 Test material 1
1000100000 Test material 1 4. Connection-oriented Vs Connection-less
1000100000 Test material 1 ? Connection-oriented
1000100000 Test material 1 # Keeps the connection to the data base alive
1000100000 Test material 1 # Intended for applications with:
1000100000 Test material 1 ? short running transactions
1000100000 Test material 1 ? only a few parallel accesses
1000100000 Test material 1 ? up-to-date data
1000100000 Test material 1
1000100000 Test material 1 ? Connectionless</b>hi shiaba
i have allredy done like this but same out put is coming as per earlier.
i want to delete material No and short description only in one line not all line
if long description is 50 line
out ut is coming like this
MATERIAL NO MATERIAL SHORT DESCRIPTION MATERIAL LONG DESCRIPTION
1000100000 Test material 1 1. DataSet vs DataReader
1000100000 Test material 1 # DataReader
1000100000 Test material 1 # Object to access data in a connected, forward-only, read-only
1000100000 Test material 1 fashion
1000100000 Test material 1
1000100000 Test material 1 # DataSet
1000100000 Test material 1 # Data structure to store schema and data in a disconnected fash
1000100000 Test material 1 # Useful for editing data offline and later update to data sourc
1000100000 Test material 1
1000100000 Test material 1 2. What is Microsoft .NET?
1000100000 Test material 1 .NET represents an advanced new generation of software that wi
1000100000 Test material 1 drive the Next Generation Internet. Its purpose is to make info
1000100000 Test material 1 available any time, any place, and on any device.
1000100000 Test material 1 Quick Definition
1000100000 Test material 1 .NET is an initiative to integrate all Microsoft products with
1000100000 Test material 1 the #Next Generation# web.
but i want like below
MATERIAL NO MATERIAL SHORT DESCRIPTION MATERIAL LONG DESCRIPTION
1000100000 Test material 1 1. DataSet vs DataReader
DataReader
Object to access data in a connected, forward-only, read- fashion
DataSet
Data structure to store schema and data in a
2. What is Microsoft .NET?
.NET represents an advanced new generation of software drive the Next Generation Internet. Its purpose is to make available any time, any place, and on any device.
Quick Definition
.NET is an initiative to integrate all Microsoft products with
the #Next Generation# web.
thanks . -
Need help in ALV grid editable cells
Hi,
I have created a ALV Grid program in which i made certain cells as editable cells.Now my question is if suppose i have 2 rows in my output then if i change the 2nd rows some cells, then some calculation has to perform till this it is fine but nw i want to modify the 3rd rows some cells as per the changes in 2nd row.
How to do it with ALV oops concepts.
I have refered BCALV_EDIT_02 and BCALV_EDIT_03 these std programs.
Thanks & Regards
MadhuriHello Madhuri
I recommend to do any post-processing of the changed data OUTSIDE your event handler method (HANDLE_DATA_CHANGED).
Within the event handler method do all required validations and the trigger PAI by calling method CL_GUI_CFW=>SET_NEW_OK_CODE (for an example refer to my sample report ZUS_SDN_TWO_ALV_GRIDS in alv)
Now at PAI of your screen you can do any kind of post-processing, calculation, etc. within the itab used for the ALV list.
Regards
Uwe -
Need to display two ALV GRIDs in a single screen
Hi,
I have a question, i'm using version 4.6. I want to display 2 ALVs in a single screen or by calling.
Step 1 : The internal table (which holds the data for the ALVs has to be populated before calling ALV1 or ALV2)
Step 2 : Display In a single report
ALV1 report (Editable ,Has to be a GRID)
ALV2 report (Non Editable, Has to be a GRID)
(or)
Step 1 : The internal table (which holds the data for the ALVs has to be populated before calling ALV1 or ALV2)
Step 2 :
ALV1 report (Editable ,Has to be a GRID, with a custom button to call ALV2 hiding the ALV1 ie not visible to user)
ALV2 report (Non Editable ,Has to be a GRID, with a custom button to call ALV1 hiding the ALV2 ie not visible to user)
Please help me <b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada GalindoHi
ABAP List Viewer
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
Check the program in the following link:
http://sap-img.com/abap/display-secondary-list-using-alv-grid.htm
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. 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
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
13. Top-of-page in ALV
selection-screen and top-of-page in ALV
14. ALV Group Heading
http://www.sap-img.com/fu037.htm
How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
15. ALV output to PDF conversion
It has an example code for PDF Conversion.
http://www.erpgenie.com/abap/code/abap51.htm
converting the output of alv in pdf
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
The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
This helps us to implement all the features mentioned very effectively.
Using ALV, We can have three types of reports:
1. Simple Report
2. Block Report
3. Hierarchical Sequential Report
There are some function modules which will enable to produce the above reports without much effort.
All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
1. SIMPLE REPORT.
The important function modules are
a. Reuse_alv_list_display
b. Reuse_alv_fieldcatalog_merge
c. Reuse_alv_events_get
d. Reuse_alv_commentary_write
e. Reuse_alv_grid_display
A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
The important parameters are :
I. Export :
i. I_callback_program : report id
ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
iii. I_callback_user_command : routine where the function codes are handled
iv. I_structure name : name of the dictionary table
v. Is_layout : structure to set the layout of the report
vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
II. Tables :
i. t_outtab : internal table with the data to be output
B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
The Important Parameters are :
I. Export :
i. I_program_name : report id
ii. I_internal_tabname : the internal output table
iii. I_inclname : include or the report name where all the dynamic forms are handled.
II Changing
ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
declared in the type pool SLIS.
C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
Parameters :
I. Import :
Et_Events : The event table is returned with all possible CALLBACK events
for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
II. Export :
I_List_type :
0 = simple list REUSE_ALV_LIST_DISPLAY
1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = hierarchical-sequential block list
REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
Parameters :
I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
This internal table has three fields :
Typ : H header, S selection , A - action
Key : only when typ is S.
Info : the text to be printed
E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
Parameters : same as reuse_alv_list_display
This is an example for simple list.
2. BLOCK REPORT
This is used to have multiple lists continuously.
The important functions used in this report are:
A. REUSE_ALV_BLOCK_LIST_INIT
B. REUSE_ALV_BLOCK_LIST_APPEND
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_BLOCK_LIST_DISPLAY
A. REUSE_ALV_BLOCK_LIST_INIT
Parameters:
I. I_CALLBACK_PROGRAM
II. I_CALLBACK_PF_STATUS_SET
III. I_CALLBACK_USER_COMMAND
This function module is used to set the default gui status etc.
B. REUSE_ALV_BLOCK_LIST_APPEND
Parameters :
Export :
I. is_layout : layout settings for block
II. it_fieldcat : field catalog
III. i_tabname : internal table name with output data
IV. it_events : internal table with all possible events
Tables :
i. t_outtab : internal table with output data.
This function module adds the data to the block.
Repeat this function for all the different blocks to be displayed one after the other.
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
This function module is used for hierarchical sequential blocks.
D. REUSE_ALV_BLOCK_LIST_DISPLAY
Parameters : All the parameters are optional.
This function module display the list with data appended by the above function.
Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
3. Hierarchical reports :
Hierarchical sequential list output.
The function module is
A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
Parameters:
I. Export:
i. I_CALLBACK_PROGRAM
ii. I_CALLBACK_PF_STATUS_SET
iii. I_CALLBACK_USER_COMMAND
iv. IS_LAYOUT
v. IT_FIELDCAT
vi. IT_EVENTS
vii. i_tabname_header : Name of the internal table in the program containing the
output data of the highest hierarchy level.
viii. i_tabname_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
ix. is_keyinfo : This structure contains the header and item table field
names which link the two tables (shared key).
II. Tables
i. t_outtab_header : Header table with data to be output
ii. t_outtab_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using REUSE_ALV_FIELDCATALOG_MERGE.
Important Attributes :
A. col_pos : position of the column
B. fieldname : internal fieldname
C. tabname : internal table name
D. ref_fieldname : fieldname (dictionary)
E. ref_tabname : table (dictionary)
F. key(1) : column with key-color
G. icon(1) : icon
H. symbol(1) : symbol
I. checkbox(1) : checkbox
J. just(1) : (R)ight (L)eft (C)ent.
K. do_sum(1) : sum up
L. no_out(1) : (O)blig.(X)no out
M. outputlen : output length
N. seltext_l : long key word
O. seltext_m : middle key word
P. seltext_s : short key word
Q. reptext_ddic : heading (ddic)
R. ddictxt(1) : (S)hort (M)iddle (L)ong
S. datatype : datatype
T. hotspot(1) : hotspot
Regards
Anji -
Hi guys !!
Do you have any good manual or tutorial on how to create a alv grid, including all the steps for the abap program and the screen painter.
Thanks a lot !Javier,
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
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. 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
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
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
Don't forget to reward if useful.... -
Hi Experts,
I have created an ALV grid using classes. I need to bring standard F4 help in the ALV Grid.
Also the value that user enters should be returned back to the ALV.
Please provide some inputs.
Thanks.Hi,
cosider the below steps :
1.in Fieldcatalog set the field as editable like for eg.
WA_FIELDCAT-COL_POS = L_LIN.
WA_FIELDCAT-FIELDNAME = 'DATAB'.
WA_FIELDCAT-DATATYPE = 'DATS'.
WA_FIELDCAT-REPTEXT = 'Valid From'(T06).
WA_FIELDCAT-F4AVAILABL = 'X'.
WA_FIELDCAT-EDIT = 'X'.
APPEND WA_FIELDCAT TO I_FIELDCAT.
2. Define F4 on the fields you want:
DATA:
* Line of F4 table
L_S_F4 TYPE LVC_S_F4,
* Table for F4 relevant fields
L_T_F4 TYPE LVC_T_F4.
* F4 on datab
L_S_F4-FIELDNAME = 'DATAB'.
L_S_F4-REGISTER = 'X'.
L_S_F4-GETBEFORE = SPACE.
L_S_F4-CHNGEAFTER = SPACE.
APPEND L_S_F4 TO L_T_F4.
CLEAR L_S_F4.
similarly you can add other fields on which you want to provide F4
CALL METHOD P_G_ALV_GRID->REGISTER_F4_FOR_FIELDS
EXPORTING
IT_F4 = L_T_F4[].
3.Implement the metohds for Event handler:
METHOD HANDLE_ONF4.
<here you can call the F4 help>
Regards,
Neha -
Problems with F4 help in ALV grid
Hi all,
I am trying to create a F4 help for the field Payee number in my reprot output (ALV Grid OO), i am able to get the window for selection of the value in the F4 help , but i am unable to pass the value back on to the screen.
I need to insert the selected value from the F4 help and aslo need to populate the Name of the payee into the Payee field.
Can some one help me in finding what error have i done in the code.
Thanks in advance for all.
I have the following code
*& Include ZRMM_ALV_TOP *
data: gc_control100 type ref to cl_gui_custom_container,
gc_control101 type ref to cl_gui_custom_container.
data: gi_outtab100 type table of ty_purchase.
data: g_cont0100 type ref to cl_gui_custom_container,
g_grid0100 type ref to cl_gui_alv_grid, " For Screen 100 Grid
gi_fcat0100 type lvc_t_fcat, " Field Catalog for Screen 100
gi_sort0100 type lvc_t_sort,
g_lout0100 type lvc_s_layo.
data: okcode_100 like sy-ucomm,
save_0100 like sy-ucomm,
okcode_200 like sy-ucomm,
save_0200 like sy-ucomm.
types: begin of f4_itab_type,
LIFNR type lifnr,
BUKRS type name1,
end of f4_itab_type.
data: f4_itab type table of f4_itab_type,
ls_f4_itab type f4_itab_type.
data : it_IZEMTAB type table of IZEMTAB,
wa_IZEMTAB type IZEMTAB.
Class Definitions.
class event_receiver_0100 definition.
PUBLIC SECTION.
types: begin of onf4_event_parameters_type,
c_fieldname type lvc_fname,
cs_row_no type lvc_s_roid,
cr_event_data type ref to cl_alv_event_data,
ct_bad_cells type lvc_t_modi,
c_display type char01,
end of onf4_event_parameters_type.
data: fieldcatalog type lvc_t_fcat.
data : f4_alv type ref to cl_gui_alv_grid,
f4_cont type ref to cl_gui_custom_container.
data: f4_params type onf4_event_parameters_type.
METHODS:
ON_F4 FOR EVENT ONF4 of cl_gui_alv_grid
importing sender
e_fieldname
e_fieldvalue
es_row_no
er_event_data
et_bad_cells
e_display.
on_data_changed for event
data_changed of cl_gui_alv_grid
importing e_onf4
e_onf4_before
e_onf4_after
er_data_changed
e_ucomm
sender.
endclass. "lcl_event_receiver DEFINITION
data: gs_variant type disvariant,
gc_save value 'A',
gs_toolbar TYPE stb_button,
gs_toolbar1 type stb_button,
gs_toolbar2 type stb_button.
DATA : T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.
DATA : event_receiver_0100 TYPE REF TO EVENT_RECEIVER_0100.
Class Implementation.
class event_receiver_0100 implementation.
For f4 help.
method on_f4.
data: ls_outtab type ty_purchase.
field-symbols <itab> type lvc_t_modi.
data: ls_modi type lvc_s_modi,
ls_f4_itab type f4_itab_type.
f4_params-c_fieldname = e_fieldname.
f4_params-cs_row_no = es_row_no.
f4_params-cr_event_data = er_event_data.
f4_params-ct_bad_cells = et_bad_cells.
f4_params-c_display = e_display.
read table it_purchase into ls_outtab index f4_params-cs_row_no-row_id.
Clear f4_itab[].
CALL FUNCTION 'FI_VENDOR_ALTERN_PAYERS_READ'
EXPORTING
I_LIFNR = ls_outtab-lifnr
I_BUKRS = ls_outtab-bukrs
TABLES
T_ZEMTAB = it_izemtab.
clear f4_itab[].
if not ls_outtab-lifnr is initial.
loop at it_izemtab into wa_izemtab.
ls_f4_itab-LIFNR = wa_izemtab-empfb.
ls_f4_itab-BUKRS = wa_izemtab-name1.
append ls_f4_itab to f4_itab.
endloop.
endif.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'LIFNR'
DYNPPROG = sy-repid
DYNPNR = '100'
WINDOW_TITLE = 'f4 help for PAYEE'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = f4_itab
RETURN_TAB = T_RETURN.
IF SY-SUBRC <> 0.
ENDIF.
assign f4_params-cr_event_data->m_data->* to <itab>.
ls_modi-row_id = f4_params-cs_row_no-row_id.
read table f4_itab into ls_f4_itab index es_row_no-row_id.
if not f4_itab is initial.
ls_modi-row_id = es_row_no-row_id.
ls_modi-value = ls_f4_itab-LIFNR.
ls_modi-FIELDNAME = 'LIFNR'.
append ls_modi to <itab>.
ls_modi-row_id = es_row_no-row_id.
ls_modi-value = ls_f4_itab-BUKRS.
ls_modi-FIELDNAME = 'NAME1'.
append ls_modi to <itab>.
endif.
er_event_data->m_event_handled = 'X'.
ENDMETHOD.
*--ENDMETHOD SHOW_F4--
endclass. "lcl_event_receiver IMPLEMENTATIONI have used the following FM for F4 help on editable ALV grid column and it worked fine.Try the below.
Call function for Input helps
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = text-049
i_selection = c_check
i_zebra = c_check
i_screen_start_column = 55
i_screen_end_column = 125
i_screen_start_line = 10
i_screen_end_line = 20
i_tabname = c_fcat_str
it_fieldcat = tl_fieldcat
IMPORTING
es_selfield = wal_selfield
TABLES
t_outtab = tl_code
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSEIF sy-subrc = 0 AND NOT wal_selfield IS INITIAL.
wl_index = wal_selfield-tabindex.
READ TABLE tl_code ASSIGNING <l_code>
INDEX wl_index.
IF sy-subrc = 0.
<l_fgis_lots>-status = <l_code>.
ENDIF.
ENDIF.
ENDIF.
Maybe you are looking for
-
Deactivating from a computer that is not working.
So I just purchased an new computer to replace an old one that is not working. (I was due for an upgrade so I didnt bother trying to repair it) I need to install my CS6 to my new laptop, but I first need to deactivate the programs from the old comput
-
Just installed XP and Drivers, Now no mouse or keyboard
Alright, so I just installed Windows XP through Boot Camp and had everything running on my new iMac. As labeled in the instructions, I popped in the driver install CD after I had XP installed (at this point, the bluetooth keyboard and mouse were both
-
I need help transferring my number to AT&T
My husband and I have been Verizon customers for almost 6 years. Since I use my phone very little, it just made sense to have me in the "pay as you go" plan once my contract expired. I kept the same phone for years, but since the phone was starting t
-
Hi All, What is the best way of creating reports in ABAP-HR while retreiving data from infotypes. I mean to ask u among the four ways that i know 1. Using Macros 2. Using Provide.. Endprovide statement 3. Using Select statements 4. Using Function M
-
Hi there, I've got OSX 10.3.9 and I'm trying to connect it to my XBOX 360 using Connect 360. I cannot get it start. The installation went well, but I cannot get it to start, my firewall is set up correctly, my router appears to be the same, but when