Query regarding SAP ABAP ALV List display
Hi All,
Have a requirement where in, when a user double clicks on a particular field as shown below, the particular cell where he has clicked has to be changed to editable and input mode. I am using ALV LIST DISPLAY.
Please reply me if someone has worked on similar requirement.
Hi Priya,
Check this link: http://www.saptechnicl.com/Tutorials/ALV/Edit/demo.htm. I think this is exactly what you require.
Hope this helps! Do let me know if you need anything else!!
(rename "technicl" as "technical", my apologies for the typo).
Cheers,
Shailesh.
Similar Messages
-
How to send the alv list display to spool
Hi all,
I am executing a program in foreground. My requirement is sending alv list output to spool. When i execute the smae program in background mode the SAP is handling the spool output in hierarchial list display. How to get the same output in foreground also.
Thanks and Regards,
Vijay.Hi max,
I think my question is not clear.
when I execute my report in background mode, I can able to see the output in the spool.
But when I execute the same report in foreground no spool output is getting generated.
To handle this I am calling some function modules like RSPO_OPEN_SPOOLREQUEST , RSPO_WRITE_SPOOLREQUEST, RSPO_WRITE_SPOOLREQUEST. But by using this i cannot able to get the desired output in alv list display format. what to do to get my desired output.
Thanks and Regards,
Vijay. -
HOW TO DISPLAY MY OWN PF STATUS IN ALV LIST DISPLAY
Hi All,
i am developing one program in this program i am displaying output by using alv list display. after displaying the out SAP predefined pf status is coming. here i need my own pf status. any body can send me the sample code ir modify my code if possible.
i am sending my code below.
report zmahi6.
type-pools : slis.
tables : zuser_secobjects.
data : it_secobjects like zuser_secobjects occurs 0 with header line.
data : i_field type slis_t_fieldcat_alv with header line.
data : w_field like line of i_field.
data : i_sort type slis_t_sortinfo_alv.
data : w_sort like line of i_sort.
data : it_filt1 type slis_t_filter_alv with header line.
data:
i_tabname type tabname,
i_repid like sy-repid,
is_lout type slis_layout_alv.
data : chk_box type slis_fieldname.
selection-screen: begin of block b1 with frame title text-t01.
parameters : p_appln type zuser_secobjects-appln.
parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
p_partnr type zuser_secobjects-appln_partner,
p_ptype type zuser_secobjects-partner_type default '02',
p_upostn type zuser_secobjects-user_position,
p_sdate like likp-erdat default sy-datum,
"type zuser_secobjects-start_date
p_edate(10) default '12/31/9999',
type zuser_secobjects-end_date,
p_revnum type zuser_secobjects-revnum,
p_cted type zuser_secobjects-created_by,
p_cdate type zuser_secobjects-creation_date,
p_ctime type zuser_secobjects-creation_time,
p_chnby type zuser_secobjects-changed_by,
p_cdate1 type zuser_secobjects-changed_date,
p_ctime1 type zuser_secobjects-changed_time.
selection-screen: end of block b1.
start-of-selection.
perform get_data.
check sy-subrc eq 0.
set pf-status 'ZMAHEE'.
perform prepare_fieldcatalog.
perform alv_list_display.
*& Form PREPARE_FIELDCATALOG
text
--> p1 text
<-- p2 text
form prepare_fieldcatalog.
clear: w_field,i_field.
refresh:i_field.
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'.
i_field-input = 'X'.
i_field-fieldname = 'HEADER'.
i_field-outputlen = 0.
append i_field.
clear i_field.
w_field-fieldname = 'APPLN'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-seltext_l = text-m01.
w_field-outputlen = '10'.
w_field-col_pos = 1.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_USER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
endform. " PREPARE_FIELDCATALOG
*form pf_status_set using rt_extab type slis_t_extab.
set pf-status '0001'.
*endform.
*& Form ALV_LIST_DISPLAY
text
--> p1 text
<-- p2 text
form alv_list_display.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_comomand = 'USER_COMMAND'
is_layout = is_lout
it_fieldcat = i_field[]
it_sort = i_sort
it_events = it_evts[]
tables
t_outtab = it_secobjects.
endform. " ALV_LIST_DISPLAY
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form get_data.
select * from zuser_secobjects
into table it_secobjects.
endform. " GET_DATA
thanks,
maheedhar.tFollow this steps.
I ahve done it once and hope wuld work for you as well.
Go to SE80. Open a a standard ABAP program - SAPLKKBL. diasplay object.
This program has many standard GUI status. Copy the one which suits you the best. May be any one standars status. Right click it and copy to your custom report. Now open your Z-Program in SE80. You will see the GUI status and when you open it you see the name of the status that you have copied from.
Now you can go and do any modifications in the screen.
Remember you have to use the same status in the program as well.
Please check this piece of code.
call the ABAP list viewer *
FORM list_display TABLES a_output.
pgm = disvariant-report = sy-repid.
disvariant-variant = variant.
call list viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = pgm
i_callback_pf_status_set = 'SET_PF_STATUS'
it_fieldcat = fieldcat
is_variant = disvariant
is_layout = layout
is_print = print
i_save = 'A'
it_events = eventcat
it_sort = sortcat
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = a_output
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "LIST_DISPLAY
FORM SET_PF_STATUS *
FORM set_pf_status USING extab TYPE slis_t_extab.
SET PF-STATUS 'STATUS1'.
ENDFORM. "set_pf_status
FORM USER_COMMAND *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
DATA t_difference TYPE i.
CASE ucomm.
WHEN 'ENT1'.<----Function code
D0 your processing.
ENDCASE.
selfield-refresh = 'X'.
ENDFORM. "user_command
HOpe this helps.
Shreekant -
Filtering the ALV List Display
Hi all.
We had a requirement like filtering ALV List display.
Suppose my ALV list dispaly contains 100 records and by using the standard filtering option ,I restricted it to 50 records and by clicking a check box for 20 records and delete button(Customized) ,I should ideally get 30 records.
But according to standard SAP functionality buttons ,all 80 Records will be displayed .But i need 30 records.
Any function module or code will be available to achieve this one?
In this case which will be the preferable method to go further?
What will be the best method(Normal ALV/OOALV) ?
Any pointers in this regard are very much helpful.
Regards,
SSR.While selecting the records on each condition , perform the select based on ur condition so dat dat select only those records directly.
-
Hide delete option is not working in ALV List Display- urgent
Hi All,
In my program i am displaying the output by using alv list display. after displaying the data i am displaying my own pf status here. in this i have few pushbuttons like
selest all, deselect all, hide . first two options are working fine. when i click hide button selected records are going to be hide.but this is not happening in my program. any body cam send me the code plz.
i am sending my code below. if possible please modify and resend the code asap.
my code:
type-pools : slis.
tables : zuser_secobjects.
data : t_header1 like zuser_secobjects.
data : begin of it_secobjects occurs 0.
include structure t_header1.
*data : box,
input(1) type c,
data : checkbox type c,
flag type c,
end of it_secobjects.
data : wa_ita like line of it_secobjects.
*data : it_secobjects like zuser_secobjects occurs 0 with header line.
data : i_field type slis_t_fieldcat_alv with header line.
data : w_field like line of i_field.
data : i_sort type slis_t_sortinfo_alv.
data : w_sort like line of i_sort.
data : it_filt1 type slis_t_filter_alv with header line.
data:
i_tabname type tabname,
i_repid like sy-repid,
is_lout type slis_layout_alv.
data : it_filt type slis_t_filter_alv with header line,
it_evts type slis_t_event with header line.
DATA : is_vari type disvariant.
constants : c_default_vari value 'X',
c_save_vari value 'U',
c_checkfield type slis_fieldname value 'ACTION',
c_f2code type sy-ucomm value '&ETA'.
data : chk_box type slis_fieldname.
selection-screen: begin of block b1 with frame title text-t01.
parameters : p_appln type zuser_secobjects-appln.
parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
p_partnr type zuser_secobjects-appln_partner,
p_ptype type zuser_secobjects-partner_type default '02',
p_upostn type zuser_secobjects-user_position,
p_sdate like likp-erdat default sy-datum,
p_edate(10) default '12/31/9999',
p_revnum type zuser_secobjects-revnum,
p_cted type zuser_secobjects-created_by,
p_cdate type zuser_secobjects-creation_date,
p_ctime type zuser_secobjects-creation_time,
p_chnby type zuser_secobjects-changed_by,
p_cdate1 type zuser_secobjects-changed_date,
p_ctime1 type zuser_secobjects-changed_time.
selection-screen: end of block b1.
form user_command using p_ucomm like sy-ucomm
rs_selfield type slis_selfield.
*DATA : it_filt type slis_t_filter_alv with header line.
case p_ucomm.
when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
loop at it_secobjects into wa_ita.
wa_ita-checkbox = 'X'.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
when 'DESLCT_ALL'.
loop at it_secobjects into wa_ita.
wa_ita-checkbox = ' '.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
is_lout-f2code = c_f2code.
is_lout-box_fieldname = c_checkfield.
is_lout-get_selinfos = 'X'.
is_lout-detail_popup = 'X'.
is_lout-detail_initial_lines = 'X'.
when 'HIDE_DEL'.
rs_selfield-exit = 'X'.
it_filt-fieldname = 'CHECKBOX'.
it_filt-tabname = '1'.
it_filt-valuf = 'X'.
it_filt-intlen = '1'.
it_filt-inttype = 'C'.
it_filt-datatype = 'CHAR'.
it_filt-valuf_int = 'X'.
it_filt-sign0 = 'E'.
it_filt-optio = 'EQ'.
if it_filt[] is initial.
append it_filt.
else.
modify it_filt index 1.
endif.
perform display using i_object.
PERForm ALV_LIST_DISPLAY.
WHEN 'SHOW_DEL'.
rs_selfield-exit = 'X'.
free it_filt.
PERForm ALV_LIST_DISPLAY.
when 'SAVE1'.
select * from zuser_secobjects where
appln = zuser_secobjects-appln
and appln_partner = zuser_secobjects-appln_partner
and partner_type = zuser_secobjects-partner_type
and start_date = zuser_secobjects-start_date
and end_date = zuser_secobjects-end_date.
endselect.
if sy-subrc eq 0.
message e000(ZV) with 'Duplicate Entry'.
endif.
endcase.
endform.
*& Form delete
form delete.
data : begin of is_secobjects occurs 0.
include structure zuser_secobjects.
data : checkbox type c.
data : end of is_secobjects.
is_secobjects-checkbox = 'X'.
modify is_secobjects
from it_secobjects
transporting checkbox
where checkbox = 'X'.
endform.
*& Form get_data
form get_data.
select * from zuser_secobjects
into table it_secobjects.
endform. " get_data
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
form prepare_fieldcatalog.
clear: w_field,i_field.
refresh:i_field.
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'.
i_field-input = 'X'.
i_field-fieldname = 'HEADER'.
i_field-outputlen = 0.
append i_field.
clear i_field.
w_field-fieldname = 'APPLN'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-seltext_l = text-m01.
w_field-outputlen = '10'.
w_field-col_pos = 1.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_USER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
endform. " prepare_fieldcatalog
*& Form ALV_LIST_DISPLAY
text
--> p1 text
<-- p2 text
form alv_list_display.
i_repid = sy-repid.
is_lout-box_fieldname = 'CHECKBOX'.
it_filt-fieldname = 'CHECKBOX'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout = is_lout
it_fieldcat = i_field[]
it_filter = it_filt[]
it_events = it_evts[]
i_default = c_default_vari
i_save = c_save_vari
is_variant = is_vari
tables
t_outtab = it_secobjects.
endform. " ALV_LIST_DISPLAY
*& Form display
text
-->P_I_OBJECT text
form display using object.
case object.
ENDCASE.
endform. " display
thanks,
maheedhar.tHi,
What do you mean by Hiding the records.
Deleting completely from the screen.
You can just delete the records from the internal table and pass to field catalog before displaying again.
or serach in the slis structrue for hiding the contents of the output.
reward if useful
regards,
Anji -
How to get subtotal value in ALV list display
Hi all,
How to give condition on the value of subtotal line in ALV list display,
i.e.if value of subtotal of plan quantity = actual quantity (in red oval) it should show the message
'ON TIME DELIVERY' else it should not show messagee.In my case(shown in red oval) its
showing for each subtotal value. I know how to change the subtotal text but i want to change
with respect to value of the subtotal.(plz refer attachment)
Any input regard to this will be achieved great.
Many thanks in advance.
samadhan shinde.Hi Samadhan,
I am awaiting for solution for this problem.....but as i think dynamically displaying sub total based on
matching actual quantity and planned quantity is bit complicated.
My idea is to display matched quantities in one block and unmatched quantities in another. I mean using blocked list.
awaiting suggestions.
regards, -
How to give color of particular cell in alv list display for dynamic table
Dear Experts,
i want to give color of a particular cell in alv list display (reuse_alv_list_display). Here i am passing data through dynamic table?Hi,
Se this:
DATA: lt_color TYPE lvc_t_scol WITH HEADER LINE.
DATA: BEGIN OF data_tab OCCURS 0.
tabcolor TYPE lvc_t_scol,
END OF data_tab.
* Befone ALV call
alv_layout-coltab_fieldname = 'TABCOLOR'.
* For each row in data_tab
REFRESH: lt_color.
CLEAR: lt_color.
lt_color-color-col = 6.
lt_color-color-int = 1.
lt_color-fname = FIELD1'.
APPEND lt_color.
lt_color-color-col = 2.
lt_color-color-int = 0.
lt_color-fname = 'FIELD2'.
APPEND lt_color.
data_tab-tabcolor[] = lt_color[].
append data_tab.
Best regards,
Leandro Mengue -
Hi Experts,
My requirement is i need a button along with the tool bar of ALV list display . when i check the button it should display the Selection criteria values which user entered as a pop up .
Is there any default tool which displays user selection values for ALV list display ?
Regards,
Vikram.S> Is there any default tool which displays user selection values for ALV list display ?
No such program.
But you have to write a code for it. Activate Button using the pf-status. then Handle that button in User command , and show a popup with the selection values.
Function used to get the selection details is
RS_REFRESH_FROM_SELECTOPTIONS
get the data and show it using a Popup. May be a ALV popup select function will help you. -
How to give colors to the top-of-page in ALV List Display
how to give colors to the top-of-page in ALV List Display....
Check this blog.........
It provides your required output...........
/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid
See the point 7 for complete code...
Regards,
Pavan -
Shifting ALV list display of report into center
Hi All,
I have got a requirement in which the ALV list needs to be shifted in to right. By default the alv list displays from 0 Postion of the column.
IN a classical list its easy to shift the output to any column postion using write statement but in alv list how can we achieve this?
Kindly provide your inputs.
Thanks and regards
Mudit BatraHi.,
I dont think it is possible., By default it will start from position 1 even in field catalog if u give col_pos 4, 5 or., .. . If u want to display alv in center u have to create a screen and create a custom container at the center and display ALV in it..
hope this helps u.,
Thanks & Regards
Kiran -
Removing columns heading for a perticular page in ALV list display
Dear All,
For last page of my ALV list display i need to remove columns heading (Strictly for single page only).
Kindly help me with possible solution.
I am triggering page break by using group attribute in the sort catalogue.( l_v_sortcat-group = '* '. )
Best Regards
Ravishekar Thallapallyif u can catch the page number,
while building fieldcat, put the condition
if sy-page = (page number)
ls_fielcact-fieldname = fieldname.
ls_fieldcat-tech = 'X'.
LS_FIELDCAT-NO_OUT = 'x'.
modify lt_fielcat from ls_fieldcat.
but how r u catching page number?? can u pls tell
endif.
Message was edited by: Hymavathi Oruganti -
ALV list display is truncated though data is present in internal table
hi
There are total 108 columns in my internal table, but the ALV list display shows only 90 , the fieldcatalog and final ALV internal table has the same structure. Please let me know how to display the rest of the field
Regards
MonirulHi.,
ALV List Display will display max. 90 columns it depends on line size 1023., Some times it goes to dump in number of columns increases ., and some times it displays some columns in one line and other columns in other line which will not look gud.. better use ALV Grid or OO ALV with custom container .
hope this helps u.,
Thanks & Regards,
Kiran -
How To avoid column heading for only total line in ALV list Display
Hi,
How To avoid column heading for only total line in ALV list Display.Hi,
to change colunm header field catlog is built
look at the example below
Changing column text headers
use this to change, hide, or alter the ALV columns
CLEAR: gt_fcat.
READ TABLE gt_fcat WITH KEY fieldname = 'TEXT1' " ***
*TEXT1 is your field name
ASSIGNING <gtfcat>.
IF sy-subrc = 0.
<gtfcat>-coltext = 'Date Type'.
<gtfcat>-no_out = ' '.
<gtfcat>-tooltip = 'Date Type Text from IT0019'.
<gtfcat>-seltext = 'IT0019'.
keep seltext to '' if u want to hide
ENDIF.
regards
austin -
Manual Fieldcatalog and ALV list display.
Hi,
Could anyone help me to know the step by step procedure to create a fieldcatalog manually and then using it for ALV list display?
Thanks,
Sandeep.Hi Sandeep,
Refer this code :
FORM build_fieldcatlog USING p_it_fieldcat TYPE slis_t_fieldcat_alv.
DATA: itab_fieldcat TYPE slis_fieldcat_alv.
FOR LIGHTS
CLEAR itab_fieldcat.
itab_fieldcat-col_pos = '1'. " POSITION OF THE COLUMN.
itab_fieldcat-fieldname = 'V_LIGHTS'. " FIELD FOR WHICH CATALOG ID FILLED.
itab_fieldcat-tabname = 'It_matstock'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
itab_fieldcat-emphasize = 'C410'. " COLOR OF THIS COLUMN.
itab_fieldcat-seltext_l = 'Category'. " LONG TEXT FOR HEADER.
itab_fieldcat-seltext_m = 'Category'. " MEDIUM TEXT FOR HEADER.
itab_fieldcat-seltext_s = 'Category'. " SHORT TEXT FOR HEADER.
itab_fieldcat-outputlen = 7. " TO DEFINE OUTPUT LENGTH OF THE COLUMN.
APPEND itab_fieldcat TO p_it_fieldcat.
FOR CHECK BOX
CLEAR itab_fieldcat.
itab_fieldcat-col_pos = '2'. " POSITION OF THE COLUMN.
itab_fieldcat-fieldname = 'V_CHKBOX'. " FIELD FOR WHICH CATALOG ID FILLED.
itab_fieldcat-tabname = 'It_matstock'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
itab_fieldcat-emphasize = 'C410'. " COLOR OF THIS COLUMN.
itab_fieldcat-seltext_l = 'CHECKBOX'. " LONG TEXT FOR HEADER.
itab_fieldcat-seltext_m = 'CHKBOX'. " MEDIUM TEXT FOR HEADER.
itab_fieldcat-seltext_s = 'CHKBOX'. " SHORT TEXT FOR HEADER.
itab_fieldcat-checkbox = 'X'. " CHECK BOX
itab_fieldcat-edit = 'X'.
itab_fieldcat-outputlen = 2. " TO DEFINE OUTPUT LENGTH OF THE COLUMN.
APPEND itab_fieldcat TO p_it_fieldcat.
*FOR MATERIAL NO (IT_MATSTOCK-MATNR)
CLEAR itab_fieldcat.
itab_fieldcat-col_pos = '3'. " POSITION OF THE COLUMN.
itab_fieldcat-fieldname = 'MATNR'. " FIELD FOR WHICH CATALOG ID FILLED.
itab_fieldcat-tabname = 'IT_MATSTOCK'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
itab_fieldcat-emphasize = 'C410'. " COLOR OF THIS COLUMN.
itab_fieldcat-seltext_l = 'MATERIAL NO'. " LONG TEXT FOR HEADER.
itab_fieldcat-seltext_m = 'MATNO'. " MEDIUM TEXT FOR HEADER.
itab_fieldcat-seltext_s = 'MATNO'. " SHORT TEXT FOR HEADER.
itab_fieldcat-hotspot = 'X'. " HOT SPOT
itab_fieldcat-outputlen = 20. " TO DEFINE OUTPUT LENGTH OF THE COLUMN.
APPEND itab_fieldcat TO p_it_fieldcat.
FOR PLANT (IT_MATSTOCK-WERKS)
CLEAR itab_fieldcat.
itab_fieldcat-col_pos = '4'. " POSITION OF THE COLUMN.
itab_fieldcat-fieldname = 'WERKS'. " FIELD FOR WHICH CATALOG ID FILLED.
itab_fieldcat-tabname = 'IT_MATSTOCK'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
itab_fieldcat-emphasize = 'C510'. " COLOR OF THIS COLUMN.
itab_fieldcat-seltext_l = 'PLANT'.
itab_fieldcat-seltext_m = 'PLANT'.
itab_fieldcat-seltext_s = 'PLANT'.
itab_fieldcat-outputlen = 10. " TO DEFINE OUTPUT LENGTH OF THE COLUMN.
APPEND itab_fieldcat TO p_it_fieldcat.
FOR STORAGE LOCATION (IT_MATSTOCK-LGORT)
CLEAR itab_fieldcat.
itab_fieldcat-col_pos = '5'. " POSITION OF THE COLUMN.
itab_fieldcat-fieldname = 'LGORT'. " FIELD FOR WHICH CATALOG ID FILLED.
itab_fieldcat-tabname = 'IT_MATSTOCK'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
itab_fieldcat-emphasize = 'C610'. " COLOR OF THIS COLUMN.
itab_fieldcat-seltext_l = 'STORAGE LOCATION'.
itab_fieldcat-seltext_m = 'STORAGE LOC'.
itab_fieldcat-seltext_s = 'SLOC'.
itab_fieldcat-outputlen = 10. " TO DEFINE OUTPUT LENGTH OF THE COLUMN.
APPEND itab_fieldcat TO p_it_fieldcat.
FOR QUANTITY (IT_MATSTOCK-LABST)
CLEAR itab_fieldcat.
itab_fieldcat-col_pos = '6'. " POSITION OF THE COLUMN.
itab_fieldcat-fieldname = 'LABST'. " FIELD FOR WHICH CATALOG ID FILLED.
itab_fieldcat-tabname = 'IT_MATSTOCK'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
itab_fieldcat-emphasize = 'C710'. " COLOR OF THIS COLUMN.
itab_fieldcat-seltext_l = 'QUANTITY'.
itab_fieldcat-seltext_m = 'QUANTITY'.
itab_fieldcat-seltext_s = 'QUAN'.
itab_fieldcat-outputlen = 10. " TO DEFINE OUTPUT LENGTH OF THE COLUMN.
APPEND itab_fieldcat TO p_it_fieldcat.
FOR UNIT OF MEASUREMENT (IT_MATSTOCK-MEINS)
CLEAR itab_fieldcat.
itab_fieldcat-col_pos = '7'. " POSITION OF THE COLUMN.
itab_fieldcat-fieldname = 'MEINS'. " FIELD FOR WHICH CATALOG ID FILLED.
itab_fieldcat-tabname = 'IT_MATSTOCK'. " INTERNAL TABLE TO WHICH THE FIELD BELONGS TO.
itab_fieldcat-emphasize = 'C110'. " COLOR OF THIS COLUMN.
itab_fieldcat-seltext_l = 'UNIT OF MEASURE'.
itab_fieldcat-seltext_m = 'UNIT OF MSURE'.
itab_fieldcat-seltext_s = 'UOM'.
itab_fieldcat-outputlen = 10. " TO DEFINE OUTPUT LENGTH OF THE COLUMN.
APPEND itab_fieldcat TO p_it_fieldcat.
FORM alv_display_grid .
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 = 'D_STRUCTURE'
I_BACKGROUND_ID = ' '
i_grid_title =
I_GRID_SETTINGS =
is_layout =
it_fieldcat = it_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort =
IT_FILTER =
IS_SEL_HIDE =
i_default = 'X'
i_save = 'A'
is_variant =
IT_EVENTS = I_EVENTCAT
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 = it_matstock
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. " ALV_DISPLAY_GRID
Reward points if helpful.
Regards,
Hemant -
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
Maybe you are looking for
-
Verizon's Run Around With the "Activation Charge"
So I called in about a million times since the build was completed for verizon fios. I was told each week that I would be contacted when it was going to be available. I received 0 calls for 2 months. Fast-forward 2 months later and I call in just t
-
Image filepath displays in PDF
Hi, I have converted a WebHelp document -> Word 2007 , applied some formatting/styles, then converted it to PDF. I converted the Word doc by using the "Create PDF -> From File" option in Acrobat Professional 8.2.3 When the mouse hovers over ALL imag
-
I downloaded some dodgy software and having cleared it up it seems to have installed an alternative browser (delta?) and toolbar to my firefox. I've uninstalled the toolbar, but when i open a new tab, instead of my most used pages, it came up with th
-
Bank Account Details to be Mandatory
Hi, I am a FI consultant and as per client requirement, In Vendor master, " Bank Account details to be made mandatory'. Could u please guide me how to configure ? thanks JK
-
Standby and PCIE 2.0 x16 problem
Good day Forum, I have encountered 2 issues with my setup (I will list the setup specifications below). Standby issue: My computer is unable to go S1 nor S3 standby despite having a new operating system installed. Power settings set at Maximum Perfor