ALV GRID capable to trigger multiple pages
Hi All,
I need some help on ALV grid display.
My requirement is :
I have got all my required data inside my final o/p internal table.
The first 2 columns of my o/p int table are MATNR (material no) and Location.
Now whenever this combination of MATNR and Location changes, I need to trigger a new page.
Also at te top of each page I will be displaying the material and location number.
I have to achieve this using ALV GRID display. I have tried this out in ALV LIST and its working but its not working incase ALV GRID is used.
I am giving an example of the scenerio for clear understanding
o/p Intarnal table (I_out)
<u>MATNR</u> <u>Location</u> <u>Details1</u> <u>Details 2</u> <u>Details3</u> ............
23 BE01 abc cde xyz
23 BE01 pqr efg rst
24 BE01 pqr efg rst
24 BE01 pqr efg rst
25 BE02 pqr efg rst
In this case, the 1st two records are for the same material and location details,
The 3rd and 4th record are for same material and Location details
and the last record is for a different combination of the material and location.
Hence the required o/p will be: (in ALV GRID display)
Material : 23
Location: BE01
<u>Detail1</u> <u>Detail2</u> <u>Detail3</u> .....................
abc cde xyz
pqr efg rst
Material : 24
Location: BE01
<u>Detail1</u> <u>Detail2</u> <u>Detail3</u> .....................
pqr efg rst
pqr efg rst
Material : 25
Location: BE02
<u>Detail1</u> <u>Detail2</u> <u>Detail3</u> .....................
pqr efg rst
This is the o/p format that i need to achieve and that too in ALV GRID display.
Please suggest suitable ways.
Dear Ramesh,
If I understand you correctly, you want to display a hierarchial form of display. However this won't be possible in ALV GRID Display as the maximum number of rows that you can set would be three. There by restricting you from displaying further information.
For further information on the same please refer to the following link:
Re: alv report
Best Regards,
Rajesh
<b>Please reward points if found helpful.</b>
Similar Messages
-
Multiple ALV GRID reports on a single page
hi all
I have an urgent requirement where I need to show 2-3 alv grids on a single page. Please let me know if it is possible to do so. If yes how. Sample code would be very helpful.
thanks in advance.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 16, 2008 1:45 PMHI,
Create multiple custom containers and call the method CALL METHOD sap_grid->set_table_for_first_display multiple times.
This will display multiple ALV grids on a single page.
Code Below:
MODULE create_objects OUTPUT.
CREATE OBJECT g_custom_container
EXPORTING
PARENT =
container_name = 'CUST_CRTL'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE e143(z1).
ENDIF.
*Create object for sap grid
CREATE OBJECT sap_grid
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = g_custom_container
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e144(z1).
ENDIF.
CREATE OBJECT g_custom_container1
EXPORTING
PARENT =
container_name = 'CUST_CRTL1'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE e143(z1).
ENDIF.
*Create object for sap grid
CREATE OBJECT sap_grid1
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = g_custom_container1
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e144(z1).
ENDIF.
CREATE OBJECT g_custom_container2
EXPORTING
PARENT =
container_name = 'CUST_CRTL2'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE e143(z1).
ENDIF.
*Create object for sap grid
CREATE OBJECT sap_grid2
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = g_custom_container2
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e144(z1).
ENDIF.
ENDMODULE. " create_objects OUTPUT
*& Module fill_fcat OUTPUT
text
MODULE fill_fcat OUTPUT.
CONSTANTS : lc_x TYPE c VALUE 'X',
lc_a TYPE c VALUE 'D'.
*Prepare field catalog for all Summary Report
wa_field-fieldname = 'BUKRS'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '12'.
wa_field-col_pos = '1'.
wa_field-coltext = text-002. "'Company Code'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'CURR'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '10'.
wa_field-col_pos = '2'.
wa_field-coltext = text-022."'Currency'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'KUNNR'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '10'.
wa_field-col_pos = '3'.
wa_field-coltext = text-005."'Customer Number'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'NAME1'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '13'.
wa_field-col_pos = '4'.
wa_field-coltext = text-007."'Customer Name'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'KLIMK'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '12'.
wa_field-col_pos = '5'.
wa_field-coltext = text-008. " 'Credit Limit'.
APPEND wa_field TO fcat.
CLEAR wa_field.
wa_field-fieldname = 'DMBTR'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '16'.
wa_field-col_pos = '6'.
wa_field-coltext = text-009. "'Current Balance Calculated'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'BLNC'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '23'.
wa_field-col_pos = '7'.
wa_field-coltext = g_bal_date. "'Balance b/f @ (Date taken from Z table) '.
wa_field-fix_column = 'X'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'DATE'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '8'.
wa_field-col_pos = '7'.
wa_field-coltext = text-021. "'Balance b/f Date @ Z Table balance'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'INVOICES'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '13'.
wa_field-col_pos = '8'.
wa_field-coltext = text-012. "'Invoices'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'PAYMENTS'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '13'.
wa_field-col_pos = '9'.
wa_field-coltext = text-013. "'Payments'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'DMBTR'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '23'.
wa_field-col_pos = '10'.
wa_field-coltext = g_bal_date1. "'Balance c/f @ (Date of Lodgement from selection screen)'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR wa_field.
wa_field-fieldname = 'CHECK'.
wa_field-tabname = 'T_BSID_BSAD'.
wa_field-outputlen = '13'.
wa_field-col_pos = '11'.
wa_field-coltext = text-020. "'CHECK'.
APPEND wa_field TO fcat.
CLEAR wa_field.
CLEAR g_layout.
g_layout-zebra = lc_x.
g_layout-sel_mode = lc_a.
*Prepare field catalog for all Invoice Extract
wa_field1-fieldname = 'BUKRS'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '12'.
wa_field1-col_pos = '1'.
wa_field1-coltext = text-002. "'Company Code'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'KUNNR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '13'.
wa_field1-col_pos = '2'.
wa_field1-coltext = text-005."'Customer Number'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'NAME1'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '13'.
wa_field1-col_pos = '3'.
wa_field1-coltext = text-007."'Customer Name'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'GJAHR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '7'.
wa_field1-col_pos = '4'.
wa_field1-coltext = text-015. " 'Fiscal Year'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'BELNR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '10'.
wa_field1-col_pos = '5'.
wa_field1-coltext = text-016. "'Invoice Number'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'CURR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '8'.
wa_field1-col_pos = '6'.
wa_field1-coltext = text-022."'Currency'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
wa_field1-fieldname = 'DMBTR'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '13'.
wa_field1-col_pos = '7'.
wa_field1-coltext = text-017. "'Invoice Amount '.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'BLDAT'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '12'.
wa_field1-col_pos = '8'.
wa_field1-coltext = text-018. "'Date of Shipment'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'DUEDT'.
wa_field1-tabname = 'T_INVOICE'.
wa_field1-outputlen = '13'.
wa_field1-col_pos = '9'.
wa_field1-coltext = text-019. "'Due Date Calculated'.
APPEND wa_field1 TO fcat1.
CLEAR wa_field1.
CLEAR g_layout1.
g_layout1-zebra = lc_x.
g_layout-sel_mode = lc_a.
*Prepare field catalog for all Payment Extract
CLEAR wa_field2.
wa_field2-fieldname = 'BUKRS'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '12'.
wa_field2-col_pos = '1'.
wa_field2-coltext = text-002. "'Company Code'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'KUNNR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '13'.
wa_field2-col_pos = '2'.
wa_field2-coltext = text-005. "'Customer Number'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'NAME1'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '13'.
wa_field2-col_pos = '3'.
wa_field2-coltext = text-007. "'Customer Name'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'GJAHR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '11'.
wa_field2-col_pos = '4'.
wa_field2-coltext = text-015. "'Fiscal Year'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'BELNR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '13'.
wa_field2-col_pos = '5'.
wa_field2-coltext = text-016. "'Invoice Number'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR wa_field2.
wa_field2-fieldname = 'CURR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '11'.
wa_field2-col_pos = '6'.
wa_field2-coltext = text-022."'Currency'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
wa_field2-fieldname = 'DMBTR'.
wa_field2-tabname = 'T_PAYMENT'.
wa_field2-outputlen = '13'.
wa_field2-col_pos = '7'.
wa_field2-coltext = text-017. "'Invoice Amount'.
APPEND wa_field2 TO fcat2.
CLEAR wa_field2.
CLEAR g_layout2.
g_layout2-zebra = lc_x.
g_layout-sel_mode = lc_a.
ENDMODULE. " fill_fcat OUTPUT
*& Module display_data OUTPUT
text
MODULE display_data OUTPUT.
g_layout3-variant = g_save.
CALL METHOD sap_grid->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
i_structure_name = 'gt_display'
is_variant = g_layout3
i_save = 'A'
i_default = 'X'
is_layout = g_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = t_bsid_bsad
it_fieldcatalog = fcat
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
MESSAGE e145(z1).
ENDIF.
g_layout4-variant = g_save1.
CALL METHOD sap_grid1->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
i_structure_name = 'gt_display1'
is_variant = g_layout4
i_save = 'A'
i_default = 'X'
is_layout = g_layout1
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = t_invoice
it_fieldcatalog = fcat1
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
MESSAGE e145(z1).
ENDIF.
g_layout5-variant = g_save2.
CALL METHOD sap_grid2->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
i_structure_name = 'gt_display2'
is_variant = g_layout5
i_save = 'A'
i_default = 'X'
is_layout = g_layout2
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
it_outtab = t_payment
it_fieldcatalog = fcat2
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
MESSAGE e145(z1).
ENDIF.
ENDMODULE. " display_data OUTPUT
*& Module exit INPUT
text
MODULE exit INPUT.
CALL METHOD g_custom_container->free.
CLEAR t_bsid_bsad[].
CALL METHOD g_custom_container1->free.
CLEAR t_invoice[].
CALL METHOD g_custom_container2->free.
CLEAR t_payment[].
LEAVE PROGRAM.
ENDMODULE. " exit INPUT
*& Module user_command_1100 INPUT
text
MODULE user_command_1100 INPUT.
MOVE g_ok_code TO g_saveok_code.
CLEAR g_ok_code.
CASE g_saveok_code.
*on BACK leave program
WHEN 'BACK'.
CALL METHOD g_custom_container->free.
CALL METHOD g_custom_container1->free.
CALL METHOD g_custom_container2->free.
CLEAR: g_custom_container,
g_custom_container1,
g_custom_container2.
LEAVE PROGRAM.
SET SCREEN 1000.
CALL TRANSACTION 'Z5172'.
CALL SELECTION-SCREEN 1000.
set screen 0.
leave screen.
*on CANCEL leave program
WHEN 'EXIT'.
CALL METHOD g_custom_container->free.
CALL METHOD g_custom_container1->free.
CALL METHOD g_custom_container2->free.
LEAVE PROGRAM.
*on CANCEL leave program
WHEN 'CANCEL'.
CALL METHOD g_custom_container->free.
CALL METHOD g_custom_container1->free.
CALL METHOD g_custom_container2->free.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " user_command_1100 INPUT -
Using GETGUI command --in ALV grid, how to extract multiple DATA
Using GETGUI command , I am able to get a single value form the ALV grid. Please explain me how I can read multiple data like rows and columns data from the ALV grid.
Please be detailed as I already tried selecting the whole block of ALV grid, but I could not help myself.
Regards
Srinivas.Hi Srinivas,
You will have to use the concept of Regular expressions for this. We will have to loop through each row/coloumn to do what u desire.
The ID of an element on grid will be something like GRIDNAME-<ELEMENT NAME>[ROW NO] [COLUMN NO]
we need to parameterize the row and also the el;ementname changes for each column along with the column number. Please let me know if this much detail is enough. If not i can show u a real time ecatt code snippet on how to play around with grids.
Regards,
Justin -
Problem in ALV Grid control in selecting multiple rows.
Dear All,
I am using ALV grid, in that first column is sel field user will select record and he press the customized button for one record it is working fine, but user unable to select multiple records without using CTRL key, and i used HOTSPOT on LIFNR field in this case when ever i ampressing LIFNR field it is takunf Fcode as &IC1 instead of LIFNR, i tried to solve this but i coudn;t succeded, please help me out in this .
Regards,
Madhu srujan.P
Edited by: Chinnu on Apr 9, 2010 5:26 PM
Edited by: Chinnu on Apr 9, 2010 5:30 PMI assume the first column contains the standard selection field of the ALV grid.
To enable the proper method of seletion, you need to pass the appropriate SEL_MODE in the your layout structure:
SEL_MODE is either SPACE, A, B, C or D.
Google for ALV grid PDF and you'll find some documentation on ALV grids in general. -
Alv grid layout display in 2 pages
Hi All,
I am presently working in ALV programming.
The client requierment is "GL line items and summary sheet will be listed in separate pages."
i am dispalying the output using ALV grid layout display.
Can you please conform that how to write logic for summary sheet.that will display after the line items and also saparate page.
Thanks,
SridharHi ,
Use event END OF PAGE .
Write a Form for end of page
then do calcualtions.
Reward if useful. -
Reg: Download alv grid data with top of page into excel sheet
Hi All,
I have a selection screen with radio button for download .
If that radio button was selected then the data will download into excel sheet (like if we execute normal ALV grid display from there we can download top-of-page and body as it is).
AOO : 2009P
Fiscal year : 2009
Posting period : 00
Local Currency : USD
CO Area Currency :
Accounting standard:
Sector : 23
BB code Period Value LC Periodic Quantity
AHDKGKAJ 200 0Did not get your question
-
ALV Grid Column name in multiple rows
Hi,
When ALV Grid is display columns are displayed horizontally in a single line.
Is there ne way to display the column names in 2 rows
e.g : Functional Location column should be shown as
Functional
LocationHi,
Actually it is not possible to disaply in multiple lines.
ALV grid Multiple Header ... ?
Re: Multiple lines in alv column headings
This problem was discussed many times in this forum, u can search for more results.
Message was edited by: Judith Jessie Selvi -
Hi
I am new this type of requirment. Please answer to my question.
I want to display in one page
Alv list, Alv Grid1 , Alv Grid2
Ex:
ALV list
Customer number
Customer Name
Customer address
ALV Grid1
Ord Number quatitiy
ALV GRID2
Component material description
The above 3 in one page.
Please provide function modules or classes or methods for this requirment.
Thanks
Suresh ThotaHi Suresh Thota,
When you have to display an ABAP list along with GUI controls, you have to use a docking control aside the ABAP list (dynpro SAPMSSY0 0120 ), at the top, left, right, or bottom. In this docking control, you'll place a splitter container to make 2 containers in which you'll place the ALV grid controls. You could also use 2 docking controls (one by ALV grid) but I think it won't be very nice.
The docking control should be instantiated during the generation of the ABAP list. As you need to use ALV list , you should implement it during an event, for example the END_OF_LIST event.
Creating each required component has been discussed many times in the forum, and there are also demo programs. Tell us where you need more help.
BR
Sandra -
Advanced row/grid level supression on multiple pages.
Hi,
I have defined a report with one dimension in Page axis. The dimension in Page axis has 10 members.
I have defined advanced supression at row level (also tried grid level) like
"Supress row if data value in a particular column is > 5."
This supression works only for the first member in the page axis, i.e 1st page. All other pages (starting form page 2 to last page) do not take this supression criteria.
Hyperion Financial Reporting Studio V9.3.1
Appreciate your thoughts.
Thanks.I think this works... kinda
1. I have a "list" that allows the selection of the item to edit.
2. That list opens a page that is the "header" page for a tab set.
3. Each page in the tab set uses the same "ID" to read the record and display the columns. That is how it would work if the list called each individual page.
4. I modified the "slave" tabs to have the "ID" of the "header" page.
This displays the correct data on each page. And it looks like the "apply changes" button saves the changes on the page.
Caveats inlclude (I think as I haven't done exhaustive testing"
1. "apply changes" must be done at each page where there were changes or they would be lost.
2. The first dispaly of the page is blank. Clicking on the tab a second time displays the data. This is true if it is the first time a user selects a record in a session (the "slave" tabs are blank) or if it is a subsequent record update (the "slave" tabs have the last records data.
Thoughts... is this really boring to everyone but me?
Sam -
ALV Grid -- Heading in each and every page while printing
Hello!!!!
How to display heading in ALV Grid in each and every page while printing?
Thanks in Advance!!!!!!Hi nitesh,
<b>data: lt_list_commentary type slis_t_listheader.
perform build_comment using
lt_list_commentary.
form build_comment using
pt_list_commentary type slis_t_listheader.
data: ls_line type slis_listheader.
clear ls_line.
ls_line-typ = 'H'.
ls_line-info = 'SREEKANTH REDDY'.
append ls_line to pt_list_commentary.
clear ls_line.
ls_line-typ = 'H'.
ls_line-info = 'HEADER1'.
append ls_line to pt_list_commentary.
clear ls_line.
ls_line-typ = 'H'.
ls_line-info = 'HEADER2TEXT'.
append ls_line to pt_list_commentary.
clear ls_line.
endform.
</b>In Function module REUSE_ALV_COMMENTARY_WRITE , give the parameter as
<b>it_list_commentary = lt_list_commentary </b>
Here ls_line-typ = 'H'. you can use options like 'H' , 'A' , 'S'. -
How to devide the top of page in alv grid display
hi all
in the alv grid display am getting the page number and total number of pages in the left hand side
but what i need is i need in the right hand side
how to get thatHi,
PLease refer to the code below:
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
* gd_layout-totals_only = 'X'.
* gd_layout-f2code = 'DISP'. "Sets fcode for when double
* "click(press f2)
* gd_layout-zebra = 'X'.
* gd_layout-group_change_edit = 'X'.
* gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL
* Form TOP-OF-PAGE *
* ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
* Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
* Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
* Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
* i_logo = 'Z_LOGO'.
endform.
* FORM USER_COMMAND *
* --> R_UCOMM *
* --> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* Check function code
CASE r_ucomm.
WHEN '&IC1'.
* Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
* Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
* Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
* Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
*& Form BUILD_EVENTS
* Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
* Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.
Thanks,
Sriram Ponna. -
SCANNING MULTIPLE PAGES TO SINGLE DOCUMENT ON 8620 FLAT GLASS
Does the HP Officejet Pro 8620 have the capability to scan multiple pages into a single document using the flat glass and not the auto feeder?
Use this when I want to scan a package or any item that won't fit through the auto feeder.
My Officejet Pro 8600 at work does by using a promptor after each page scannned that asks if there are more pages remaining to scan to same document.
If the answer is no, do I have to return my 8620 and purchase an 8600?
JackimoHi Jackimo,
A such can be done by launching the scan from the HP software on your PC.
Open the HP Officejet 8620 software and clcik on Scan a Document or Photo.
Select the PDF option, ensure the scan resolution is set as 300 or below and the Scan Source is set as Flatbed Glass.
As well ensure the Show Scan Preview option is checked and click on Scan.
Use the Plus button below the scan preview to scan additional pages from the glass, click on Save once you are done.
Regards,
Shlomi
Say thanks by clicking the Kudos thumb up in the post.
If my post resolve your problem please mark it as an Accepted Solution -
ALV Grid merge cells horizontally for specific record
Hi Experts,
We have a requirement regarding ALV Grid developement.
In ALV Grid, we will have multiple records as normal output.
Output will be as below.
In that, we need Summery Text should be in from Field 2 * to* Field 6 as a single Cell and below that all output
will be normal each cell wise.
That Summery will come for each new Field1.
OUTPUT
Field1 Field2 Field3 Field4 Field5 Field6 Field7 Field8 Field9
001 | . .... .. .. Summery ........... | 10 | 20 | 30
001 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 |
001 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 |
001 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 |
001 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 |
Thanks & regards
MangleshHi Manglesh,
sorry ALV is not as flexible as Excel may be.
You can only define a header in that way but it would be above the column headings.
The ALV table display allows only to change the width of the whole column.
Regards,
Clemens -
Hi all F4 in alv grid with restricted value -- no solution from forum
hi all
i have developed report using alv grid using FM (important).
i have a field xyz which is input/output enabled in alv grid output. this field is attached with f4 help.
my requirement is to get or read the row in alv grid when user press f4 on that field so that restricted value should come in f4 help i.e. i have to read current line when user presses f4 i.e. the single line data in alv grid.
so how to get or read the current row when user press f4 i.e user will choose any row in alv grid and this output is on alv grid and there are multiple records.
or in other word is it possible to read current row in alv grid when user presses F4, if yes how???.
i hope u understood the query.Hai,
Check the code it may help u.
For F4 Values on Screen:
PROCESS ON VALUE_REQUEST
using module call starting with FIELD i.e FIELD field MODULE module
There are number of function modules that can be used for the purpose, but these
can fullfill the task easily or combination of them.
DYNP_VALUE_READ
F4IF_FIELD_VALUE_REQUEST
F4IF_INT_TABLE_VALUE_REQUEST
POPUP_WITH_TABLE_DISPLAY
DYNP_VALUE_READ
This function module is used to read values in the screen fields. Use of this
FM causes forced transfer of data from screen fields to ABAP fields.
There are 3 exporting parameters
DYNAME = program name = SY-CPROG
DYNUMB = Screen number = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
and one importing TABLE parameter
DYNPFIELDS = Table of TYPE DYNPREAD
The DYNPFIELDS parameter is used to pass internal table of type DYNPREAD
to this FM and the values read from the screen will be stored in this table.This
table consists of two fields:
FIELDNAME : Used to pass the name of screen field for which the value is to
be read.
FIELDVALUE : Used to read the value of the field in the screen.
e.g.
DATA: SCREEN_VALUES TYPE TABLE OF DYNPREAD ,
SCREEN_VALUE LIKE LINE OF SCREEN_VALUES.
SCREEN_VALUE-FIELDNAME = 'KUNNR' . * Field to be read
APPEND SCREEN_VALUE TO SCREEN_VALUES. * Fill the table
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = SCREEN_VALUES.
READ TABLE SCREEN_VALUES INDEX 1 INTO SCREEN_VALUE.Now the screen value for field KUNNR is in the SCREEN_VALUE-FIELDVALUE and can be used for further processing like using it to fill the internal table to be used as parameter in F4IF_INT_TABLE_VALUE_REQUEST ETC.
F4IF_FIELD_VALUE_REQUEST
This FM is used to display value help or input from ABAP dictionary.We have to pass the name of the structure or table(TABNAME) along with the field name(FIELDNAME) . The selection can be returned to the specified screen field if three
parameters DYNPNR,DYNPPROG,DYNPROFIELD are also specified or to a table if RETRN_TAB is specified.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
TABNAME = table/structure
FIELDNAME = 'field name'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNR
DYNPROFIELD = 'screen field'
IMPORTING
RETURN_TAB = table of type DYNPREAD
F4IF_INT_TABLE_VALUE_REQUEST
This FM is used to dsiplay values stored in an internal table as input
help.This FM is used to program our own custom help if no such input help
exists in ABAP dictionary for a particular field. The parameter VALUE_TAB is used to pass the internal table containing input values.The parameter RETFIELD
is used to specify the internal table field whose value will be returned to the screen field or RETURN_TAB.
If DYNPNR,DYNPPROG and DYNPROFIELD are specified than the user selection is passed to the screen field specified in the DYNPROFIELD. If RETURN_TAB is specified the selectionis returned in a table.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = field from int table whose value will be returned
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'screen field'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = internal table whose values will be shown.
RETURN_TAB = internal table of type DDSHRETVAL
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.
POPUP_WITH_TABLE_DISPLAY
This FM is used to display the contents of an internal table in a popup window.The user can select a row and the index of that is returned in the CHOISE
parameter.The VALUETAB is used to pass the internal table.
A suitable title can be set using TITLETEXT parameter. The starting and end position of the popup can be specified by the parameters STARTPOS_COL / ROW and ENDPOS_ROW / COL .
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
ENDPOS_COL =
ENDPOS_ROW =
STARTPOS_COL =
STARTPOS_ROW =
TITLETEXT = 'title text'
IMPORTING
CHOISE =
TABLES
VALUETAB =
EXCEPTIONS
BREAK_OFF = 1
OTHERS = 2.
e.g.
DATA: w_choice TYPE SY-TABIX.
DATA: BEGIN OF i_values OCCURS 0 WITH HEADER LINE,
values TYPE I,
END OF i_values.
PARAMETRS : id TYPE I.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR id
i_values-values = '0001'.
APPEND i_values.
i_values-values = '0002'.
APPEND i_values.
i_values-values = '0003'.
APPEND i_values.
i_values-values = '0004'.
APPEND i_values.
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
ENDPOS_COL = 40
ENDPOS_ROW = 12
STARTPOS_COL = 20
STARTPOS_ROW = 5
TITLETEXT = 'Select an ID'
IMPORTING
CHOISE = w_choice
TABLES
VALUETAB = i_values
EXCEPTIONS
BREAK_OFF = 1
OTHERS = 2.
CHECK w_choice > 0.
READ TABLE i_values INDEX w_choice....now we can process the selection as it is contained
...in the structure i_values.
Other FM that may be used to provide input help is HELP_START .
check this also.
See the following ex:
TYPES: BEGIN OF TY_MBLNR,
MBLNR LIKE MKPF-MBLNR,
END OF TY_MBLNR.
DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
data: it_ret like ddshretval occurs 0 with header line.
At selection-screen on value-request for s_mat-low.
Select MBLNR from mkpf into table it_mblnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MBLNR'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_MBLNR
FIELD_TAB =
RETURN_TAB = IT_RET
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF SY-SUBRC = 0.
read table it_ret index 1.
move it_ret-fieldval to S_mat-low.
ENDIF.
Go through the test program.
REPORT Ztest_HELP .
TABLES : MARA.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_MATNR(10) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
DATA : BEGIN OF ITAB OCCURS 0,
MATNR TYPE MATNR,
END OF ITAB.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
SELECT MATNR
FROM MARA
INTO TABLE ITAB
UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATERIAL NUMBER'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
regards.
sowjanya.b. -
Alv Grid ctrl + y problem
hi all, I have a problem with an editable alv grid, if I copy multiple lines with ctrl + y and paste them in the last line the program creates new rows...but i don't want the creation of new rows.
Any suggestion?
Many thanks,
LucaSo how do you see it? You want to fit couple rows in one empty line? It's not too logical, is it? Ensure you have enough number of rows below the line you are trying to paste your copied lines. So if you copy 3 lines, you will have to start pasting from 3rd line from the bottom at most (not below that one).
Regards
Marcin
Maybe you are looking for
-
Need suggestion on adding Index on table
Hi, There is table called customer_locations in my database which has records about more then 5000 rows, When we write some select query to fetch data from this table takes too much time to load the data. Need a suggestion how to add index to increas
-
Need to update another users iweb site
I wan't to take over updating duties on another user's iweb site. They can't handle it so they'd like to defer to me. Is there a way to do this?
-
Hello, I am trying to know how many users logged in server and logged off from the server in a day. And how much time they were in the server. Is there any table or report from where i can fetch this report. Best Regards, Prashant Dubey
-
Why are some dots blue and some green?
When viewing showtimes in the trailers app, some showtimes are marked with a blue dot and some are marked with a green dot?
-
OSX Upgrade and new software purchases slow down Mac and Battery won't hold charge?
Any assistance appreciated: I have recently upgraded my OSX from Snow Leopard, which I was quite happy with, and was ticking over very nicely. And, today, I have problems??? I was using Snow Leopard, I purchased Mainstage 2 for my musical work... Nic