Displaying a header on alv list
hi there,
i want to display a header on alv list.
i have already used
call method alvgrid->set_table_for_first_display
regrads
Hi,
use the TOP_OF_PAGE event and add the event to the IT_EVENTS internal table..
In the subroutine that is assigned to the event..
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = heading.
ENDFORM.
Thanks,
Naren
Similar Messages
-
Display Page number in ALV List.
Dear Friends,
I want to display page numbers in ALV list print output. But I dont know how to do that without using objects.
Please suggest.
Regards,
Madan.TRY LIKE THIS
data : ifieldcat type slis_t_fieldcat_alv,
wfieldcat type slis_fieldcat_alv,
IEVENT TYPE SLIS_T_EVENT,
WEVENT TYPE SLIS_ALV_EVENT..
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = IEVENT
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE IEVENT INTO WEVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WEVENT-FORM = 'TOP_OF_PAGE'.
MODIFY IEVENT FROM WEVENT INDEX SY-TABIX.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOPOFPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = IFIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = IEVENT
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_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
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.
FORM TOP_OF_PAGE.
WRITE : /10 'HeadinG OF ALV'.
WRITE : 100 SY-PAGNO.
ENDFORM.
ONE THING IS THERE YOU CAN USE WRITE FOR ONLY LIST DISPLAY NOT FOR GRID DISPALY.
REGARDS
SHIBA DUTTA -
Is it possible to display LOGO in simple ALV list?
Hi Guys,
Is it possible to display LOGO in simple ALV list. If yes plz explain in details.
Thanks
SharatYes it is possible to display logo at the top of the page.
TYPE-POOLS: slis.
* Data Decalaration
DATA: it_vbak TYPE TABLE OF vbak.
DATA: g_repid TYPE sy-repid.
DATA: it_listheader TYPE slis_t_listheader,
wa_listheader TYPE slis_listheader.
* START-OF-SELECTION
START-OF-SELECTION.
g_repid = sy-repid.
SELECT * FROM vbak INTO TABLE it_vbak.
PERFORM build_alv_header.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
i_structure_name = 'vbak'
TABLES
t_outtab = it_vbak.
*& Form BUILD_ALV_HEADER
FORM build_alv_header .
* Type H is used to display headers i.e. big font
wa_listheader-typ = 'H'.
wa_listheader-info ='Flight Details'.
APPEND wa_listheader TO it_listheader.
CLEAR wa_listheader.
* Type S is used to display key and value pairs
wa_listheader-typ = 'S'.
APPEND wa_listheader TO it_listheader.
CLEAR wa_listheader.
* Type A is used to display italic font
wa_listheader-typ = 'A'.
wa_listheader-key = 'Date :' .
wa_listheader-info ='SAP ALV Report'.
APPEND wa_listheader TO it_listheader.
CLEAR wa_listheader.
ENDFORM. " BUILD_ALV_HEADER
*& Form top_of_page
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader
i_logo = 'PARI'.
ENDFORM. "top_of_page -
Couldn't print header of ALV list
Hi All,
I couldn't print header for the alv list. Code is below.
REPORT ztest123456 .
TYPE-POOLS: slis.
DATA: wa_fieldcat TYPE slis_fieldcat_alv,
g_t_tfieldcat TYPE slis_t_fieldcat_alv,
itab1 TYPE STANDARD TABLE OF cdhdr,
g_t_event TYPE slis_t_event,
wa_event TYPE slis_alv_event,
g_pos TYPE i VALUE 1,
head TYPE slis_t_listheader,
wa_head TYPE slis_listheader.
START-OF-SELECTION.
SELECT * FROM cdhdr INTO TABLE itab1
WHERE objectclas = 'COND_A'
AND tcode = 'VK12'.
SORT itab1 BY objectclas.
wa_head-typ = 'H'.
wa_head-info = 'Records in cdhdr table'.
APPEND wa_head TO head.
PERFORM sub_fldctlg USING: 'OBJECTCLAS' 'ITAB1' 13 'Object class'.
FORM sub_fldctlg *
FORM sub_fldctlg USING u_fname TYPE slis_fieldcat_alv-fieldname
u_tname TYPE slis_fieldcat_alv-tabname
u_outlen TYPE slis_fieldcat_alv-outputlen
u_seltext TYPE slis_fieldcat_alv-seltext_l.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = g_pos. "Column Position
wa_fieldcat-fieldname = u_fname. "Field Name
wa_fieldcat-tabname = u_tname. "Table Name
wa_fieldcat-outputlen = u_outlen. "Output column Length
wa_fieldcat-seltext_l = u_seltext. "Column Header
g_pos = g_pos + 1. "Incrementing column position
APPEND wa_fieldcat TO g_t_tfieldcat. "Appending field Catalog
ENDFORM.
*& Form sub_top
FORM sub_top.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = head.
ENDFORM. " sub_top
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
IMPORTING
et_events = g_t_event.
READ TABLE g_t_event INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'SUB_TOP'.
MODIFY g_t_event FROM wa_event INDEX sy-tabix.
ENDIF.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = g_t_tfieldcat
it_events = g_t_event
TABLES
t_outtab = itab1.
Thanks in advance.Hi,
The issue is resolved. I just pass the program name (SY-REPID) through a variable to the function module that displays list/grid. I came to know that these system variable behavior is UN-predictable in SAP and hence passed program name through a global variable instead of using a system variable value.
Thanks.. -
How to Change Column header in ALV List
hello,
is there a way to change the column header/label of an ALV list other than inheriting it from the source table it is bound to?
thanks,
sidYes, you can. If you are using a field catalog, you can change the field labels in your program.
For example.
data: fc_tmp type slis_fieldcat_alv .
clear: fieldcat. refresh: fieldcat.
clear: fc_tmp.
<b> fc_tmp-reptext_ddic = 'Material Number'.</b>
fc_tmp-fieldname = 'MATNR'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '18'.
fc_tmp-col_pos = 2.
append fc_tmp to fieldcat.
If you are using the MERGE funciton module to get your field catalog, then you just need to loop thru it and change the field which is holding the description, then modify the line of the field catalog.
REgards,
Rich Heilman -
How To Create Header in ALV List Report
Hi All,
I want to create a Header for <b>MY ALV List Report</b>!
How can i achieve the same. It should come above <b>ALV</b>.
ALV report i had already written and it is coming correctly.
Heading should look like this:
<i>1st Line</i>
<b>PROGRAM NAME: XXXXXX CLIENT: XXXXXXXXXX PAGE:XX</b>
<i>2nd Line</i>
<b>RUN DATE/TIME: XXXXX - XXXX REPORT NAME/HEADER</b>
How can i acheive the same in <b>ALV List Report</b>!
I am amking use of <b>REUSE_ALV_LIST_DISPLAY</b> Function module.
Thanks in advance.
Thanks & Regards,
Prasad.Hi Prasad,
Use the sample code specified below as the guideline. For more info. refer to the documentation of the FM 'REUSE_ALV_COMMENTARY_WRITE'.
DATA: first(01) type c,
events type slis_t_event,
gt_list_top_of_page type slis_t_listheader,
ls_event type slis_alv_event.
initialization.
call function 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = events
EXCEPTIONS
LIST_TYPE_WRONG = 1
OTHERS = 2.
read table events with key name = 'TOP_OF_PAGE'
into ls_event.
if sy-subrc = 0.
move: 'TOP_OF_PAGE' to ls_event-form.
append ls_event to events.
clear ls_event.
endif.
End of additions
Start-of-selection
START-OF-SELECTION.
Top-of-page
TOP-OF-PAGE.
PERFORM TOP_OF_PAGE.
FORM TOP_OF_PAGE .
data: ls_line type slis_listheader.
if first is initial.
ls_line-typ = 'S'.
ls_line-key = 'Run Date :'.
write: sy-datum to ls_line-key+10 mm/dd/yyyy.
ls_line-info = 'Billing Date:'.
write: s_fkdat-low to ls_line-info+15 mm/dd/yyyy.
ls_line-info+28 = 'To'.
write s_fkdat-high to ls_line-info+32 mm/dd/yyyy.
append ls_line to gt_list_top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
first = 'N'.
else.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = gt_list_top_of_page.
endif.
ENDFORM. " top_of_page
<b>Please mark helpful answer.</b>
Regards,
Amit Mishra -
Hi,
how to add a long header line ( more than 60 characters ) to an ALV list, please ?
I tried with filling a table with structure SLIS_T_LISTHEADER, but this only allows lines up to 60 characters...
thanks,
RolfUnless you can break it into 2 lines, you're pretty much stuck with the 60 char line.
I seem to remember we tried doing this using the HTML option for the header, but we found that it was inconsistent and
not to our liking. We reverted to 2 lines. -
Display Row number in ALV List
Hi All,
I have 50 records in Internal table . I am displaying this internal table data in ALV List display. I want to print row number in ALV . Could you please help me how to print.
Thanks,
PRSN.HI,
take one more field in the internal table and fill it up with the number when you are filling it with data .
loop at itab.
it_final-seqno = sy-tabix.
append it_final.
endloop. -
Hello friends,
I want to display icon in ALV header list.
Caould you please tell me how can i achieve this.
Currently instead of icon it is showing as '@5B@'.
CREATE OBJECT document.
CALL METHOD document->add_icon
EXPORTING
sap_icon = 'ICON_LED_GREEN'.
ls_header-typ = 'S'.
write ICON_LED_GREEN AS ICON TO text_001.
CONCATENATE 'Aufnr:'
p_aufnr
text_001
INTO ls_header-info.
APPEND ls_header TO lt_header.
CLEAR: ls_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lt_header
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =Hi,
Check this
w_events-name = 'TOP_OF_PAGE'.
w_events-form = 'TOP_OF_PAGE'.
APPEND w_events TO i_events.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = i_fieldcat
it_events = i_events
TABLES
t_outtab = it_data.
FORM top_of_page.
WRITE:/ '@08@'," Green light; positive
'@09@'," Yellow light; neutral
'@0A@'." Red light; negative
ENDFORM. "top_of_page -
hi abapers,
i got a requirement to disply material no.'s in descending order in lav grid/list both..
now, when i did sorting of the column, grid is displaying the output fine but in list HEADER IS GETTING PRINTED MULTIPLE TIMES, one for each new matnr [although it gets descendigly sorted],
below is my code of sorting, could you please expalin why is this happening,. ?? is this compatibiltiy issue ??
*& Form ZF_SORTING
text
-->P_I_SORTINFO text
FORM zf_sorting USING p_i_sortinfo TYPE slis_t_sortinfo_alv.
DATA l_sortinfo TYPE slis_sortinfo_alv.
REFRESH p_i_sortinfo.
CLEAR l_sortinfo.
*&-- passing attributes to sort the column
L_SORTINFO-SPOS = '1'. " 1 sorting position
l_sortinfo-fieldname = 'MATNR'. "fieldname
l_sortinfo-tabname = 'I_FINAL'. "final table
l_sortinfo-down = 'X'. "enable
l_sortinfo-group = ' * '. "DONT REPEAT COMMON ITEM
APPEND l_sortinfo TO p_i_sortinfo.
ENDFORM. " ZF_SORTING
*& Form zf_display_alv_list
text
--> p1 text
<-- p2 text
FORM zf_display_alv_list .
*&--calling FM to display LIST LAYOUT
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = v_progname
I_CALLBACK_PF_STATUS_SET = 'ZF_PF_STATUS_SET'
is_layout = wa_layout
it_fieldcat = i_fieldcat
I_DEFAULT = 'X'
it_events = i_eventcat
it_sort = i_sortinfo
I_SAVE = C_SAVE "all user/default
IS_VARIANT = IT_VARIANT1
TABLES
t_outtab = i_final
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. " zf_display_alv_list
Please help,Hi,
Did you find a solution for this?, I am also having a similar requirement.
If you have any work around please share.
Thanks. -
How to display page-no in alv list
Hi All,
I am trying to display pag number using events 'top-of-page'.
when i write sy-pagno in top-of-page form its printing only 1, if i press page down i need to change the page number. it should display current pag number. How to achieve this. thanks.
regards
vishalwe can print the pageno .I was also trying for the same finally succeded
It can be done in the following manner
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'.
<b>gs_sort-group = '* '. "<<<new page</b>
APPEND GS_SORT TO GT_SORT.
CLEAR GS_SORT.
GS_SORT-FIELDNAME = 'FIELD2'.
GS_SORT-SPOS = 2.
GS_SORT-UP = 'X'.
gs_sort-group = ' '. "<<<new page
*GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
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. -
Display Logo in ALV LIST header
Hi Experts!!
I need the logo to be displayed in the header of ALV LIST but not the grid display. I searched for this, and got the results for ALV grid display. Kindly let me know if there's any way of printing the logo in the ALV List display. I hope that's possible with oops.
Please help me out.
Thanks and Regards,
Seenuhello srinivas,
Check the Examples in LIBS trxn,
see the example One-Line List with Top of Page
regards,
Shweta -
How to create space between Header text of Hierarchical ALV List.
hi,
I am display data using Hierarchical ALV List.
In Perform of field catalog, I am writing this code:
PERFORM fill_catalogue USING :
'CHKBX' 'T_HEADER' 20 'Sess Decision Box'(t19) 'X',
'SESS_NO' 'T_HEADER' 11 'Session'(t20) ' ' ,
'SESS_STAT' 'T_HEADER' 4 'Status'(t39) ' ',
'HOLD_STAT' 'T_HEADER' 4 'HOLD'(t52) ' ',
'ICON' 'T_HEADER' 9 'Tracking'(t21) ' ' ,
'CREATE_DT' 'T_HEADER' 10 'Archiving Date'(t22) ' ' ,
'AGING' 'T_HEADER' 50 'Aging'(t23) ' ',
'OBJECT' 'T_HEADER' 12 'Archive Obj'(t24) ' ',
'HOLD_INFO' 'T_HEADER' 100 'Hold Reason' ' ' ,
'YFY_DATA' 'T_HEADER' 4 'Data Fiscal Year'(t48) ' ' ,
'COMMENTS' 'T_HEADER' 50 'Session Notes'(t26) ' ' ,
'DATATYPE' 'T_HEADER' 50 'Archive Object Description'(t25) ' ',
'APPR_STAT' 'T_ITEM' 16 'Approval Status'(t29) ' ',
'DESTR_DT_REV' 'T_ITEM' 10 'New Date'(t30) ' ',
'REJCT_REASON' 'T_ITEM' 60 'Rejection Reason'(t31) ' ' .
At output of this program , there are two rows in HEADER details.
I want text 'Session notes' of 2nd row under 'Archiving Date' of 1st row.
For this i have to create space between 'Data Fiscal Year' & 'Session notes' text.
How i can do this.
Regards,
MamtaHi,
You can use TOP-OF-PAGE event and pass this event to Hierarchical ALV FM.
Thanks,
Kartavya Kaushik. -
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 -
Hi Guys,
I need to display data in a ALV list and grid in the following format.
GI----
Delivery-
Document Year PostDate Item Plnt Stlc CoCd Document Item
Could anyone please tell me how do i get the Header Part (GI and Delivery that spans the below columns). GI will be header for the Document Year PostDate Item..etc.....and Delivery should be the header for document and Item columns in alv.
Please give me an idea......
Sanhi San,
You can write the GI----------------Delivery part in top of page
chk this
REPORT ztest.
TABLES : mara.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
w_repid = sy-repid.
DATA : BEGIN OF it_mara OCCURS 0,
matnr LIKE mara-matnr,
END OF it_mara.
*layout
DATA: wa_layout TYPE slis_layout_alv.
*field catalog
DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
i_internal_tabname = 'IT_MARA'
* i_structure_name = 'IT_MARA'
* I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = w_repid
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = it_fieldcat_wrt_off[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 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_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = wa_layout
it_fieldcat = it_fieldcat_wrt_off
TABLES
t_outtab = it_mara
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.
* Form TOP-OF-PAGE *
* ALV Report Header *
FORM top-of-page.
*ALV Header declarations
DATA: t_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader,
t_line LIKE wa_header-info,
ld_lines TYPE i,
ld_linesc(10) TYPE c.
* Title
wa_header-typ = 'H'.
wa_header-info = ' REPORT'.
APPEND wa_header TO t_header.
CLEAR wa_header.
* Date
* wa_header-typ = 'S'.
* wa_header-key = 'Date: '.
* CONCATENATE sy-datum+6(2) '.'
* sy-datum+4(2) '.'
* sy-datum(4) INTO wa_header-info. "todays date
* APPEND wa_header TO t_header.
* CLEAR: wa_header.
wa_header-typ = 'S'.
wa_header-key = '--'.
CONCATENATE '-----------GI--------------------------------------'
'delivery---------------------------------'
INTO wa_header-info.
APPEND wa_header TO t_header.
CLEAR: wa_header.
* Total No. of Records Selected
* describe table it_ekko lines ld_lines.
* ld_linesc = ld_lines.
* concatenate 'Total No. of Records Selected: ' ld_linesc
* into t_line separated by space.
* wa_header-typ = 'A'.
* wa_header-info = t_line.
* append wa_header to t_header.
* clear: wa_header, t_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
* i_logo = 'Z_LOGO'.
ENDFORM. "top-of-page
Maybe you are looking for
-
How do I post a message on the qosmio forum?
Hi, I see messages on the qosmio forum pages but no mention of "post a new topic" this is the only page I can see that allows me to post a topic. I wish to post a topic asking what cables are included in the qosmio f20-136 in UK as I seem to be missi
-
I'm using Safari 4.0.3 for Windows on XP SP3 and it seems to take a long time to start. After I've already run it once and cached everything, starting still takes 8 seconds. I used procmon from Microsoft to watch what it's doing, and 5 seconds of tha
-
Keystore used by the web start
Dear friends, the keystore used by web start is the same used by the IExplorer? i.e., if I import a certificate in te browser, it is also valid to my web start applications ?
-
I've got a form. The form asks the visitor their address (first name, last name, street address, apartment number, city, state, and zip code... each a separate text field). This form is repeated 10 times on the page, allowing the visitor to enter mul
-
User Password changes: Ex. Custom Oracle FORM Button Trigger to force DB change Password. -- Force an alter user statement to the database. -- sys.verify_password function will verify. Cmd_Line := 'Alter user "'||:CHANGE_PWD.USER_NAME|| '" identified