Oo alv hierarchical
can anybody send me oo alv hierarchical report
REPORT ALV_HIRARCHECIAL_REPORT.
TABLES : VBAK.
TYPE-POOLS SLIS.
SELECT-OPTIONS : S_VBELN FOR VBAK-VBELN.
DATA : IT_VBAK LIKE VBAK OCCURS 0 WITH HEADER LINE,
IT_VBAP LIKE VBAP OCCURS 0 WITH HEADER LINE,
IT_KEYINFO TYPE SLIS_KEYINFO_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA : R_NAME LIKE SY-REPID.
INITIALIZATION.
R_NAME = SY-REPID.
START-OF-SELECTION.
SELECT * FROM VBAK INTO TABLE IT_VBAK
WHERE VBELN IN S_VBELN.
SELECT * FROM VBAP INTO TABLE IT_VBAP
WHERE VBELN IN S_VBELN.
*PERFORM FIELDCAT.
IT_KEYINFO-HEADER01 = 'VBELN'.
IT_KEYINFO-ITEM01 = 'VBELN'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = R_NAME
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
IS_LAYOUT =
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT = ' '
IT_EVENTS =
IT_EVENT_EXIT =
I_TABNAME_HEADER = 'IT_VBAK'
I_TABNAME_ITEM = 'IT_VBAP'
I_STRUCTURE_NAME_HEADER = 'VBAK'
I_STRUCTURE_NAME_ITEM = 'VBAP'
IS_KEYINFO = IT_KEYINFO
IS_PRINT =
IS_REPREP_ID =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB_HEADER = IT_VBAK
T_OUTTAB_ITEM = IT_VBAP
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 FIELDCAT
text
FORM FIELDCAT.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = R_NAME
I_INTERNAL_TABNAME =
I_STRUCTURE_NAME = 'IT_VBAK'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = R_NAME
I_BYPASSING_BUFFER = 'X'
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_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.
ENDFORM. " FIELDCAT
Similar Messages
-
Values from alv hierarchical list display
hi all,
i need to display sme values from vbak and vbap tables in ALV hierarchical list display.if i click on the sales order of the header, it should directly go to the second screen of transaction VA03 with the sales details displayed..
i got the parameter id, how can i assign the selected sales order value to this parameter id?...
regards,
Hamsa PriyaHi,
Check this example..Marked in bold..
TYPE-POOLS: slis.
DATA: BEGIN OF itab OCCURS 0,
vbeln TYPE vbeln,
expand,
END OF itab.
DATA: BEGIN OF itab1 OCCURS 0,
vbeln TYPE vbeln,
posnr TYPE posnr,
matnr TYPE matnr,
netpr TYPE netpr,
END OF itab1.
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-rollname = 'VBELN'.
s_fieldcatalog-outputlen = '12'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'VBELN'.
s_fieldcatalog-outputlen = '12'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'POSNR'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'POSNR'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'MATNR'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'MATNR'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'NETPR'.
s_fieldcatalog-tabname = 'ITAB1'.
s_fieldcatalog-rollname = 'NETPR'.
s_fieldcatalog-do_sum = 'X'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
DATA: s_layout TYPE slis_layout_alv.
s_layout-subtotals_text = 'SUBTOTAL TEXT'.
s_layout-key_hotspot = 'X'.
s_layout-expand_fieldname = 'EXPAND'.
SELECT vbeln UP TO 100 ROWS
FROM
vbak
INTO TABLE itab
WHERE vbeln > '0060000040'.
IF NOT itab[] IS INITIAL.
SELECT vbeln posnr matnr netpr
FROM vbap
INTO TABLE itab1
FOR ALL ENTRIES IN itab
WHERE vbeln = itab-vbeln.
ENDIF.
DATA: v_repid TYPE syrepid.
v_repid = sy-repid.
DATA: s_keyinfo TYPE slis_keyinfo_alv.
s_keyinfo-header01 = 'VBELN'.
s_keyinfo-item01 = 'VBELN'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
<b> i_callback_user_command = 'USER_COMMAND'</b>
is_layout = s_layout
it_fieldcat = t_fieldcatalog
i_tabname_header = 'ITAB'
i_tabname_item = 'ITAB1'
is_keyinfo = s_keyinfo
TABLES
t_outtab_header = itab
t_outtab_item = itab1
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.
<b>FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
IF ucomm = '&IC1' AND selfield-fieldname = 'VBELN'.
READ TABLE itab INDEX selfield-tabindex.
IF sy-subrc = 0.
document
SET PARAMETER ID 'AUN' FIELD itab-vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDFORM.</b>
Thanks,
Naren -
Hi,
Can any one of you tell me how do we use ALV Hierarchical display.
In this I want to display only the header details,then only when the user clicks on any one of the field on the header,I want the details to be displayed.I know that we have to set some parameter,but whci parameter we have to set,I am not able to find out.Pls help me out.This is very urgent.
RamyaHI,
just copy and paste the following program .
REPORT ZALV_HIER .
type-pools:slis.
tables: ekko,ekpo.
DATA: alv_layout TYPE slis_layout_alv.
data:begin of it_ekko occurs 0,
EXPA type FLAG,
ebeln like ekko-ebeln,
bukrs like ekko-bukrs,
lifnr like ekko-lifnr,
bedat like ekko-bedat,
end of it_ekko.
data: begin of it_ekpo occurs 0,
sno like ekpo-ebeln,
ebelp like ekpo-ebelp,
menge like ekpo-menge,
netwr like ekpo-netwr,
end of it_ekpo.
data v_repid like sy-repid.
data it_fieldcat type slis_fieldcat_alv occurs 0 with header line.
data x_keyinfo type slis_keyinfo_alv.
select-options:s_ebeln for ekko-ebeln.
initialization.
v_repid = sy-repid.
s_ebeln-low = '1000'.
s_ebeln-sign = 'I'.
s_ebeln-option = 'EQ'.
S_ebeln-high = '5000'.
append s_ebeln.
start-of-selection.
perform get_data.
perform get_field.
perform get_key.
perform key_modify.
perform display.
*& Form get_data
* text
* --> p1 text
* <-- p2 text
form get_data.
select ebeln bukrs
lifnr bedat
from ekko
into corresponding fields of table it_ekko.
it_ekko-expa = 'X'.
MODIFY it_ekko transporting expa
WHERE expa = space.
select ebeln ebelp
menge netwr
from ekpo
into table it_ekpo.
endform. " get_data
*& Form get_field
* text
* --> p1 text
* <-- p2 text
form get_field.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'IT_EKKO'
i_inclname = v_repid
CHANGING
ct_fieldcat = it_fieldcat[].
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'IT_EKPO'
i_inclname = v_repid
CHANGING
ct_fieldcat = it_fieldcat[].
endform. " get_field
*& Form get_key
* text
* --> p1 text
* <-- p2 text
form get_key.
x_keyinfo-header01 = 'EBELN'.
x_keyinfo-item01 = 'SNO'.
endform. " get_key
*& Form DISPLAY
* text
* --> p1 text
* <-- p2 text
form display.
alv_layout-detail_popup = 'X'.
alv_layout-group_change_edit = 'X'.
alv_layout-EXPAND_FIELDNAME = 'EXPA'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = v_repid
IS_LAYOUT = alv_layout
it_fieldcat = it_fieldcat[]
i_tabname_header = 'IT_EKKO'
i_tabname_item = 'IT_EKPO'
is_keyinfo = x_keyinfo
TABLES
t_outtab_header = it_ekko
t_outtab_item = it_ekpo.
endform. " DISPLAY
*& Form key_modify
* text
* --> p1 text
* <-- p2 text
form key_modify.
loop at it_fieldcat. "Avoid Repitiotion of data.
case it_fieldcat-fieldname.
when 'SNO'.
if it_fieldcat-tabname = 'IT_EKPO'.
it_fieldcat-no_out = 'X'.
it_fieldcat-key = space.
endif.
endcase.
modify it_fieldcat index sy-tabix.
endloop.
endform. -
ALV Hierarchical With multiple boxes
Hello.
I have an alv hierarchical with multiple boxes.
Can I insert a buttom in Gui status of alv that allows me to expand all the boxes of hierarchy?
Regards
AngelaHi Narendra,
Try this program:
TABLES : sflight.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
w_repid = sy-repid.
DATA: BEGIN OF it_sflight OCCURS 0,
checkbox(1),
carrid LIKE sflight-carrid,
END OF it_sflight.
*layout
DATA: wa_layout TYPE slis_layout_alv.
*field catalog
DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
wa_fieldcatalog TYPE slis_fieldcat_alv.
START-OF-SELECTION.
SELECT carrid FROM sflight
INTO CORRESPONDING FIELDS OF TABLE it_sflight.
END-OF-SELECTION.
CLEAR it_fieldcatalog.
REFRESH it_fieldcatalog.
wa_fieldcatalog-fieldname = 'CHECKBOX'.
wa_fieldcatalog-outputlen = '3'.
wa_fieldcatalog-col_pos = '1'.
wa_fieldcatalog-seltext_m = 'Chk'.
wa_fieldcatalog-checkbox = 'X'.
wa_fieldcatalog-edit = 'X'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'CARRID'.
wa_fieldcatalog-outputlen = '10'.
wa_fieldcatalog-col_pos = '2'.
wa_fieldcatalog-seltext_m = 'Carrid'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
is_layout = wa_layout
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcatalog
TABLES
t_outtab = it_sflight
EXCEPTIONS
program_error = 1
OTHERS = 2.
*& Form USER_COMMAND
FORM user_command USING p_ucomm TYPE sy-ucomm
p_selfld TYPE slis_selfield.
CASE p_ucomm.
WHEN '&DATA_SAVE'.
DATA ref1 TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref1.
CALL METHOD ref1->check_changed_data.
LOOP AT it_sflight WHERE checkbox = 'X'.
DELETE it_sflight INDEX sy-tabix.
ENDLOOP.
p_selfld-refresh = 'X'.
ENDCASE.
ENDFORM. "user_command
Hope this helps you.
Regards,
Chandra Sekhar -
Hi , Is it possible to have a ALV hierarchical display in a single screen using ALV with ABAP objects.
Yes, it is, it is included in the ALV Object Model. If you have a NetWeaver system, then this is available to you. Here is the help.
http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
Here is the example, second one.
http://help.sap.com/saphelp_nw2004s/helpdata/en/f9/1ab54099de3726e10000000a1550b0/frameset.htm
On previous releases, the heir-sequential list ALV is only avaiable via the function module interface.
Regards,
RIch Heilman -
ALV hierarchical sequential list through oops
Hi ,
How to display ALV hierarchical sequential list through oops concept.
I looking for a method which is replacement for FM 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' in oops. if you can provide the sample code with that method will be really useful.
Thanks,
ShrinivasHi Shrinivas,
Check out these demo programs that are provided in SAP.
BALVHD01
BALVHD01_GROUP
<b>Reward points if this is helpful.</b>
Kiran -
Hi,
I want one simple ALV Hierarchical display Example report at least having 3 or 4 nodes.My report will be
SumA SumB SumC SumD
Field1 10 10 10 10
-> A 2 3 2 2
-> C 1 1 1 2
1 2 1 0
->D 1 2 1 0
-> B 8 7 8 8 .. Cntnue ...
Like field A,B Respectivly Having 3 Nodes etc...
Give me an example . Dont give program refering with Standard Tables. Its not understandable.please store the data in to internal table . It will be easy to understand.
Thank you.
PrakashHi Prakash,
just check this sample code...
REPORT ZTEST_HIER LINE-COUNT 65
LINE-SIZE 200
NO STANDARD PAGE HEADING
MESSAGE-ID ZZ.
TYPE-POOLS: SLIS.
TYPES: BEGIN OF TY_HEAD,
VBELN LIKE VBAK-VBELN,
KUNNR LIKE VBAK-KUNNR,
NAME LIKE KNA1-NAME1,
END OF TY_HEAD.
TYPES: BEGIN OF TY_ITEM,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
MAKTX LIKE MAKT-MAKTX,
CHECK(1),
END OF TY_ITEM.
DATA: IT_ITEM TYPE TABLE OF TY_ITEM.
DATA: IT_HEADER TYPE TABLE OF TY_HEAD,
IT_EVENTS TYPE SLIS_T_EVENT, "Events.
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: X_LAYOUT TYPE SLIS_LAYOUT_ALV,
X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
X_KEY TYPE SLIS_KEYINFO_ALV,
X_EVENTS TYPE SLIS_ALV_EVENT, "Event
X_VBELN LIKE VBAK-VBELN,
X_ITEM TYPE TY_ITEM.
CONSTANTS: C_S(1) VALUE '/'.
DATA: V_FLAG.
* SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR X_VBELN. "Sales order Number
SELECTION-SCREEN END OF BLOCK BLK.
AT SELECTION-SCREEN.
IF NOT S_VBELN[] IS INITIAL.
SELECT SINGLE VBELN
INTO X_VBELN
FROM VBAK
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E002 WITH 'Please enter valid Sales Order'(020).
ENDIF.
ENDIF.
* CLASS lcl_bill_complete DEFINITION
CLASS LCL_BILL_COMPLETE DEFINITION.
PUBLIC SECTION.
METHODS:GET_HEADER_DATA,
GET_ITEM_DATA,
SHOW_DATA,
FILL_FIELDCAT,
FILL_EVENTS,
TOP_OF_PAGE.
ENDCLASS. "lcl_bill_complete DEFINITION
* CLASS lcl_bill_complete IMPLEMENTATION
CLASS LCL_BILL_COMPLETE IMPLEMENTATION.
METHOD GET_HEADER_DATA.
DATA:X_HEADER LIKE LINE OF IT_HEADER.
X_HEADER-VBELN = '12345'.
X_HEADER-KUNNR = '1234'.
X_HEADER-NAME = 'Test'.
APPEND X_HEADER TO IT_HEADER.
X_HEADER-VBELN = '12346'.
X_HEADER-KUNNR = '1236'.
X_HEADER-NAME = 'Test'.
APPEND X_HEADER TO IT_HEADER.
X_HEADER-VBELN = '12347'.
X_HEADER-KUNNR = '1235'.
X_HEADER-NAME = 'Test'.
APPEND X_HEADER TO IT_HEADER.
ENDMETHOD. "get_header_data
METHOD GET_ITEM_DATA.
DATA:X_ITEM LIKE LINE OF IT_ITEM.
X_ITEM-VBELN = '12345'.
X_ITEM-POSNR = '0010'.
X_ITEM-MATNR = 'TESTMATNR'.
X_ITEM-MAKTX = 'TESTMAT'.
APPEND X_ITEM TO IT_ITEM.
X_ITEM-VBELN = '12345'.
X_ITEM-POSNR = '0020'.
X_ITEM-MATNR = 'TESTMATNR'.
X_ITEM-MAKTX = 'TESTMAT'.
APPEND X_ITEM TO IT_ITEM.
X_ITEM-VBELN = '12346'.
X_ITEM-POSNR = '0010'.
X_ITEM-MATNR = 'TESTMATNR'.
X_ITEM-MAKTX = 'TESTMAT'.
APPEND X_ITEM TO IT_ITEM.
X_ITEM-VBELN = '12346'.
X_ITEM-POSNR = '0020'.
X_ITEM-MATNR = 'TESTMATNR'.
X_ITEM-MAKTX = 'TESTMAT'.
APPEND X_ITEM TO IT_ITEM.
X_ITEM-VBELN = '12347'.
X_ITEM-POSNR = '0010'.
X_ITEM-MATNR = 'TESTMATNR'.
X_ITEM-MAKTX = 'TESTMAT'.
APPEND X_ITEM TO IT_ITEM.
X_ITEM-VBELN = '12347'.
X_ITEM-POSNR = '0020'.
X_ITEM-MATNR = 'TESTMATNR'.
X_ITEM-MAKTX = 'TESTMAT'.
APPEND X_ITEM TO IT_ITEM.
ENDMETHOD. "get_item_data
METHOD SHOW_DATA.
X_KEY-HEADER01 = 'VBELN'.
X_KEY-ITEM01 = 'VBELN'.
X_KEY-ITEM02 = 'POSNR'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = X_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
I_TABNAME_HEADER = 'IT_HEADER'
I_TABNAME_ITEM = 'IT_ITEM'
IS_KEYINFO = X_KEY
IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB_HEADER = IT_HEADER
T_OUTTAB_ITEM = IT_ITEM
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDMETHOD. "show_data
METHOD FILL_FIELDCAT.
DATA: L_POS TYPE I.
X_LAYOUT-HEADER_TEXT = 'HEADER'.
X_LAYOUT-ITEM_TEXT = 'ITEM'.
X_LAYOUT-DEFAULT_ITEM = ' '.
X_LAYOUT-NO_KEYFIX = 'X'.
X_LAYOUT-BOX_TABNAME = 'IT_ITEM'.
L_POS = L_POS + 1.
*- Sales Order Number
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_HEADER'.
X_FIELDCAT-SELTEXT_M = 'Sales Order'(017).
X_FIELDCAT-OUTPUTLEN = 11.
X_FIELDCAT-COL_POS = L_POS.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'KUNNR'.
X_FIELDCAT-TABNAME = 'IT_HEADER'.
X_FIELDCAT-SELTEXT_M = 'Sold-to Party'(010).
X_FIELDCAT-OUTPUTLEN = 13.
X_FIELDCAT-COL_POS = L_POS.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'NAME'.
X_FIELDCAT-TABNAME = 'IT_HEADER'.
X_FIELDCAT-OUTPUTLEN = 15.
X_FIELDCAT-SELTEXT_M = 'Sold-to name'(011).
X_FIELDCAT-COL_POS = L_POS.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'CHECK'.
X_FIELDCAT-TABNAME = 'IT_ITEM'.
X_FIELDCAT-CHECKBOX = 'X'.
X_FIELDCAT-INPUT = 'X'.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-SELTEXT_M = ' '.
X_FIELDCAT-OUTPUTLEN = 2.
X_FIELDCAT-COL_POS = L_POS.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'IT_ITEM'.
X_FIELDCAT-SELTEXT_M = 'Sales Order'(017).
X_FIELDCAT-OUTPUTLEN = 11.
X_FIELDCAT-TECH = 'X'.
X_FIELDCAT-COL_POS = L_POS.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
*- Sales Order Item
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'IT_ITEM'.
X_FIELDCAT-SELTEXT_M = 'SO Item'(018).
X_FIELDCAT-OUTPUTLEN = 7.
X_FIELDCAT-COL_POS = L_POS.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'MATNR'.
X_FIELDCAT-TABNAME = 'IT_ITEM'.
X_FIELDCAT-OUTPUTLEN = 18.
X_FIELDCAT-SELTEXT_M = 'Material number'(012).
X_FIELDCAT-COL_POS = L_POS.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'MAKTX'.
X_FIELDCAT-TABNAME = 'IT_ITEM'.
X_FIELDCAT-OUTPUTLEN = 40.
X_FIELDCAT-SELTEXT_M = 'Material Description'(013).
X_FIELDCAT-COL_POS = L_POS.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
ENDMETHOD. "fill_fieldcat
*--Fill the events table
METHOD FILL_EVENTS.
*- Top of page
X_EVENTS-NAME = 'TOP_OF_PAGE'.
X_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND X_EVENTS TO IT_EVENTS.
ENDMETHOD. "fill_events
"fill_events
METHOD TOP_OF_PAGE.
*- Call Steelcase Standard Header
WRITE 'top_of_page here'.
ENDMETHOD. "top_of_page
ENDCLASS. "lcl_bill_complete IMPLEMENTATION
START-OF-SELECTION.
DATA: OBJ TYPE REF TO LCL_BILL_COMPLETE.
CREATE OBJECT OBJ.
CALL METHOD OBJ->GET_HEADER_DATA.
CALL METHOD OBJ->GET_ITEM_DATA.
CALL METHOD OBJ->FILL_FIELDCAT.
CALL METHOD OBJ->FILL_EVENTS.
CALL METHOD OBJ->SHOW_DATA.
*& Form top_of_page
* TOP_OF_PAGE
FORM TOP_OF_PAGE.
*-To show the top of page
CALL METHOD OBJ->TOP_OF_PAGE.
ENDFORM. "top_of_page
Regards
vijay -
Printing page numbers in ALV Hierarchical
Hi All,
I have a requirement to display page numbers in the report and also when in printing the page numbers will be displayed like this 'Page xx of yy'. I placed this one in the top_of_page event of the function module REUSE_ALV_HIERSEQ_LIST_DISPLAY. The only display is the Page xx while yy is not. For xx i used the sy-pagno but for the yy as total numbers i try all system fields but still not display. Please help its urgent guys.Hi,
Check thease therds
https://forums.sdn.sap.com/click.jspa?searchID=12193297&messageID=269935
https://forums.sdn.sap.com/click.jspa?searchID=12193297&messageID=2461055
Regards
Kiran Sure -
Hierarchical ALV list with control of printout and Excel download
Hello everybody,
i have to write a program, that has to generate a hierarchical master/client list. The list should
have the same functionality, that a standard ALV Grid
offers (sorting, grouping, OLE export to Excel). The printout must show a new sheet for every master group.
ALV grid does not allow to display hierarchical lists. The ALV hierarchical list and blocklist view switches to
text mode with no "single click Excel activation". I have tried to implement the &XXL ok_code, but in text mode, there is no chance to activate this single-table functionality.
Another possibility seems to be ALV tree, but there is no
possibility to control the printout (new sheet at group level) and the given practice, to load child nodes at selection, is not acceptable for my kind of program (all childs have to be expanded and the printout must contain a dialog to print i.e. a "from to group" selection).
Does anyone have an idea, to solve this problem in an easy object oriented way? my only thought at this time is, to use a standard ABAP list and to integrate Excel via document office integration. This gives me the fullcontrol about printout and export, but it needs far more time then ALV.
Another possibility may be, to develop a custom control, based on VS with Flexgrid, Singray or ComponentOne tools, but ich have to go as near as possible to SAP standard, without using 3rd party programming systems or controls.
I'm glad about tip's!
Greets from germany
JensJens,
Take a look at this for ideas:
REPORT Zsandbox_prog .
INCLUDE OLE2INCL.
field-symbols: <Val> type any.
data: row_cnt type i.
types: begin of t_Excel,
Material_Info(20),
Sugg_Price(20),
Cost(20),
Comments(100),
end of t_Excel.
data: r_Excel type t_Excel.
data: i_Excel type table of t_Excel with header line.
constants: xlCenter type i value '-4108',
xlBottom type i value '-4107',
xlLeft type i value '-4131',
xlRight type i value '-4152'.
constants: xlContinuous type i value '1',
xlInsideVertical type i value '11',
xlThin type i value '2',
xlLandscape type i value '2',
xlPortrait type i value '1',
xlLetter type i value '1',
xlLegal type i value '5',
xlThick type i value '4',
xlNone type i value '-4142',
xlAutomatic type i value '-4105'.
DATA: hExcel TYPE OLE2_OBJECT, " Excel object
hWorkBooks TYPE OLE2_OBJECT, " list of workbooks
hWorkbook TYPE OLE2_OBJECT, " workbook
hSheet TYPE OLE2_OBJECT, " worksheet object
hRange TYPE OLE2_OBJECT, " range object
hRange2 TYPE OLE2_OBJECT, " range object
hBorders TYPE OLE2_OBJECT, " Border object
hInterior TYPE OLE2_OBJECT, " interior object - for coloring
hColumn TYPE OLE2_OBJECT, "column
hCell TYPE OLE2_OBJECT, " cell
hFont TYPE OLE2_OBJECT, " font
hSelected TYPE OLE2_OBJECT, " range object
hPicture TYPE OLE2_OBJECT, "picture object
hLogo TYPE OLE2_OBJECT. "Logo object
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECTION-SCREEN skip 1.
parameter: wraptext as checkbox.
SELECTION-SCREEN END OF BLOCK b1.
row_cnt = 1.
Perform Build_Dummy_Vals.
Perform Start_Excel.
Perform Build_Header_Line using row_cnt.
Perform Pass_Records using row_cnt.
Perform Release_Excel.
FORM Build_Dummy_Vals .
data: matnum(5) type n.
data: baseprice(3) type n.
do 5 times.
matnum = matnum + 50.
clear r_Excel.
concatenate 'Material ' matnum into r_Excel-material_info
separated by space.
r_excel-Sugg_Price = baseprice * matnum.
r_excel-Cost = ( baseprice * matnum ) / 2.
concatenate 'Comments for Material ' matnum into r_excel-Comments
separated by space.
append r_excel to i_Excel.
enddo.
ENDFORM. " Build_Dummy_Vals
Form Start_Excel.
CREATE OBJECT hExcel 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
get list of workbooks, initially empty
CALL METHOD OF hExcel 'Workbooks' = hWorkbooks.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF hWorkbooks 'Add' = hWorkbook.
PERFORM ERR_HDL.
Get Worksheet object.
get property of hWorkbook 'ActiveSheet' = hSheet.
EndForm.
FORM Build_Header_Line using p_row_cnt.
data: l_range(30).
data: row_start(10).
PERFORM Fill_The_Cell USING p_row_cnt 1 1 'Material'.
PERFORM Fill_The_Cell USING p_row_cnt 2 1 'Suggested Price'.
PERFORM Fill_The_Cell USING p_row_cnt 3 1 'Cost'.
PERFORM Fill_The_Cell USING p_row_cnt 4 1 'Comments'.
Perform Format_Column using 1 15 xlCenter ' ' xlCenter 0.
Perform Format_Column using 2 10 xlCenter ' ' xlCenter 1.
Perform Format_Column using 3 35 xlCenter ' ' xlCenter 0.
if WrapText = 'X'.
Perform Format_Column using 4 35 xlLeft ' ' xlCenter 1.
else.
Perform Format_Column using 4 100 xlLeft ' ' xlCenter 0.
endif.
Build the range object.
row_start = p_row_cnt.
concatenate 'A' row_start ':D' row_start into l_range.
condense l_range no-gaps.
Set row color to yellow.
CALL METHOD OF hExcel 'RANGE' = hRange EXPORTING #1 = l_range.
call method of hRange 'Interior' = hInterior.
set property of hInterior 'ColorIndex' = 6. "yellow
p_row_cnt = p_row_cnt + 1.
ENDFORM. " Build_Header_Line
FORM Format_Column USING p_ColNum
p_ColWidth
p_ColHAlign
p_ColFormat
p_ColVAlign
p_WrapText.
CALL METHOD OF hExcel 'COLUMNS' = hColumn
EXPORTING #1 = p_ColNum . "column number
SET PROPERTY OF hColumn 'HorizontalAlignment' = p_ColHAlign.
SET PROPERTY OF hColumn 'VerticalAlignment' = p_ColVAlign.
SET PROPERTY OF hColumn 'ColumnWidth' = p_ColWidth.
SET PROPERTY OF hColumn 'WrapText' = p_WrapText.
ENDFORM. " Format_Column
Form Pass_Records using p_row_cnt.
data: col_cnt type i.
data: l_range(30).
data: row_start(10).
col_cnt = 1.
*Pass the internal table values to the spreadsheet.
loop at i_Excel into r_Excel.
do 4 times.
assign component sy-index of STRUCTURE r_excel TO <Val>.
PERFORM Fill_The_Cell USING p_row_cnt col_cnt 0 <Val>.
col_cnt = col_cnt + 1. "increment column
enddo.
Build the range object.
row_start = p_row_cnt.
concatenate 'A' row_start ':D' row_start into l_range.
condense l_range no-gaps.
Set row color to yellow.
CALL METHOD OF hExcel 'RANGE' = hRange EXPORTING #1 = l_range.
call method of hRange 'Interior' = hInterior.
set property of hInterior 'ColorIndex' = 7. "yellow
p_row_cnt = p_row_cnt + 1. "increment row
col_cnt = 1. "reset column to A (ie. col 1)
endloop.
EndForm.
FORM Release_Excel .
SET PROPERTY OF hExcel 'Visible' = 1.
FREE OBJECT hExcel.
PERFORM ERR_HDL.
ENDFORM. " Release_Excel
FORM Fill_The_Cell *
Sets cell at coordinates i,j to value val boldtype bold *
BOLD --> 1 = true, set bold ON 0 = false, set bold OFF
FORM Fill_The_Cell USING I J BOLD TheValue.
CALL METHOD OF hExcel 'Cells' = hCell EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL.
SET PROPERTY OF hCell 'Value' = TheValue.
PERFORM ERR_HDL.
GET PROPERTY OF hCell 'Font' = hFont.
PERFORM ERR_HDL.
SET PROPERTY OF hFont 'Bold' = BOLD.
PERFORM ERR_HDL.
ENDFORM.
FORM ERR_HDL.
IF SY-SUBRC <> 0.
message i000(zz) with 'OLE Automation error: ' SY-SUBRC.
exit.
ENDIF.
ENDFORM. " ERR_HDL -
How to get multiple header lines dynamically and also data hierarchically using ALV
Hi experts,
My requirement is shown below.. I neet to compare prices of service RFQs. So i design as below..
I want to get RFQ number ,Vendor code and vendor name in ALV header and also other headings which static. I think dynamic table is the best way to load RFQ numbers to header.. But problem is i'm unable to load two lines dynamically using ALV.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
i_style_table = 'X'
it_fieldcatalog = gt_dyn_fcat
IMPORTING
ep_table = gt_dyn_table
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
I use this function and pass RFQ no and vendor code in two rows but it output gt_dyn_table in same row.. How to print them as given image???
Then in data I want to get service items and according to the external service number divide them to groups and get sub totals and also finally total of all sub categories to compare each RFQs price to compare.. There i think ALV hierarch can use. but not sure I can use with dynamic table(in header use it).
What is thee best way to get the output in my image..??
Thanks..
PaviHi experts,
My requirement is shown below.. I neet to compare prices of service RFQs. So i design as below..
I want to get RFQ number ,Vendor code and vendor name in ALV header and also other headings which static. I think dynamic table is the best way to load RFQ numbers to header.. But problem is i'm unable to load two lines dynamically using ALV.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
i_style_table = 'X'
it_fieldcatalog = gt_dyn_fcat
IMPORTING
ep_table = gt_dyn_table
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
I use this function and pass RFQ no and vendor code in two rows but it output gt_dyn_table in same row.. How to print them as given image???
Then in data I want to get service items and according to the external service number divide them to groups and get sub totals and also finally total of all sub categories to compare each RFQs price to compare.. There i think ALV hierarch can use. but not sure I can use with dynamic table(in header use it).
What is thee best way to get the output in my image..??
Thanks..
Pavi -
Webdynpro :: Hierarchical ALV display
Hello All,
I am new to Webdynpro ABAP. I am having a problem in ALV Hierarchical List display.
As per my requirement, I need to display an ALV Hierarchical List with first column as Hierarchical column.
Hierarchical level shpuld be up to 6 levels.
I have made the table as Hierarchical table , set the column as hierarchy.
I am able to display only one node and one leaf.
Sample Code:
data : alv_config_table type ref to CL_SALV_WD_CONFIG_TABLE.
wd_this->alv_config_table->if_salv_wd_table_settings~set_display_type(
if_salv_wd_c_table_settings=>display_type_hierarchy ).
DATA : lr_column_hier TYPE REF TO cl_salv_wd_column.
lr_column_hier = wd_this->alv_config_table->if_salv_wd_column_settings~get_column( 'NODE_CONTENT' ).
lr_column_hier->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
Anyone can suggest, how I can display multi level hierarchy for the same column.
Thanks in advance for yours inputs.
Hari GajulaHi,
You can refer this article: [ALV and Standard Table as Hierarchy in Web Dynpro ABAP|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f].
I hope it helps.
Regards
Arjun -
Hi All,
I have developed ALV hierarchical report with check boxes for header and item records.
If i select header checkbox, the corresponding item records checkboxes should be selected automatically, here after selecting header checkbox i have to press some push button(like Refresh) then only item check boxes getting selected,
but here my req. is without clicking any button item checkboxes should be checked automatically if corresponding header check box is selected.
If anybody have an idea pls get back to me.
Regards,
AshwinHi,
Construct a field catalogue as follows:
DATA: z_fieldcat TYPE slis_fieldcat_alv
Then set the checkbox related fields fields like:
z_fieldcat-seltext_l = 'Checkbox'.
z_fieldcat-checkbox = 'X'. " Display this field as a checkbox
z_fieldcat-edit = 'X'. " This option ensures that you can
" edit the checkbox. Else it will
" be protected.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Jan 30, 2008 5:35 PM -
For all classes used in the alv reports.
we need the list of required classes used in alv reports this urgent .
please help me.Hi Navid,
Check <b>SLIS Package/Dev.Class for node Classes</b>,
here u will find all required <b>classes for ALV including ALV Hierarchical,AVL Tree, ALV HTML.</b>
Classes.
CL_ALVHT_HTMLINPUT-> ALV: HTML Input (Control Proxy)
CL_ALVHT_HTML_PAGE-> ALV HTML Page
CL_ALVHT_HTML_TEMPLATE-> ALV: HTML Templates
CL_ALVHT_TAGSTREAM-> ALV
CL_ALVHT_UI_ELEMENT-> ALV: HTML User Input Element
CL_ALV_BDS-> BDS Access and Data Retention
CL_ALV_CHANGED_DATA_PROTOCOL-> Message Log for Data Entry
CL_ALV_DD_DOUBLE_LISTBOX-> Management Class for two D&D List Boxes
CL_ALV_DD_LISTBOX-> D&D List Box
CL_ALV_EVENT_DATA-> Changing Data Container for Events
CL_ALV_EVENT_TOOLBAR_SET-> ALV Context Menu
CL_ALV_GRAPHICS-> ALV Graphic (Integration with GFW)
CL_ALV_GRAPHICS_CU-> Customizing of ALV Graphics
CL_ALV_LISTBOX_DRAGOBJ->
CL_ALV_OI BDS-> Access and Data Retention
CL_ALV_TABLE_CREATE-> Dynamic Creation of ALV Data Table
CL_ALV_TREE_BASE-> Basis Class ALV Tree Control
CL_ALV_VARIANT-> ALV Variant Management
CL_GUI_ALV_GRID-> ALV List Viewer
CL_GUI_ALV_GRID_BASE-> Basis Class for ALV Grid
CL_GUI_ALV_TREE-> ALV Tree Control
Regards,
Raghav
Message was edited by:
Raghavendra L -
Graphical display of hierarichal structure (ALV)
Hi Friends,
I have the requirement of displaying the hierarchical data in graphical mode. For this I am using the FM CNET_GRAPHIC_HIERARCHY, now the problem is that I want to navigate on to some screen when user clicks any node of the graphical structure , how I can capture the event of click on the node.
Kindly reply ASAP.
Thanks and regards,
Rachit KhannaHi Janagar,
My requirement is not to make the ALV hierarchical interactive. Basically i want the graphical mode of the hierarchical structure interactive.
To make more clear kindly execute the program RIEQUI10 , Enter the equipment number and then F8.
Now you will see the hierarchical report. Now follow the path GOTO --> Graphic a new window will now open with the Graphical view of the hierarchical list.
Now my requirement is to make a program that will output the current graph (this I have done) and when the user click on any node of the hierarchical tree it should call another screen. I am not able to understand how can I capture the click event when user clicks on any of the node. -
ALV Examples?????
Hi experts,
could anyone please tell me about any sap standard alv interactive report, if there are any?
Thanks and Regards,
RamanaHi,
i've listed some standard ALV Reports.this may help you
BALVEX02 ALV demo program: Output flights (simplest version)
BALVEXTR Extract management
BALVHD01 Demo program ALV: Hierarchical-sequential list flight model
BALVHD01_GROUP Demo program ALV: Hierarchical-sequential list flight model
BALVHT01 Test program ALV: hierarchical-sequential list flight model
BALVHTMAINTENANCE Report for manipulating HTML templates
BALVHTTRANSLHTMPL ALV: Report for automatic HTML template translation
BALVSD01 Demo program ALV: Simple list flight model
BALVSD02 ALV demo program: Output flights (simplest version)
BALVSD02_GRID Simple ALV grid control call in fullscreen mode
BALVSD02_SAVE Simple ALV call with storage option
BALVSD03 Simple list
BALVSD04 Simple list (merged)
BALVSD06 Demoprogram ALV: Output flights (simple version + save)
BALVSD11 Demo program ALV: Simple list with interactions and variants
BALVST01 Test program ALV: Simple list flight model
BALVST02 Test program ALV: Simple list flight model
BCALV_TEST_BLOCK_LIST Program BCALV_TEST_BLOCK_LIST
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
BCALV_TEST_EXCEL_DATATYPES FILTER Test Report
BCALV_TEST_FB_CREATE Test Report for Dynamic Generation of Tables
BCALV_TREE_01 ALV tree control: build up the hierarchy tree
BCALV_TREE_02 ALV tree control: event handling
Maybe you are looking for
-
Can No Longer Play DVDs of any Type
3-month old PB G4 15" 1.67Ghz. I was able to play commercial DVDs for about a week, and since January I haven't been able to play anything at all. I can play CDs and burn CDs, but when I insert a DVD, it shows up on the desktop, but DVD Player will n
-
How do I create a mouseover hotspot that changes the background color?
I'm creating an image gallery and want to know how to allow the viewer to change the background of the page with a mouseover hotspot. How would I go about doing this? Thanks in advance for any help.
-
I am having problems with using a cfstoredproc. I am trying to pass a character chain (cf_sql_varchar) but it gives me an error message. It doesn't like that I am passing a varchar. When I pass a numeric value, it works. I used to have the same code
-
Query regarding entity_type in eam_work_orders_v table
Hi All, This is regarding the Enterprise Asset Module in Oracle. I have the following 2 queries - select * from eam_work_orders_v where wip_entity_name = 'XYZ' and select * from wip_entities where wip_entity_name = 'XYZ' The first query does not retu
-
Where to find a tutorial for clusters and bundling by name?
I have a huge vi. I need data to flow from one multistep loop to another. I want to make it a subvi for another vi, but there are too many connections for it to be created. The help error suggests i use some clusters. I would like to view some basic