ALV hierarchy header
hi .. Abaper~
I have a question.
I'd like to use the hierarchy header in ALV.
For example.
--no | name -| - part--
|
| -
| position | subpart---- |
1|- jake---|-senier -|accounting--|
2|miky|-junier---|recruting-----|
isn't it possible?
please.. help ..
Hi Jake, the current ALV tool does not allow for multi line headers for the columns.
Regards,
RIch Heilman
Similar Messages
-
Top_of_page is not working in ALV hierarchy?
Hi,
I have written following code for top_of_page using event but which is not working...This report is developed for interactive report.
Note: passed the it_events into ALV hierarchy functional module.
FORM build_event_tab .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 1
IMPORTING
et_events = it_events[].
READ TABLE it_events INTO wa_events WITH KEY form = 'TOP_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'TOP_OF_PAGE'.
APPEND wa_events TO it_events.
ENDIF.
ENDFORM. "Get_events
FORM top_of_page USING document TYPE REF TO cl_dd_document.
DATA: dl_text(255) TYPE c,
lv_cutime TYPE sy-uzeit,
lv_cudt(20) TYPE c.
lv_cudt = sy-datum.
*--Passing Date----*
WRITE lv_cudt TO dl_text.
CONCATENATE 'Date : ' lv_cudt+6(2) '-'
lv_cudt+4(2) '-'
lv_cudt+0(4) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
WRITE 'Company Name' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 150.
lv_cutime = sy-uzeit.
CONCATENATE 'Time : ' lv_cutime+0(2) ':'
lv_cutime+2(2) ':'
lv_cutime+4(2) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 60.
WRITE 'Title' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
ENDFORM. "html_top_of_page
Thanks
ShreePERFORM build_fieldcat.
PERFORM build_event_tab.
PERFORM alv_display.
*---Build fieldcat
FORM build_fieldcat.
wa_fieldcat-tabname = 'IT_VENDOR'.
wa_fieldcat-fieldname = 'LIFNR'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = 'SUPPLIER'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_VENDOR'.
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = 'VENDOR NAME'.
wa_fieldcat-outputlen = 40.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-col_pos = '1'.
wa_fieldcat-seltext_l = 'Plant'.
wa_fieldcat-outputlen = 5.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'AWKEY'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = ' Document'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BELNR'.
wa_fieldcat-col_pos = '3'.
wa_fieldcat-seltext_l = 'A/c Document'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BUDAT'.
wa_fieldcat-col_pos = '4'.
wa_fieldcat-seltext_l = 'PJ Date'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'XBLNR'.
wa_fieldcat-col_pos = '5'.
wa_fieldcat-seltext_l = 'Inv'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BLDAT'.
wa_fieldcat-col_pos = '6'.
wa_fieldcat-seltext_l = 'PJ Date'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'DMBTR'.
wa_fieldcat-col_pos = '7'.
wa_fieldcat-seltext_l = 'Bill.Amount'.
wa_fieldcat-outputlen = 19.
wa_fieldcat-do_sum = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'HKONT'.
wa_fieldcat-col_pos = '8'.
wa_fieldcat-seltext_l = 'Cost Ctr'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "Build_fieldcat
*----ALV Display-----*
FORM alv_display.
key-header01 = 'LIFNR'.
key-item01 = 'LIFNR'.
DELETE ADJACENT DUPLICATES FROM it_vendor.
DELETE ADJACENT DUPLICATES FROM it_final.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'PFSTATUS'
it_fieldcat = it_fieldcat[]
i_tabname_header = 'IT_VENDOR'
i_tabname_item = 'IT_FINAL'
it_events = it_events[]
is_keyinfo = key
TABLES
t_outtab_header = it_vendor[]
t_outtab_item = it_final[].
ENDFORM. "alv_display
*----interactive method--
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_final INTO wa_final INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
IF rs_selfield-fieldname = 'BELNR'.
SET PARAMETER ID 'BLN' FIELD wa_final-belnr.
SET PARAMETER ID 'BUK' FIELD pa_bukrs.
SET PARAMETER ID 'GJA' FIELD pa_gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'AWKEY'.
SET PARAMETER ID 'RBN' FIELD wa_final-awkey.
SET PARAMETER ID 'GJR' FIELD pa_gjahr.
CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'LFBNR'.
SET PARAMETER ID 'BLN' FIELD it_bsak-lfbnr.
SET PARAMETER ID 'BUK' FIELD pa_bukrs.
SET PARAMETER ID 'GJA' FIELD pa_gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'EBELN'.
SELECT SINGLE
ebeln
INTO wk_ebeln
FROM ekko
WHERE ebeln = it_bsak-ebeln
AND bstyp = 'F'.
IF sy-subrc EQ 0.
SET PARAMETER ID 'BES' FIELD it_bsak-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ELSE.
SET PARAMETER ID 'VRT' FIELD it_bsak-ebeln.
CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. "user_command
FORM pfstatus USING ut_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
ENDFORM. "pfstatus
*---Authorization check---
FORM bukrs_check.
SELECT SINGLE
butxt "Name of the Company Code / Company
ort01 "City
INTO (wk_company, wk_city) FROM t001
WHERE bukrs = pa_bukrs.
IF sy-subrc <> 0.
MESSAGE 'create your own message' TYPE 'I'.
ENDIF.
ENDFORM. " BUKRS_CHECK
FORM build_event_tab.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events[].
READ TABLE it_events INTO wa_events
WITH KEY name = 'SLIS_EV_TOP_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'TOP_OF_PAGE'.
MODIFY it_events FROM wa_events INDEX sy-tabix.
ENDIF.
READ TABLE it_events INTO wa_events WITH KEY name =
'SLIS_EV_END_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'END_OF_PAGE'.
MODIFY it_events FROM wa_events INDEX sy-tabix.
ENDIF.
ENDFORM. "Get_events
FORM end_of_page.
DATA: it_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
wa_header-typ = 'S'.
wa_header-key = 'MATERIAL'.
* wa_line-info = p1.
APPEND wa_header TO it_header.
CLEAR wa_header.
* READ TABLE it_maktx WITH KEY matnr = p1.
wa_header-typ = 'S'.
wa_header-key = 'DESCRIPTION'.
* wa_line-info = it_maktx-maktx.
APPEND wa_header TO it_header.
CLEAR wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
* i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = it_header.
ENDFORM. "END_OF_PAGE
FORM top_of_page USING document TYPE REF TO cl_dd_document.
DATA: dl_text(255) TYPE c,
lv_cutime TYPE sy-uzeit,
lv_cudt(20) TYPE c.
lv_cudt = sy-datum.
*--Passing Date----*
WRITE lv_cudt TO dl_text.
CONCATENATE 'Date : ' lv_cudt+6(2) '-'
lv_cudt+4(2) '-'
lv_cudt+0(4) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
WRITE 'INCAP CON MFG SER (P) LTD' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 150.
lv_cutime = sy-uzeit.
CONCATENATE 'Time : ' lv_cutime+0(2) ':'
lv_cutime+2(2) ':'
lv_cutime+4(2) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 60.
WRITE 'Purchase Journal' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
ENDFORM. "html_top_of_page -
Multiple levels in ALV Hierarchy
Hi All
How to display Multiple levels in ALV Hierarchy.
I have header and Item Tables but Under Header Expansions I have to display one more Expansion.
Means Multiple levels.Hi,
I think you can check standard program BCALV_TEST_HIERSEQ_LIST
Regards,
Himanshu -
Dear Experts,
Can anyone tell me how to create a ALV Hierarchial report with one HEADER table and multiple ITEM(child) tables.
thanks & regards,
gautamHi you can tray review this code for a example i found in the web and help me:
REPORT Z_TEST_HIESEQ_REPORT.
TABLES: ekko,ekpo.
* selection option
SELECT-OPTIONS s_ebeln FOR ekko-ebeln.
TYPE-POOLS:slis.
* define header table and item table
DATA: BEGIN OF headertab OCCURS 0,
ebeln LIKE ekko-ebeln,
bstyp LIKE ekko-bstyp,
bsart LIKE ekko-bsart,
statu LIKE ekko-statu,
END OF headertab.
DATA: BEGIN OF itemtab OCCURS 0,
ebeln LIKE ekpo-ebeln,
ebelp LIKE ekpo-ebelp,
matnr LIKE ekpo-matnr,
werks LIKE ekpo-werks,
menge LIKE ekpo-menge,
netpr LIKE ekpo-netpr,
peinh LIKE ekpo-peinh,
netwr LIKE ekpo-netwr,
END OF itemtab.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: v_repid LIKE sy-repid.u201Ccurrent program name
DATA: g_tabname_header TYPE slis_tabname,
g_tabname_item TYPE slis_tabname.
* data connect header table and item table
* we can set 5 field as foreign key at same time
DATA: gs_keyinfo TYPE slis_keyinfo_alv.
INITIALIZATION.
v_repid = sy-repid.
START-OF-SELECTION.
PERFORM get_data.
END-OF-SELECTION.
* get field catalog of header table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'HEADERTAB'
i_inclname = v_repid
i_bypassing_buffer = 'X'
i_buffer_active = "
CHANGING
ct_fieldcat = i_fieldcat
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.
* get field catalog of item table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITEMTAB'
i_inclname = v_repid
i_bypassing_buffer = 'X'
i_buffer_active = "
CHANGING
ct_fieldcat = i_fieldcat
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.
* set the header and item table are connected by pur doc number
gs_keyinfo-header01 = 'EBELN'.
gs_keyinfo-item01 = 'EBELN'.
g_tabname_header = 'HEADERTAB'.
g_tabname_item = 'ITEMTAB'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
it_fieldcat = i_fieldcat
i_save = 'A'
i_tabname_header = g_tabname_header
i_tabname_item = g_tabname_item
is_keyinfo = gs_keyinfo
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab_header = headertab
t_outtab_item = itemtab
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 get_data.
SELECT ebeln bstyp bsart statu
INTO TABLE headertab
FROM ekko
UP TO 100 ROWS
WHERE ebeln IN s_ebeln.
IF NOT headertab[] IS INITIAL.
SELECT ebeln ebelp matnr werks menge netpr peinh netwr
INTO TABLE itemtab
FROM ekpo
FOR ALL ENTRIES IN headertab
WHERE ebeln = headertab-ebeln.
ENDIF.
ENDFORM. "get_data
Edited by: Juan Manuel Garcia on Aug 17, 2010 11:29 PM
Edited by: Juan Manuel Garcia on Aug 17, 2010 11:36 PM -
Hi all,
is it possible to print a different title for each page when you use ALV hierarchy?
For example I need to print the PO number for each page as thet title.
Thanks,
MelTry this..
ip_confing type ref to CL_SALV_WD_CONFIG_TABLE.
"set alv table header
ip_config->if_salv_wd_table_settings~r_header->set_text( 'Test ALV Header functionality' ).
or
data: lr_table_settings type ref to if_salv_wd_table_settings.
data: lr_header type ref to CL_SALV_WD_HEADER.
lr_table_settings ?= l_value.
lr_header = lr_table_settings->get_header( ).
lr_header->set_text( 'FLIGHT LIST SEARCH' ).
Cheers,
Kris. -
Traffic lights in ALV list header
how do i display traffic lights as icons in ALV list header. for example, in the code below, i want to display a green icon at the end of closed items and a red icon at the end of the open items:
closed : 4 [green-icon]
open : 2 [red-icon]
CLEAR header_alv_wa-info.
header_alv_wa-key = 'closed:'.
header_alv_wa-info = gv_closed.
header_alv_wa-typ = 'S'.
APPEND header_alv_wa TO headeralv.
CLEAR header_alv_wa-info.
header_alv_wa-typ = 'S'.
header_alv_wa-key = 'open:'.
header_alv_wa-info = gv_open.
APPEND header_alv_wa TO headeralv.Hi,
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
the above links will give u the code for the same..
Regards,
Aparna -
Displaying ALV hierarchy at a certain level
Hi all,
I have an ALV report that shows a hierarchy. This ALV hierarchy is created using std class CL_GUI_ALV_TREE.
The number of hierarchy levels is dynamic and only determined during run time. However I would like to be able to either display all nodes expanded or only the last node unexpanded. In other words I would like to control which hierarhcy level is expanded when the report is first displayed.
Can anyone suggest a way to do this please?
ThanksIf you want to display the sum for a given hierarchy level, you should use CUBESET function.
e.g.
=IF(B2="all",CUBESET("mycube","[Location].[Location Hierarchy].[Department].&[DEPT 07]","all"),Cubemember("MyCube","[Location].[Location Hierarchy].[Department].&[DEPT 07].&["&B1&"]"))
Hope it helps. -
Writing selections in alv list header
Hi,
in alv list header i have to show the values entered in selection screen.
ex.
Current year : 2008
current period : 03
report ID : R_123
company code : I BT AA to BB
I BT CC to DD
I EQ FF
in the above example first three are parameters and company code is select-option, for parameters i can display what i want, but for company code( which is select option) it is showing only first line and not showing other lines.
at the time of filling list header table for select-option, i am looping the select-option, first i am filling with typ, key and info and for other i am filling only info, if i fill typ, key also for other recoreds also it is showing the company code in all lines as below ....
company code : I BT AA to BB
company code : I BT CC to DD
company code : I EQ FF
can any one suggest to get the list header as shown at the begining....
thanks,
bhushanHi,
Check this sample code. Here plant and date are selection screen paramters.
Plant
lwa_header-typ = 'S'.
lwa_header-key = text-t47.
If the select option for plant is 'EQ'
LOOP AT s_werks. "#EC *
IF s_werks-option = 'EQ'.
lwa_plant-werks = s_werks-low.
APPEND lwa_plant TO lt_plant.
CLEAR lwa_plant.
If the select option for plant is 'BT'
ELSEIF s_werks-option = 'BT'.
CONCATENATE s_werks-low
text-t50
s_werks-high
INTO lf_plant.
lwa_header-info = lf_plant.
APPEND lwa_header TO gt_header.
CLEAR lwa_header.
ENDIF.
ENDLOOP.
IF s_werks-option = 'EQ'.
READ TABLE lt_plant INTO lwa_plant INDEX 1.
lwa_header-info = lwa_plant-werks.
APPEND lwa_header TO gt_header.
CLEAR lwa_header.
LOOP AT lt_plant INTO lwa_plant FROM 2.
lwa_header-typ = 'S'.
lwa_header-key = ''.
lwa_header-info = lwa_plant-werks.
APPEND lwa_header TO gt_header.
CLEAR: lwa_header.
ENDLOOP.
ENDIF.
Post date Range
lwa_header-typ = 'S'.
lwa_header-key = text-t33.
If the select option for post date is 'EQ'
LOOP AT s_budat. "#EC *
IF s_budat-option = 'EQ'.
CONCATENATE s_budat-low+6(2) '.'
s_budat-low+4(2) '.'
s_budat-low(4) INTO lf_range.
For multiple values
IF lf_date_tmp IS INITIAL.
lwa_date-date = lf_range.
APPEND lwa_date TO lt_date.
ELSE.
lwa_date-date = lf_range.
APPEND lwa_date TO lt_date.
ENDIF.
If the select option for post date is 'BT'
ELSEIF s_budat-option = 'BT'.
CONCATENATE s_budat-low+6(2) '.'
s_budat-low+4(2) '.'
s_budat-low(4) text-t49
s_budat-high+6(2) '.'
s_budat-high+4(2) '.'
s_budat-high(4) INTO lf_range .
lwa_header-info = lf_range.
CLEAR lf_range.
ENDIF.
ENDLOOP.
IF s_budat-option = 'EQ'.
READ TABLE lt_date INTO lwa_date INDEX 1.
lwa_header-info = lwa_date-date.
APPEND lwa_header TO gt_header.
CLEAR: lwa_header.
LOOP AT lt_date INTO lwa_date FROM 2.
lwa_header-typ = 'S'.
lwa_header-key = ''.
lwa_header-info = lwa_date-date.
APPEND lwa_header TO gt_header.
CLEAR: lwa_header.
ENDLOOP.
ENDIF.
Appending work area to the header table
APPEND lwa_header TO gt_header.
CLEAR lwa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_header.
<REMOVED BY MODERATOR>
Regards,
Ramya
Edited by: Alvaro Tejada Galindo on Apr 8, 2008 4:30 PM -
Hai Friends,
In my ALV List header..i am writing date , time and my program name.
but all are coming on left side.
can i get date on left side, program name on centered and time on write side.
my code is like this.
FORM list_headers.
lists-typ = 'H'.
lists-info = text-010.
APPEND lists.
CLEAR lists.
lists-typ = 'S'.
lists-key = text-011.
CONCATENATE sy-datum+6(2) '/'
sy-datum+4(2) '/'
sy-datum+0(4) INTO lists-info.
APPEND lists.
CLEAR lists.
lists-typ = 'S'.
lists-key = text-012.
CONCATENATE sy-uzeit+0(2) ':'
sy-uzeit+2(2) ':'
sy-uzeit+4(2) INTO lists-info.
APPEND lists.
CLEAR lists.
ENDFORM.Hi again,
1. first of all how are u writing / displaying
the alv header ?
2. using documentary write ?
then also, u can use one variable of
length 100 and use this concept.
3. If u are using top_of_page
event,
in this event, WE CAN use WRITE.
(i have used it, and it
works fantastic)
(not in case of alv grid)
4. My point is, what ever u are using,
use on variable of length 100.
WRITE value INTO variable.
using offset
and then proceed further.
regards,
amit m. -
Setting the ALV Hierarchy tree with grid line between the columns and rows
Hi Experts,
I would like to ask if there is any suggestion on setting the ALV hierarchy tree to be separated by grid line between the columns and rows just like how it is display the same way in normal ALV grid.
Thanks in advance.Hi Lin,
The requirement which you have stated is not possible.
Lin,
Also i have a query regarding BADI ZME_PROCESS_REQ_CUST, which you had raised on SDN. You have marked the question as solved/answered.
Changing the data of a customize field in purchase requisition
Could you please let me know, the steps you did to update the screen fields through the BADI.
I would really appreciate your reply, because i am facing exactly the same problem which you have mentioned.
Thanks,
Best regards,
Prashant -
Is it possible to refresh the ALV HTML header?
ex: When I click in a button of the ALV Toolbar, I want the html header to refresh...
Thanks.
AlexandreHi
An internal table can be converted into an HTML Template using the function Module WWW_HTML_FROM_LISTOBJECT. This will create an HTML template which will be stored in SMW0->(Zero)
Now you can call this template in your header.
Regards,
Vara -
Alv hierarchy subtotal in 2 fields
Hi gurus,
First, thanks to all those who helped me with my first problem. I have a new question, still regarding subtotal.
The client now wants to have a subtotal in alv hierarchy per vendor and purchase doc. My output displays a subtotal per purchase doc only. Client wants to have an output that would look like this:
VENDOR
PURCH DOC PO AMT.
1
410000001 1000
410000001 2000
410000001 3000 (subtotal per purch doc)
410000002 100
410000002 100 (subtotal per purch doc)
1 3100 (subtotal per vendor)
2
420000001 500
420000001 300
420000001 800 (subtotal per purch doc)
2 800 (subtotal per vendor)
TOTAL 3900
Here's an excerpt of my code:
FORM build_fcat using p_type changing p_fcat.
data lt_fcat type slis_t_fieldcat_alv.
field-symbols <fs_fcat> like line of lt_fcat.
lt_fcat = p_fcat.
loop at lt_fcat assigning <fs_fcat>.
<fs_fcat>-ddictxt = 'L'.
case <fs_fcat>-fieldname.
when 'LIFNR'.
<fs_fcat>-seltext_l = 'VENDOR'.
<fs_fcat>-tabname = 'I_HEADER'.
<fs_fcat>-key = 'X'.
<fs_fcat>-outputlen = 15.
modify lt_fcat from <fs_fcat>.
when 'EBELN'.
<fs_fcat>-seltext_l = 'PURCH DOC'.
<fs_fcat>-tabname = 'I_ITEM'.
<fs_fcat>-key = 'X'.
<fs_fcat>-outputlen = 12.
modify lt_fcat from <fs_fcat>.
when 'RLWRT'.
<fs_fcat>-seltext_l = 'PO AMT.'.
<fs_fcat>-tabname = 'I_ITEM'.
<fs_fcat>-datatype = 'CURR'.
<fs_fcat>-ref_fieldname = 'WAERS'.
<fs_fcat>-ref_tabname = 'I_ITEM'.
<fs_fcat>-do_sum = 'X'.
<fs_fcat>-outputlen = 15.
modify lt_fcat from <fs_fcat>.
endcase.
endloop.
p_fcat = lt_fcat.
ENDFORM.
FORM build_fsort changing p_fsort.
data lt_sort type slis_t_sortinfo_alv.
data ls_sort like line of lt_sort.
ls_sort-spos = 1.
ls_sort-fieldname = 'EBELN'.
ls_sort-tabname = 'I_HEADER'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
append ls_sort to lt_sort.
clear ls_sort.
ls_sort-spos = 2.
ls_sort-fieldname = 'LIFNR'.
ls_sort-tabname = 'I_HEADER'.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
append ls_sort to lt_sort.
clear ls_sort.
p_fsort = lt_fsort.
ENDFORM.
FORM modify_key changing p_keyinfo type slis_keyinfo_alv.
clear p_keyinfo.
p_keyinfo-header01 = 'LIFNR'.
p_keyinfo-item01 = 'LIFNR'.
p_keyinfo-header02 = 'EBELN'.
p_keyinfo-item02 = 'EBELN'.
ENDFORM.
Is there a way to meet the client's expected output?
Thanks in advance for all the help and advises.
Points will be rewarded.Sorry I didn't include that earlier. I'm using Citrix so copy-paste of codes outside Citrix is not allowed. I'll just type a shorter version of my it here.
data: begin of i_item occurs 0,
lifnr like ekko-lifnr,
name1 like-lfa1-name1,
ebeln like ekpo_ebeln,
po_dat like ekko-bedat,
rlwrt like ekko-rlwrt,
waers like ekko-waers,
dmbtr like ekko-dmbtr,
end of i_item.
data wa_item like line of i_item,
data: begin of i_header occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
ebeln like ekpo-ebeln,
end of i_header.
data wa_header like line of i_header. -
Hi experts ,
I have an requirment to divide a ALV column header.
I want to add a header row grouping the column headers.
Departure Arrival <-- This row is what I want to add
Airport Gate Date Airport Gate Date
Thanks,
Regards ,
Swashrayee
Edited by: SWASHRAYEE77928 on Feb 1, 2012 7:30 AM
Moderator Message: UserID sent for deletion, for ignoring multiple Moderator warnings.
Edited by: kishan P on Feb 1, 2012 12:05 PMHello,
Take a look on this code:
DATA:
lv_title TYPE string,
lt_columns TYPE salv_wd_t_column_ref,
lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_salv_wd_table TYPE REF TO iwci_salv_wd_table,
lr_table TYPE REF TO cl_salv_wd_config_table,
FIELD-SYMBOLS:
<fs_column> LIKE LINE OF lt_columns,
lr_salv_wd_table = wd_this->wd_cpifc_cmp_alv( ).
lr_table = lr_salv_wd_table->get_model( ).
lr_column_settings ?= lr_table.
lt_columns = lr_column_settings->get_columns( ).
LOOP AT lt_columns ASSIGNING <fs_column>.
lr_col_header = <fs_column>-r_column->get_header( ).
lr_col_header->set_ddic_binding_element( space ).
lr_col_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none ).
lv_title = cl_wd_utilities=>get_otr_text_by_alias( alias = 'HISTORIC' ).
lr_col_header->set_text( lv_title ).
CLEAR lv_title.
I suggest you to put this code in some method called over the method WDDOMODIFYVIEW.
Regards. -
How can I do a Smartform from an ALV hierarchy? Is this possible?
Please give me any help...
Regards.
HugoHi, thank for your reply.
Well... I've a hierarchy alv report with a status bar... It's working properly.
Now, I want to print a smarform from this report...
this show the alv ************
call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
exporting
i_callback_program = vl_repid
is_layout = st_layout
it_fieldcat = t_fieldcat[]
i_tabname_header = 'T_AUX'
i_tabname_item = 'T_OUTPUT'
is_keyinfo = st_key
tables
t_outtab_header = t_aux[]
t_outtab_item = t_output[]
exceptions
program_error = 1
others = 2.
My doubt is in the smartform... I can pass 2 tables as parameters???
-->
call function l_fm_name
exporting
p_gjahr = p_gjahr
p_form = p_form
p_date_d = p_date_d
p_date_h = p_date_h
p_nom = p_nom
tables
gt_salida = gt_salida ???? "Table 1
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
I'm sorry for my poor english... -
Split ALV Column heading into two
Hello All,
I have a ALV Column Header - ALV LIST - SAP 46C.
Material | Info Type | Quantity | Price etc..
Due to space contraints and other reason client needs to split the Info type column into two.
Material | Info | Quantity | Price etc..
| Type |
The data records should not have any additional blank lines.
How to achieve this?
Thanks,You have to assign X to layout property no_colhead.
Then write your heading using write statements.
Here is the exact example you are looking for [Create Multiple Lines Header In ALV List Report|http://www.freesaptutorial.com/create-multiple-lines-header-in-alv-list-report/]
Maybe you are looking for
-
i have an ipod touch 4th gen i reg it on my decktop then it had a power surge and blewup so i put itunes on my laptop and now it will now let me do anything to my apps pics or music what can i do i tried to reinstall but that didnt work i dont want t
-
Approval before COST DISTRIBUTION Process
Hi, Is there any standard functionality (in 12.0.6) of Approval available before Cost Distributions ? After importing actual transactions, creating pre-approved batches or doing Project Transfer, user want to put restriction on Cost Distribution. The
-
Monthly utilization of Cenvat problem
Hi ALL While doing utilization for for the month of JAN the key user has maintained todays date i.e.04.05.2008.and done the utilization.i.eJ2iun. As it has posted in todays date it has done utilization till today. Now I Reversed the document and want
-
How to configure SOAP in OC4J Standalone
Hi I recently installed the soap.ear in OC4J 903 standalone. I'm using Oracle JDeveloper 903 to access the web service but the test operation throws: Testing connection... Not using Proxy Server java.lang.Exception org.apache.soap.rpc.Response o
-
Project in iPhoto library is missing photos
I am using an iphoto library for photos in both iphoto and Aperture 3.5. My O/S is Mavericks on a MBP Retina laptop. Sometime after a recent upgrade--not sure it was the Mavericks, iphoto, or Aperture--I noticed that I was unable to edit picture in o