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
Similar Messages
-
Is it possible to cusomize the layout of the manual ordering dialog?
Hello all,
I have a question about the layout for manual ordering.
The user should be able to order folders under a specific path manually. So I create a new layout set and add the UI Command "order_type_settings". So far, everything works fine. My question is, if it is possible to customize the layout of the organize folder dialog? The problem is, that the users are able to see the details dialog, if they open the context menu of a folder. Is there a possibility to restrict this context menu?
Thanks a lot.
Kind regards.
NicoleHi Nicole,
Yes, you can. It's possible to restrict the context menu.
As you see, you must use layout set. Each layout set use: Collection Renderer, Resource Renderer and details command. Each one of these, use command groups for folder, links and files.
You can create a new command group in order to limit it.
You should duplicate a layout set, and then you can assign it to a folder or your navigation iview.
For more information:
http://help.sap.com/saphelp_nw04/helpdata/en/30/504a1e7f0e354bbf9adedf1a29f3ec/frameset.htm
Patricio. -
Is it possible to change the layout of alerts from SharePoint Online
Is it possible to change the layout of the alert mails you get from SharePoint Online? If yes, then how?
Thanks.
Thomas Bomann, simplySOHi,
it is not possible for SharePoint online
check this thread
http://community.office365.com/en-us/f/154/t/14442.aspx
Kind Regards,
John Naguib
Senior Consultant
John Naguib Blog
John Naguib Twitter
Please remember to mark this as answered if it helped you -
Possibility to transport the classification of documents ?
Hi everybody,
we want to migrate our EP 7.0 Portal from Windows 2003 to AIX in the following way:
1.) transport of all PCD-Objects (incl. Portal-Customizing) from Windows to the AIX-System
2.) recreating of our KMC-Configuration from scratch in the new AIX-System
3.) transport of all Documents (incl. Folders, ACL, ) with ICE
We don´t want to use Systemcopy, because we will start with a fresh system. But we need a way / possibility to transport the classification of our documents.
Any ideas ?
OliverHi Oliver,
You can export/import taxonomies from one system to another, see the following link:
http://help.sap.com/saphelp_nw70/helpdata/EN/83/3f6f4146df197de10000000a155106/frameset.htm
Document assignments are not however transported.
Regards, Lorcan. -
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 -
Event for the List Box in ALV Grid Control
Hello,
I have the below urgent requirment.
I have an ALV Grid Control built using ABAP Objects. In the grid, I have few fields and one of these fields is a List Box. Depending on the values selected, I need to enable or disable some fields. So, is there any event for the List box in ALV Grid Control.
For ex: I have 2 Fields, Designation and Commission. The designation field is a List Box field having 'Software Engineer' and 'Manager' as values. When I select 'Software Engineer', the commission field should be disabled. When I select 'Manager', the comission field should be enabled.
Early reply is hightly appreciated.
PriyaREPORT ZTEST1234 MESSAGE-ID ZZ .
DATA: G_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: L_VALID TYPE C,
V_FLAG,
V_DATA_CHANGE,
V_ROW TYPE LVC_S_ROW,
V_COLUMN TYPE LVC_S_COL,
V_ROW_NUM TYPE LVC_S_ROID.
DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE SY-UCOMM,
G_CONTAINER1 TYPE SCRFNAME VALUE 'TEST',
GS_LAYOUT TYPE LVC_S_LAYO.
DATA:BEGIN OF ITAB OCCURS 0,
VBELN LIKE LIKP-VBELN,
POSNR LIKE LIPS-POSNR,
COMISN(10),
CELLCOLOR TYPE LVC_T_SCOL, "required for color
DROP(20),
<b> HANDLE_STYLE TYPE LVC_T_STYL,</b>
END OF ITAB.
* CLASS lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION .
METHODS:
**Hot spot Handler
HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
<b>**Handler to Check the Data Change
HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED
E_ONF4
E_ONF4_BEFORE
E_ONF4_AFTER,</b>
**Double Click Handler
HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN ES_ROW_NO.
ENDCLASS. "lcl_event_handler DEFINITION
* CLASS lcl_event_handler IMPLEMENTATION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*Handle Hotspot Click
METHOD HANDLE_HOTSPOT_CLICK .
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW_ID.
V_COLUMN = E_COLUMN_ID.
V_ROW_NUM = ES_ROW_NO.
MESSAGE I000 WITH V_ROW 'clicked'.
ENDMETHOD. "lcl_event_handler
*Handle Double Click
METHOD HANDLE_DOUBLE_CLICK.
ENDMETHOD. "handle_double_click
<b>**Handle Data Change
METHOD HANDLE_DATA_CHANGED.
DATA: X_CHANGE TYPE LVC_S_MODI,
X_FINAL TYPE ITAB,
L_FLAG,
LS_OUTTAB LIKE LINE OF ITAB.
DATA: LS_EDIT TYPE LVC_S_STYL,
LT_EDIT TYPE LVC_T_STYL.
LOOP AT ER_DATA_CHANGED->MT_GOOD_CELLS INTO X_CHANGE.
IF X_CHANGE-FIELDNAME = 'DROP' AND X_CHANGE-VALUE = 'S/W ENGINEER'.
LS_EDIT-FIELDNAME = 'COMISN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 8.
INSERT LS_EDIT INTO TABLE LT_EDIT.
INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
MODIFY ITAB INDEX X_CHANGE-ROW_ID FROM LS_OUTTAB TRANSPORTING
HANDLE_STYLE .
else.
LS_EDIT-FIELDNAME = 'COMISN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 8.
INSERT LS_EDIT INTO TABLE LT_EDIT.
INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
MODIFY ITAB INDEX X_CHANGE-ROW_ID FROM LS_OUTTAB TRANSPORTING
HANDLE_STYLE .
ENDIF.
ENDLOOP.
CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY
EXCEPTIONS
FINISHED = 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.
ENDMETHOD. "HANDLE_DATA_CHANGED</b>
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
*& Global Definitions
DATA: G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,"Container1
G_HANDLER TYPE REF TO LCL_EVENT_HANDLER. "handler
*- Fieldcatalog for First and second Report
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
X_FIELDCAT TYPE LVC_S_FCAT,
LS_VARI TYPE DISVARIANT.
* START-OF_SELECTION
START-OF-SELECTION.
SELECT VBELN
POSNR
FROM LIPS
UP TO 20 ROWS
INTO CORRESPONDING FIELDS OF TABLE ITAB.
END-OF-SELECTION.
IF NOT ITAB[] IS INITIAL.
CALL SCREEN 100.
ELSE.
MESSAGE I002 WITH 'NO DATA FOR THE SELECTION'(004).
ENDIF.
*& Form CREATE_AND_INIT_ALV
* text
FORM CREATE_AND_INIT_ALV .
DATA: LT_EXCLUDE TYPE UI_FUNCTIONS.
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING CONTAINER_NAME = G_CONTAINER1.
CREATE OBJECT G_GRID
EXPORTING I_PARENT = G_CUSTOM_CONTAINER.
* Set a titlebar for the grid control
CLEAR GS_LAYOUT.
GS_LAYOUT-GRID_TITLE = TEXT-003.
<b>GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.</b>
GS_LAYOUT-ZEBRA = SPACE.
GS_LAYOUT-CWIDTH_OPT = 'X'.
GS_LAYOUT-NO_ROWMARK = 'X'.
GS_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
<b> CALL METHOD G_GRID->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.</b>
CREATE OBJECT G_HANDLER.
SET HANDLER G_HANDLER->HANDLE_DOUBLE_CLICK FOR G_GRID.
SET HANDLER G_HANDLER->HANDLE_HOTSPOT_CLICK FOR G_GRID.
<b> SET HANDLER G_HANDLER->HANDLE_DATA_CHANGED FOR G_GRID.</b>
DATA: LS_CELLCOLOR TYPE LVC_S_SCOL. "required for color
DATA: L_INDEX TYPE SY-TABIX.
"Here i am changing the color of line 1,5,10...
"so you can change the color of font conditionally
LOOP AT ITAB.
L_INDEX = SY-TABIX.
IF L_INDEX = 1 OR L_INDEX = 5 OR L_INDEX = 10.
LS_CELLCOLOR-FNAME = 'VBELN'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
LS_CELLCOLOR-FNAME = 'POSNR'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '0'.
LS_CELLCOLOR-COLOR-INV = '1'.
APPEND LS_CELLCOLOR TO ITAB-CELLCOLOR.
MODIFY ITAB INDEX L_INDEX TRANSPORTING CELLCOLOR.
ENDIF.
ENDLOOP.
* setting focus for created grid control
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
EXPORTING
CONTROL = G_GRID.
* Build fieldcat and set editable for date and reason code
* edit enabled. Assign a handle for the dropdown listbox.
PERFORM BUILD_FIELDCAT.
PERFORM SET_DRDN_TABLE.
* Optionally restrict generic functions to 'change only'.
* (The user shall not be able to add new lines).
PERFORM EXCLUDE_TB_FUNCTIONS CHANGING LT_EXCLUDE.
**Vaiant to save the layout
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->REGISTER_EDIT_EVENT
EXPORTING
I_EVENT_ID = CL_GUI_ALV_GRID=>MC_EVT_MODIFIED.
**Calling the Method for ALV output
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
IT_OUTTAB = ITAB[].
* Set editable cells to ready for input initially
CALL METHOD G_GRID->SET_READY_FOR_INPUT
EXPORTING
I_READY_FOR_INPUT = 1.
ENDFORM. "CREATE_AND_INIT_ALV
*& Form EXCLUDE_TB_FUNCTIONS
* text
* -->PT_EXCLUDE text
FORM EXCLUDE_TB_FUNCTIONS CHANGING PT_EXCLUDE TYPE UI_FUNCTIONS.
* Only allow to change data not to create new entries (exclude
* generic functions).
DATA LS_EXCLUDE TYPE UI_FUNC.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_DELETE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_APPEND_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_INSERT_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_MOVE_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_COPY.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_CUT.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_PASTE_NEW_ROW.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
LS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_LOC_UNDO.
APPEND LS_EXCLUDE TO PT_EXCLUDE.
ENDFORM. " EXCLUDE_TB_FUNCTIONS
*& Form build_fieldcat
* Fieldcatalog
FORM BUILD_FIELDCAT .
DATA: L_POS TYPE I.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Delivery'(024).
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-NO_ZERO = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-HOTSPOT = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Item'(025).
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Drop'(025).
X_FIELDCAT-FIELDNAME = 'DROP'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '5'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-DRDN_HNDL = '1'.
X_FIELDCAT-DRDN_ALIAS = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SCRTEXT_M = 'Comissn'(025).
X_FIELDCAT-FIELDNAME = 'COMISN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-EDIT = 'X'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
ENDFORM. " build_fieldcat
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF G_CUSTOM_CONTAINER IS INITIAL.
**Initializing the grid and calling the fm to Display the O/P
PERFORM CREATE_AND_INIT_ALV.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form SET_DRDN_TABLE
* text
FORM SET_DRDN_TABLE.
DATA:LT_DRAL TYPE LVC_T_DRAL,
LS_DRAL TYPE LVC_S_DRAL.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = 'S/W Engineer'.
LS_DRAL-INT_VALUE = 'S/W Engineer'.
APPEND LS_DRAL TO LT_DRAL.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = 'Manager'.
LS_DRAL-INT_VALUE = 'Manager'.
APPEND LS_DRAL TO LT_DRAL.
**Setting the Drop down table for Reason Code
CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
EXPORTING
IT_DROP_DOWN_ALIAS = LT_DRAL.
ENDFORM. " set_drdn_table
Regards
vijay -
How to find the selected item in alv grid or table control
can any one tell me please
how to find the selected item in alv grid or table controlIn table control, If you goto screen painter and goto table control properties ( f2 ), there is one check-box w/selColumn check that and give column name. Then add that column to your internal table.
IN PAI
LOOP AT it_tkhdr.
FIELD it_tkhdr-sel_row
MODULE tab_tkhdr_mark ON REQUEST.
ENDLOOP.
MODULE tab_tkhdr_mark INPUT.
MODIFY it_tkhdr INDEX tc_tkhdr-current_line.
ENDMODULE. " tab_tkhdr_mark INPUT
here it_TKHDR is internal table sel_row is field for selection
After that, you can loop at it_tkhdr where sel_row is 'X' to get selected rows.
regards,
Gagan -
How to keep track of the changes done in ALV GRID Report
Hi Experts,
how to keep track of the changed record in ALV GRID Report. how to set the field to be editable even for the entire row also. Can anybody guide along with code also?...
Valuable answers will be rewarded.
Thanks,
Satish.Hi,
Access the table through SM30. It comes blank as standard. Click "New Entries" and make entries for changes to be tracked. For example, whenever an org. unit changes 002 and 003 relationship, you will make entries like:
01 O 1001 B002 Activate box checked
01 O 1001 B003 Activate box checked
Here, 01 is your active plan version, O is org. unit, 1001 is infotype and B002 and B003 are the subtypes. You can also use * for infotype and subtype which means every change will be logged.
If you then run the report RHCDOC_DISPLAY through SA38, it will pick up all the changes pertaining to B002 and B003 relationship for org. units (in the above example).
Similarly, you can set up this table for other object types.
For more information, follow SPRO>Personnel Management>OM>Basic Settings>Activate change documents and go through the documentation for that node. Also, read up the documentation for the report.
Hope this helps.
Donnie -
Is it possible to Transport the Query(in SQVI) from one client to another?
Hi,
i hav created the query in Production now i want to assign the t-code for that perticular query...
i want to transport that query from PRD to Dev then only i can assign the t-code...
is it possible to transport query from Production to Dev?
Regards
Smithahi smitha ,
i don't think its possible to transport query created form the SQVI in to other client.
for that other solution is create query with same name in other clinet and save it in local package
and check the generated program name and made tcode in se93 . it will work .
or
cretae query from the SQ02 , SQ03 , SQ01 .
Query made through this procedure is transportable .
Regards
Digvijay Rai -
How it is possible to modify the layout 1-N01
The only OSS note that deals with a change of 1-N01 is based on ABAP program changing table's content directly. Is there any other way except for ABAP to copy and edit the layout used in KBK6?
According to SAP it can not be modified and copied. You can try to follow your recommendation yourself to confirm this.
-
How to get save button for saving the layout in OO ALV
Hi all,
When I execute my report an OO ALV, I want to save the layout and make it default.Please tell me how to do it.
I am using the below code.
*Call ALV
CALL METHOD c_alvgd->set_table_for_first_display
EXPORTING
is_layout = gd_layout
i_save = 'X'
CHANGING
it_outtab = it_ekko
it_fieldcatalog = it_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
even after passing i_save eq 'X', it is not showing save option in the layout.
please help.
thanks,
Siddhartha PrakashHi,
You need to pass the call back program name also.
CLEAR wa_variant.
MOVE sy-repid TO wa_variant-report.
CALL METHOD wcl_alvgrid1->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE = space
I_BYPASSING_BUFFER = c_x
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = wa_variant "variant options
i_save = c_x
I_DEFAULT = c_X
is_layout = wa_layout
Thanks,
Vinod. -
The Visible attribute on alv grid column is not changed after Change Layout
Setup:
I have a program that displays output in an ALV grid (using cl_salv_table).
The ALV grid is displayed within a custom control on a subscreen.
I have 4 subscreens being used on a tabstrip control. So I have 4 ALV grids total (one on each subscreen).
On each ALV grid, I have set the set_layout_change function to true so that the user can hide and unhide columns etc. on each grid via the button on the alv grid toolbar.
I also allow the user to dowload the contents of all 4 grids to excel. To do this I have a custom button that when clicked goes to each ALV grid - gets the column metadata (via cl_salv_columns_table-get() ) and checks the visibility to determine if the column should be downloaded or not (via cl_salv_column-is_visible() ) to excel.
The Problem:
As I said I have 4 grids being displayed via a tab control. Let's say the user is on tab 1 and unhides some columns on the alv grid 1 via the Change Layout... button. And then the user navigates to tab 2. If they click the download button at that point - when the download code is run and it checks the visibility of the columns on alv grid 1 - the changes that were made via the Change Layout... button have not synchronized yet. When I call is_visible() for a column that was unhid it still comes back as false.
The only way I have found to remedy this is to make the user click on a button on the alv grid's toolbar before navigating to a different tab to force the synchronization between the changes made and the backend column metadata. However, this is not the best option and requires training for the user that they have to do this for the download to work correctly.
The Question:
1) why is the Change Layout... button not automatically synchronizing the changes it made to the back end? Is there a way to make it do this?
2) OR, is there a way that I can force the synchronization within the code and not force the user to click a button on the alv grid? If there is a way to force the synchronization - where do I put that code? As far as I can tell, when I switch between tabs - I am unable to catch that action in my PAI events.
Thanks in advance for any help.I was able to resolve this issue with a satisfactory solution.
In my program I had a local class definition to handle the grids' events. When the synchronization wasn't working I only had two events defined: for link_click and added_functions.
I created another definition for event after_salv_function:
on_after_salv_function for event after_salv_function of cl_salv_events importing e_salv_function
There is no code in the method implementation - but adding this event handler now causes a synchronization to occur after the Change Layout is done. -
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 -
"REG:capturing fields of the Layout change in Alv"
hi gurus,
I have got a requirement like,i need to capture the fields displayed after the layout has been changed in ALV,initially my internal table has got 12 fields.After modifying the layout,the output shows only 5 fields,i have to capture this 5 fields alone and wrtie a bdc for further processing.how to do that.
which internal table holds this fields and displays.please help me with this.
thx in advance.
regards,
balaji.sHi,
Try the below methods in the ALV Class CL_GUI_ALV_GRID
GET_FRONTEND_FIELDCATALOG
GET_FRONTEND_LAYOUT = Get Current Layout from Frontend
GET_INTERNAL_LAYOUT = Get Current Layout from Frontend
Check the below program for Get frontend_layout method
BCALV_GRID_VERIFY
Regards,
Boobalan S -
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
Maybe you are looking for
-
Vintage Prints - Does your b/w hue settings work?
I like the 'Vintage Prints' theme in terms of layout, transitions and style ... but I'm having problem applying any of the 'Black and white' hue adjustments to any of the photos. It still remains in 'antique' tone (just a little lighter). I want it t
-
I need to change countries but the system won't allow because of an outstanding 7 cents credit balance. What do I need to do?
-
Preview/Quicklook crash - compatability problem with Acrobat?
Hi, I have experienced Preview crashes when opening a few .pdf files that are able to open in Acrobat Reader v9.4. When I try to get info about those documents using Finder, the folder vanishes for a moment and I am able to see my home screen. When I
-
hello everyone! I have installed openoffice3 on solaris 10.The installation went alright but when i try to run ./soffice from /opt/openoffice.org3/program it throws errors: ./soffice: /opt/openoffice.org3/program/../basis-link/ure-link/bin/javaldx: c
-
Data Modeller: compare models
Hello, when i go through the compare models dialog. The table columns are highlighted as been different. Inspection revels that the difference is in the data type: On the source model it is set to the domain presentation and on the target - to it's a