TREES IN ALV
HI ,
Can anybody suggest me how to create trees in alv......I seen the example codes for alv trees but all r given oops concept..since i dont know oops concept i feel difficult to understand the programs......so can anybody send me the example for creating trees using alv....
Regards,
Revathi
Hi Abaper,
I think this code will be useful for u.
report zsuma_tree1 .
type-pools:stree,fibs.
data:t_node type snodetext.
data:node_tab like t_node occurs 0 with header line.
node_tab-type = 'T'.
node_tab-name = 'N'.
node_tab-tlevel = '01'.
node_tab-nlength = '5'.
node_tab-color = '4'.
node_tab-text = 'Header level'.
node_tab-tlength = '20'.
node_tab-tcolor = '3'.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'N1-2'.
node_tab-tlevel = '02'.
node_tab-nlength = '5'.
node_tab-color = '4'.
node_tab-text = 'item leve1'.
node_tab-tlength = '20'.
node_tab-tcolor = '3'.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'N1-3'.
node_tab-tlevel = '03'.
node_tab-nlength = '5'.
node_tab-color = '4'.
node_tab-text = 'item leve2'.
node_tab-tlength = '20'.
node_tab-tcolor = '3'.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'N1-4'.
node_tab-tlevel = '04'.
node_tab-nlength = '5'.
node_tab-color = '4'.
node_tab-text = 'item leve3'.
node_tab-tlength = '20'.
node_tab-tcolor = '3'.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'N1-5'.
node_tab-tlevel = '04'.
node_tab-nlength = '5'.
node_tab-color = '4'.
node_tab-text = 'item leve3'.
node_tab-tlength = '20'.
node_tab-tcolor = '3'.
append node_tab.
clear node_tab.
node_tab-type = 'P'.
node_tab-name = 'N2-2'.
node_tab-tlevel = '02'.
node_tab-nlength = '5'.
node_tab-color = '4'.
node_tab-text = 'item leve1'.
node_tab-tlength = '20'.
node_tab-tcolor = '3'.
append node_tab.
clear node_tab.
call function 'RS_TREE_CONSTRUCT'
* EXPORTING
* INSERT_ID = '000000'
* RELATIONSHIP = ' '
* LOG =
tables
nodetab = node_tab
exceptions
tree_failure = 1
id_not_found = 2
wrong_relationship = 3
others = 4
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'RS_TREE_LIST_DISPLAY'
exporting
* CALLBACK_PROGRAM =
* CALLBACK_USER_COMMAND =
* CALLBACK_TEXT_DISPLAY =
* CALLBACK_MOREINFO_DISPLAY =
* CALLBACK_COLOR_DISPLAY =
* CALLBACK_TOP_OF_PAGE =
* CALLBACK_GUI_STATUS =
* CALLBACK_CONTEXT_MENU =
* STATUS = 'IMPLICIT'
* CHECK_DUPLICATE_NAME = '1'
* COLOR_OF_NODE = '4'
* COLOR_OF_MARK = '3'
* COLOR_OF_LINK = '1'
* COLOR_OF_MATCH = '5'
* LOWER_CASE_SENSITIVE = ' '
* MODIFICATION_LOG = ' '
* NODE_LENGTH = 30
* TEXT_LENGTH = 75
* TEXT_LENGTH1 = 0
* TEXT_LENGTH2 = 0
return_marked_subtree = 'X'
* SCREEN_START_COLUMN = 0
* SCREEN_START_LINE = 0
* SCREEN_END_COLUMN = 0
* SCREEN_END_LINE = 0
* SUPPRESS_NODE_OUTPUT = ' '
* LAYOUT_MODE = ' '
use_control = 'F' "we can use P(print),L(list),
"D(dynpro) also.
* IMPORTING
* F15 =
Similar Messages
-
Report with ALV tree and ALV list?
I need to create a report with layout as same as this one
[http://trangiegie.com/MyFile/output.JPG]
It looks like a report with combination of ALV tree and list. The tree works like a navigation bar. Wonder if there are any demo programs like this. Will appreciate any help.For Tree alone - You can check program : BCALV_TREE_02
Program Name Report title
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
BCALV_TEST_SIMPLE_TREE Program BCALV_TEST_SIMPLE_TREE
BCALV_TREE_01 ALV Tree Control: Build Up the Hierarchy Tree
BCALV_TREE_02 ALV Tree Control: Event Handling
BCALV_TREE_03 ALV Tree Control: Use an Own Context Menu
BCALV_TREE_04 ALV Tree Control: Add a Button to the Toolbar
BCALV_TREE_05 ALV Tree Control: Add a Menu to the Toolbar
BCALV_TREE_06 ALV tree control: Icon column and icon for nodes/items
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_DND ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_DND_MULTIPLE ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_EVENT_RECEIVER Include BCALV_TREE_EVENT_RECEIVER
BCALV_TREE_EVENT_RECEIVER01
BCALV_TREE_ITEMLAYOUT ALV Tree: Change Item Layouts at Runtime
BCALV_TREE_MOVE_NODE_TEST Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO Program BCALV_TREE_SIMPLE_DEMO
BCALV_TREE_VERIFY Verifier for ALV Tree and Simple ALV Tree -
Tree OOPS ALV - Need to display header & items of the sales order in oops
HI,
I need to display some of the header fields of the sales order & items in the oops alv, could you please let me know how to achieve this. I know FM - 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' but how to achieve this through oops alv.
Thanksit is not possible with that function in OO .
you can try with class cl_salv_hierseq_table
Just check this Rich's article
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0f03986-046c-2910-a5aa-e5364e96ea2c
if you don't want that then you may have to use ALV tree. -
How to make column tree the ALV
As in normal table we can make column tree by using 'TreeByNestingTableColumn' property, can any one tell me how to do the same in alv.
I have used set_hierarchy_column( abap_true ), but i was not able to map all the elements with in a node to other columns present in the alv table.
requirement:
Column 1 Column 2
P1 value 1
->C1 value 2
-> C11 value 3
-> C12 value 4
->C2 value 5
-> C21 value 6
-> C22 value 7
P2 value 8
Can some please tell me how to do it.
Thanks
AbhishekCan some one please help me!!
I need to implement column tree in web dynpro application using ALV -
Coloring column in an ALV tree
Hi all,
What I want to do is set background color for columns in a tree-view ALV(class cl_gui_alv_tree). However no matter how I set the field EMPHASIZE in the fieldcatalog internal table, the display of the ALV tree keeps unchange. Anyone can help me on this?
Thanks,
Chen ChangHi,
<b>If u want to change the node colr in ALV tree do as follows</b>
Adding Root Nodes for the tree.
Key:
NODE_KEY, RELATKEY, RELATSHIP, HIDDEN, DISABLED, ISFOLDER, N_IMAGE,
EXP_IMAGE, <b>STYLE</b>, LAST_HITEM, NO_BRANCH, EXPANDER, DRAGDROPID, TEXT
perform f9101_node_list using: '1' 'ROOT' '' '' '' c_x '' '' '' '' ''
c_x '' text-003.
Adding subitems for the root node.
perform f9101_node_list using:
Material Details
'MATRL' '1' '' '' '' '' '' '' '' '' '' '' ''
text-001,
Document Details
'DOCU' '1' '' '' '' '' '' '' '' '' '' '' ''
text-002.
form f9101_node_list using value(pnodekey)
value(prelatkey)
value(prelatship)
value(phidden)
value(pdisabled)
value(pisfolder)
value(pimage)
value(pexpimage)
value(pstyle)
value(plastitem)
value(pnobranch)
value(pexpander)
value(pdragdropid)
value(ptext).
w_nodes-node_key = pnodekey.
w_nodes-relatkey = prelatkey.
w_nodes-relatship = prelatship. "Natural number
w_nodes-hidden = phidden.
w_nodes-disabled = pdisabled.
w_nodes-isfolder = pisfolder.
w_nodes-n_image = pimage. "Icons / embedded bitmap
w_nodes-exp_image = pexpimage. "Icons / embedded bitmap
<b> w_nodes-style = pstyle.</b> w_nodes-last_hitem = plastitem. "Tree Control: Column Name / Item
"Name
w_nodes-no_branch = pnobranch.
w_nodes-expander = pexpander.
w_nodes-dragdropid = pdragdropid.
w_nodes-text = ptext.
append w_nodes to i_nodes.
endform. " f9101_node_list
Try changing the style so that u can change the column color.
If u want that in ALV grid
1. different color in line of alv
2. Coloring Cells/rows in ALV Grid.
Got this from forum
report .
Use of colours in ALV grid (cell, line and column) *
Table
tables : mara.
Type
types : begin of ty_mara,
matnr like mara-matnr,
matkl like mara-matkl,
counter(4) type n,
free_text(15) type c,
color_line(4) type c, " Line color
color_cell type lvc_t_scol, " Cell color
end of ty_mara.
Structures
data : wa_mara type ty_mara,
wa_fieldcat type lvc_s_fcat,
is_layout type lvc_s_layo,
wa_color type lvc_s_scol.
Internal table
data : it_mara type standard table of ty_mara,
it_fieldcat type standard table of lvc_s_fcat,
it_color type table of lvc_s_scol.
Variables
data : okcode like sy-ucomm,
w_alv_grid type ref to cl_gui_alv_grid,
w_docking_container type ref to cl_gui_docking_container.
parameters : p_column as checkbox,
p_line as checkbox,
p_cell as checkbox.
at selection-screen output.
perform get_data.
perform fill_catalog.
if w_docking_container is initial.
perform create_objects.
endif.
*& Form create_objects
form create_objects.
create object w_docking_container
exporting
ratio = 60
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
create object w_alv_grid
exporting
i_parent = w_docking_container.
Field that identify color line in internal table
move 'COLOR_LINE' to is_layout-info_fname.
Field that identify cell color in inetrnal table
move 'COLOR_CELL' to is_layout-ctab_fname.
call method w_alv_grid->set_table_for_first_display
exporting
is_layout = is_layout
changing
it_outtab = it_mara
it_fieldcatalog = it_fieldcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
endform.
*& Form get_data
form get_data.
select * from mara up to 5 rows.
clear : wa_mara-color_line, wa_mara-color_cell.
move-corresponding mara to wa_mara.
add 1 to wa_mara-counter.
move 'Blabla' to wa_mara-free_text.
if wa_mara-counter = '0002'
and p_line = 'X'.
Color line move 'C410' to wa_mara-color_line.
elseif wa_mara-counter = '0004'
and p_cell = 'X'.
Color cell
move 'FREE_TEXT' to wa_color-fname.
move '6' to wa_color-color-col.
move '1' to wa_color-color-int.
move '1' to wa_color-color-inv.
append wa_color to it_color.
wa_mara-color_cell[] = it_color[].
endif.
append wa_mara to it_mara.
endselect.
endform.
*& Form fill_catalog
form fill_catalog.
Colour code : *
Colour is a 4-char field where : *
- 1st char = C (color property) *
- 2nd char = color code (from 0 to 7) *
0 = background color *
1 = blue *
2 = gray *
3 = yellow *
4 = blue/gray *
5 = green *
6 = red *
7 = orange *
- 3rd char = intensified (0=off, 1=on) *
- 4th char = inverse display (0=off, 1=on) *
Colour overwriting priority : *
1. Line *
2. Cell *
3. Column *
data : w_position type i value '1'.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATNR' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATNR' to wa_fieldcat-ref_field.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATKL' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATKL' to wa_fieldcat-ref_field.
Color column
if p_column = 'X'.
move 'C610' to wa_fieldcat-emphasize.
endif.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'COUNTER' to wa_fieldcat-fieldname.
move 'N' to wa_fieldcat-inttype.
move '4' to wa_fieldcat-intlen.
move 'Counter' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'FREE_TEXT' to wa_fieldcat-fieldname.
move 'C' to wa_fieldcat-inttype.
move '20' to wa_fieldcat-intlen.
move 'Text' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
endform.
Check this link to get code for different colors http://www.sapdesignguild.org/resources/ma_guidelines/VisualDesignRules/colors.html
Try this out the same thing will work for Reuse also.
Thanks & Regards,
Judith.
Message was edited by: Judith Jessie Selvi -
How to alter the alv tree node text?
hi
i want to alter the alv tree node text, many people say it cann't be changed, but
i look into the sample code 'BCALV_TREE_04', the average funtion(select a column and then select average function in the tool bar) can alter the tree node text dynamically.
i try to look into the source code, the it's the sap standard code, all the funtions that user input, it goes to the statement " CALL METHOD cl_gui_cfw=>dispatch.", and i don't understand what this statement do, can someone helps me?hi
good
The ALV tree report produces uses OBJECT METHOD functionality in-order to produce a
tree structured ALV output.
The creation of an ALVtree report first requires the creation of a simple program to build the ALV
details such as the fieldcatalog and to call a screen which will be used to display the ALVTree.
The screen should be created with a 'custom control' where you wish the ALVtree report to appear.
For the following example it will have the name 'SCREEN_CONTAINER'.
http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
reward point if helpful.
thanks
mrutyun^ -
Example for 4 or 3 level Hierarchail Seq ALV report?
i need the example for 4 or 3 level heirarchial sequential ALV report. ?
Hi,
Hierarchail Seq ALV may not support 3rd 4th levels.For this type of requirement you may go to tree report.
Refer the below links for tree report.
[http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm|http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm]
DWDM - transaction for sample/demo programs for controls
sample Program
BCALV_TREE_01 ALV Tree Control: Build Up the Hierarchy Tree
BCALV_TREE_02 ALV Tree Control: Event Handling
BCALV_TREE_03 ALV Tree Control: Use an Own Context Menu
BCALV_TREE_04 ALV Tree Control: Add a Button to the Toolbar
BCALV_TREE_05 ALV Tree Control: Add a Menu to the Toolbar
BCALV_TREE_06 ALV tree control: Icon column and icon for nodes/items
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_DND ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_DND_MULTIPLE ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_EVENT_RECEIVER Include BCALV_TREE_EVENT_RECEIVER
BCALV_TREE_EVENT_RECEIVER01
BCALV_TREE_ITEMLAYOUT ALV Tree: Change Item Layouts at Runtime
BCALV_TREE_MOVE_NODE_TEST Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO Program BCALV_TREE_SIMPLE_DEMO
BCALV_TREE_VERIFY Verifier for ALV Tree and Simple ALV Tree
Reward if found helpful.
Regards,
Boobalan Suburaj -
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 -
ALV Header and details in the report
Hi Experts,
I have the following requirements for the report:
Company Code: -->Report Header
Plant:
Posting Date:
Material Jan Amount Feb Amount March Amount --> Header info
Sales order number Delivery dates Order dates Qty UOM Amount -->Details Info
1234 1,000.00 500.00 300.00 --> Header info
0001 02/02/2008 01/02/2008 10 PC 60.00 -->Details Info
0002 02/03/2008 01/02/2008 5 PC 30.00
0003 02/03/2008 01/02/2008 12 PC 70.00
0004 02/04/2008 01/02/2008 14 PC 90.00
0005 02/06/2008 01/02/2008 10 PC 60.00
5678 2,000.00 400.00 300.00 --> Header info
0001 02/02/2008 01/02/2008 10 PC 60.00 -->Details Info
0002 02/03/2008 01/02/2008 5 PC 30.00
0003 02/03/2008 01/02/2008 12 PC 70.00
0004 02/04/2008 01/02/2008 14 PC 90.00
0005 02/06/2008 01/02/2008 10 PC 60.00
the report should look like the one above. How can I develop this in ALV Grid or List? Thanks so much!
Best Regards,
KurttHi,
You can use Hierarchial ALV.
Refer:-
BCALV_TREE_01 ALV : tree control: build up the hierarchy tree
BCALV_TREE_DND ALV : tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_DND_MULTIPLE ALV : tree control: Drag & Drop within a hierarchy tree
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
How to Display Sub-Columns using ALV Grid
Hi ,
Could someone tell me how to display sub-columns under a parent column using ALV Grid. Do we have any standard Program which has this scenario. Please let me know.
Thanks,
Abaper.
Message was edited by:
ABAP'eryou can check all with <b>BCALV* or RSDEMO*</b> in SE38 for all Std
check below
BCALV_DND_01 Drag ALV Row to Tree Folder
BCALV_DND_02 Drag Icons from Tree to Rows of the Grid
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
Rewards if useful............
Minal -
How to make checkbox to be pre-selected in ALV
Hi all!
I`m creating ALV report and I want to create checkbox in the first column of the row. So I have a field SEL(1) in my structure and I`ve made the fieldcat:
gs_fcat-col_pos = 5.
gs_fcat-coltext = 'Check'.
gs_fcat-fieldname = 'SEL'.
gs_fcat-tabname = 'GT_TREE9001'.
gs_fcat-outputlen = 10.
gs_fcat-checkbox = 'X'.
gs_fcat-edit = 'X'.
That works, checkbox is displayed.
But now I need to make all the checkboxes to be checked for the first start of my program.
I mean when user executes my report all the checkboxes must be checked by default.
I have tried to do following:
loop at gt_tree9001.
gs_tree9001-sel = 'X'.
modify gt_tree9001 from gs_tree9001.
endloop.
But it doesnt work, I now see checkbox and mark 'X' near but not the checked ckeckbox.
Any help appreciated!Solved.
My final code:
data: lv_tree_size TYPE i,
ls_layout_item TYPE lvc_s_laci,
lt_layout_item TYPE lvc_t_laci,
lv_ind TYPE LVC_INDEX.
CLEAR ls_layout_item.
ls_layout_item-fieldname = 'SEL'.
ls_layout_item-class = cl_gui_column_tree=>item_class_checkbox.
ls_layout_item-editable = 'X'.
ls_layout_item-u_class = 'X'.
ls_layout_item-u_editable = 'X'.
ls_layout_item-u_chosen = 'X'.
ls_layout_item-chosen = 'X'.
append ls_layout_item to lt_layout_item.
call method g_tree9001->set_table_for_first_display
EXPORTING
i_save = 'A'
is_variant = ls_variant
CHANGING
it_sort = gt_sort9001
it_outtab = gt_tree9001
it_fieldcatalog = gt_treefcat9001.
DESCRIBE TABLE gt_tree9001 LINES lv_tree_size.
DO lv_tree_size TIMES.
CALL METHOD G_TREE9001->CHANGE_LAYOUT
EXPORTING
I_OUTTAB_INDEX = sy-index
IT_ITEM_LAYOUT = lt_layout_item .
ENDDO.
The main trick is in u_class, u_editable, u_chosen. These params say that layout should be changed. Only this way it will work.
And some helpful links:
ALV tree get selected checkbox
Checkbox ALV Tree CL_GUI_ALV_TREE
ALV TREE-Checkbox
CL_GUI_ALV_TREE and Checkboxes
Report BCALV_TREE_ITEMLAYOUT is also very helpful. -
Reg:expansion of fields(Tree method)
hiii,
can u guys tell me fm for alv tree grid method to expand the fields at the output,n also i need sample code of alv tree grid display.plz help me out.
with regards,
sumanth reddy
Edited by: sumanth reddy on Mar 23, 2009 12:17 PMhi,
check out these standard programs on ALV.
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
BCALV_TEST_SIMPLE_TREE Program BCALV_TEST_SIMPLE_TREE
BCALV_TREE_01 ALV Tree Control: Build Up the Hierarchy Tree
BCALV_TREE_02 ALV Tree Control: Event Handling
BCALV_TREE_03 ALV Tree Control: Use an Own Context Menu
BCALV_TREE_04 ALV Tree Control: Add a Button to the Toolbar
BCALV_TREE_05 ALV Tree Control: Add a Menu to the Toolbar
BCALV_TREE_06 ALV tree control: Icon column and icon for nodes/
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_DND ALV tree control: Drag & Drop within a hierarchy
BCALV_TREE_DND_MULTIPLE ALV tree control: Drag & Drop within a hierarchy
BCALV_TREE_EVENT_RECEIVER Include BCALV_TREE_EVENT_RECEIVER
BCALV_TREE_EVENT_RECEIVER01
BCALV_TREE_ITEMLAYOUT ALV Tree: Change Item Layouts at Runtime
BCALV_TREE_MOVE_NODE_TEST Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO Program BCALV_TREE_SIMPLE_DEMO
BCALV_TREE_VERIFY Verifier for ALV Tree and Simple ALV Tree
You would get you required information
Regards
Sharath -
Drag from tree to Drop on button
Hi Expert,
I want to drag data from a tree and drop it to button.Pls suggest how we do that.
Please do help.
Thanks and Regards.
Swatantra PathakHi
Have you checked these programs:
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
Regards
Neha -
Tree structure format in report.
Hi all,
I have got a report to develop where in i have to display the ouptut of the report
in a tree structure.Can anybody tell me how to proceed with this ?? This is
basically an interactive report where clicking on one of the node will take us to
another page.
Thanks and Regards.
syed.HI
Refer this code.
REPORT YMS_ALVTREEDEMO .
*Data Declaration
TABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
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,
it_ekpo TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
it_emptytab TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko,
wa_ekpo TYPE t_ekko.
DATA: ok_code like sy-ucomm, "OK-Code
save_ok like sy-ucomm.
*ALV data declarations
DATA: fieldcatalog TYPE lvc_t_fcat WITH HEADER LINE.
DATA: gd_fieldcat TYPE lvc_t_fcat,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv.
*ALVtree data declarations
CLASS cl_gui_column_tree DEFINITION LOAD.
CLASS cl_gui_cfw DEFINITION LOAD.
DATA: gd_tree TYPE REF TO cl_gui_alv_tree,
gd_hierarchy_header TYPE treev_hhdr,
gd_report_title TYPE slis_t_listheader,
gd_logo TYPE sdydo_value,
gd_variant TYPE disvariant.
*Create container for alv-tree
DATA: l_tree_container_name(30) TYPE c,
l_custom_container TYPE REF TO cl_gui_custom_container.
*Includes
*INCLUDE ZDEMO_ALVTREEO01. "Screen PBO Modules
*INCLUDE ZDEMO_ALVTREEI01. "Screen PAI Modules
*INCLUDE ZDEMO_ALVTREEF01. "ABAP Subroutines(FORMS)
*Start-of-selection.
START-OF-SELECTION.
ALVtree setup data
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM build_hierarchy_header CHANGING gd_hierarchy_header.
PERFORM build_report_title USING gd_report_title gd_logo.
PERFORM build_variant.
Display ALVtree report
call screen 100.
*& Form DATA_RETRIEVAL
Retrieve data into Internal tables
FORM data_retrieval.
SELECT ebeln
UP TO 10 ROWS
FROM ekko
INTO corresponding fields of TABLE it_ekko.
loop at it_ekko into wa_ekko.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
FROM ekpo
appending TABLE it_ekpo
where ebeln eq wa_ekko-ebeln.
endloop.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
Please not there are a number of differences between the structure of
ALVtree fieldcatalogs and ALVgrid fieldcatalogs.
For example the field seltext_m is replace by scrtext_m in ALVtree.
fieldcatalog-fieldname = 'EBELN'. "Field name in itab
fieldcatalog-scrtext_m = 'Purchase Order'. "Column text
fieldcatalog-col_pos = 0. "Column position
fieldcatalog-outputlen = 15. "Column width
fieldcatalog-emphasize = 'X'. "Emphasize (X or SPACE)
fieldcatalog-key = 'X'. "Key Field? (X or SPACE)
fieldcatalog-do_sum = 'X'. "Sum Column?
fieldcatalog-no_zero = 'X'. "Don't display if zero
APPEND fieldcatalog TO gd_fieldcat.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-scrtext_m = 'PO Iten'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-scrtext_m = 'Status'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-scrtext_m = 'Item change date'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-scrtext_m = 'Material Number'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 4.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-scrtext_m = 'PO quantity'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 5.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-scrtext_m = 'Order Unit'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 6.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-scrtext_m = 'Net Price'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 7.
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO gd_fieldcat..
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-scrtext_m = 'Price Unit'.
fieldcatalog-outputlen = 15.
fieldcatalog-col_pos = 8.
APPEND fieldcatalog TO gd_fieldcat..
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 build_hierarchy_header
build hierarchy-header-information
-->P_L_HIERARCHY_HEADER structure for hierarchy-header
FORM build_hierarchy_header CHANGING
p_hierarchy_header TYPE treev_hhdr.
p_hierarchy_header-heading = 'Hierarchy Header'(013).
p_hierarchy_header-tooltip = 'This is the Hierarchy Header !'(014).
p_hierarchy_header-width = 30.
p_hierarchy_header-width_pix = ''.
ENDFORM. " build_hierarchy_header
*& Form BUILD_REPORT_TITLE
Build table for ALVtree header
<-> p1 Header details
<-> p2 Logo value
FORM build_report_title CHANGING
pt_report_title TYPE slis_t_listheader
pa_logo TYPE sdydo_value.
DATA: ls_line TYPE slis_listheader,
ld_date(10) TYPE c.
List Heading Line(TYPE H)
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-key "Not Used For This Type(H)
ls_line-info = 'PO ALVTree Display'.
APPEND ls_line TO pt_report_title.
Status Line(TYPE S)
ld_date(2) = sy-datum+6(2).
ld_date+2(1) = '/'.
ld_date3(2) = sy-datum4(2).
ld_date+5(1) = '/'.
ld_date+6(4) = sy-datum(4).
ls_line-typ = 'S'.
ls_line-key = 'Date'.
ls_line-info = ld_date.
APPEND ls_line TO pt_report_title.
Action Line(TYPE A)
CLEAR ls_line.
ls_line-typ = 'A'.
CONCATENATE 'Report: ' sy-repid INTO ls_line-info SEPARATED BY space.
APPEND ls_line TO pt_report_title.
ENDFORM.
*& Form BUILD_VARIANT
Build variant
form build_variant.
Set repid for storing variants
gd_variant-report = sy-repid.
endform. " BUILD_VARIANT
Check these programs.
e.g
BCALV_TREE_01 ALV tree control: build up the hierarchy tree
BCALV_TREE_02 ALV tree control: event handling
BCALV_TREE_03 ALV tree control: use an own context menu
BCALV_TREE_04 ALV tree control: add a button to the toolbar
BCALV_TREE_05 ALV tree control: add a menu to the toolbar
BCALV_TREE_06 ALV tree control: Icon column and icon for nodes/items
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_DND ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_DND_MULTIPLE ALV tree control: Drag & Drop within a hierarchy tree
RSDEMO_DRAG_DROP_TREE_MULTI
BCALV_TREE_EVENT_RECEIVER Include BCALV_TREE_EVENT_RECEIVER
BCALV_TREE_EVENT_RECEIVER01
BCALV_TREE_ITEMLAYOUT ALV Tree: Change Item Layouts at Runtime
BCALV_TREE_MOVE_NODE_TEST Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO Program BCALV_TREE_SIMPLE_DEMO
BCALV_TREE_VERIFY Verifier for ALV Tree and Simple ALV Tree
Reward all helpfull answers.
Regards.
Jay -
hello everyone,
I want to out put to alv list with three hierarchy,is there any way to solve this problem?
for example:
1.CAUFV-AUFNR CAUFV-PLNBEZ
2.AFVC-VORNR CRHD-ARBPL AFVC-LTXA1
3.RESB-MATNR RESB-BDMNG RESB-MEINS
AND AT NEW AUFNR SUM.
thanks a million1
regards
davidzhang.Hi,
for this requirement, best you should go to Tree alv.
Check the below links for alv Tree.
[http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm|http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm]
DWDM - transaction for sample/demo programs for controls
check the below example program are in se38
BCALV_GRID_DND_TREE ALV Grid: Drag and Drop with ALV Tree
BCALV_GRID_DND_TREE_SIMPLE ALV GRID: Drag and drop with ALV tree (simple)
BCALV_TEST_COLUMN_TREE Program BCALV_TEST_COLUMN_TREE
BCALV_TEST_SIMPLE_TREE Program BCALV_TEST_SIMPLE_TREE
BCALV_TREE_01 ALV Tree Control: Build Up the Hierarchy Tree
BCALV_TREE_02 ALV Tree Control: Event Handling
BCALV_TREE_03 ALV Tree Control: Use an Own Context Menu
BCALV_TREE_04 ALV Tree Control: Add a Button to the Toolbar
BCALV_TREE_05 ALV Tree Control: Add a Menu to the Toolbar
BCALV_TREE_06 ALV tree control: Icon column and icon for nodes/items
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_DND ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_DND_MULTIPLE ALV tree control: Drag & Drop within a hierarchy tree
BCALV_TREE_EVENT_RECEIVER Include BCALV_TREE_EVENT_RECEIVER
BCALV_TREE_EVENT_RECEIVER01
BCALV_TREE_ITEMLAYOUT ALV Tree: Change Item Layouts at Runtime
BCALV_TREE_MOVE_NODE_TEST Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO Program BCALV_TREE_SIMPLE_DEMO
BCALV_TREE_VERIFY Verifier for ALV Tree and Simple ALV Tree
Regards,
SB
Maybe you are looking for
-
I have a text file which is just 1 line Nick, Price, Mr, 29/12/83, 64 Borrat Way, 07776243523, 001, M00184769I am trying to split this line, and each of the splits going into their own variable e.g. Nick goes into String firstName. I have done
-
Can I set up wireless internet and a wireless printer at the same time?
I have an AirPort Express configured already which allows wireless access to the internet (as it is connected to my broadband router) but can I also configure it to allow wireless printer sharing at the same time? I would appreciate an answer on this
-
Adapter issue or battery issue?
My brand new Macbook Pro is occasionally not charging. Is it an issue with the adapter or battery? Anyone experiencing this same problem? Please help!!
-
Sleep problem after upgrading to Lion
I have a late 2009 MBP with 2 user accounts setup. I normally log out of my user account and then close lid which puts it in sleep with the indicator light blinking. Now after updating to Lion, it doesn't seem to go to sleep, the light is constantl
-
Apple TV failed to find service connection url?
Anyone know why I cannot get into my iTunes account from my Apple TV. I keep getting a connection failed message "failed to find service connection URL". Wifi network working just fine and I can access my account from pc no problem.