New field category not display in ALV report
Hi,
Hi, I modifying an existing ALV report.
I have a problem to insert the new field into the ALV report.
The field and column title have been populated in alv field category correctly, but when FM 'REUSE_ALV_GRID_DISPLAY' executed, the new field and column didn't appear.
Anybody can help me.
Regards
Nislina
hi
Add that new field in the fieldcatalog and populate the value in the value in the internal table.
loop at it_fieldcatalog into wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'NEW_FIELD'.
wa_fieldcatalog-outputlen = '15'.
append wa_fieldcatalog to it_fieldcatalog.
clear wa_fieldcatalog,
endloop.
regards
ravish
<b>plz reward points if helpful</b>
Similar Messages
-
0.00 is currency not displaying in ALV REPORT......
Hi All,
There is a currency field in the internal table which is not displaying only value 0.00 if the value is 0.03 then it is displaying in ALV.
I have checked the Internal Table passed in the FM: REUSE_ALV_LIST_DISPLAY but it is carrying the value 0.00. But while displaying it is not displaying in the report.
I have also checked the Field catalogue there is no such conditions mentioned.
Kindly help me.
Thanks in Advance.
MPHi MP,
while handling witht eh currency fields make sure that the following are taken care of
in the field catalog use:
gs_field-datatype = 'CURR'.
gs_field-inttype = 'C'.
also the following
fieldcatalog-no_zero = 'X'. should be taken care of otherwise it will not display the zeros appearing in the final internal table for ALV display.
Hope its helpful
Thanks,
Srikanth.P -
Column Heading are not displayed in ALV Report using CL_SALV_DISPLAY?
Hi,
I am using CL_SALV_DISPLAY class to display data. I Created an Internal Table Dynamically based fieldcatalog which was prepared based data at run time. When i displayed data using CL_SALC_DISPALY data is display in output but column headings are not displayed.
can anyone suggest me how to display heading in ALV using CL_SALV_DISPLAY class, My code is
CLASS lcl_report DEFINITION
CLASS lcl_report DEFINITION.
PUBLIC SECTION.
METHODS:
display IMPORTING l_table TYPE string
l_fcat TYPE string.
ENDCLASS. "lcl_report DEFINITION
CLASS lcl_report IMPLEMENTATION
CLASS lcl_report IMPLEMENTATION.
METHOD display.
DATA: gr_table TYPE REF TO cl_salv_table.
DATA: gr_columns TYPE REF TO cl_salv_columns_table,
gr_column TYPE REF TO cl_salv_column_table,
ls_fcat TYPE slis_fieldcat_alv.
DATA: gr_display TYPE REF TO cl_salv_display_settings.
DATA: l_o_functions TYPE REF TO cl_salv_functions_list,
l_field TYPE string.
FIELD-SYMBOLS : <fs_table> TYPE STANDARD TABLE,
<ft_fcat> TYPE STANDARD TABLE.
Get the ALV object refering to the output table
ASSIGN (l_table) TO <fs_table>.
ASSIGN (l_fcat) TO <ft_fcat>.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = gr_table
CHANGING
t_table = <fs_table> ).
CATCH cx_salv_msg. "#EC NO_HANDLER
ENDTRY.
Add basic default functionality in the ALV report
Functions
l_o_functions = gr_table->get_functions( ).
l_o_functions->set_all( abap_true ).
gr_columns = gr_table->get_columns( ).
gr_columns->set_headers_visible( abap_true ).
Display the list
gr_table->display( ).
ENDMETHOD. "extract
ENDCLASS. "lcl_report IMPLEMENTATION
*& start-of-selection declaration
START-OF-SELECTION.
PERFORM :
get store codes
get_storecodes USING p_stfile
CHANGING it_t001w,
fetching mard data
read_mard_data,
preparing fieldcatalog for Final Data
create_filedcat USING it_t001w
it_site
CHANGING it_fieldcat,
preparing structure & internal table for Final Data
create_final_table_structure USING it_fieldcat,
prepare output data
prepare_final_data.
*& end-of-selection declaration
END-OF-SELECTION.
PERFORM :
display data
display_data USING l_table
l_fcat.
*& Form get_storecodes
FORM get_storecodes USING p_p_stfile
CHANGING p_it_t001w LIKE it_t001w[].
DATA :
internal table for RAW
lt_raw TYPE truxs_t_text_data,
rs_site LIKE LINE OF rt_site,
l_index LIKE sy-tabix.
FIELD-SYMBOLS :
field symbol for it_t001w
<fs_t001w> LIKE LINE OF p_it_t001w.
calling function module to get Stores Data from File
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = lt_raw
i_filename = p_p_stfile
TABLES
i_tab_converted_data = p_it_t001w[]
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
EXIT.
ENDIF.
SORT p_it_t001w BY werks.
CLEAR rs_site.
rs_site-sign = 'I'.
rs_site-option = 'EQ'.
rs_site-low = p_dccode.
APPEND rs_site TO rt_site.
IF it_t001w[] IS NOT INITIAL.
LOOP AT p_it_t001w ASSIGNING <fs_t001w>.
l_index = sy-tabix.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = <fs_t001w>-werks
IMPORTING
output = <fs_t001w>-werks.
MODIFY p_it_t001w FROM <fs_t001w> INDEX l_index.
IF <fs_t001w>-werks GE s_site-low AND <fs_t001w>-werks LE s_site-high.
append site to ranges
CLEAR rs_site.
rs_site-sign = 'I'.
rs_site-option = 'EQ'.
rs_site-low = <fs_t001w>-werks.
APPEND rs_site TO rt_site.
CONTINUE.
ENDIF.
ENDLOOP.
SORT p_it_t001w BY werks.
SORT rt_site.
ENDIF.
ENDFORM. " get_storecodes
*& Form create_final_table_structure
FORM create_filedcat USING p_it_t001w LIKE it_t001w[]
p_it_site LIKE it_site[]
CHANGING p_it_fieldcat LIKE it_fieldcat[].
FIELD-SYMBOLS :
field symbol for p_it_t001w
<fs_t001w> LIKE LINE OF p_it_t001w,
field symbol for p_it_site
<fs_site> LIKE LINE OF p_it_site.
DATA :
fieldname
l_fieldname TYPE slis_fieldname,
workarea for site ranges
rs_site LIKE LINE OF rt_site.
CLEAR : l_fieldname, rs_site.
l_fieldname = p_dccode.
PERFORM
prepare fieldcatalog
build_fieldcatalog USING : 'MTART' 'CHAR' '5' ,
'MTBEZ' 'CHAR' '25' ,
'MATKL' 'CHAR' '6' ,
'WGBEZ' 'CHAR' '20' ,
'MATNR' 'CHAR' '18' ,
'MAKTX' 'CHAR' '30' ,
l_fieldname 'CHAR' '17' .
create header for excel
PERFORM create_excel_header USING : 'Division',
'Divsion Description',
'MC Code',
'MC Description',
'Article',
'Article Description',
l_fieldname.
loop for creating fieldcatalog
LOOP AT it_site ASSIGNING <fs_site>.
READ TABLE it_t001w ASSIGNING <fs_t001w> WITH KEY werks = <fs_site>-werks
BINARY SEARCH.
IF sy-subrc = 0 AND <fs_t001w> IS ASSIGNED AND
<fs_site> IS ASSIGNED AND <fs_site>-stock GT 0.
CLEAR : l_fieldname, rs_site.
l_fieldname = <fs_site>-werks.
prepare fieldcatalog
PERFORM build_fieldcatalog USING : l_fieldname 'CHAR' '17'.
create header for excel
PERFORM create_excel_header USING l_fieldname .
CONTINUE.
ENDIF.
ENDLOOP.
l_fcat = 'it_fieldcat[]'.
ENDFORM. " create_final_table_structure
*& Form build_fieldcatalog
FORM build_fieldcatalog USING p_fieldname TYPE slis_fieldname
p_datatype TYPE datatype_d
p_length TYPE intlen.
DATA : ls_fieldcat LIKE LINE OF it_fieldcat.
CLEAR : ls_fieldcat.
ls_fieldcat-fieldname = p_fieldname.
ls_fieldcat-datatype = p_datatype.
ls_fieldcat-intlen = p_length.
APPEND ls_fieldcat TO it_fieldcat.
ENDFORM. " build_fieldcatalog
*& Form create_final_table_structure
FORM create_final_table_structure USING p_it_fieldcat.
Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat
IMPORTING
ep_table = t_table.
ASSIGN t_table->* TO <ft_final>.
ENDFORM. " create_final_table_structure
*& Form create_excel_header
FORM create_excel_header USING p_p_fieldname.
DATA : ls_header LIKE LINE OF it_header.
CLEAR ls_header.
ls_header-col_name = p_p_fieldname.
APPEND ls_header TO it_header.
ENDFORM. " create_excel_header
*& Form prepare_final_data
FORM prepare_final_data .
DATA : l_matnr LIKE g_matnr,
l_werks LIKE g_werks,
l_index LIKE sy-tabix.
FIELD-SYMBOLS : <fs_mard> LIKE LINE OF it_mard.
Getting No. of Lines in IT_MARD internal table
DESCRIBE TABLE it_mard LINES g_lines.
LOOP AT it_mard ASSIGNING <fs_mard>.
l_index = sy-tabix.
IF l_matnr IS INITIAL.
l_matnr = <fs_mard>-matnr.
CLEAR : l_werks.
l_werks = <fs_mard>-werks.
UNASSIGN : <fs_value>, <fs_final>.
Create dynamic work area and assign to FS
CREATE DATA t_line LIKE LINE OF <ft_final>.
ASSIGN t_line->* TO <fs_final>.
ASSIGN COMPONENT 'MATNR' OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_mard>-matnr.
ASSIGN COMPONENT l_werks OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_value> + <fs_mard>-labst.
getting Article Type,MC & its Descriptions
PERFORM get_other_data USING l_matnr
l_werks.
ELSEIF l_matnr <> <fs_mard>-matnr.
APPEND <fs_final> TO <ft_final>.
CLEAR l_matnr.
l_matnr = <fs_mard>-matnr.
CLEAR : l_werks.
l_werks = <fs_mard>-werks.
UNASSIGN : <fs_value>, <fs_final>.
Create dynamic work area and assign to FS
CREATE DATA t_line LIKE LINE OF <ft_final>.
ASSIGN t_line->* TO <fs_final>.
ASSIGN COMPONENT 'MATNR' OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_mard>-matnr.
ASSIGN COMPONENT l_werks OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_value> + <fs_mard>-labst.
getting Article Type,MC & its Descriptions
PERFORM get_other_data USING l_matnr
l_werks.
ELSE.
CLEAR : l_werks.
l_werks = <fs_mard>-werks.
ASSIGN COMPONENT l_werks OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_value> + <fs_mard>-labst.
ENDIF.
IF l_index = g_lines.
APPEND <fs_final> TO <ft_final>.
ENDIF.
ENDLOOP.
l_table = '<ft_final>[]'.
ENDFORM. " prepare_final_data
*& Form get_other_data
FORM get_other_data USING p_l_matnr
p_l_werks.
FIELD-SYMBOLS : <fs_mara> LIKE LINE OF it_mara,
<fs_t023t> LIKE LINE OF it_t023t,
<fs_t134t> LIKE LINE OF it_t134t,
<fs_makt> LIKE LINE OF it_makt.
READ TABLE it_mara ASSIGNING <fs_mara> WITH KEY matnr = p_l_matnr. " BINARY SEARCH.
IF sy-subrc = 0 AND <fs_mara> IS ASSIGNED.
ASSIGN COMPONENT 'MTART' OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_mara>-mtart.
ASSIGN COMPONENT 'MATKL' OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_mara>-matkl.
READ TABLE it_makt ASSIGNING <fs_makt> WITH KEY matnr = <fs_mara>-matnr BINARY SEARCH.
IF sy-subrc = 0 AND <fs_makt> IS ASSIGNED.
ASSIGN COMPONENT 'MAKTX' OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_makt>-maktx.
ENDIF.
READ TABLE it_t023t ASSIGNING <fs_t023t> WITH KEY matkl = <fs_mara>-matkl BINARY SEARCH.
IF sy-subrc = 0 AND <fs_t023t> IS ASSIGNED.
ASSIGN COMPONENT 'WGBEZ' OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_t023t>-wgbez.
ENDIF.
READ TABLE it_t134t ASSIGNING <fs_t134t> WITH KEY mtart = <fs_mara>-mtart BINARY SEARCH.
IF sy-subrc = 0 AND <fs_t134t> IS ASSIGNED.
ASSIGN COMPONENT 'MTBEZ' OF STRUCTURE <fs_final> TO <fs_value>.
<fs_value> = <fs_t134t>-mtbez.
ENDIF.
ENDIF.
ENDFORM. " get_other_data
*& Form display_data
text
FORM display_data USING p_l_table
p_l_fcat.
DATA:
Variable for Object Creation
o_report TYPE REF TO lcl_report.
CREATE OBJECT o_report.
o_report->display( EXPORTING l_table = p_l_table
l_fcat = p_l_fcat ).
ENDFORM. " display_dataI don't know how to read the code you pasted or I would have checked this myself.
Do your fields in the internal table reference dictionary objects or elementary types? If not using dictionary types, the column names will be blank by default. If you can't change your fields to be dictionary types, you can try this to change the column names:
I made a method inside my local class to add the names:
call method set_colname
EXPORTING iv_tab = alv_tab
iv_colid = 'xxxx' "fieldname from the table
iv_stxt = text-t54
iv_mtxt = text-t55
iv_ltxt = text-t55.
METHOD set_colname .
data:
alv_cols type REF TO cl_salv_columns_table,
alv_col type REF TO cl_salv_column.
TRY .
*... Change fieldnames
call METHOD iv_tab->get_columns RECEIVING value = alv_cols.
call method alv_cols->get_column EXPORTING columnname = iv_colid RECEIVING value = alv_col.
IF iv_stxt <> ''.
CALL METHOD alv_col->set_short_text EXPORTING value = iv_stxt.
ENDIF.
IF iv_mtxt <> ''.
CALL METHOD alv_col->set_medium_text EXPORTING value = iv_mtxt.
ENDIF.
IF iv_ltxt <> ''.
CALL METHOD alv_col->set_long_text EXPORTING value = iv_ltxt.
ENDIF.
CATCH cx_salv_not_found.
ENDTRY.
ENDMETHOD. "set_colname -
Sub total icon is not displaying in alv report output
Hi friends ,
In alv report display on menu bar the icon : subtotals is not displaying at the output , I should not give subtotal in each field catalog .
Plz give me solution, points will be rewarded.
with regards,
prasad.Hi,
I think u r using PF-STATUS parameter in function module,
if u use this parameter, you sholud give the icon name etc..
otherwise by default it will appear.
Check your code again.
Give me exact requirement, if possible paste the code.
Regards,
Chandu -
New Field value not displayed in "My own activities" of CRM 5.0 Own tab
Hi.
I have a scenario where in we have added a new field to "My open activities" in CRM 5.0 Own tab.
However the value of the field for various transactions is getting displayed only for one particular user and not for all the users.
what may be the reason for this?!!!!!!
The only user who is getting the output properly, the user ID of his was replication based on similar roles to check whether it was issue related with roles. But the output was not obtained even with the replicated user ID.
Hence the output continues to come only for one particular user in all the systems.
Kindly request to provide some inputs / suggestions at the earliest.
Thanks and regards.Is aanyone able to help with this?
Thanks -
New field not displaying in ALV
Hi all,
I have worked with ALV before, but currently I'm facing the problem of adding a new field to the ALV but it was not display on the screen. I have checked the fieldcatalog table and internal table right before the call of GRID-> SET_TABLE_FOR_FIRST_DISPLAY. All seems to be fine at this moment. Just that the new field was not displayed on the screen. Any idea?Hello Mil
If you are using the old-fashioned ALV you will find several push-buttons for changing the ALV layout.
If you are using OO-based ALV then you will have a single push-button in the ALV toolbar with dropdown menu to select the specific function.
In any case, choose function "Change layout...". Usually you will get a popup with two lists of fields:
- on the left side you see the currently displayed fields in the ALV list
- on the right side you see fields that can additionally displayed
For sure you will find your missing field there.
Regards
Uwe -
Enabled UDF's are not displaying in XL Report Composer.
Hi,
I Enabled User Defined Fields (UDF) under manage user defined fields. But itu2019s displaying only Light dimensionu2018s fields. But Dimension attributeu2019s fields are not displaying in XL Report composer. How we can display Dimension attribute fields in XL Report.
Regds,
Sampath Kumar.Hi,Danie Posthumus
First of all we are not able to see my User define filed in report composer except for light dimensions type. Only we are getting Light Dimension Data Item type only we are not getting Dimension Attribute Data item type.
Regds,
Sampath Kumar Devunuri. -
New ALV field is not displaying
Hi
I have added the currency field in the existing ALV report.
The final internal table having the currency field and it has value. Curreny field is not displaying in output. Pls help
Below is my ALV code for currency.
PERFORM FILL_FIELDCAT USING
'WAERS' SPACE SPACE 'CURRENCY' 'CURRENCY' 'CURRENCY'.
READ TABLE GIT_FIELDCAT INTO LX_FIELDCAT
WITH KEY FIELDNAME = 'WAERS' .
LX_FIELDCAT-OUTPUTLEN = 5.
LX_FIELDCAT-JUST = 'L'.
MODIFY GIT_FIELDCAT FROM LX_FIELDCAT INDEX SY-TABIX.
FORM FILL_FIELDCAT USING P_FIELDNAME
P_NO_OUT
P_DO_SUM
P_SELTEXT_S
P_SELTEXT_M
P_SELTEXT_L. "#EC *
DATA: LX_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
CLEAR LX_FIELDCAT.
LX_FIELDCAT-TABNAME = 'GIT_LIST'.
LX_FIELDCAT-FIELDNAME = P_FIELDNAME.
LX_FIELDCAT-NO_OUT = P_NO_OUT.
LX_FIELDCAT-DO_SUM = P_DO_SUM.
LX_FIELDCAT-SELTEXT_S = P_SELTEXT_S.
LX_FIELDCAT-SELTEXT_M = P_SELTEXT_M.
LX_FIELDCAT-SELTEXT_L = P_SELTEXT_L.
APPEND LX_FIELDCAT TO GIT_FIELDCAT.
ENDFORM. " FILL_FIELDCATYou have to [maintain maintenance dialog|http://help.sap.com/SAPHELP_NWPI71/helpdata/EN/a7/513484407a11d1893b0000e8323c4f/frameset.htm] as described in the link.
Regards,
Raymond -
Need to remove space for a field when displayed in ALV Report
Hi,
I have material field of length 18, but the content is only 10 char. I need to remove the extra space when it is displayed on ALV Report.
Is there any option in ALV field catalogueuse statement condense.
condense zmatnr.
also giv output lenth of alv column as 10. -
Field of character length 255 not displaying in ALV output
Dear all,
i am trying to display a field of ztable with lenght 255 character, same is not displaying at ALV output.
it is displaying only upto 128 characters in ALV output.
table is Ztable-zfield with CHAR255 length.
please help me.
Regards,
Sam.Hi Sam Johny,
In ALV Grid the maximum characters can be displayed in one column is 128 Characters..
But for your solution you can press Print Preview Button to view more text(or Press Ctrl + Shift + F10 )...
Else try with ALV LIST
and pass FIELDCAT-OUTPUTLEN = '255' for field in fieldcatalog
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya -
End of Page event not triggering in ALV report
Hello,
I am developing an ALV report using REUSE_ALV_LIST_DISPLAY. Whatever I write in top_of_page, it will be displayed in the header portion of the output.
But I want to display some footer text at the end of the page. The problem I am facing is, the WRITE statements within end_of_page are not displayed when the report is run.
I have populated the i_events as follows :
FORM f_events CHANGING p_i_events TYPE slis_t_event.
CONSTANTS : l_c_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',
l_c_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
DATA : l_wa_event TYPE slis_alv_event.
Returns table of possible events
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_i_events.
To append internal table holding event names with event 'TOP OF PAGE'
READ TABLE p_i_events INTO l_wa_event
WITH KEY name = slis_ev_top_of_page.
IF sy-subrc = 0.
MOVE l_c_top_of_page TO l_wa_event-form.
APPEND l_wa_event TO p_i_events.
ENDIF.
To append internal table holding event names with event 'END OF PAGE'
READ TABLE p_i_events INTO l_wa_event
WITH KEY name = slis_ev_end_of_page.
IF sy-subrc = 0.
MOVE l_c_end_of_page TO l_wa_event-form.
APPEND l_wa_event TO p_i_events.
ENDIF.
ENDFORM. "f_events
Regds
RajeshHi have a look at the following code, and change ur code for end of page accordingly. this will resolve ur problem.
This is a basic ALV with the followings:-
- Page Heading
- Page No
- Sub-Total
- Grand Total
REPORT ZALV.
TYPE-POOLS: SLIS.
DATA: G_REPID LIKE SY-REPID,
GS_PRINT TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS TYPE SLIS_T_EVENT,
GT_SORT TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
COL_POS TYPE I.
DATA: BEGIN OF ITAB,
FIELD1(5) TYPE C,
FIELD2(5) TYPE C,
FIELD3(5) TYPE P DECIMALS 2,
END OF ITAB.
DATA: BEGIN OF ITAB1 OCCURS 0.
INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB1.
DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
INCLUDE STRUCTURE ITAB.
DATA: END OF ITAB_FIELDCAT.
Print Parameters
PARAMETERS:
P_PRINT AS CHECKBOX DEFAULT ' ', "PRINT IMMEDIATE
P_NOSINF AS CHECKBOX DEFAULT 'X', "NO SELECTION INFO
P_NOCOVE AS CHECKBOX DEFAULT ' ', "NO COVER PAGE
P_NONEWP AS CHECKBOX DEFAULT ' ', "NO NEW PAGE
P_NOLINF AS CHECKBOX DEFAULT 'X', "NO PRINT LIST INFO
P_RESERV TYPE I. "NO OF FOOTER LINE
INITIALIZATION.
G_REPID = SY-REPID.
PERFORM PRINT_BUILD USING GS_PRINT. "Print PARAMETERS
START-OF-SELECTION.
TEST DATA
MOVE 'TEST1' TO ITAB1-FIELD1.
MOVE 'TEST1' TO ITAB1-FIELD2.
MOVE '10.00' TO ITAB1-FIELD3.
APPEND ITAB1.
MOVE 'TEST2' TO ITAB1-FIELD1.
MOVE 'TEST2' TO ITAB1-FIELD2.
MOVE '20.00' TO ITAB1-FIELD3.
APPEND ITAB1.
DO 50 TIMES.
APPEND ITAB1.
ENDDO.
END-OF-SELECTION.
PERFORM BUILD.
PERFORM EVENTTAB_BUILD CHANGING GT_EVENTS.
PERFORM COMMENT_BUILD CHANGING GT_LIST_TOP_OF_PAGE.
PERFORM CALL_ALV.
FORM BUILD.
DATA FIELD CATALOG
Explain Field Description to ALV
DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD1'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
*FIELDCAT_LN-NO_OUT = 'X'. "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
FIELDCAT_LN-KEY = ' '. "SUBTOTAL KEY
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD2'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
FIELDCAT_LN-NO_OUT = 'X'.
FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
APPEND FIELDCAT_LN TO GT_FIELDCAT.
CLEAR FIELDCAT_IN.
FIELDCAT_LN-FIELDNAME = 'FIELD3'.
FIELDCAT_LN-TABNAME = 'ITAB1'.
FIELDCAT_LN-REF_FIELDNAME = 'MENGE'. "<- REF FIELD IN THE DICTIONNARY
FIELDCAT_LN-REF_TABNAME = 'MSEG'. "<- REF TABLE IN THE DICTIONNARY
FIELDCAT_LN-NO_OUT = ' '.
FIELDCAT_LN-DO_SUM = 'X'. "SUM UPON DISPLAY
APPEND FIELDCAT_LN TO GT_FIELDCAT.
DATA SORTING AND SUBTOTAL
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
ENDFORM.
FORM CALL_ALV.
ABAP List Viewer
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'ITAB1'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = GT_SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
IT_EVENT_EXIT =
IS_PRINT = GS_PRINT
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM.
HEADER FORM
FORM EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
CONSTANTS:
GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
*GC_FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE'.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
define END_OF_PAGE event
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_END_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
ENDFORM.
FORM COMMENT_BUILD CHANGING GT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: GS_LINE TYPE SLIS_LISTHEADER.
CLEAR GS_LINE.
GS_LINE-TYP = 'H'.
GS_LINE-INFO = 'HEADER 1'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP = 'S'.
GS_LINE-KEY = 'STATUS 1'.
GS_LINE-INFO = 'INFO 1'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
GS_LINE-KEY = 'STATUS 2'.
GS_LINE-INFO = 'INFO 2'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
CLEAR GS_LINE.
GS_LINE-TYP = 'A'.
GS_LINE-INFO = 'ACTION'.
APPEND GS_LINE TO GT_TOP_OF_PAGE.
ENDFORM.
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
WRITE: SY-DATUM, 'Page No', SY-PAGNO LEFT-JUSTIFIED.
ENDFORM.
FORM END_OF_PAGE.
WRITE at (sy-linsz) sy-pagno CENTERED.
ENDFORM.
PRINT SETTINGS
FORM PRINT_BUILD USING LS_PRINT TYPE SLIS_PRINT_ALV.
LS_PRINT-PRINT = P_PRINT. "PRINT IMMEDIATE
LS_PRINT-NO_PRINT_SELINFOS = P_NOSINF. "NO SELECTION INFO
LS_PRINT-NO_COVERPAGE = P_NOCOVE. "NO COVER PAGE
LS_PRINT-NO_NEW_PAGE = P_NONEWP.
LS_PRINT-NO_PRINT_LISTINFOS = P_NOLINF. "NO PRINT LIST INFO
LS_PRINT-RESERVE_LINES = P_RESERV.
ENDFORM.
*END OF ZALV PROGRAM
Satish -
What is the difference between list display and grid display in alv report
Hai genious
i am a new of the abap, i dont know the alv report, i have a small doubt, can u please tell me what is the main difference between list display and grid display in alv report
thanks®ards
chinnuHi ,
1. For all practical purposes, they are the same.
2. Some differences:
a) from abap coding point of view,
alv list is done with Function modules,
alv gris can also be done with FM,
but can also be done using OO concepts.
b) Alv grid (using oo concept) requires
designing the screen layout .
Hence, in one screen, we can show more
then one alv grid
(we cannot show more than
one alv list on one screen)
c) ALV grid uses ActiveX controls
present on the Presentation Server.
Hence, it consumes More Memory
on the presentation server.
d) ALV LIST is Display Only.
Whereas
ALV Grid Can Be made EDITABLE for entry purpose.
e) In alv grid, these options are possible,
but not in alv list.
without horizontal lines
without vertical lines
without cell merging during sorts
display total lines above the entries
I hope it helps.
Regards,
Mamta
Edited by: Mamta Verma on Nov 27, 2008 6:41 AM -
Adding custom fields to standard Asset Accounting ALV reports
Hello,
I have recently added some fields to the Asset Master table ANLU using the customizing include CI_ANLU. I have also added some fields using an append structure to ANLZ. I now need to have these fields available in the standard reports for Asset Accounting. One example is the report generated for transaction S_ALR_87011963. I need the new fields available in the 'Displayed Columns' list when clicking the Change Layout icon. Any suggestions?
Thanks,
JRHi Vignesh,
Adding new fields is not possible, but custom subscreens can be added.
Check enhancements QQMA0001 (subscreen for notification header) and QQMA0008 (subscreen for additional data).
It might help you.
Thanks & Regards,
Swati -
Hyperlink Field in column of 2D ALV Report
Hi,
I have to display a ALV Report in which one of column reprsent a field which have hyperlink.
How to acheive this?Can anybody tell me approach?
-RickHi Ricky,
Kindly go through the link below:
http://help.sap.com/saphelp_erp2004/helpdata/EN/85/ce25c2d7ae11d3b56d006094192fe3/content.htm
Hope it helps you
Regrds
Mansi -
Hi,
What is the best way to display an ALV report in the Portal?
I would like the report to be displayed in the GUI of the Portal (meaning, I would like to work with WebDynpro or PDK or any other way such that the GUI will be identical to all the other Portal objects).
Thanks in advance,
AviadHi,
You can actually, as suggested by others, code the PDV_ALV found in the PDK yourself.
All you need is to understand the workflow of the BAPI called "PORTAL_ALV_QUERY_CALL".
This BAPI is configured to get the properties of a query and another BAPI (derived from Z_QUERY_SELECTIONS) which plants additional data in the original query.
For example - If you wish to activate a query called myQuery1 in the user group FI-AP with a variant called TEST between a date range selected by the portal user. The parameters passed to the BAPI are as follows -
"QUERY_NAME=myQuery1"
"QUERY_USERGROUP=FI-AP"
"QUERY_VARIANT=TEST"
"QUERY_CREATE_SELTAB_FM=Z_QUERY_SELECTIONS_1"
"FROM_DATE="
"TO_DATE="
What will happen in the background is that the query myQuery1 from the usergroup FI-AP will be activated using the variant TEST and using the QUERY_CREATE_SELTAB_FM value the date fileds will be assigned to their corresponding fields in the query. After the activation the BAPI will return a table with the result.
Hope it helps,
Aviad
Maybe you are looking for
-
Disk Utility can't repair Time Machine + HDneeds to be repaired using the Recovery HD
Time Machine does back up. In fact it does not even show up on my desktop. I used didk utility and msg I got is below. I am in a place where I cannot even buy a flash drive. My harddisk is malfunctioning. Its hard to restart from the 'sleep' mode, s
-
Problem Related To HOT Spot in ABAP Programming?
Hi All, I developed a program of purchase register now i want that on clicking the PO it will take the user to the conserned PO for that i used HOt Spot but still it is not taking me to the conserned PO. Plz tell me what do i do to fullfill my purpos
-
X axis to represent Yearin weeks and months ?
I want to create an X axis to represent a year in weeks and months. Anyone know how please ? The current limits of 10 max for major and minor will not allow a sensible scale or grid.
-
Transfer from PC to MacPro?
I am thinking about buying a MacBook Pro. How do I transfer existing mail & PC data?
-
CCM 5.1.1 Clustering: Add a subscriber
Hi, I'm trying to add a Subscriber in a 5.1 (b) fresh installation. I've not add any upgrade. I've added the new server on Publisher "Add new server" and followed all installation tasks (Not first node, DNS, ecc). Installation goes without errors but