Refreshing ALV output display
Hi,
I have a report with ALV .In the output success or error message gets displayed in a column based on certain conditions.The errors can be manually corrected.I
f the errors are corrected and 'Refresh' button is pressed in my output,the error message displayed in the output should disappear.
As of now,this happens if the report is run again but i want this to happen just by clicking of refresh button.i.e. the entire report should be run again with the existing inputs entered in selection screen.
If i try to call the same program using 'submit' spool gets created,but i want the output in the same page.
Can you please tell me how this can be achieved.
Regards,
S.Subasree
Hi Subasree,
The following method call is used to refresh the data displayed within an ALV object grid:
CALL method gd_tree->REFRESH_TABLE_DISPLAY.
CALL METHOD gd_tree->set_table_for_first_display
EXPORTING
is_layout = gd_layout
CHANGING
it_fieldcatalog = gd_fieldcat
it_sort = it_sortcat
it_outtab = it_report.
CALL method gd_tree->REFRESH_TABLE_DISPLAY.
CALL METHOD cl_gui_cfw=>flush.
Hope this helps.
Reward if helpful.
Regards,
Sipra
Similar Messages
-
Hi,
how to refresh an ALV LIST display?
Thanks.Hi,
Content and Structure Change
Use
You are able to change the internal data table in various ways. Depending on which type of change you use, you have to proceed differently to make the change visible on the front end in the ALV output as well.
You are able to make the following changes:
· You change content or the sequence of the individual data records
Afterwards you need to refresh the ALV output
· You replace the entire data table
Refresh Display of the ALV Output
If you have changed single values, added rows or deleted rows in the data table of list-type ALV outputs, you need to complete these changes in the ALV output as well by refreshing the ALV display.
For Changes in the Tree Structure you do not have to refresh the display. In the other ALV tools, you do not have to refresh the ALV output when you make the following changes:
§ Changes to the Display of Columns
§ Changes Sequence of Columns in the ALV display
§ Changes to the DDIC Reference of Columns
By default, the ALV output automatically scrolls to the beginning. However, you are able to determine that the current display (position on the screen) not be changed.
You are able to refresh the ALV output in two ways:
· All settings for filters and sorting remain.
This setting can lead to newly inserted data records not being displayed because the filter setting hid exactly these data records.
· All settings for filters and sorting remain.
Features
For changes to content and structure, you are able to make the following settings:
· Refresh ALV output
· Swap the data table of the ALV output
Refresh ALV output
With the refresh, you ensure that the changed values are available on the front end as well.
Display type
ALV Tool
Classic ABAP list
Full screen
In the Container
Simple, two-dimensional table
Yes
Yes
Yes
Hierarchical-sequential list
Yes
Tree structure
No
No
Methods
Function
Class
Method
Refresh ALV output without deleting filter and sort settings
CL_SALV_TABLE
CL_SALV_HIERSEQ_TABLE
REFRESH
(Parameter REFRESH_MODE: SOFT)
Refresh ALV output and delete filter and sort settings
REFRESH
(Parameter REFRESH_MODE: FULL)
Change the Structure of the Data Table with SET_DATA
Depending on which ALV tool you are using, the parameters of the SET_DATA method are different:
If you assign a new structure with SET_DATA, all objects that referred to the previous structure will be deleted such as all sort objects in list-type ALV outputs or all node objects in tree structures.
Methods
Function
Class
Method
Change structure and data table
CL_SALV_TABLE
CL_SALV_HIERSEQ_TABLE
CL_SALV_TREE
CL_SALV_HIERSEQ_LEVEL
SET_DATA
Change the Structure of the Data Table with the SET_DATA Method
ALV Tool
Parameter
Remarks
Simple, two-dimensional table
T_TABLE
Table for structure and contents of the ALV output
Hierarchical-sequential list
(in CL_SALV_HIERSEQ_TABLE)
LEVEL
Hierarchy level whose structure you wish to change
T_TABLE
New table of hierarchy level
T_BINDING
List of up to five foreign-key relationships
(in CL_SALV_HIERSEQ_LEVEL)
VALUE
New table of hierarchy level
T_BINDING
List of up to five foreign-key relationships
Tree structure
T_TABLE
Initial table
Empty table, only sets the structure -
hi
i'm doing an ALV Report. In the output i'm double clicking on the Document field using user-command
it is taking me to a particular Transaction and my requirement is if i change any field for ex : Description
in that transaction and come back again to the output display the Changed Description should appear
when i refresh the Output.how to get it?
Regards1. create one icon on allication toolbar which is REFRESH icon, and give some function for it.
2. write the code like:
CASE SY_UCOMM.
when 'FCODE'.
refresh itab.
perform get_data.
perform_displaydata.
it is nothing but u need to put the same code which u used earlier to show the data in output gaian after clicking on function code.
Regards,
Rajesh. -
Hi gurus,
My requirement is that i want to refresh my alv output when i click a particular button. and all the data displayed should be deleted and empty lines should be there.
i have done till the refreshement but i am not getting empty lines. i am not getting any line . i have to click insert row everytime i need a new entry.
i have written this code:
REFRESH gt_output.
CALL METHOD gv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'V_T001B'
i_save = 'A'
it_toolbar_excluding = lt_exclude
CHANGING
it_outtab = gt_output
it_fieldcatalog = gt_fieldcat[].
DO anyone have the answerHi,
Refersh
call the method gv_grid->refresh_table_display
Delete
clear your final internal table gt_output which is displaying the data in the grid
refersh gt_output.
Refersh the grid using the method refresh_table_display.
Reward if found helpful.
Regards,
Boobalan Suburaj -
Strange behaviour in alv output display for a date column!
hi friends,
my alv output list display contains a column for budat (posting date), if this field has no value, then it displays a blank cell (space) in the output in my user login...but when the same report is run in another user login, even though the value of the column is null, it displays 00000000 (8 zeroes) rather than displaying a blank cell...i have set the field catalog property NO_ZERO = 'X'; is this property has anything to do with authorization to achieve its funcionality? am not sure...this is strange, as it is the same report, same field catalog that is being used..need some inputs on this
thanks in advance
SathishThere are 2 solutions for an adhoc solution you can change the field to a char10 field, this will solve your immediate problem of the 0 display. For a permanent solution you can check the user profile setting for the date for you as well as the concerned user.
Hope That Helps
Anirban M. -
To Display Calender in F4 help in ALV Output Display.
Hello Experts.
I have one requirement. I have an ALV output. In this one date field is editable. Here User wants F4 Help. I have provided the F4 help, F4 help is coming but for F4 help i want the Factory Calendar type display. Currently the F4 help is coming like a normal F4 help.
Thanks.
Swati.hi Swati,
I hope you have checked standard program 'bcalv_edit_08'.
in this program, if the type of field we are taking in that perticuler column is 'DATS' then it should display the calender.
Regards,
Ani -
Hello,
I have one query witl regards to ALV output. After entering data in the selection screnn my ALV output gets displayed and there is no issue with it. The ALV is in display mode and if i click on the change button the ALV becomes editable. So fat it is fine.
The area of concern is the initial ALV output even though it is in display mode looks as if it is editable ALV. On click of the change button, then the ALV is shown in display mode and it is easily identifiable.
The user feels the initial ALV output is confusing and that he is not able to recognize whether it is display/editbale ALV. How can we fix it so that client can identify it?
Also, how do we get all the standard ALV buttons that we get in SE38 output in webdynpro? Please help.
Regards,
VaishnaviHi,
init your ALV settings with:
DATA lr_alv_cfg TYPE ref to cl_salv_wd_config_table.
lo_INTERFACECONTROLLER = wd_this->wd_cpifc_alv_table( ).
lr_alv_cfg = lo_interfacecontroller->get_model( ).
lr_alv_cfg->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_true ).
If you click change button do this:
is_read_only = lr_alv_cfg->IF_SALV_WD_TABLE_SETTINGS~GET_READ_ONLY( ).
if lv_is_read_only = abap_true.
lr_alv_cfg->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_false ).
else.
lr_alv_cfg->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_true ).
endif. -
To refresh alv output using function button
hi frnds..
its alv ... i have added refresh button in output ... as per requirement..
but i am getting the exact functionality to incorate in form user-command.
here i am using REUSE_ALV_GRID_DISPLAY.
i just want the output to refresh while i click the refresh button.
can u pls help me...Hi Sekhar,
Modify your code seeing the following:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'REFRESH'
(write ur code here)
rs_selfield-refresh = 'X'.
ENDCASE.
ENDFORM. "user_command
With the help of the statement rs_selfield-refresh = 'X'. you will be able to Refresh ur ALV list.
Award points if useful.
Thanks,
Nadim -
Align ALV Output Display to fit window resolution using cl_gui_custom_conta
hi,
my ALV Display is not fitting to the window screen for different resolutions.
big monitor the screen display is too small and small monitor its fitting.
I want to have DYNAMIC screen fit using cl_gui_custom_container...
is it possible??
ags.Thanks Pawan,
the link you provided had my exact solution.
this is a very rare feature to know i believe since most of the people havnt faced it i guess.
I will have to say the same thing as you said in the
"Thanks Pawan, that explains everything.. sometime I just overlook the things..Thnaks again!!"
ags. -
Total is not getting displayed in the ALV output.
Hi,
Total is not getting displayed in the ALV output.
I m using :REUSE_ALV_BLOCK_LIST_APPEND & REUSE_ALV_BLOCK_LIST_DISPLAY
Are there any issues with it as the same settings are working fine with REUSE_ALV_LIST_DISPLAY
source code:
DATA: layout TYPE slis_layout_alv,
IT_eventS TYPE slis_t_event,
fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
rec_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
TYPES: BEGIN OF ty_tab,
belnr TYPE dberchz-belnr,
belzart TYPE dberchz-belzart,
net TYPE dberchz-nettobtr,
END OF ty_tab.
DATA: lt_tab TYPE STANDARD TABLE OF ty_tab.
SELECT belnr belzart nettobtr
FROM dberchz
INTO TABLE lt_tab[]
WHERE belnr eq '000000000001'.
if sy-subrc ne 0.
ENDIF.
* defining layout
layout-colwidth_optimize = 'X'.
layout-def_status = 'X'.
*defning event
*event
*defining field catalog
fcat-col_pos = 1.
fcat-fieldname = 'BELNR'.
fcat-tabname = 'LT_TAB'.
APPEND fcat.
fcat-col_pos = 2.
fcat-fieldname = 'BELZART'.
fcat-tabname = 'LT_TAB'.
APPEND fcat.
fcat-col_pos = 3.
fcat-fieldname = 'NET'.
fcat-tabname = 'LT_TAB'.
fcat-do_sum = 'X'.
APPEND fcat.
*calling alv
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = 'YZ_PLR'
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* IT_EXCLUDING =
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = layout
it_fieldcat = fcat[]
i_tabname = 'LT_TAB'
it_events = IT_EVENTS[]
* IT_SORT =
* I_TEXT = ' '
tables
t_outtab = lt_tab[]
* EXCEPTIONS
* PROGRAM_ERROR = 1
* MAXIMUM_OF_APPENDS_REACHED = 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.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
Thanks,
GauravHi
No I don't think, this is my code (based on your code) and it works fine:
TYPE-POOLS SLIS.
DATA: BEGIN OF LT_TAB OCCURS 0,
BELNR LIKE BSEG-BELNR,
GJAHR LIKE BSEG-GJAHR,
WRBTR LIKE BSEG-WRBTR,
WAERS LIKE BKPF-WAERS,
END OF LT_TAB.
DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
IT_EVENTS TYPE SLIS_T_EVENT,
FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
REC_FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
START-OF-SELECTION.
FCAT-COL_POS = 1.
FCAT-FIELDNAME = 'BELNR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'BELNR'.
FCAT-REF_TABNAME = 'BSEG'.
APPEND FCAT.
FCAT-COL_POS = 2.
FCAT-FIELDNAME = 'GJAHR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'GJAHR'.
FCAT-REF_TABNAME = 'BSEG'.
APPEND FCAT.
FCAT-COL_POS = 3.
FCAT-FIELDNAME = 'WRBTR'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-CFIELDNAME = 'WAERS'.
FCAT-REF_FIELDNAME = 'WRBTR'.
FCAT-REF_TABNAME = 'BSEG'.
FCAT-DO_SUM = 'X'.
APPEND FCAT.
FCAT-COL_POS = 4.
FCAT-FIELDNAME = 'WAERS'.
FCAT-TABNAME = 'LT_TAB'.
FCAT-REF_FIELDNAME = 'WAERS'.
FCAT-REF_TABNAME = 'BKPF'.
FCAT-DO_SUM = SPACE.
APPEND FCAT.
SELECT * FROM BSEG INTO CORRESPONDING FIELDS OF TABLE LT_TAB
WHERE BUKRS = 'MAAB'
AND BELNR = '0000000001'.
LT_TAB-WAERS = 'EUR'.
MODIFY LT_TAB FROM LT_TAB TRANSPORTING WAERS WHERE WAERS = SPACE.
*CALLING ALV
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = 'ZPROVAMAX5'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FCAT[]
I_TABNAME = 'LT_TAB'
IT_EVENTS = IT_EVENTS[]
TABLES
T_OUTTAB = LT_TAB[].
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
I've also inserted a currency field
Max -
Newly added field not getting displayed in ALV output
Hi All,
I'm adding one more field/column to be displayed in an old existing program that uses REUSE_ALV_FIELDCATALOG_MERGE to generate the ALV fieldcat.
DATA: BEGIN OF it_salary OCCURS 0,
pernr LIKE pa0000-pernr,
ename LIKE pa0001-ename,
rtext like lv_rtext, -
added field
waers LIKE pa0008-waers
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = driver
i_internal_tabname = 'IT_SALARY'
i_client_never_display = 'X'
i_inclname = driver
CHANGING
ct_fieldcat = lv_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = driver
it_fieldcat = lv_fieldcat[]
i_default = 'X'
i_save = 'A'
is_variant = lv_tmplt
is_layout = lv_ls_layout
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = it_salary
EXCEPTIONS
program_error = 1
OTHERS = 2.
The newly added field is not getting populated in the lv_fieldcat table. Tried running programs BALVBUFDEL,
BCALV_BUFFER_DEL_SHARED then logging off and logging in but of no help.
Please provide suggestion for this issue.
Regards,
Sridevi SHi,
Fieldcat is buffered - so use
I_BYPASSING_BUFFER = 'X'
Since a while CL_GUI_ALV_GRID is available which does NOT need any fieldcat (is determined internally using RTTI). It is worth playing around whith this class if you have some time. This class is recommended for ALV Output by SAP (but no edit is possible - was never supported officially).
A simple use would be:
data: gt_output type standard table of (adjust!).
*simple ALV output
data go_alv type ref to cl_salv_table.
data go_functions type ref to cl_salv_functions_list.
data go_columns type ref to cl_salv_columns_table.
data go_column type ref to cl_salv_column_table.
*Exceprion handlig
data: go_exception type ref to cx_root,
gv_errortext type string.
** fill table gt_output ...
** ALV output
if not gt_output is initial.
try.
call method cl_salv_table=>factory
importing
r_salv_table = go_alv
changing
t_table = gt_output.
catch cx_salv_msg into go_exception.
gv_errortext = go_exception->get_text( ).
message gv_errortext type 'A'.
endtry.
* enable all standard ALV functions
go_functions = go_alv->get_functions( ).
go_functions->set_all( ).
* hide MANDT
go_columns = go_alv->get_columns( ).
go_column ?= go_columns->get_column( columnname = 'MANDT' ).
go_column->set_technical( ).
go_alv->display( ).
Kind regards,
Holger -
Hi,
I need to create a column that will have an icon ICON_DOCUMENT displayed in the column. Now, when i clik on this icon it should check for the existance of any links existing for a material , if so, then display those links . Basically this icon should dispaly the link to material drawings . How do i include the icon in the output column in ALV?
Thanks,
Sindhu.hi,
Sample code is ::
report zalvexer2 message-id zz .
*& TABLES DECLARATION *
tables: vbak.
*& TYPE POOLS DECLARATION *
type-pools: slis.
*& INTERNAL TABLE DECLARATION *
data: begin of itab occurs 0,
icon type icon-id,
vbeln like vbak-vbeln,
audat like vbak-audat,
vbtyp like vbak-vbtyp,
auart like vbak-auart,
augru like vbak-augru,
netwr like vbak-netwr,
waerk like vbak-waerk,
end of itab.
*INTERNAL TABLE FOR FIELD CATALOG
data: wa_fieldcat type slis_fieldcat_alv,
it_fieldcat type slis_t_fieldcat_alv.
IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
WITH HEADER LINE,
*INTERNAL TABLE FOR EVENTS
data: it_event type slis_t_event,
wa_event type slis_alv_event,
*INTERNAL TABLE FOR SORTING
it_sort type slis_t_sortinfo_alv,
wa_sort type slis_sortinfo_alv,
*INTERNAL TABLE FOR LAYOUT
wa_layout type slis_layout_alv.
*& VARIABLE DECLARATION *
data : v_repid type sy-repid,
v_pagno(4) type n,
v_date(8) type c.
*& CONSTANTS *
constants: c_x type c value 'X'.
*& SELECTION SCREEN *
selection-screen: begin of block b1 with frame title text-001.
select-options: s_vbeln for vbak-vbeln,
s_vbtyp for vbak-vbtyp default 'C'.
selection-screen: end of block b1.
selection-screen: begin of block b2 with frame title text-002.
selection-screen : begin of line.
selection-screen comment 1(20) text-003.
parameters: p_list radiobutton group rad1 default 'X'.
selection-screen : end of line.
selection-screen : begin of line.
selection-screen comment 1(20) text-004.
parameters: p_grid radiobutton group rad1.
selection-screen : end of line.
selection-screen: end of block b2.
at selection-screen.
perform validate_screen.
*& START OF SELECTION *
start-of-selection.
clear: itab, itab[].
V_REPID = SY-REPID.
perform get_data.
perform display_data.
*& END OF SELECTION *
end-of-selection.
*--DO ALV Process
v_repid = sy-repid.
*--Sort the Output Fields
perform sort_fields.
*--Build Field catalog for the Output fields
PERFORM BUILD_FIELDCAT.
*--Set the Layout for ALV
perform set_layout.
*& Form GET_DATA
text
TO GET THE DATA FROM TABLES INTO ITAB
form get_data .
select vbeln
audat
vbtyp
auart
augru
netwr
waerk
into corresponding fields of table itab
from vbak
where vbeln in s_vbeln and
audat > '04.04.2005'
and netwr > 0.
<b>loop at itab.
if itab-netwr < 10000.
itab-icon = '@08@'.
elseif itab-netwr > 10000 and itab-netwr < 100000.
itab-icon = '@09@'.
elseif itab-netwr > 100000.
itab-icon = '@0A@'.
endif.
modify itab index sy-tabix.
endloop.</b>
endform. " GET_DATA
*& Form sort_fields
form sort_fields .
clear wa_sort.
wa_sort-fieldname = 'VBTYP'.
wa_sort-spos = '1'.
wa_sort-up = 'X'.
append wa_sort to it_sort.
clear wa_sort.
wa_sort-fieldname = 'NETWR'.
wa_sort-spos = '2'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
append wa_sort to it_sort.
endform. " sort_fields
*& Form set_layout
form set_layout .
if p_list = c_x .
wa_layout-window_titlebar = 'LIST DISPLAY'(016).
wa_layout-zebra = 'X'.
*-- ALV LIST DISPLAY
perform list_display tables itab.
*-- ALV GRID DISPLAY
elseif p_grid = c_x.
wa_layout-window_titlebar = 'GRID DISPLAY'(017).
wa_layout-zebra = 'X'.
perform grid_display tables itab.
endif.
endform. " set_layout
*& Form list_display
form list_display tables p_itab .
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = v_repid
is_layout = wa_layout
it_fieldcat = it_fieldcat[]
it_sort = it_sort[]
i_save = 'U'
tables
t_outtab = itab
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. " list_display
*& Form GRID_DISPLAY
form grid_display tables p_itab .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = v_repid
is_layout = wa_layout
it_fieldcat = it_fieldcat[]
it_sort = it_sort[]
it_events = it_event
tables
t_outtab = itab
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. " GRID_DISPLAY
*& Form VALIDATE_SCREEN
text
--> p1 text
<-- p2 text
form validate_screen .
data: lv_vbeln like vbak-vbeln.
if not s_vbeln is initial.
select vbeln
into lv_vbeln
up to 1 rows
from vbak
where vbeln in s_vbeln.
endselect.
if sy-subrc <> 0.
message e000 with 'INVALID SALES DOC'.
endif.
endif.
endform. " VALIDATE_SCREEN
*& Form display_data
text
--> p1 text
<-- p2 text
form display_data .
define m_fieldcat.
add 1 to wa_fieldcat-col_pos.
wa_fieldcat-fieldname = &1.
wa_fieldcat-ref_tabname = 'VBAK'.
wa_fieldcat-do_sum = &2.
wa_fieldcat-cfieldname = &3.
append wa_fieldcat to it_fieldcat.
end-of-definition.
data:
ls_fieldcat type slis_fieldcat_alv,
lt_fieldcat type slis_t_fieldcat_alv.
m_fieldcat 'ICON' '' ''.
m_fieldcat 'VBELN' '' ''.
m_fieldcat 'AUDAT' '' ''.
m_fieldcat 'VBTYP' '' ''.
m_fieldcat 'AUART' '' ''.
m_fieldcat 'AUGRU' '' ''.
m_fieldcat 'NETWR' 'C' 'WAERK'.
m_fieldcat 'WAERK' '' ''.
endform. " display_data[/code]
Message was edited by: Ashok Parupalli
Message was edited by: Ashok Parupalli -
ALV list display in a Background job - Spool output
Hi,
We are currently working on a report scheduled to be run in the background job, and the ALV list is displayed in the spool output.
ALV list in the spool does not look the same as front run job, the column headers are all crowded together, and there is no grid in-between different columns or rows. It's hard to read.
Is there a way to add grid for this kind of output?
Thanks!Hi Deepak:
I expanded your report into two rows display, and the grid in the spool display simply gone!
report zzscratch line-size 120 no standard page heading.
type-pools slis.
tables pa0001.
data : li_field type standard table of slis_fieldcat_alv,
gi_events type standard table of slis_alv_event,
gr_layout_bck type slis_layout_alv,
gr_save like disvariant,
gr_events type slis_alv_event.
types : begin of gtt_emp,
pernr type persno,
ename like pa0001-ename,
uname like pa0001-UNAME,
end of gtt_emp.
data : lr_field type slis_fieldcat_alv.
data : lc_rep like syst-repid.
data : li_emp type standard table of gtt_emp,
lr_emp type gtt_emp.
data : gv_ref_table type lvc_rtname.
gv_ref_table = 'CATSDB'.
lr_field-fieldname = 'PERNR'.
lr_field-ref_tabname = gv_ref_table.
lr_field-inttype = 'N'.
lr_field-outputlen = 8.
lr_field-seltext_l = 'EMPLOYEE Number'.
append lr_field to li_field.
lr_field-fieldname = 'ENAME'.
lr_field-ref_tabname = 'PA0001'.
lr_field-inttype = 'C'.
lr_field-outputlen = 40.
lr_field-seltext_l = 'EMPLOYEE Name'.
append lr_field to li_field.
lr_field-fieldname = 'UNAME'.
lr_field-ref_tabname = 'PA0001'.
lr_field-inttype = 'C'.
lr_field-outputlen = 12.
lr_field-seltext_l = 'User Name'.
lr_field-row_pos = 2.
lr_field-col_pos = 1.
append lr_field to li_field.
lc_rep = sy-repid.
gr_layout_bck-edit_mode = 'D'.
gr_save-report = sy-repid.
lr_emp-pernr = '00000001'.
lr_emp-ename = 'abc'.
lr_emp-uname = 'testus'.
append lr_emp to li_emp.
lr_emp-pernr = '00000002'.
lr_emp-ename = 'def'.
append lr_emp to li_emp.
lr_emp-pernr = '00000003'.
append lr_emp to li_emp.
lr_emp-pernr = '00000004'.
append lr_emp to li_emp.
lr_emp-pernr = '00000005'.
append lr_emp to li_emp.
lr_emp-pernr = '00000006'.
append lr_emp to li_emp.
lr_emp-pernr = '00000007'.
append lr_emp to li_emp.
lr_emp-pernr = '00000008'.
append lr_emp to li_emp.
end-of-selection.
Function module for ALV grid display
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = lc_rep
is_layout = gr_layout_bck
it_fieldcat = li_field
i_save = 'A'
is_variant = gr_save
it_events = gi_events
TABLES
t_outtab = li_emp[]
EXCEPTIONS
program_error = 1
others = 2.
if sy-subrc <> 0.
clear gr_messages.
message e023 into gr_messages.
append gr_messages to gi_messages.
endif. -
ALV output problem in displaying the field lengths.( LONG_DES1 & LONG DES)
I have declared itab of ALV output like below...
Internal table for ALV report generation***********
DATA : Begin of pdet_otab_alv occurs 0,
bukrs LIKE bsid-bukrs, "Company code
postm(4), "Posting month (YYMM format)
xblnr LIKE bsid-xblnr, "Reference document number
kunnr LIKE bsid-kunnr, "Customer (Supplier Billing Customer)
name1 LIKE kna1-name1, "Name 1
buzei like bsid-buzei,
gjahr like bsid-gjahr,
filkd like bsid-filkd, "Rep Number
rname like kna1-name1, "Rep Name
belnr LIKE bsid-belnr, "Document number (invoice number)
blart LIKE bsid-blart, "Document type
zfbdt LIKE bsid-zfbdt, "Baseline date
zterm LIKE knb1-zterm, "Terms
netdt LIKE bsega-netdt,"Due date
sgtxt LIKE bsid-sgtxt, "Text
agerg TYPE t_agerg, "Age range of invoice
wrbtr LIKE bsid-wrbtr, "Original invoice amount
due LIKE bsid-wrbtr, "Amount outstanding on invoice
long_des(250) type c, " Long description
<b> long_des TYPE string,
long_des1 TYPE string,</b>
date_s(10) type c, " Date
short_des(20) type c, " Short Description
counter type i,
End of pdet_otab_alv.
And after filling the internal table fields ( fields 'LONG_DES1' & 'LONG_DES' from FM READ_TEXT 's longtext, which are of 265 chars each )
<b>'LONG_DES1' & 'LONG_DES' are trimmed in ALV out put WHY ?</b>
w_fieldcat-fieldname = 'LONG_DES1'.
w_fieldcat-tabname = 'PDEL_OTAB_ALV'.
w_fieldcat-ref_fieldname = 'SCRTEXT_L'.
w_fieldcat-ref_tabname = 'DD03P'.
w_fieldcat-seltext_l = 'Original Note'.
w_fieldcat-col_pos = 17.
APPEND w_fieldcat TO fieldcat.
CLEAR w_fieldcat.
w_fieldcat-fieldname = 'LONG_DES'.
w_fieldcat-tabname = 'PDEL_OTAB_ALV'.
w_fieldcat-ref_fieldname = 'SCRTEXT_L'.
w_fieldcat-ref_tabname = 'DD03P'.
w_fieldcat-seltext_l = 'Latest Note'.
w_fieldcat-col_pos = 18.
APPEND w_fieldcat TO fieldcat.
CLEAR w_fieldcat.
<b>next part i.e., before passing fieldcat.... I have filled s_layout like below.</b>
<b> s_layout-max_linesize = 1000.
s_layout-colwidth_optimize = 'X'.</b>
Call the following function to display output in ALV form
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZFRSBOI0'
is_layout = s_layout
it_fieldcat = fieldcat
it_events = p_events[]
it_sort = p_it_sort[]
i_save = 'A'
TABLES
t_outtab = pdet_otab_alv1
EXCEPTIONS
program_error = 1
OTHERS = 2.
If the function call is not successful, raise error message
and come out from the program
IF sy-subrc <> 0.
message e000(00) with
'Unable to display report'(e01).
exit.
ENDIF.some body suggested me....we can display full length of text by below coding ?
Is that not correct - just asking....
s_layout-max_linesize = 1000.
s_layout-colwidth_optimize = 'X'.
Call the following function to display output in ALV form
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZFRSBOI0'
is_layout = s_layout
it_fieldcat = fieldcat
it_events = p_events[]
it_sort = p_it_sort[]
i_save = 'A'
TABLES
t_outtab = pdet_otab_alv1
EXCEPTIONS
program_error = 1
OTHERS = 2.
If the function call is not successful, raise error message
and come out from the program
IF sy-subrc <> 0.
message e000(00) with
'Unable to display report'(e01).
exit.
ENDIF. -
After refreshing ALV display, set it to the current cell that was modified.
Hello Experts,
I am currently using cl_gui_alv_grid for my ALV grid display. I have 1 editable column
which lets users input values. Now, When users press 'ENTER' in the keyboard I refresh
the ALV display to reflect the changes done. But the display always "moves back" to the first column
so it is tiresome to find the current cell that was modified. My question is, how do I set the ALV
display to just "stay put" in the current cell that was modified after pressing 'ENTER'?
Hope you can help me guys.Thank you and take care!Check this link
ALV scroll bar
Maybe you are looking for
-
Use one account for apps and other for itunes match
Hello everybody My question today is quite simple. I use one account for apps and tv shows, but inwant to use a different itunes account for purchasing itunes match. How can I use them both on my devices? Will it be asking for my user-pass each time
-
Images into db, what's wrong?
Hi, I'm still trying to fetch some images into my database, gif or jpeg, but I have some problems. I used the following code but it gives me a compile error. I don't understand why! EXEC does'nt work. CREATE TABLE MY_IMAGES_DB( id NUMBER(10) NOT NULL
-
Report with "|" Delimited
As per the requirements the report output should be viewed (opened) in Microsoft Excel, the length of the report is too long... so my data in the rows are wrapped to the next line... that makes the report unreadble... My settings in reports Layout Ma
-
Prints are too dark even though screen image looks fine
I have an iMac and an HP Photosmart D7360 printer. Lately, every photo I print is too dark. With older versions of iPhoto I was able to adjust the print settings (saturation, brightness, etc) from the print window and save those as a preset so my pri
-
I have 4 different hard drives and have very poor organization skills. all hard drives have been used as my scratch disk at one time or another. I lost a *.fcp file and can't find it.I don't remember what I named it. I do know that in the browser I h