Layout Issue In ALV Grid
Dear All,
I have made an editable ALV andafter entreing data and successful update it will show another ALV.
The issue is that user has saved different Layouts for the 2 ALV's and made it user specific. But again when the report is executed then the 2 saved layouts are not coming.
The respective layout should come for the 2 ALVs.
Thanks & Regards,
Bharti Jain
Hi, let us try with the following code,
type-pools SLIS.
data : lv_vbeln type vbak-vbeln.
select-options : so_vbeln for lv_vbeln.
initialization.
so_vbeln-low = '4970'.
so_vbeln-high = '4975'.
append so_vbeln.
types : begin of ty_vbak,
vbeln type vbak-vbeln,
erdat type vbak-erdat,
erzet type vbak-erzet,
ernam type vbak-ernam,
end of ty_vbak.
data : lt_vbak type standard table of ty_vbak,
ls_vbak type ty_vbak.
data : ls_variant like DISVARIANT.
data : ls_layo type SLIS_LAYOUT_ALV.
data : lt_fcat type SLIS_T_FIELDCAT_alv.
start-of-selection.
perform getvbak.
if sy-subrc eq 0.
perform displayvbak.
endif.
FORM GETVBAK .
select vbeln erdat erzet ernam from vbak
into table lt_vbak
where vbeln in so_vbeln.
ENDFORM. " GETVBAK
FORM DISPLAYVBAK .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_STRUCTURE_NAME = 'ZMYVBAk'
IS_LAYOUT = ls_layo
IT_FIELDCAT = lt_fcat[]
I_SAVE = 'X'
IS_VARIANT = ls_variant
TABLES
T_OUTTAB = lt_vbak[].
ENDFORM. " DISPLAYVBAK
After execution select the fields which you want to hide and after that goto SETTINGS menu -->Layout --->save it
it will ask the save variant and name .
After that goto layout management and select the variant which you created and execute the alv program
then you can observe the fields will hide .
Thanks & Regards,
Raghunadh . K
Similar Messages
-
Issue with ALV grid print preview/spool
Hello everyone,
I am working on a report and I am having some issues with ALV grid. Currently in our DEV and QA environments the user can run the report, view the ALV grid, and print the grid without any issues.
However this isn't the case in the Prod environment. The user is able to run the report and view the grid without any issues. But when they click print preview or click print, the spool is incorrect. It shows the proper values from the grid, but the first field is reduced in length. Rather than showing a numeric field of length 10 it shows 99999999# or 99999999...
The programs are identical through every environment, including user parameters, formats, and spool settings. I have been told printing grids may have some issues, does anyone have any advice or dealt with this issue before?
I appreciate the help.
Thanks,
CI was waiting to hear from the functional team on the matter and no one has mentioned any more issues. I am assuming the problem is solved. I just noticed the thread was still un-answered and wanted to give an update.
Thank you for you help Vijay.
Regards
C -
What is the constant name for Change layout Button in ALV Grid ABAP Objects
Dear All,
I have one query please help me.
what is the constant name for Change layout Button in ALV Grid ABAP Objects.
With Rgds,
BabuHalo Vinod,
The consant name is cl_gui_alv_grid=>mc_fc_current_variant.
Regards
Arshad -
Layout selection in ALV grid.
Hi All,
I have one requirement to change the existing program. Currently it is displaying all the fields in the ALV grid. Now i need to make the selection screen with two options for Header data selection and Item data selection. So now if I select the Header data only to be displayed (in the coding I made the changes in the field catalog and hidded some fields using
WHEN 'FKART'
if p_header = 'X'.
<fc>-no_out = 'X'.
endif.
so now it should not display the FKART field in the output. My question is, If I select some different layout in the ALV GRID even this hidden header fields are also getting displayed. Please help me and give me the solution for this.
Regards,
AL.Hi Anbu,
You can try like this, Modify your Col Position like this...
IF P_HEARDER = 'X'.
COL_POS = COL_POS + 1.
FIELDCATALOG-COL_POS = COL_POS.
FIELDCATALOG-FIELDNAME = 'FKART'.
FIELDCATALOG-OUTPUTLEN = 10.
FIELDCATALOG-NO_OUT = 'X'.
APPEND FIELDCATALOG TO FIELDCATALOG.
ELSE.
COL_POS = COL_POS + 1.
FIELDCATALOG-COL_POS = COL_POS.
FIELDCATALOG-FIELDNAME = 'FKART'.
FIELDCATALOG-OUTPUTLEN = 10.
APPEND FIELDCATALOG TO FIELDCATALOG.
ENDIF.
Thanks & regards,
Dileep .C -
Is it possible to transport the layouts of an alv-grid?
Hello,
is it possible to transport the layouts of an alv-grid and does anybody know how to do this?
Regards, Lars.Hi
LS_VARI TYPE DISVARIANT.
LS_VARI-REPORT = SY-REPID.
LS_VARI-HANDLE = SPACE.
LS_VARI-LOG_GROUP = SPACE.
LS_VARI-USERNAME = SPACE.
LS_VARI-VARIANT = SPACE.
LS_VARI-TEXT = SPACE.
LS_VARI-DEPENDVARS = SPACE.
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
<b> IS_VARIANT = LS_VARI</b>
IS_LAYOUT = GS_LAYOUT
<b> I_SAVE = 'A'</b>
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = IT_FINAL[].
try this
regards
vijay -
Change layout button in ALV Grids
Hi Experts,
I have displayed 2 ALV grids in a single screen using OOPS concepts and I have activated the Save Layout option for both the Lists.
Now whenever I will save the layout for the 1st list then automatically it is taken into consideration for the common fields in the second list as well.
Please help me on how I can avoid changing the 2nd list if I will change the 1st list if possible.
Thanks in advance..
Regards,
Srinivas
Edited by: Srinivas Hari on Jun 23, 2009 10:07 AMHello,
I think u can achieve that by populating
HANDLE
LOG_GROUP fields of Disvariant structure in u r program.
Regards -
I am displaying the table in ALV Grid format. I have 4 fields in the table. The filter works for the first 3 fields, but doesnot work for the last field.
Please let me know what might be the issue.
Find the table declaration and the table population as in the below code
TYPES : BEGIN OF ty_message,
avm_nr TYPE avm_nr,
motiv TYPE motiv_nr,
text TYPE t100-text,
msg TYPE merep_orderstat,
END OF ty_message.
DATA: gt_message TYPE STANDARD TABLE OF ty_message,
gs_message TYPE ty_message.
gs_message-avm_nr = gs_upload-avm_nr.
gs_message-motiv = gs_upload-motiv.
gs_message-text = 'Order Successfully Changed'.
gs_message-msg = 'Success'.
APPEND gs_message TO gt_message.
CLEAR gs_message.
Regards,
SalilSince the field MSG refer to MEREP_ORDERSTAT which is CHAR10, it will convert the content to UpperCase.
So, try like:
gs_message-avm_nr = gs_upload-avm_nr.
gs_message-motiv = gs_upload-motiv.
gs_message-text = 'Order Successfully Changed'.
gs_message-msg = 'SUCCESS'.
APPEND gs_message TO gt_message.
CLEAR gs_message.
Regards,
Naimesh Patel -
Issue in ALV Grid Grand Totals
Hi Friends,
Hwo can i display grand total text in ALV Grid? Eventhough i am using Totals_text parameter in layout i am unable to display. any one vcan help me out in this refgard.
if pos send the code
Regards,
Vijay<REMOVED BY MODERATOR>
SAMPLE PROGRAM:
REPORT ysalesorder_alv_subtotals.
* Type Pools
TYPE-POOLS:slis.
* Tables
TABLES: vbak, "Sales Document: Header Data
vbap. "Sales Document: Item Data
* Global Structures
DATA:gt_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
gt_sortcat TYPE slis_t_sortinfo_alv,
wa_sortcat LIKE LINE OF gt_sortcat.
* Internal Table
DATA: BEGIN OF gt_salesorder OCCURS 0,
vbeln LIKE vbak-vbeln, " Sales Document Number
posnr LIKE vbap-posnr, " Sales Doc Item
netwr LIKE vbap-netwr, " Net Value
END OF gt_salesorder.
* SELECT OPTIONS
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME
TITLE text-001.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln. " Sales Document
Number.
SELECTION-SCREEN END OF BLOCK b1.
* Initialization
INITIALIZATION.
PERFORM initialization.
* Start Of Selection
START-OF-SELECTION.
PERFORM field_catalog. "For Structure Creation
PERFORM fetch_data. "Get the Data From DB Table
PERFORM sorting USING gt_sortcat.
* End Of Selection
END-OF-SELECTION.
PERFORM display_data.
*& Form initialization
* text
* --> p1 text
* <-- p2 text
FORM initialization .
s_vbeln-sign = 'I'.
s_vbeln-option = 'BT'.
s_vbeln-low = '4969'.
s_vbeln-high = '5000'.
APPEND s_vbeln.
ENDFORM. " initialization
*& Form field_catalog
* text
* --> p1 text
* <-- p2 text
FORM field_catalog .
REFRESH : gt_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-col_pos = '1'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table
wa_fieldcat-fieldname = 'VBELN'. "Field Name
wa_fieldcat-key = 'X'. "Blue Color
wa_fieldcat-seltext_m = 'Sales Doc No'. "Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = '2'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table Name
wa_fieldcat-fieldname = 'POSNR'. "Field Name
wa_fieldcat-seltext_m = 'Sales Doc Item'."Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
*SubTotal on the Field NETWR
wa_fieldcat-col_pos = '3'. "Column Position
wa_fieldcat-tabname = 'IT_SALESORDER'. "Internal Table
wa_fieldcat-fieldname = 'NETWR'. "Field Name
wa_fieldcat-do_sum = 'X'. "Sum
wa_fieldcat-seltext_m = 'Net Value'. "Display Text In Screen
APPEND wa_fieldcat TO gt_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " field_catalog
*& Form sorting
* text
* -->P_IT_SORTCAT text
FORM sorting USING p_it_sortcat TYPE slis_t_sortinfo_alv.
CLEAR wa_sortcat.
wa_sortcat-fieldname = 'VBELN'.
wa_sortcat-up ='X'.
wa_sortcat-subtot = 'X'.
APPEND wa_sortcat TO p_it_sortcat.
ENDFORM. " sorting
*& Form display_data
* text
* --> p1 text
* <-- p2 text
FORM display_data .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
it_fieldcat = gt_fieldcat
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = gt_sortcat
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_salesorder
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_data
*& Form fetch_data
* text
* --> p1 text
* <-- p2 text
FORM fetch_data .
REFRESH : gt_salesorder.
CLEAR : gt_salesorder.
SELECT a~vbeln
posnr
b~netwr
FROM vbak AS a
INNER JOIN vbap AS b ON a~vbeln = b~vbeln
INTO TABLE gt_salesorder
WHERE a~vbeln IN s_vbeln.
ENDFORM. " fetch_data
Edited by: Alvaro Tejada Galindo on Apr 11, 2008 12:24 PM -
Disabling "Default layout setting" in ALV grid display
Hello,
We have a requirement where we need to disable layout default settings in ALV grid display.
Only certain users should be able to save the report layout as default.
We would be creating an authorization group for this and then based on the Authority check we would need to enable or disable Default layout save option.
I found that using I_SAVE in the FM "REUSE_ALV_GRID_DISPLAY", we can either enable or disable layout save option.
But our requirement is to disable Default layout save option based on the authority check.
We will find this option next to User specific option when we save the report layout.
Can anyone guide me on this?
Thanks,
Regards,
AnidHi Anid,
First of all check if you can do this excluding the buttons from the ALV with the excluding tab. If not, here is the code for the ALV OO to exclude the buttons.
FORM F_DISPLAY_ALV.
* Layout
PERFORM f_layout.
* Exclude Buttons
DATA: gt_excl TYPE ttb_button
REFRESH gt_excl.
* Append those you want to exclude. These are some of them. Check Class in SE24 -> Atributes of class cl_gui_alv_grid.
APPEND: cl_gui_alv_grid=>mc_fc_loc_cut TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_undo TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_copy TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_paste TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_copy_row TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_move_row TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_delete_row TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_insert_row TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_append_row TO gt_excl,
cl_gui_alv_grid=>mc_fc_loc_paste_new_row TO gt_excl,
cl_gui_alv_grid=>mc_fc_to_office TO gt_excl,
cl_gui_alv_grid=>mc_fc_expcrdesig TO gt_excl.
CALL METHOD gv_alv_grid->set_table_for_first_display
EXPORTING
it_toolbar_excluding = gt_excl[]
is_layout = wa_layout_main
is_variant = wa_variant
i_save = 'A'
CHANGING
it_outtab = gt_alv[]
it_fieldcatalog = gt_fieldcat[]
it_sort = gt_sort[].
Edited by: Ernesto Caballero on Mar 11, 2010 5:59 PM
Edited by: Ernesto Caballero on Mar 11, 2010 6:03 PM -
Issue with ALV Grid and events
Hi,
I am creating an ALV Grid with fields Matnr,Charg,Labst,Meins. The first three fields are editable and the last (MEINS) is read only.
Now I am trying to fill the MEINS field programmaticly after entering the MATNR and confirm with enter/return.
I think that I have to "overload" the enter event of the alv grid to fill the MEINS everytime when a MATNR was entered. But I don't know how I could implementing this. Could you give me a hint how I could solve this problem?
(The behavior should look like in transaction MIGO)
ThanksHi Alex
When you press enter an event is triggerd and function code is filled in sy-ucoom or you can say in ok_code. At that time PAI event occurs. In PAI of that screen you need to check ok_code and load new data in table which you passed to ALV and also refresh the ALV.
data: ok_code like sy-ucomm.
PAI----screen 100
case ok_code.
when 'ENTER'.
select data
and refresh ALV
then again call
funtion to display ALV
Regards
Aditya -
Performance issue with ALV Grid in Module Pool
Hi Experts,
I am using an editable ALV Grid on a screen. This ALV does not have too many fields and is called in modal dialog box.
I call this screen from a standard transaction. The problem is this screen is taking 3-4 seconds to load. I checked that fetching the data is not a problem and only after the call screen statement, the processing becomes very slow. Is this due to ALV grid. Please help as this is urgently needed and I cannot change from ALV to table control. Please suggest if anything can b done?
Regards
SatishHi Satish,
I hope there is a chance to do the SET_TABLE_FOR_FIRST_DISPLAY or preparation of field catalog earlier, i.e. in INITILIZATION event and then later just exchange table contents before display. That will reduce time.
Regards,
Clemens -
Change layout Button In ALV Grid
Hi all,
I have a requirement where I am creating Field Catalogue from Z Table(has 60 fields) for few(12) fields.
The user would like to have the option to add more fields by changing the Layout. But I dont see the Fields in Hidden Column when I click the Change Layout Button in ALV Toolbar. It just displays the Field based on Field Catalogue defined.
Is there a way I can maintain all the fields without being displayed in ALV initally and letting the user select the hidden fields as per their requirement. As happens in SE16 where we can select the fields to be displayed.
Thanks for the support.Hi Abhilasha,
In the reuse_alv function module we can see a field I_SAVE.If you pass this as 'X' then the option of saving the layout variants are available.
Create a layout by,selecting just the fileds required for display and set it as the default variant.It can be made Global or user-specific.But we need to declare all fields in the fieldcatalog.
So if the default variant is set,everytime the program is run it shows only the fields selected in it but can select more form the change layout option.
Hope it helps.
Regards
Byju -
Issues in Change layout Variant of ALV grid
Hi all,
I am using a ALV gird to display the data with some table column. I am able to save/ choose the Layout variant. I choose the existing layout varaint it works fine but when I change the column fields display from selected layout then it will immidiately looks fine, but if I perform some event, it goes to the initial stage of the choosed layout varaint.
I can solve this issue if I clear the Variant from the is_variant (of set_table_for_first_display method). So if I can find the fieldcatalog for layout Variant, then it will solved very easily.
Please suggest, if you have any idea on this.
Thanks,
Sanket SethiI got the solution. You can find the Variant field catalog by using Function module 'LVC_VARIANT_SELECT'. You can set the dialog box based on your requirements as well. So closing this thread. Thanks..
-
Field Catelog Issue for ALV Grid
Hi,
I have generated the ALV Dynamically based on the Date Range entered on the selection screen, now I am able to fill the values into the structure also, here my problem is date is like S858-spbup ( mm/yyyy format), what ever the values I have moved is S858-umwavwr(Currency values), now I want to sub total these values. Since my field catelog is date format that is why it is not doing subtotals.
code is
gs_fc-seltext_l = date.
gs_fc-seltext_m = date.
gs_fc-seltext_s = date.
gs_fc-ref_fieldname = 'umwavwr'.
gs_fc-ref_tabname = 'S858'.
gs_fc-do_sum = 'X'.
gs_fc-outputlen = 20.
APPEND gs_fc TO gt_fc.
it is doing subtotal but the issue is in ALV header it is not displaying like date (for example 06/2005),instead it is displaying the name as ref_fieldname text. How to resolve this issue. Please help me.
Thanks & Regards,
Sivaram KandulaHi Rich,
Thanks for your speedy reply. But in my case scenario is different.
if i remove the ref_fieldname = date means it is dumping bcz,
output is like this
suppose my input is 06/2005 to 08/2005
CSR District 06/2005 07/2005 08/2005 totals
xxx newyork 30.00 3.00 5.00 38.00
xxx newyork 40.00 5.00 6.00 20.00
xxx 70.00 8.00 11.00 58.00
now I am able to display the output like this, but the problem here is i am unable to subtotal these, bcz my field catelog is date type that is why do_sum is not working, that is why I took ref_feield name as UMWAVWR and S858, it is subtotaling but I am unable to see the header like above, instead it is displaying like
CSR District invoice:Cost invoice:Cost Invoice:cost tot
so please advise me how to proceed further.
Thanks & Regards,
Sivaram Kandula -
How to get the SAVE Layout ICON on ALV Grid display report
Hi,
I am using the standard ALV Layout, and I do not get the SAVE LAYOUT Icon on the Menubar, where I could save the report Layout.I am using the layout routine as,
FORM layout_build USING u_lf_layout TYPE slis_layout_alv.
u_lf_layout-box_fieldname = 'SELK'. " Checkbox
u_lf_layout-zebra = 'X'.
u_lf_layout-colwidth_optimize = 'X'.
u_lf_layout-confirmation_prompt = 'X'.
u_lf_layout-get_selinfos = 'X'.
u_lf_layout-f2code = '&ETA' .
u_lf_layout-detail_titlebar = 'Delivery Due List'.
u_lf_layout-key_hotspot = 'X'.
u_lf_layout-info_fieldname = 'COL'.
ENDFORM. " layout_build
Is there anything that I am missing. Please suggest.Many thanks for your help.
Regards,
MiraHi,
i think you've forgotten param. <b>i_save</b>
x_save = 'X'.
gs_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'ZTAB01'
IS_VARIANT = gs_variant
IS_layout = lay
I_SAVE = x_save
TABLES
T_OUTTAB = gridtab
EXCEPTIONS
OTHERS = 1.
regards Andreas
Maybe you are looking for
-
Hi gurus! Is it possible to a place variable in aggregate? I see you can use a fixed value within an aggregate, but I would like to create an aggregate based on Calendar Month variable which could be detected from the system. I suspect that it is no
-
Group by order by in same query
Hi, I am wondering whether it is possible to use group by and order by in same query For example if i have a table like the one below Col1 Col2 col3 C 36 2 A 25 5 B 12 8 A 25 6 B 12 9 C 36 1 A 25 7 I need a result like below A 25 5 A 25 6 A 25 7 B 12
-
Why Won't Launchctl Load Script After Reboot?
Hello, iMac with OS X 10.7.3 root# ls -lah /Library/LaunchAgents/dbase_backup.plist -rw-r--r-- 1 root wheel 479B Feb 24 10:24 /Library/LaunchAgents/dbase_backup.plist I load it with: root# launchctl load /Library/LaunchAgents/dbase_backup.plist
-
Flatten Form field Only or specific field
I'm doing a PDF Form for a client. The client will use Adobe Reader XI to enter the data and save the results. I was using a button with a javascript to flatten the form field and do a save as. Everything work fine until I discovered that the flatten
-
:"Required File Cannot Be Found' Ipod + Itunes Help Please.
Hey I have accidently deleted some files from my Imac, since then I have been receiving a message in Itunes when I try to upload Photos to my Ipod which says ,'Required file cannot be found'. Is there any downloadable software to restore the missing