‎2007 Oct 22 4:55 PM
Hi all !!
I need to get the Orders related to an Order Group.
I read that I can use the function K_HIERARCHY_TABLES_READ.. But I dont know how to do it..
The Orders are in table: AFIH and field: AUFNR.
I found "Order group" may be in table: SETLEAF, using '0103' in Setclass field.
Please help..
Tranks !!
JCO.
Message was edited by:
jco
Title was edited by:
Alvaro Tejada Galindo
‎2007 Oct 22 5:06 PM
Hi
use the fun module
G_SET_TREE_IMPORT
concatenate class subclass and group and pass to setid and take the group_tab and group_tab values(2 internal tables)
call function 'G_SET_TREE_IMPORT'
exporting
CLIENT = SY-MANDT
FIELDNAME = ' '
LANGU = SY-LANGU
NO_DESCRIPTIONS = ' '
NO_RW_INFO = ' '
setid = p_setid
TABNAME = ' '
NO_VARIABLE_REPLACEMENT = ' '
ROOT_HEADER_ONLY = ' '
NO_TABLE_BUFFERING = ' '
MAX_HIER_LEVEL = 99
DATE_FROM =
DATE_TO =
IMPORTING
SET_NOT_TRANSPARENT =
tables
set_hierarchy = group_tab
set_values = value_tab
EXCEPTIONS
SET_NOT_FOUND = 1
ILLEGAL_FIELD_REPLACEMENT = 2
ILLEGAL_TABLE_REPLACEMENT = 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.
endform. "frm_g_set_tree_import
Regards
Anji
‎2007 Oct 22 5:06 PM
Hi
use the fun module
G_SET_TREE_IMPORT
concatenate class subclass and group and pass to setid and take the group_tab and group_tab values(2 internal tables)
call function 'G_SET_TREE_IMPORT'
exporting
CLIENT = SY-MANDT
FIELDNAME = ' '
LANGU = SY-LANGU
NO_DESCRIPTIONS = ' '
NO_RW_INFO = ' '
setid = p_setid
TABNAME = ' '
NO_VARIABLE_REPLACEMENT = ' '
ROOT_HEADER_ONLY = ' '
NO_TABLE_BUFFERING = ' '
MAX_HIER_LEVEL = 99
DATE_FROM =
DATE_TO =
IMPORTING
SET_NOT_TRANSPARENT =
tables
set_hierarchy = group_tab
set_values = value_tab
EXCEPTIONS
SET_NOT_FOUND = 1
ILLEGAL_FIELD_REPLACEMENT = 2
ILLEGAL_TABLE_REPLACEMENT = 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.
endform. "frm_g_set_tree_import
Regards
Anji
‎2007 Oct 22 8:30 PM
Thanks.. but im still lost..
Do you have an example on how to pass the parameters and how to get them back?
Im newbie
)
‎2007 Oct 22 8:42 PM
Try:
DATA: c_info LIKE grphinfo,
c_overwrite LIKE sy-datar.
CALL FUNCTION 'K_HIERARCHY_TABLES_READ'
EXPORTING
e_class = '0103'
e_setid = setid
e_kokrs = '0001'
e_mandt = sy-mandt
e_master_data = 'XXX'
e_structure = 'X X0200'
e_replace_class = space
e_replace_unit = space
e_suffix = space
e_old_line_level = 1 "l_ol_level
TABLES
t_nodes = it_ceg_nodes
t_values = it_ceg_values
CHANGING
c_info = c_info
c_overwrite = c_overwrite
EXCEPTIONS
no_controlling_area = 1
no_chart_of_account = 2
different_controlling_areas = 3
different_chart_of_accounts = 4
set_not_found = 5
illegal_field_replacement = 6
illegal_table_replacement = 7
fm_raise = 8
convert_error = 9
no_overwrite_standard_hier = 10
no_bukrs_for_kokrs = 11
OTHERS = 12.
Rob