Height of ALV Header
I have created ALV Tree using custom container. Now i want to rstrict the Height of the top of page as top of page containes too many rows hence in the whole report only the Header is displayed. Can you tell me the method for to rstrict the Height of Header on Tree ALV screen.
Hi,
DATA obj_tree1 TYPE REF TO cl_gui_alv_tree
CALL METHOD obj_tree1->set_table_for_first_display
EXPORTING
is_hierarchy_header = l_hierarchy_header
it_list_commentary = lt_list_commentary[]
i_background_id = 'ALV_BACKGROUND'
i_save = 'A'
is_variant = ls_variant
CHANGING
it_outtab = i_final2
it_fieldcatalog = i_fieldcat. "table must be empty !!
I have used the following methods also but din't work.
CALL METHOD obj_tree1->set_splitter_row_height
EXPORTING
i_height = 10.
CALL METHOD obj_tree1->create_report_header
EXPORTING
it_list_commentary = lt_list_commentary[]
I_BACKGROUND_ID = 'ALV_BACKGROUND'
i_set_splitter_height = 'X'.
Regards,
Deepthi.
Similar Messages
-
Increasing header height in ALV
I am creating ALV header using cl_dd_document. I need to display 4 lines in the header but currently only 3 lines appear and I have to scroll to see the 4th line.
How can I set the row height for the header to constant to display all 4 lines without scrolling?Hi,
Glad to know that its working.
Regards
cem -
HI all
I got an assingment to divide a ALV header into some sub division , I have searched it into google . Can anyone please help me by giving the exact ALV function name .
tThanks,
RegardsHI,
Let us try the following code for the subdivision of alv header.
data : o_cust type ref to cl_gui_custom_container,
o_split type ref to cl_gui_splitter_container,
o_cont1 type ref to cl_gui_container,
o_cont2 type ref TO cl_gui_container.
START-OF-SELECTION.
call screen 100.
module STATUS_0100 output.
SET PF-STATUS 'ABC'.
CREATE OBJECT o_cust
EXPORTING
container_name = 'CST'.
CREATE OBJECT o_split
EXPORTING
parent = o_cust
rows = 2
columns = 1.
CALL METHOD o_split->set_row_height
EXPORTING
id = 1
height = 10.
CALL METHOD o_split->get_container
EXPORTING
row = 1
column = 1
receiving
container = o_cont1.
CREATE OBJECT o_split
EXPORTING
parent = o_cont1
rows = 1
columns = 2.
CALL METHOD o_split->set_row_height
EXPORTING
id = 2
height = 10.
CALL METHOD o_split->get_container
EXPORTING
row = 2
column = 1
receiving
container = o_cont2.
endmodule. " STATUS_0100 OUTPUT
module USER_COMMAND_0100 input.
case sy-ucomm.
when 'BACK'.
LEAVE PROGRAM.
ENDCASE.
endmodule.
Thanks & Regards,
Raghunadh.K -
How to display total in ALV Header
How to display total in ALV Header?
Hi Venkey,
As far as your issue is concerned I would like to quote my perception.
Create a header internal table with title and number of records.
At the later part of your program you should have found the total number of records ,now assign it to the header internal table and print it.
For further clarification you can go check this link:
http://wiki.sdn.sap.com/wiki/display/ABAP/AddHeadertoALVreport
Thanks
P.Srikanth -
Hi friends,
I make one header alv ok I want and take one variable count in my program so I want to display its value in ALV HEADER
Total Target Qty:
Total EMP. Efficiency
Total Machine Effi.
I take may header like this and pass thre text here.ok Now I want to display value of this three.
Total Trget Qty: 2.23 like that.
CLEAR st_line.
st_line-typ = 'S'.
CONCATENATE 'Total Target Qty: ' count ' ' INTO st_line-info.
APPEND st_line TO t_list_top_of_page.
So I took like this in header count is my variable in which I take value.
So how can we pass the value in ALV Header please tell me.
its urgent so.
Thnaks in Advance.
Prashant.HI DHWANI,
*& Report ZPP_RE_EMP_DETAILS
*& This Report is used to check the Employee Performance And Used Machine Quantity
*& Rqueirement By Santhosh
*& Developed By Prashant On Date 01.02.2008
*& Created By: Prashant Brahmbhatt
*& Creation Date: 20080201
*& Module: PP (Production & Plannig)
*& Changed By Changed Date Reason
REPORT zpp_re_emp_details.
TABLES:zpplan.
TYPE-POOLS:slis.
DATA:BEGIN OF itab OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
iserh LIKE zpplan-iserh,
quaty LIKE zpplan-quaty,
plan_qty LIKE zpplan-plan_qty,
act_prod LIKE zpplan-act_prod,
temp TYPE c,
tar_qty(10) TYPE c,
ach_qty(10) TYPE c,
mch_eff(10) TYPE c,
a(10) TYPE c,
END OF itab.
DATA:BEGIN OF temp OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
iserh LIKE zpplan-iserh,
quaty LIKE zpplan-quaty,
plan_qty LIKE zpplan-plan_qty,
act_prod LIKE zpplan-act_prod,
temp TYPE c,
tar_qty(10) TYPE c,
ach_qty(10) TYPE c,
mch_eff(10) TYPE c,
a(10) TYPE c,
END OF temp.
DATA:BEGIN OF itab_t OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
iserh LIKE zpplan-iserh,
quaty LIKE zpplan-quaty,
plan_qty LIKE zpplan-plan_qty,
act_prod LIKE zpplan-act_prod,
temp TYPE c,
tar_qty(10) TYPE c,
ach_qty(10) TYPE c,
mch_eff(10) TYPE c,
a(10) TYPE c,
END OF itab_t.
DATA:BEGIN OF itab1 OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
act_prod LIKE zpplan-act_prod,
quaty LIKE zpplan-quaty,
planned LIKE zpplan-planned,
iserh LIKE zpplan-iserh,
temp TYPE c,
tar_qty TYPE p DECIMALS 2,
ach_qty TYPE p DECIMALS 2,
mch_eff TYPE p DECIMALS 2,
END OF itab1.
DATA: wa LIKE itab1.
DATA:BEGIN OF itab2 OCCURS 0,
zdate LIKE zpplan-zdate,
werks LIKE zpplan-werks,
mname LIKE zpplan-mname,
shftin LIKE zpplan-shftin,
act_prod LIKE zpplan-act_prod,
quaty LIKE zpplan-quaty,
planned LIKE zpplan-planned,
iserh LIKE zpplan-iserh,
temp TYPE c,
tar_qty(10) TYPE p DECIMALS 2,
ach_qty(10) TYPE p DECIMALS 2,
mch_eff(10) TYPE p DECIMALS 2,
count(10) TYPE c,
END OF itab2.
DATA: a(10) TYPE c,
b(10) TYPE c,
count(10) TYPE c,
count1(10) TYPE c.
c(2) TYPE p DECIMALS 2.
DATA:t_fcat TYPE slis_t_fieldcat_alv,
t_events TYPE slis_t_event,
t_list_top_of_page TYPE slis_t_listheader,
t_list_end_of_page TYPE slis_t_listheader.
CONSTANTS:c_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
CONSTANTS:c_formname_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
DATA: st_line TYPE slis_listheader.
SELECTION-SCREEN
SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
*PARAMETERS:shftin LIKE zpplan-shftin.
SELECT-OPTIONS:date FOR zpplan-zdate,
shftin FOR zpplan-shftin,
werks FOR zpplan-werks.
SELECTION-SCREEN:END OF BLOCK blk1.
ALV CALL
INITIALIZATION.
PERFORM build_fieldcatalog USING t_fcat .
PERFORM event_call.
PERFORM head_built USING t_events.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM display_alv.
*& Form build_fieldcatalog
text
-->P_T_FCAT text
FORM build_fieldcatalog USING temp_fcat TYPE slis_t_fieldcat_alv.
DATA:w_fcat TYPE slis_fieldcat_alv.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'MNAME'.
w_fcat-seltext_m = 'Machine Name'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'SHFTIN'.
w_fcat-seltext_m = 'Emp No'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'ZDATE'.
w_fcat-seltext_m = 'Pos Date'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'QUATY'.
w_fcat-seltext_m = 'Quantity'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'ACT_PROD'.
w_fcat-seltext_m = 'Actual Quantity'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'ISERH'.
w_fcat-seltext_m = 'Down Time'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'TAR_QTY'.
w_fcat-seltext_m = 'Target Qty.'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'ACH_QTY'.
w_fcat-seltext_m = 'EMP Effec.'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'MCH_EFF'.
w_fcat-seltext_m = 'Machine Effec.'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
w_fcat-tabname = 'ITAB2'.
w_fcat-fieldname = 'COUNT'.
w_fcat-seltext_m = 'Machine Effec.'.
APPEND w_fcat TO temp_fcat.
CLEAR w_fcat.
ENDFORM. " build_fieldcatalog
*& Form event_call
text
--> p1 text
<-- p2 text
FORM event_call .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = t_events
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.
ENDFORM. " event_call
*& Form data_retrieval
text
--> p1 text
<-- p2 text
FORM data_retrieval .
IF shftin <> ''.
SELECT zdate werks mname shftin INTO CORRESPONDING FIELDS OF TABLE
temp FROM zpplan
WHERE shftin IN shftin
AND zdate IN date
AND werks IN werks.
ELSE.
SELECT zdate werks mname INTO CORRESPONDING FIELDS OF TABLE
temp FROM zpplan
WHERE zdate IN date
AND werks IN werks.
ENDIF.
SORT temp BY mname zdate shftin.
DELETE ADJACENT DUPLICATES FROM temp.
SORT temp BY mname shftin zdate.
DELETE ADJACENT DUPLICATES FROM temp.
APPEND temp.
LOOP AT temp.
SELECT zdate werks mname shftin act_prod quaty iserh FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab_t
WHERE mname = temp-mname
AND zdate = temp-zdate
AND werks = temp-werks.
LOOP AT itab_t.
MOVE-CORRESPONDING itab_t TO itab.
APPEND itab.
ENDLOOP.
ENDLOOP.
*******************************************8
SELECT zdate werks mname shftin act_prod quaty iserh FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab
FOR ALL ENTRIES IN temp
WHERE zdate = temp-zdate AND
werks = temp-werks
AND mname = temp-mname.
SELECT zdate werks mname shftin act_prod quaty iserh FROM zpplan INTO CORRESPONDING FIELDS OF TABLE itab
WHERE zdate IN date AND
werks IN werks AND
shftin = shftin.
SORT itab BY mname zdate.
DELETE ADJACENT DUPLICATES FROM itab.
LOOP AT itab.
MOVE-CORRESPONDING itab TO itab1.
COLLECT itab1.
ENDLOOP.
LOOP AT itab1.
itab1-tar_qty = itab1-tar_qty + ( itab1-quaty / 3 ).
IF ( itab1-tar_qty NE 0 ).
itab1-ach_qty = ( itab1-ach_qty + itab1-act_prod / itab1-tar_qty ) * 100.
ELSE.
itab1-ach_qty = 0 * 100.
ENDIF.
itab1-mch_eff = ( ( 8 - itab1-iserh ) / 8 ) * 100.
MODIFY itab1 TRANSPORTING tar_qty ach_qty mch_eff.
ENDLOOP.
LOOP AT itab1.
READ TABLE itab1 INDEX 1 INTO wa.
IF itab1-mname = wa-mname.
itab1-zdate = wa-zdate.
itab2-shftin = itab1-shftin.
itab2-mname = itab1-mname.
itab2-zdate = itab1-zdate.
itab2-quaty = itab2-quaty + itab1-quaty.
itab2-act_prod = itab2-act_prod + itab1-act_prod.
itab2-iserh = itab2-iserh + itab1-iserh.
itab2-tar_qty = itab2-tar_qty + itab1-tar_qty.
itab2-ach_qty = itab2-ach_qty + itab1-ach_qty.
itab2-mch_eff = itab2-mch_eff + itab1-mch_eff.
ELSE.
APPEND itab2.
CLEAR itab2.
MOVE-CORRESPONDING itab1 TO wa.
itab2-shftin = itab1-shftin.
itab2-mname = itab1-mname.
itab2-zdate = itab1-zdate.
itab2-quaty = itab2-quaty + itab1-quaty.
itab2-act_prod = itab2-act_prod + itab1-act_prod.
itab2-iserh = itab2-iserh + itab1-iserh.
itab2-tar_qty = itab2-tar_qty + itab1-tar_qty.
itab2-ach_qty = itab2-ach_qty + itab1-ach_qty.
itab2-mch_eff = itab2-mch_eff + itab1-mch_eff.
ENDIF.
ENDLOOP.
APPEND itab2.
LOOP AT itab2.
IF ( itab2-tar_qty NE 0 ).
itab2-ach_qty = ( itab2-ach_qty + itab2-act_prod / itab2-tar_qty(10) ) * 100.
ELSE.
itab2-ach_qty = 0 * 100.
ENDIF.
itab2-mch_eff = ( ( 8 - itab2-iserh ) / 8 ) * 100.
MODIFY itab2 TRANSPORTING tar_qty ach_qty mch_eff.
ENDLOOP.
APPEND itab2.
LOOP AT itab2.
count = sy-tfill.
a = a + itab2-tar_qty.
b = b + itab2-ach_qty.
ENDLOOP.
CLEAR itab2.
itab2-tar_qty = a.
itab2-ach_qty = b.
APPEND itab2.
CLEAR itab2.
count = a / sy-tfill.
count1 = b / sy-tfill.
itab2-tar_qty = count.
itab2-ach_qty = count1.
itab2-tar_qty = count.
APPEND itab2.
ENDFORM. " data_retrieval
*& Form head_built
text
-->P_T_EVE text
FORM head_built USING p_t_eve TYPE slis_t_event.
count = a / sy-tfill.
DATA: ls_event TYPE slis_alv_event.
REFRESH t_list_top_of_page.
READ TABLE p_t_eve WITH KEY name = slis_ev_top_of_page INTO ls_event.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO ls_event-form.
MODIFY p_t_eve FROM ls_event INDEX sy-tabix.
ENDIF.
CLEAR st_line.
st_line-typ = 'S'.
st_line-key = 'Total Target Qty: '.
st_line-info = count.
APPEND st_line TO t_list_top_of_page.
CLEAR st_line.
st_line-typ = 'S'.
st_line-info = count.
CONCATENATE 'Avg Target Qty.' count ' ' INTO st_line-info.
APPEND st_line TO t_list_top_of_page.
CLEAR st_line.
st_line-typ = 'S'.
st_line-key = 'Avg.EMP Efficiency: '.
st_line-info = count1.
APPEND st_line TO t_list_top_of_page.
CLEAR st_line.
st_line-typ = 'S'.
st_line-key = 'Avg. Machine Efficincy: '.
st_line-info = count.
APPEND st_line TO t_list_top_of_page.
REFRESH t_list_end_of_page.
READ TABLE p_t_eve WITH KEY name = slis_ev_end_of_list INTO ls_event.
IF sy-subrc = 0.
MOVE c_formname_end_of_page TO ls_event-form.
MODIFY p_t_eve FROM ls_event INDEX sy-tabix.
ENDIF.
CLEAR st_line.
st_line-typ = 'S'.
CONCATENATE 'END OF PAGE' ' ' INTO st_line-info.
APPEND st_line TO t_list_end_of_page.
ENDFORM. " head_built
*& Form top-of-page
text
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_list_top_of_page
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "top-of-page
*& Form display_alv
text
--> p1 text
<-- p2 text
FORM display_alv .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = 'ZPP_RE_EMP_DETAILS'
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 =
i_background_id = 'ALV_BACKGROUND'
i_grid_title = 'EMP Information'
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = t_fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = t_events
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
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = itab2
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. " display_alv -
Space in Top of page on alv header
Hi Experts,
I do have a query on ALV , Can you please help me in solving my problem.
Here goes my query...
I have to develop a ALV where on the top of page i have to display two fields as shown in below which was highlighted in the screen
http://img410.imageshack.us/my.php?image=op2sn9.jpg
But i'm getting output as shown below screen
http://img410.imageshack.us/my.php?image=op1ut4.jpg
I have tried with space and all other alternatives but i'm unable to get the desired output.
Can i have any sample code for the same
Regards
NandaHi,
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
form build_fieldcatalog.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
* I.e. Field type may be required in-order for
* the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
* fieldcatalog-do_sum = 'X'.
* fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material No'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
* gd_layout-totals_only = 'X'.
* gd_layout-f2code = 'DISP'. "Sets fcode for when double
* "click(press f2)
* gd_layout-zebra = 'X'.
* gd_layout-group_change_edit = 'X'.
* gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
* i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
* it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
* is_variant = z_template
tables
t_outtab = it_ekko
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. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
* up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL
* 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 = 'EKKO Table 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.
* 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.
* FORM USER_COMMAND *
* --> R_UCOMM *
* --> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* Check function code
CASE r_ucomm.
WHEN '&IC1'.
* Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
* Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
* Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
* Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
*& Form BUILD_EVENTS
* Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
* Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.
Try with this sample
Regards
Krishna -
Alv heading to display in excel
Hi
i have a problem ,
i want 2 take print of body of alv with ALV header.
while printing , only body is comin for print-out, not a header.
guide me.
points vil be rewardedwrite the header under the event top-fo-page and use listheader structure and also use FM ALV_commentary _write
see following code for example
http://sapprograms.blogspot.com/2008/04/alv-grid-display-report.html -
Rename alv header text in webdynpro abap
Hi ,
I have created two attribute PART_NUMBER and TERM_CODE in context level with type CHAR10.
AND in ALV header PART_NUMBER and TERM_CODE is displaying, which is coming from context level.
i want to rename the header of ALV to PARTNUMBER and TERMCODE.
could any one send me the sampls code or any solution?
Thanks
RaksharFirst get access to the ALV Model object for your ALV usage:
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data l_salv_wd_table type ref to iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv( ).
data l_table type ref to cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
Then access the column you want to change the header on. In addition to setting the text of the header of the column, you must also force off the data dictionary binding for the field property text.
data l_column type ref to cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
data l_header type ref to cl_salv_wd_column_header.
l_header = l_column->get_header( ).
l_header->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
l_header->set_text( `Posting Date` ). -
How to Display Logo in ALV Header?
Hi
I want to display/ print my company logo image in ALV Header. Please help me how can I do this?
Thanks
Iftikhar Ali
Islamabad.Hi,
If you are already having a logo say ZLOGO .
You can use it this way .
Give TOP-OF-PAGE
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
And in top of page do this .
FORM top-of-page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRIT
EXPORTING
IT_LIST_COMMENTARY = IT_LISTHE
i_logo = 'ZLOGO'
I_END_OF_LIST_GRID =
endform.
Hope this will work .
Reward if found useful.
Regards
SureshP. -
Displaying blank line in ALV header
How do I display a blank line in ALV header
For eg i want if i want the ALV header to display as follows
Document Datewise Report as of 31/10/2009
<-- BLANK LINE
Run On : 01/12/2009Hi,
Are you using 'REUSE_ALV_COMMENTARY_WRITE' for displaying the header?
If yes, then I think it is not possible. Instead, use the events table to achieve it.
Use the 'REUSE_ALV_EVENTS_GET' FM to get all possible events and then modify
the events internal table to specify the form name to handle top-of-page event.
eg.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS
* 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 V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'TOP_OF_PAGE'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-FORM.
ENDIF.
FORM TOP_OF_PAGE.
* Use write statements to display the header data.
ENDFORM.
In write statement use '/' to go to new line. So to insert an empty line you can use something like
write : 'some text' / / 'some text' .
Hope this helps.
Regards,
Bhavesh. -
Hi Friends,
In ALV GRID i need to display the output header like below.
SHIP
SOLD
|----
NUM
NAME
NUM
NAME
It's not dots and pipes. But like the box with above design.
Can any one please give me your valuable inputs regarding this.
I want to use it in ALV GRID . i.e: By using ALV FM or OOPS also.
Thanks
Srinivas.Hi
REPORT znnr_nnr LINE-SIZE 125.
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
is_variant = z_template
tables
t_outtab = it_ekko
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. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL
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 = 'EKKO Table 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.
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.
FORM USER_COMMAND *
--> R_UCOMM *
--> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
*& Form BUILD_EVENTS
Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
endform. -
Vertical text in ALV header (WD4A)
HI,
Can anybody tell me how I can display ALV header text in WD4A as vertical text ?
Cheers, JohnHi,
DATA:
lr_alv_header TYPE REF TO cl_salv_wd_column_header.
Get the column reference of the ALV column.
CALL METHOD lr_column->set_width
EXPORTING
value = '70'.
lr_alv_header = lr_column->get_header( ).
lr_alv_header->set_text( 'Header' ).
lr_column->set_resizable( abap_true ).
lr_alv_header->set_header_text_wrapping( abap_true ). -
Can we adjust ROW height in ALV report as like of Excel ?
Dear all,
Can we adjust ROW height in ALV report as like of Excel sheet ?
Can we increase/decrease the row height in the output display ?
How ?kps204020 wrote:
Thanks a lot for your response.
I've tried your proposal, but it has no affect. The report cells show all their content using as much lines as necessary for this.This is the default behaviour for HTML table data (tables and cells expand to fit their content).
So I still have rows with lots of lines and rows with only a few lines mixed in my IR dependant on the cell content. Because some rows filling nearly the whole screen, it is difficult to get an overview with regard to adjacent rows.
I'm using Application Express 4.1.1.00.23. with Theme 21. Scarlet and Firefox 17.0.1.Are all users using Firefox?
Actually I'm working on my first APEX Solution for usage in my company and the customers demanding a solution for this topic . So I'm very keen to find a solution.
I'm very much looking forward to your response.I've been involved with similar issues in the past. My first response is simple: Does this data have to be shown in the report? Can the offending column(s) be removed from the primary report? They will still be visible in the single row view, and the detail view if there is one.
The second option is to create a detail view for the report with a structure that is better suited to the data involved, and make this the default view. (For an example of this, see the treatment of the PRODUCT_DESCRIPTION column in the detail view of the Products report in the Sample Database Application: click on the View Detail button on the Products page.)
The third possibility is some kind of customization of the presentation of the data. This will involve using some combination of HTML/CSS/Dynamic Actions/Plug-ins/JavaScript that you may not be familiar with: do you have experience of these? To go down that route you need to describe in detail how you want to present the data, or what behaviour is required when the data is too long, and share an example of the report on apex.oracle.com that we can work with. -
Hi friends,
I want the heading of an ALV report in the format given as below ..... Is that possible ???
In the 1st line :-
123 ( Left corner ) ..... ABC (Center).... date (right corner)
In the second line also :- something like the first line .....
Is that possible ???
If yes ... How can i do this ???
Expecting your answers
thanks in advance
Cheers
R.Kriparefer the links:
http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
or
http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm
or
ALV LIST Header
how to display header in alv list
The last two would address your question more precisely.
Regards,
Ravi -
Hi,
How to dispaly ALV Heading in each and every page while printing or in download file in (EXCEL).
Thanks & Regards
hruHi Manish,
Thank you for your reply
Iam using the ALV GRID using FM REUSE_ALV_GRID_DISPLAY
The event ( FROM = 'TOP_OF_PAGE') (NAME = 'SLIS_EV_TOP_OF_PAGE') and add this event to the function module REUSE_ALV_EVENTS_GET.
create a Form with the name 'TOP_OF_PAGE',in this form use the function module REUSE_ALV_LIST_COMMENTARY' to display heaer text.
Build the code like this and then i did download all the records to excel file, But in that i found Header information display only once.
But i want display heading each and every page.
Thanks & Regards
hru
Maybe you are looking for
-
Itunes will not read the ripped CD
My hard drive crashed. With a new drive,I have now imported all my previously saved music into my Itunes library perfectly. Now, after having ripped a dozen full CD's, the new music has been loaded and can be played, but itunes will not read the titl
-
No BOM explosion in assembly order
Dear Experts, I am running a assembly order, type PP04 which is directly created from a sales order. During the creation, the BOM is exploded. My question is that how can I disable the BOM explosion as I want to enter all the components according to
-
Disk Utility Verify permissions question
I have always done, since 10.x, repair permissions via disk utility by opening disk utility app, selecting the top most icon: "drive manufacturer and size" name and then underneath: "Macintosh HD" and then under that "my disc drive" name I have alway
-
Pages look weird after reinstall
I formatted my drive, installed Win7, then reinstalled my CS3 suite. I created "new" sites to match the ones that I already had and pointed them to the folders where the files were. The pages all look weird in DW now. It only shows a header (a php
-
Both are on the latest version of MacOS (made sure I had them completely up to date before starting). Laptop and imac are connected via ethernet cable. Has been stuck for at least 2 hours showing "About 3 hours and 12 minutes remaining". Not sure wha