How to use two ALV grids in a single program (pl read below for details)?
Please read thoroughly::
I have an ALV report using REUSE_ALV_GRID_DISPLAY.
On the output of this report, when I click on a "change" button, a couple of columns should be made editable.
I achieved this by modifying the fieldcatalog and triggering the output with another REUSE_ALV_GRID_DISPLAY.
When I click on the back button of this second report, it is still taking me to the first one.
How to over come this?
Note:
I used custom containers etc but the default buttons on the container are not controllable. I added custom buttons but could not suppress the default ones. So I did not pursue this much even though this is more comfortable to use.
I am not able to get into the code in debug to see how the default buttons like COPY, INSERT ROW etc are working.
Can any body throw some inputs into this?
Thanks,
Ven.
>I achieved this by modifying the fieldcatalog and triggering the >output with another REUSE_ALV_GRID_DISPLAY.
>When I click on the back button of this second report, it is still >taking me to the first one.
>How to over come this?
For this there is a solution
i am thinking you are using user_command and calling the second time ALV Grid if so check this.
form user_command using r_ucomm type sy-ucomm selfield type slis_selfield.
case r_ucomm.
when 'CHANGE'.
selfield-exit = 'X'. "use this , this will solve the problem
"i hope you are calling the Function here
endform.
Similar Messages
-
Two AlV Grids in a single screen
I want to bring two ALV GRIDS in a single report output screen.How can i achieve this through Classical coding( not OBJECT ORIENTED ). If possible please provide with codes.
thanks,
VenkatHello Venkat
I agree that using fm's this is an almost impossible task whereas using OO-based ALV lists it is just a piece of cake.
For a sample have a look at report ZUS_SDN_TWO_ALV_GRIDS in thread alv
or report ZUS_SDN_THREE_ALV_GRIDS in thread Alv
Regards
Uwe -
Two ALV Grids in a single screen are overlapping eachother
Hi,
I have created two ALV grids in a single screen. I have used seperate containers for them.
But on executing them , both the ALV grids are overlapping eachother.
Please give me a solution.Hi,
IF w_custom_container IS INITIAL.
Creating Object for the Custom Container.
CREATE OBJECT w_custom_container
EXPORTING
container_name = w_container
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
CASE sy-subrc.
WHEN 1.
MESSAGE e054. "CNTL ERROR
WHEN 2.
MESSAGE e055. "CNTL SYSTEM ERROR
WHEN 3.
MESSAGE e056. "CREATE ERROR
WHEN 4.
MESSAGE e057. "LIFETIME ERROR
WHEN 5.
MESSAGE e058. "LIFETIME DYNPRO DYNPRO LINK
ENDCASE.
Creating object for the Splitter Container.
CREATE OBJECT w_split_container
EXPORTING
parent = w_custom_container
orientation = 0
sash_position = 30
with_border = 2
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CASE sy-subrc.
WHEN 1.
MESSAGE e054. "CNTL_ERROR
WHEN 2.
MESSAGE e055. "CNTL_SYSTEM_ERROR
ENDCASE.
Creating Grid Control.
CREATE OBJECT w_grid1
EXPORTING
i_parent = w_split_container->top_left_container.
CREATE OBJECT w_grid2
EXPORTING
i_parent = w_split_container->bottom_right_container.
Building field catalog for ALV.
Fieldcat for the Detail Record.
PERFORM build_fieldcat USING: c_1 c_code c_output c_check
c_comcode c_olength,
c_2 c_fileno c_output c_check
c_filenum c_olength,
c_3 c_dedcod c_output c_check
c_dedcode c_olength,
c_4 c_dedfac c_output c_check
c_dedf c_olength.
FieldCatlog for the Error Records.
PERFORM build_fieldcat_error USING: c_1 c_pernr c_error c_check
c_person c_olength,
c_2 c_desc c_error c_check
c_descp c_olength.
ALV Display.
CALL METHOD w_grid1->set_table_for_first_display
EXPORTING
i_buffer_active =
i_bypassing_buffer =
i_consistency_check =
i_structure_name =
is_variant =
i_save =
i_default = 'X'
is_layout =
is_print =
it_special_groups =
it_toolbar_excluding =
it_hyperlink =
it_alv_graphics =
it_except_qinfo =
ir_salv_adapter =
CHANGING
it_outtab = t_error
it_fieldcatalog = t_fieldcat_error
it_sort =
it_filter =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
CASE sy-subrc.
WHEN 1.
MESSAGE e076. "invalid parameter combination
WHEN 2.
MESSAGE e001. "program error
WHEN 3.
MESSAGE e078. "too many lines
ENDCASE.
CALL METHOD w_grid2->set_table_for_first_display
EXPORTING
i_buffer_active =
i_bypassing_buffer =
i_consistency_check =
i_structure_name =
is_variant =
i_save =
i_default = 'X'
is_layout =
is_print =
it_special_groups =
it_toolbar_excluding =
it_hyperlink =
it_alv_graphics =
it_except_qinfo =
ir_salv_adapter =
CHANGING
it_outtab = t_output
it_fieldcatalog = t_fieldcat
it_sort =
it_filter =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
CASE sy-subrc.
WHEN 1.
MESSAGE e076. "invalid parameter combination
WHEN 2.
MESSAGE e001. "program error
WHEN 3.
MESSAGE e078. "too many lines
ENDCASE.
ELSE.
CALL METHOD w_grid1->refresh_table_display
EXPORTING
i_soft_refresh = 'X'.
CALL METHOD w_grid2->refresh_table_display
EXPORTING
i_soft_refresh = 'X'.
ENDIF.
Hope it Helps,
Jayant Sahu. -
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 -
How to cretae two flat file with a single program
Hi All,
I am trying to creating to two files on the application server using the open data set and close data.
lets say the first file is file1 and second file is file2. but when i go to the Tcode AL11 and check the file only second file is appears there.
its may be coz i m using two times this open data and close data in my program.
can u tell help me howz these two file is appears on the application server i.e AL11.
its very urgent pls help me.
Thanks!
VipinHi Do one thing,
Start ur program in debugging mode complete first open data set and close data set and then go and chekc whehter the file got created or not and also check the sy-subrc values when u r doing ur open data set.
if the first file is not done then no file will be in AL11 including ur new file name.
In this way you can find whether the file got created or not.
check that u r giving differnet file names fifferently otherwise it will be keep on overwriting the existing one.
Regards,
sasi -
How to use two JS attributes in the single column
Hi friends,
I have a tabular form. In that for the one of the column i need to display the content of that column in the right justified manner and for that i have given the below code in the element attributes of the column
style="text-align:right;"The above is working fine as i can able to print the content in the right justified.
In that same column i need to receive a calculated value and this value only needs to be printed in the right justified manner.
For that i have created a function in the javascript and called that function in the element attributes of that column like
onfocus="calculateNet(this);"But how i can able to call both codings in the same element attribute in the tabular column.
i tried by giving like specifying comma in between the two, but none of it is firing, what may be the problem and how i can able to give the two in the same element attribute section of the column in tabular form.
Brgds,
MiniHi dirk,
Thanks it worked well.
I have one question for you in the tabular form.
i have totally 10 columns in my tabular form, in that 9 column is of database column and only one column is non-database column, while updating the row in the tabular form it is throwing the below error like
Current version of data in database has changed since user initiated update process. current row version identifier = "A0FD649E5A28DF9244990A3B9368298A" application row version identifier = "44CE02A233595BCA6F7D4A140BD4DF30" (Row 1)I thought the above error is due to the existence of non-database column in my tabular form. Is there any way to solve this issue. I need to have a non-database column in my tabular form but the presence of that column is not allowing to perform update in that tabular form.
how to get rid of this issue dirk.
Any ideas??
Brgds,
Mini -
How to use two different fonts in a single label?
Hello all,
Is there any way to use font of 2 different size and color for a single label?
Looking for a quick replies from you.
Regards,
ObaidNo. One label, one font, size and color.
-
How can I get the selected rows from two ALV grids at the same time?
I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
How can I select the rows, then click on just one button, and process the marked entries from both grids?
Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
Thanks.Hello Tamas ,
If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
is it possible to have a check box in each grid & get the selected lines in PAI of the screen ?
regards
prabhu -
Popup instead of list when using WD4A ALV Grid Drop Down By Key
I am develop a WD4A application and I am using an ALV grid. I have set the cell editor for one column wiht the following code:
CREATE OBJECT lr_ddbk
EXPORTING
SELECTED_KEY_FIELDNAME = 'ZCURRENCY'.
Data: lv_key_visable TYPE abap_bool,
lv_key_visible_fieldname TYPE string.
lr_ddbk->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
* lv_key_visable = lr_ddbk->GET_KEY_VISIBLE( ).
* lv_key_visible_fieldname = lr_ddbk->GET_KEY_VISIBLE_FIELDNAME( ).
* lr_ddbk->SET_KEY_VISIBLE( abap_false ).
lr_alv_column->SET_CELL_EDITOR( lr_ddbk ).
This code works fine. I then fill the drop down with the following code:
*...Build the currency drop down list
DATA lv_default_currency TYPE wdr_context_attr_value.
DATA lv_currency_count TYPE STRING.
DATA ls_tcurt TYPE tcurt.
CLEAR ls_contextvalue_set.
CLEAR lt_contextvalue_set. REFRESH lt_contextvalue_set.
CLEAR lv_default_currency.
loop at it_ac_attr into ls_ac_attr.
if ls_ac_attr-attr_id eq 'CUR'.
select single * from tcurt into ls_tcurt
Where spras = 'EN' AND
waers = ls_ac_attr-value.
If sy-subrc = 0.
ls_contextvalue_set-value = ls_ac_attr-value.
ls_contextvalue_set-value = ls_ac_attr-value.
ls_contextvalue_set-text = ls_tcurt-ktext.
IF ls_ac_attr-DFT_FLAG = 'X'.
lv_default_currency = ls_contextvalue_set.
ENDIF.
append ls_contextvalue_set to lt_contextvalue_set.
endif.
Endif.
endloop.
lo_nd_zebuy_describe_item_info = lo_nd_zebuy_describe_item->get_node_info( ).
lo_nd_zebuy_describe_item_info->set_attribute_value_set(
exporting
name = 'ZCURRENCY'
value_set = lt_contextvalue_set ).
*...End build currency drop down list
This code works fine. The issue I am having is that the drop down is behaving like a search help field rather than a drop down list. Meaning a popup comes when I drop down the list. The popup has the values I have set. I don't want a popup I want a drop down list. Additionallly the field is editable (meaning I can type a value into the field as well as select a value). I want the user to only be able to select values from the list. Any help with this issue would be appreciated.I fugured out what I was doing wrong. I was setting the cell editor to cl_salv_wd_uie_input_field later in the code by mistake.
-
How to send the ALV GRID output to spool by using the print button in std t
How to send the ALV GRID output to spool by using the print button in standard tool bar.
We have created a button in the va02 transaction. If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept. But i am unable to send the output to spool using the print button in the standard tool bar.
I am able to display the Print parameter dialog box but i am not able to send it to spool.
Kindly help.
Thanks In Advance.
G.V.RamanaHi Shaik,
There is not properties button in my print screen.
MODULE user_command_0900 INPUT.
WHEN 'EXCEL'.
PERFORM excel_download.
WHEN 'PRI'.
PERFORM print_output.
form Print_output.
CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
EXPORTING
columns = 80
device = 'ANY '
lines = 65
maxpenality = 1999
TABLES
layouts = lt_layouts1
EXCEPTIONS
unknown_device = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT lt_layouts1.
IF lt_layouts1-penality < 1000 AND
lt_layouts1-penality < l_min_penality.
l_layout = lt_layouts1-layout.
l_min_penality = lt_layouts1-penality.
ENDIF.
ENDLOOP.
IF NOT l_layout IS INITIAL.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
mode = 'CURRENT'
line_size = 80 "#EC *
new_list_id = l_new_list_id
no_dialog = l_no_dialog
layout = l_layout
IMPORTING
out_archive_parameters = rs_arc_params
out_parameters = rs_pri_params
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc NE 0. " INS SLIN
ENDIF. " INS SLIN
IF rs_pri_params-linsz LT 80 OR
rs_pri_params-linsz LT gt_stack-s_lprint-width.
gt_stack-print_line_break = 'X'.
ELSE.
CLEAR gt_stack-print_line_break.
ENDIF.
IF l_valid NE 'X'.
rs_pri_params = ls_pri_params_sav.
rs_arc_params = ls_arc_params_sav.
ENDIF.
ENDIF.
ENDIF.
endform. " Print_output
CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
EXPORTING
is_layout = gs_layout_cost_tot_grand
CHANGING
it_fieldcatalog = gt_fcat_cost_tot_grand[]
it_outtab = gt_cost_tot_grand[].
Please check my code -
Can we have two alv grid in the output
Hi
Can we have two alv grid in the output?. If yes how can we do that using oops alv. I think first need to create the container on that two subscreen. is this correct? Thanks.
Regards
Raj>
Rajitha1234 wrote:
> Hi
>
> Can we have two alv grid in the output?. If yes how can we do that using oops alv. I think first need to create the container on that two subscreen. is this correct? Thanks.
>
> Regards
> Raj
Hi Rajitha,
You can have as many as ALV output in the screen By using OOPS.
By using Container you can pass ALV output.
see the sample Program SALV_TEST_TABLE.
Regards,
Prabhudas -
Create blank screen space between two ALV grids
I want to create some blank screen space between the two ALV grids I have on the screen. Can someone tell me how to do this?
Thanks and best regards,
SandyYou don't have link the two containers.
I guess you have a grid and tree control that you want to display. So, use a different container for each of these controls, so that they appear differently.
If you don't want space in between them, you can have one container and split that into and display the tree and grid in each of the split portions.
The advantage with this will be you can resize the tree/grids using the vertical line that separates them.
Take a look at WE02 transaction to see what I am trying to explain.
Regards,
Ravi -
Two ALV Grid in the same screeen
Hi,
I have created a module pool with a screen.
In this screen I have defined two customer objects and I dipslay two different ALV grid.
DATA: grid_1 TYPE REF TO cl_gui_alv_grid,
grid_2 TYPE REF TO cl_gui_alv_grid.
When the user puts the values into the field in both lists and pushes "enter", the program gets the input value by method
"get_selected_rows". It works only for the list where there is the cursor.
I need to read the value of each list at the same moment.
Thanks in advance
Marco*& Report Z7CC_ALV_OOPS_TWO_ALV_SCREENS *
report z7cc_alv_oops_two_alv_screens .
* TEMP DECLARATION TYPE DECLARATIONS
* Structure for Sales Order
types: begin of y_vbak ,
vbeln type vbeln_va ,
end of y_vbak ,
* Structure for Sales Order Details.
begin of y_vbap ,
vbeln type vbeln_va ,
posnr type posnr_va ,
matnr type matnr ,
charg type charg_d ,
arktx type arktx ,
end of y_vbap ,
*& Structure of line item ----------
begin of y_po_item,
ebeln type ekko-ebeln, " PO NUMBER
ebelp type ekpo-ebelp, "LINE ITEM
matnr like ekpo-matnr, " Material Number
netpr like ekpo-netpr, " Price per unit.
menge like ekpo-menge, " Purchase order quantity.
netwr like ekpo-netwr, " Net order in Purchase order currency
meins like ekpo-meins, " UOM
end of y_po_item.
data: t_y_po_item type standard table of y_po_item.
data: w_container_1 type ref to cl_gui_container .
data: t_vbap type standard table of y_vbap.
*--------- END OF TEMP DECLARATION ------------
data: ok_code like sy-ucomm.
*-- Global data definitions for ALV
*--- ALV Grid instance reference
data gr_alvgrid type ref to cl_gui_alv_grid .
*--- Name of the custom control added on the screen
data gc_custom_control_name type scrfname value 'Z7CC_ALV2' .
*--- Custom container instance reference
data gr_ccontainer type ref to cl_gui_custom_container .
*--- Field catalog table
data gt_fieldcat type lvc_t_fcat .
data gt_fieldcat_2 type lvc_t_fcat .
*--- Layout structure
data gs_layout type lvc_s_layo .
*&------- DECLARATION FOR THE NEXT SCREEN ------------------
*--- ALV Grid instance reference
data gr_alvgrid_2 type ref to cl_gui_alv_grid .
*--- Name of the custom control added on the screen-----------
data gc_custom_control_name_2 type scrfname value 'Z7CC_ALV' .
*--- Custom container instance reference
data gr_ccontainer_2 type ref to cl_gui_custom_container .
*Declare your internal table which is supposed to hold the list data.
*&Lets name it gt_list.
*Here is an example declaration.
*--- Internal table holding list data
data begin of gt_list occurs 0.
data matnr like mara-matnr.
data maktx like makt-maktx.
data end of gt_list .
data: begin of gt_list_2 occurs 0.
include structure z7cc_po_header.
data: linecolor(4) type c, "Color for corresponding line
end of gt_list_2.
data: t_gt_list_2 type standard table of z7cc_po_header.
*----- CLASS DECLARATION ------
* FIELD-SYMBOLS
field-symbols <fs_vbap> type y_vbap.
field-symbols <fs_gt_list_2> type z7cc_po_header.
class lcl_event_receiver definition deferred.
data w_event_receiver type ref to lcl_event_receiver.
* Creating a class definition for handling events on the ALV Grid.
class lcl_event_receiver definition.
public section.
methods: handle_top_of_page for event top_of_page
of cl_gui_alv_grid
importing e_dyndoc_id,
handle_hotspot_click for event hotspot_click
of cl_gui_alv_grid
importing e_row_id,
handle_toolbar_event for event toolbar
of cl_gui_alv_grid
importing e_object,
handle_user_command for event user_command
of cl_gui_alv_grid
importing e_ucomm.
endclass. "lcl_event_receiver DEFINATION
* Implementing the Class for handling events on the ALV Grid.
class lcl_event_receiver implementation.
method handle_top_of_page.
perform show_top_of_page using e_dyndoc_id w_container_1.
endmethod. "handle_top_of_page
method handle_hotspot_click.
perform show_hotspot_click_details using e_row_id.
endmethod. "lcl_event_receiver
method handle_toolbar_event.
perform create_alv_toolbar using e_object.
endmethod. "handle_toolbar_event
method handle_user_command.
perform handle_user_command using e_ucomm.
endmethod. "handle_user_command
endclass. "lcl_event_receiver IMPLEMENTATION
data: w_grid type ref to cl_gui_alv_grid .
*-------- END OF CLASS DECLARATION -------------
start-of-selection.
perform populate_table.
call screen 100.
*& Module STATUS_0100 OUTPUT
* text
module status_0100 output.
set pf-status 'Z7CC_ALV1'.
* SET TITLEBAR 'xxx'.
endmodule. " STATUS_0100 OUTPUT
*& Module DISPLAY_ALV OUTPUT
* text
module display_alv output.
perform display_alv.
endmodule. " DISPLAY_ALV OUTPUT
*& Form POPULATE_TABLE
* text
* --> p1 text
* <-- p2 text
form populate_table .
select ebeln ebelp matnr netpr menge netwr meins into corresponding fields of table t_y_po_item
from ekpo.
select ekko~ebeln ekko~bukrs ekko~aedat ekko~ernam
ekko~lifnr ekko~zterm ekko~angnr into corresponding fields of
table t_gt_list_2 from ekko .
endform. " POPULATE_TABLE
*& Form DISPLAY_ALV
* text
* --> p1 text
* <-- p2 text
form display_alv .
if gr_alvgrid is initial .
perform create_first_obj_container.
*&----------- ONE MORE CONTROL ON THE SCREEN-------------------
perform create_second_obj_container.
" DISPLAY_ALV
* Creating ALV Grid instance
perform create_first_alvgrid.
perform create_second_alvgrid.
* PERFORM FIELD_CATALOG. " CREATE A FIELD CATALOG.
perform field_cat changing gt_fieldcat.
perform field_cat_1 changing gt_fieldcat_2.
*----Here will be additional preparations
*--e.g. initial sorting criteria, initial filtering criteria, excluding
*--functions
perform call_mthd_display_both_grid.
*&--------- create a field catalog.------------
perform event_handling.
else.
*&-----------CALL ALV GRID REFRESH TABLE DISPLAY
perform call_mthd_alv_refresh.
endif.
endform. "DISPLAY_ALV
*& Module USER_COMMAND_0100 INPUT
* text
module user_command_0100 input.
endmodule. " USER_COMMAND_0100 INPUT
*& Form EXIT_PROGRAM
* text
* --> p1 text
* <-- p2 text
form exit_program .
leave program.
endform. " EXIT_PROGRAM
*& Module PAI INPUT
* text
module pai input.
case ok_code.
when '&EXT'.
perform exit_program.
when others.
* do nothing
endcase.
clear ok_code.
endmodule. " PAI INPUT
*& Form CREATE_FIRST_OBJ_CONTAINER
* text
* --> p1 text
* <-- p2 text
form create_first_obj_container .
create object gr_ccontainer
exporting
container_name = gc_custom_control_name
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. " CREATE_FIRST_OBJ_CONTAINER
*&---------------------------------------- -
Report with two ALV grids and a header
Hi experts,
I have a report with two ALV grids in the same screen, each one in a separated container. The information displays it correctly. The report has been implemented by using OO Programming.
My real trouble is in the header. It must have a logo, a title with a specific font and other information.
I'll attach a capture of my need:
[Report with two ALV grids and a header|http://picasaweb.google.com/lh/photo/AcQD49QPmm-0L_jL2iMedA?feat=directlink]
Then, I want to set up the header you can see, with logo, a font with specific features. Obviously, the header you see has taken from another report. But is the same idea.
I've tried with a third container, using the CL_GUI_CONTAINER and CL_GUI_CONTAINER classes, but it doesn't work.
Any idea? Would welcome any help you can provide.
Thanks in advance,
Jorge RojasHi, Jorge.
Should the header be a"attached" to any of the ALV? Or it should be carried alone?
If first applies, you've given the solution yourself: put the info & logo in first ALV's header and invoke it from the proper method.
You could use CL_GUI_DOCKING_CONTAINER CLASS to divide screen in several containers and then, in the upper one, I would create another one docking container to divide the screen into two: the written info could be performed with an HTML viewer class and the logo with a CL_GUI_PICTURE element.
Cheers. -
How to use Two main windows with in a page in script ?
Hi any body explain me...
How to use Two main windows with in a page in script ?
with header data in one main window,
& Item data in other main window.HI..,
u need to go for <b>SPLITTING THE MAIN WINDOW</b> !!!
Main windows in page windows allow you to format text in multiple columns. Define an area in the page window, in which to position the main windows.
Here is the procedure !!
-->Create a page window and assign it to a page.
Choose <b>Edit --> Main windows</b>.
A dialog box appears.
-->Enter values in the fields <b>Area width</b> and A<b>rea height</b> in accordance with the input guidelines for main windows.
-->Enter values in the fields <b>Spacing</b> and Number in the <b>Horizontal group</b> if you want to use multiple columns. You can ignore the fields in the Vertical group.
Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the <b>Horizontal and Vertical groups</b>.
-->The value in the field Left margin varies from main window to main window if multiple columns are used. The following applies:
<b>
Left margin of current column + Window width + Horizontal spacing = Left margin of next column</b>
In label printing, the field Upper margin also varies from main window to main window:
<b>
Upper margin of current main window + Window height + Vertical spacing = Upper margin of next main window</b>
-->Enter a value in the field Start position.
This is a counter. Enter a starting value which is equal to or greater than 1.
-->The main windows are added to the list.
-->Save your form.
reward if it helps u...
sai ramesh
Maybe you are looking for
-
Can I convert an standar account into an admin one since Terminal?
Hi, Everybody! Trying to overcome some bugs on my MacBook, I decided to erase some folders from system and install Mac OS X from its original DVD. Bad idea. Now I only have one account, which may be the Admin one, but appears as a Standar one. I'm bl
-
How do I connect my new Macbook Pro to an LG HX300G digital projector?
I just got this new computer and the connections are different. I realize that we now have thunderbolt instead of the video connection I had on my last MacBook. I have to teach a class on Friday. How can I connect my new computer to the projector? Th
-
Error message: file not found
I have an extensive list of music that has not been synced for a while on my laptop. I have since upgraded iTunes. Now I cannot play any of the music stored on the laptop, though the list is still there. The error message says that the file is not fo
-
New iPhone only plays from one headphone.
I got my iPhone 5 today and music only plays from the right headphone, no matter what headset I use. This also happened with my iPhone 4 so I thought the problem would be gone with the new phone. So I am thinking it might be a setting or something,
-
Can't find history of changes I've made to photos.
I recently noticed that some previously adjusted photos were no longer linked to Lightroom 5 (in navigatoe, they were grayed out with a questionmark next to them). So I found the photos and imported them to a new folder using "convert to DNG" in the