12-16-2004 10:01 AM
In my alv report , I am not able to enable the layout save toolbar .. The toolbar is not visible . Also, I want to know how we can put horizontal and vertical line in alv and also How to display Documentation help in ALV . Can anybody pls answer to my questions .. I am not a beginner in ALV. But not an expert too .. Pls help me ..
Thanking u in advance ..
12-16-2004 10:16 AM
Hi Shankara,
In the REUSE_ALV_LIST_DISPLAY or any other such func. module pass value 'A' for the parameter I_SAVE if you want to save user specific layouts or pass 'X' if you want system specific layouts. In case of user specific only that user will be able to get the layout on F4.
For horizontal and vertical lines, to my knowledge they will automatically appear till u set the option NO_VLINE to 'X' in the layout.
regarding the documentation help I'm still not clear what exactly u require. If you are talking about documentation of fields when F1 key is pressed, then for that you have to set in the fieldd catalog (a) either the ROLLNAME or (b)REF_FIELDNAME & REF_TABNAME
like T_FCAT-ROLLNAME = 'VBELN_VL'. "For Delivery No.
or T_FCAT-REF_FIELDNAME = 'VBELN'
T_FCAT-REF_TABNAME = 'LIKP'.
Hope this answers you queries.
regards,
Satyadev Dutta
12-16-2004 10:31 AM
I am using grid display and i am giving i_save = 'A' . Still that layout save and layout load tools are not coming .
12-16-2004 10:38 AM
12-16-2004 10:52 AM
Hello Shankar,
It would certainly help if you be more clear about your exact requirement the terminology you use.
What do you mean by layout <i>and tools?</i>
When you are giving the parameter I_SAVE as 'A', you want the standard user-specific save mode. But this attribute alone does not give you the save layout option. consider this example.
DATA: GT_SFLIGHT TYPE TABLE OF SFLIGHT,
LS_VARIANT TYPE DISVARIANT .
SELECT *
FROM SFLIGHT
INTO TABLE GT_SFLIGHT.
LS_VARIANT-REPORT = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_STRUCTURE_NAME = 'SFLIGHT'
IS_VARIANT = LS_VARIANT
I_SAVE = 'A'
TABLES
T_OUTTAB = GT_SFLIGHT.
The moment you give the option of saving the layout, you will also have to give the parameter IS_VARIANT.
Read the FM Documentation for more info. If you need any more explanation , please get abck.
Regards,
Anand Mandalika.
12-16-2004 11:07 AM
Thank you very much .. The layout issue is solved .. Can u solve the other issues ?
12-16-2004 11:30 AM
Hi,
Can you give me some points? And also the code to see why the lines don't appear?
Regards,
Anand Mandalika.
12-16-2004 10:37 AM
Hello Shankar,
1. Are you not able to see the ALV Toolbar itself? If yes, there's a parameter in the layout called NO_TOOLBAR. Please check that this parameter is set to space.
2. In case you are able to see the toolbar, but are not able to see the <i>Layout Button</i>, then, as Satyadev had pointed out, the parameter i_save has to be set accordingly to one of the following.
' ' = Display variants cannot be saved
'X' = Standard save mode
'U' = User-specific save mode
'A' = Standard and user-specific save mode
3. Can you be a little more clear about Horizontal and Vertical Lines ? Do you mean the grid lines? In my experience, I have never had to explicitly code for the grid lines. they appear by default. Only you have to suppress them explicitly if you don't want them.
4. Regarding Documentation, do you mean the documentation for the whole grid? or the F1 help for the cells of the grid ?
Regards,
Anand Mandalika.
12-16-2004 11:02 AM
1. ALV toolbar is visible . But layout save and load button is invisible
2.I have already set the i_save = 'A' in the function
'REUSE_ALV_GRID_DISPLAY'
3.I need a horizontal line after each record and also vertical lines after each column .
4.ya .. i need F1 help for each cell
12-16-2004 11:09 AM
Hi Shankar,
Seems like you have not read the answers above. Please do.
Also, please psot the code of the FM call here so that we can investigate what's wrong. Because the grid lines not appearing is something very strange (and uncommon). So I guess it gets a little difficult to find out your problem merely through <i>guesses</i>.
Hope to see your problems resolved.
Regards,
Anand Mandalika.
12-16-2004 11:21 AM
I am sorry .. horizontal lines and vertical lines i need not in grid display.. but in ALV LIST DISPLAY ..
12-16-2004 11:30 AM
In case of REUSE_ALV_LIST_DISPLAY, I'm not sure you will get any horizontal lines. But you will get the vertical lines by default.
12-16-2004 11:43 AM
No i am not getting vertical lines also ..
form call_alv.
gs_print-no_print_selinfos = 'X'.
gs_print-prnt_info = space.
gs_print-no_print_listinfos = 'X'.
gs_print-reserve_lines = 1.
gs_layout-colwidth_optimize = ''.
gs_layout-no_hline = 'X'.
gs_layout-no_vline = 'X' .
ABAP List Viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_structure_name = 'ITAB1'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_sort = gt_sort[]
it_events = gt_events[]
is_print = gs_print
i_save = 'A'
TABLES
t_outtab = itab1
EXCEPTIONS
program_error = 1
OTHERS = 2.
endform.
FORM build_layout.
gs_layout-no_input = ''.
gs_layout-colwidth_optimize = 'X'.
gs_layout-totals_text = 'Totals'(105).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode gs_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gs_layout-header_text = 'Test Report'.
ENDFORM. " BUILD_LAYOUT
FORM build.
DATA: fieldcat_in TYPE slis_fieldcat_alv.
CLEAR fieldcat_in.
fieldcat_ln-fieldname = 'MATNR'.
fieldcat_ln-tabname = 'ITAB1'.
fieldcat_ln-seltext_l = 'Material Num'.
fieldcat_ln-key = ' '.
fieldcat_in-outputlen = 18.
fieldcat_ln-col_pos = 1.
fieldcat_ln-row_pos = 1.
APPEND fieldcat_ln TO gt_fieldcat.
.........................................
.........................................
endform.
12-16-2004 11:55 AM
For exactly the same code, I'm able to get the vertical lines. Could you please check the values of the exporting parameter GS_LAYOUT just at the point where the Function Module is being called. I have a feeling that the field no_vline is getting set somewhere. Please re-check in debug mode.
Regards,
Anand Mandalika.
12-16-2004 12:42 PM
12-16-2004 12:51 PM
Hi,
I think you can have a look at my earlier response. That should resolve your problem.
FORM build.
DATA: fieldcat_in TYPE slis_fieldcat_alv.
CLEAR fieldcat_in.
fieldcat_ln-fieldname = 'MATNR'.
fieldcat_ln-tabname = 'ITAB1'.
fieldcat_ln-ref_fieldname = 'MATNR'.
fieldcat_ln-ref_tabname = 'MARA'.
fieldcat_ln-seltext_l = 'Material Num'.
fieldcat_ln-key = ' '.
fieldcat_in-outputlen = 18.
fieldcat_ln-col_pos = 1.
fieldcat_ln-row_pos = 1.
APPEND fieldcat_ln TO gt_fieldcat.
Cheers,
Satya
12-17-2004 5:20 AM
Hello Shankar,
In general, you would automatically get the F1 help for the fields by default, if the field has been declared with reference to a standard field in the ABAP Dictionary.
The ALV List is not different in this regard.
In case you have some fields in the list which do not refer to the dictionary fields or if the data-element does not have the documentation maintained, then you would have to program the Help yourself. In this case, you will have to handle the event (of pressing the key F1) yourself. In the event handler, you can call a function module like DOCUSHOW*. However, this is a pretty rare case.
Regards,
Anand Mandalika.
P.S. If the answers help you, please do reward the points as and when you read them.
01-09-2014 11:38 AM
hi,
you have to set i_save property 'A'- user can edit(allow to change)
'X'- user cant't edit default not set (not allow to change)
'U'- default selected (but not allow to change)
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_structure_name = 'ITAB1'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_sort = gt_sort[]
it_events = gt_events[]
is_print = gs_print
i_save = 'A' / 'X'/ 'U'
TABLES
t_outtab = itab1
EXCEPTIONS
program_error = 1
OTHERS = 2.