Setid hierarchy
Hi Folks,
My requirement is to get an hierarchy from a setid.I need to display the balances against each company code and the output should look like this.
Legal
CA A B B-A
4001 $2000 $4000 $2000
4002 $3000 $4000 $1000
4003 $2000 $4000 $2000
Subtotal $5000
NE
3500 $2000 $4000 $2000
3501 $2000 $4000 $2000
Subtotal $4000
NY
2500 $2000 $4000 $2000
Subtotal $2000
Total $11000
The values are taken from different tables.
The hierarchy is from a setid (transaction code:GS03)
This is an alv report i guess and there will be a drilldown option in the next stage.
Please provide me any sample code if possible.
Thanks and regards.
this is hierarchy compare report...Change it according to ur requirement.
REPORT y_hierarchies_in_tables
NO STANDARD PAGE HEADING.
PARAMETER: g_group TYPE grpname. " DEFAULT 'Z_GLAB0000'.
DATA:
g_setid TYPE setid,
g_class TYPE setclass.
DATA: lt_hier TYPE STANDARD TABLE OF sethier,
lt_val TYPE STANDARD TABLE OF setvalues.
DATA: hier LIKE sethier OCCURS 0 WITH HEADER LINE,
val LIKE setvalues OCCURS 0 WITH HEADER LINE,
setinfo LIKE setinfo OCCURS 0 WITH HEADER LINE.
DATA: zaccbas(20) TYPE c OCCURS 0 WITH HEADER LINE.
DATA: miss_val LIKE setvalues-from OCCURS 0 WITH HEADER LINE.
DATA: table_name TYPE tabname,
field_name TYPE setfld.
DATA: ambiguity_flag TYPE c.
Ambiguity check
PERFORM ambiguity_check.
Display Records
PERFORM display_records.
*& Form AMBIGUITY_CHECK
Ambiguity check
FORM ambiguity_check .
DATA: it_abaplist LIKE abaplist OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF it_ascilist OCCURS 0,
zeile(256) TYPE c,
END OF it_ascilist.
DATA: flag.
SUBMIT rgsovl00 "VIA SELECTION-SCREEN
WITH p_shrtn = g_group
WITH path = 'X'
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = it_abaplist
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listasci = it_ascilist
listobject = it_abaplist
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3 .
LOOP AT it_ascilist.
IF it_ascilist-zeile = text-001.
flag = 'X'.
ENDIF.
IF flag = 'X' AND
it_ascilist-zeile = text-002.
ambiguity_flag = 'X'.
CLEAR flag.
ENDIF.
ENDLOOP.
FREE MEMORY.
ENDFORM. " AMBIGUITY_CHECK
*& Form DISPLAY_RECORDS
Display the Records
FORM display_records .
PERFORM get_records.
PERFORM header_data.
PERFORM item_data.
ENDFORM. " DISPLAY_RECORDS
*& Form GET_RECORDS
Get all the Node values
FORM get_records .
Get the ID name for the Hierarchy
CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
EXPORTING
shortname = g_group
setclass = g_class
old_setid = g_setid
IMPORTING
new_setid = g_setid.
Get the Table and Field name for the Top Node
CALL FUNCTION 'G_SET_GET_INFO'
EXPORTING
setname = g_setid
no_set_title = 'X'
use_table_buffer = 'X'
IMPORTING
info = setinfo.
table_name = setinfo-tabname.
field_name = setinfo-fld.
Get all the Nodes for the Hierarchy
CALL FUNCTION 'G_SET_TREE_IMPORT'
EXPORTING
no_descriptions = ' '
no_rw_info = 'X'
setid = g_setid
TABLES
set_hierarchy = lt_hier
set_values = lt_val.
hier[] = lt_hier.
val[] = lt_val.
SELECT (field_name) FROM (table_name) INTO TABLE zaccbas.
LOOP AT zaccbas.
READ TABLE val WITH KEY FROM = zaccbas.
IF sy-subrc = 0.
DELETE zaccbas.
CLEAR zaccbas.
DELETE val INDEX sy-tabix.
CLEAR val.
ENDIF.
ENDLOOP.
ENDFORM. " GET_RECORDS
*& Form HEADER_DATA
Header Data
FORM header_data .
DATA: desc TYPE settext.
READ TABLE hier WITH KEY fieldname = field_name
shortname = g_group.
IF sy-subrc = 0.
desc = hier-descript.
ENDIF.
SKIP.
WRITE: 'Node :',g_group.
WRITE:75 'User name :', sy-uname.
WRITE:/ 'Description :', desc.
WRITE:75 'Date:', sy-datum.
WRITE:/ 'Table Name :' , table_name.
WRITE:75 'Time:', sy-timlo.
WRITE:/ 'Field Name :', field_name.
write:75 'Client:', SY-MANDT.
skip.
IF ambiguity_flag = 'X'.
WRITE:/ 'Ambiguity Check :'. WRITE: 'Success' COLOR 5.
ELSE.
WRITE:/ 'Ambiguity Check :'. WRITE: 'Failed' COLOR 6 .
ENDIF.
WRITE:/ sy-uline.
WRITE:/37 'Validation for Hierarchy'.
WRITE:/ sy-uline.
ENDFORM. " HEADER_DATA
*& Form ITEM_DATA
Output Report for Nodes
FORM item_data .
IF NOT zaccbas[] IS INITIAL.
WRITE:/ 'Missing Records from Hierarchy' COLOR 3.
LOOP AT zaccbas.
WRITE:/ zaccbas.
ENDLOOP.
ENDIF.
IF NOT val[] IS INITIAL.
SKIP 1.
WRITE:/ 'Additional Records in Hierarchy' COLOR 3.
LOOP AT val.
WRITE:/ val-from. ", 28 val-DESCRIPT.
ENDLOOP.
ELSEIF ZACCBAS[] IS INITIAL.
WRITE:/ 'No Missing Records Found' COLOR 3.
ENDIF.
ENDFORM. " ITEM_DATA
Similar Messages
-
Check whether element exists in hierarchy
Hi together,
I've got a profit center hierarchy in BW and I need to develop a function module to check, whether a profit center exists under a certain hierarchy node.
Does anyone has an approach how to do that?
Kind regards
StefanHI Stefan,
You can do it in 2 ways:-
<b>1)</b> Use the Function Module <b>'G_SET_TREE_IMPORT'</b>
<b> CALL FUNCTION 'G_SET_TREE_IMPORT'
EXPORTING
no_descriptions = ' '
no_rw_info = 'X'
setid = p_setid
TABLES
set_hierarchy = lt_hier
set_values = lt_val.</b>
here, in lt_hier table you will get all the Nodes and in lt_val talbe you will get all the values under that nodes, so loop the lt_val Internal talbe and see whether the value is existed or not.
<b>2)</b> you can use SETNODE and SETLEAF tables to get the value and the Hierarchy Node.
i will show the way how to do this
By using the Fm you will get all the nodes and the values, so loop that internal tales and get waht you want and if you want to check a profit center then use the table SETLEAF, you will get the child node, then use the SETNODE to get the next node for that node. do like this up to get the parent node.
Hope you understand my point
Regards
Sudheer -
HR Reporting - Position Hierarchy
All,
I am looking to report salaries of all positions in a hierarchy format. The only hierarchy we currently have for HR is Org Unit. Is there a way to report within BW with standard content with this requirement?
Example:
Supervisor | Supervisor Salary | SUM[Supervisor Salary, Salary 1, Salary 2...]
Subordinate 1 | Salary 1
Subordinate 2 | Salary 2
Please advise.
Thanks,
DCDid you try doing the below steps
In Section 3.3.2.3 'How to Configure Department Trees and Business Unit Trees', the task should include the following additional configuration steps:
In DAC, go to the Design view, and select the appropriate custom container from the drop-down list.
Display the Tasks tab.
Select the task SDE_PSFT_InternalOrganizationDimension_Department, and display the Parameters subtab.
Use the $$TREE_SETID parameter to specify the tree set ID in the format '<setid>'.
Wrap the setid value in single quotation marks.If you have multiple trees, separate them using a comma. For example: 'SHARE', 'US', 'EU'.The default value of this parameter is 'SHARE'.
The above steps are mentioned in Release Notes
I had a similar issue and got it resolved by doing this. -
Profit Center Hierarchy Level in ABAP-HR
I am working on an ABAP-HR report related to Organisation management.
There is a requirement wherein I need to retrieve data from a Profit Center Hierarchy Level .Can u please advice me on this.
Thanks in advance,
Raja.Hi ,
(i_name is the entered profit center group name)
Get the internal name of the entered profit center hierarchy.
CALL FUNCTION 'G_SET_LIST_SELECT'
EXPORTING
SETCLASS = '0106'
SHORTNAME = I_NAME
KOKRS = 'MIT '
KTOPL = 'HEUS'
TABLES
MATCHING_SETS = T_SETLIST.
IF T_SETLIST[] IS INITIAL.
MESSAGE E002(SY) WITH 'Profit Center group does not exist'.
EXIT.
ELSE.
READ TABLE T_SETLIST INDEX 1.
ENDIF.
Get the entered profit center hierarchy info.
CALL FUNCTION 'G_SET_TREE_IMPORT'
EXPORTING
SETID = T_SETLIST-SETNAME
TABLES
SET_HIERARCHY = T_SETHIER
SET_VALUES = T_SETVALUES
EXCEPTIONS
SET_NOT_FOUND = 1
ILLEGAL_FIELD_REPLACEMENT = 2
ILLEGAL_TABLE_REPLACEMENT = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE E002(SY) WITH 'Profit Center group does not exist'.
EXIT.
ENDIF.
or try one of these
FC_PRCTR_HIERARCHY
TXW_EXTRACT_CO_PCTR_HIERARCHY
Regards,
pankaj singh.
Message edited by pankaj singh -
Need profit center HIERARCHY FM
Hello Experts,
I know the profit center and profit center group. Could you tell me which function module i have to use to get the complete hierarchy?
Regards,
AmitHi,
<i>(i_name is the entered profit center group name)</i>
Get the internal name of the entered profit center hierarchy.
CALL FUNCTION 'G_SET_LIST_SELECT'
EXPORTING
SETCLASS = '0106'
SHORTNAME = I_NAME
KOKRS = 'MIT '
KTOPL = 'HEUS'
TABLES
MATCHING_SETS = T_SETLIST.
IF T_SETLIST[] IS INITIAL.
MESSAGE E002(SY) WITH 'Profit Center group does not exist'.
EXIT.
ELSE.
READ TABLE T_SETLIST INDEX 1.
ENDIF.
<i>
Get the entered profit center hierarchy info.</i>
CALL FUNCTION 'G_SET_TREE_IMPORT'
EXPORTING
SETID = T_SETLIST-SETNAME
TABLES
SET_HIERARCHY = T_SETHIER
SET_VALUES = T_SETVALUES
EXCEPTIONS
SET_NOT_FOUND = 1
ILLEGAL_FIELD_REPLACEMENT = 2
ILLEGAL_TABLE_REPLACEMENT = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE E002(SY) WITH 'Profit Center group does not exist'.
EXIT.
ENDIF.
Regards
Sudheer -
HR Analytics - Organization hierarchy
Hi,
Need some help in configuring Department Based Organization hierarchy in OBIA 7.9.6.3… Im implementing OBIA HR Analytics with Peoplesoft as the data source...
After installation and configuration we loaded the data in the warehouse. But W_INT_ORG_DH table is not loaded… I somehow feel that the parameter values we set for $$TREE_SETID_NAME_LIST and $$TREE_STRUCT_ID_LIST are not correct…
Documentation doesn’t say from which table we need to query to get the values for these parameters…But the source tables to load dwh table are PS_DEPT_TBL, PSTREESTRCT, PSTREENODE, PSTREELEVEL.
We don’t know which column I should query to set the parameters…
Could you please let me know the table and column in Peoplesoft to set these parameter values..
thanks & regards,
dmazeDid you try doing the below steps
In Section 3.3.2.3 'How to Configure Department Trees and Business Unit Trees', the task should include the following additional configuration steps:
In DAC, go to the Design view, and select the appropriate custom container from the drop-down list.
Display the Tasks tab.
Select the task SDE_PSFT_InternalOrganizationDimension_Department, and display the Parameters subtab.
Use the $$TREE_SETID parameter to specify the tree set ID in the format '<setid>'.
Wrap the setid value in single quotation marks.If you have multiple trees, separate them using a comma. For example: 'SHARE', 'US', 'EU'.The default value of this parameter is 'SHARE'.
The above steps are mentioned in Release Notes
I had a similar issue and got it resolved by doing this. -
Where can I find a tutorial about Show Folders Hierarchy?
I have Permiere Elements 11 which also has the Elements Organizer as part of the program. And I have Photoshop Elements 10 also. The Elements Organizer with the video editing program is what I'm interested in though. I think my folder hierarchy is not right. I'd like to straighten it out but I don't know how. Can someone direct me to a tutorial on how to work with the Folders Hierarchy.
This might be a different question, but it might be related to my confusion about the Folder Hierarchy in the Organizer. On June 10 I was copying some photos from my hard drive to the Organizer - probably a dumb thing to do. While I was doing this, the Pictures folder (View and organizes digital pictures) no longer took me to all my photos on the hard drive. The Pictures folder is under Personal Folder, Documents, Music, Control Panel on the Windows 7 desktop to the right of the Start Menus stuff.
When I click on Pictures now I get two folders: Adobe and Pictures. The Adobe folder has these values - Size: 0 bytes; Contains: 0 Files, 1 Folder; Created: Monday, June 10, 2013; Attributes: Read-only (only applies to files in the folder. I deleted the Abobe folder several times but it keeps coming back.
What I would really like to do is to restore my Pictures folder to its original state so that I will have access to all my hard drive photos immediately instead of clicking around in those folders. I vaguely think that something I did to the folder hierarchy in the Optimizer has messed up other things on my computer.You wrote, "So if you moved the files, what you need to do is move them back..."
I don't know how to do this. Could you tell me how. I moved about 50 photos into the Organizer. Now I know I should not have done this. I'd like to correct the mistake.
When I click on the Show Folder List icon this is what I see:
My Pictures
Pictures
Faces
Clowns
My Videos
Computer
C:
Program Data
Users
Tommy
Faces
Dancing
Faces
Lovers
Racing
Tommy
Pictures
D
E
F
G
This makes no sense to me. But I could live with it - except perhaps something I did has made my PrE11 impossible to work with. When I put new clips via the memory card into the program, they do not go into the Timeline. All I get is an error message.
I like the Adobe programs and don't want to give up on them, especially since my problems probably have been self-imposed. -
Hiding a hierarchy column in graph view
Hi All,
In an compound layout I would like to have pivot view and bar chart view.
There are two hierarchy columns in criteria. These column should display in pivot view.
My requirement is to hide the hierarchy columns in Bar chart view and can we apply separate selection steps for each view.
Kindly help me..
Thanks,
HareeHi,
Edit the pivot table and graph and at the below you can see the selection steps for the individual components. So that you can give separately for each of the components.
Hope this helped/ answered.
Regards
MuRam -
When we are loading a hierarchy in the BW system, we get the following error :
Error in the hierarchy structure: see error log.
We tried activation of the hierarchy data source then rerun the load. Still it fails with the same error.
Please let us knwo if any one has inputs regarding the same.Please go through the following SAP Notes.
[Note 1266877 - BW hierarchy error when loading|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1266877]
[Note 384945 - BW: Incorrect hierarchy extraction for 0REOBJ|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=384945]
You will also find plent of threads with the same issue. Just search with the key words from the Error Log.
Regards,
Gaurav -
Error while assigning a foreign hierarchy characteristic
Hi Guys,
When trying to insert a characteristic node to a hierarchy, it gives me an error saying 'info object OHIER_NODE not entered for /SI/SS_O356(where the hierarchy is being maintained) as a foreign hierarchy characteristic' .Is there anything else that i need to maintain ?
Can someone please help me get out of this message
award will be provide for correct answer
ThanksHi,
Have you got the solution for your problem? .If so, may i know how did you solved it.
If not, please do not make thread as answered ,it misguide us that you got solution.
With rgds,
Anil Kumar Sharma .P -
Creation of new product hierarchy and products in SAP CRM.
Dear all,
please help with resolving of following issue:
In CRM system base hierarchies were replicated from R/3 system with materials. Current requirement is to create new materials in CRM directly (as standalone scenario). As far as I understand, I have to create new hierarchy with required list of set types in order to allow creation of products in CRM directly (product type = material). Can anybody describe changes in the system step by step, what should be changed and where?
As a result I need to have a possibility to create products in CRM directly for sales scenario processing.
Thank you in advance!Hi Jorge,
thank you so much for your reply!
Here what I tried to do:
1. I created new category in hierarchy R3PRODSTYP, added 3 set types: COMM_PR_MAT, COMM_PR_SHTEXT, COMM_PR_UNIT as basic set types.
2. In the SPRO - Cross-Application Components - SAP Product - Settings for Product Type - Number Assignment - Define Number Ranges for the Product Type "Material" I found my new product category is unassigned, so I assigned it to the "CRM Products" group.
3. Farther I tried to create a new product for created category in CRM Web UI, but was not able to find it in the Base category search field. All categories correctly displayed from R3PRODSTYP, but my new category is absent. What can be the reason of category absence? Btw, it cannot be found even when I try to display whole hierarchy in Web UI, however, in SAP GUI, it can be seen via tcode comm_hierarchy.
Here is the setup of hierarchies in the system:
I have no idea how to check #3 "Ensure the hierarchy is assigned to CRM application".
Can you please suggest, what should be changed in addition? Thank you! -
Hi Bridge Geniuses!
I need your help. I am using Bridge to sort and keyword a pretty big photo archive. I have created a pretty long nested hierarchy (4 layers deep, max) and, for a few reasons, would like the parent tags to be automatically included when I indicate a sub-tag. The problem I have now is that the keyword list is distractingly long and organized alphabetically. My first question is this: is there a preference setting in Bridge that will ask the program to display the keywords in their hierarchy? That is, will Bridge present the list as, for example, cars à hybrids à Toyotas à Prius.
My second question is: if I have two or more names that represent the same keyword, is there an “aka” function in this program that will allow me to direct searches for two or more different words to the same keyword entry? (For example, if I want my searches for “Bruce Wayne” to also show entries marked as “Batman.”)
Finally, I would like to know if Bridge will perform keyword searches for more than one word at a time. So far, I have tried entering two keywords with overlap at a time, separated by a space or a comma or a semicolon, and the search comes up empty.
Thank you very much for your help!I reset my custom workspace and all seems to be well now. My keywords now show, the number of photos each applies to and I can again search.
Thank you. -
Error while uploading data from a flat file to the hierarchy
Hi guys,
after i upload data from a flat file to the hierarchy, i get a error message "Please select a valid info object" am loading data using PSA, having activated all external chars still get the problem..some help on this please..
regards
Srithere is o relation of infoobject name in flat file and infoobjet name at BW side.
please check with the object in the BW and their lengths and type of the object and check your flat file weather u have the same type there,
now check the sequence of the objects in the transfer rules and activate them.
there u go. -
Why I can not find field:Level in Project Hierarchy in BAPI_BUS2054_NEW?
Dear experts,
Why I can not find the field of "Level in Project Hierarchy" in structure BAPI_BUS2054_NEW?
I only define the data to upload wbs:
PROJECT DEFINITION
PROJECT DESCRIPTION
PROJECT PROFILE
WBS Element
WBS description
Can you tell me which fields must to upload?
Looking forward to your reply.
Many thanks.
MerryzhangAnyone can help me ?I need the field "Level" in BAPI_BUS2054_NEW,But I can not find it.
-
I have hierarchy data in R/3 side how will i load that data from R/3 to BW
Hi all,
i have my hierarchy data in the R/3 side how will i load that data from R/3 to BW side
Regard
Kiran KumarHi Kiran,
Here is the procedure:
1. In the Data Warehousing Workbench under Modeling, select the InfoSource tree.
2. Select the InfoSource (with direct update) for the InfoObject, to which you want to load the hierarchy.
3. Choose Additional Functions® Create Transfer Rules from the context menu of the hierarchy table object for the InfoObject. The Assign Source System dialog box appears.
4. Select the source system from which the hierarchy is to be loaded. The InfoSource maintenance screen appears.
○ If the DataSource only supports the transfer method IDoc, then only the transfer structure is displayed (tab page DataSource/Transfer Structure).
○ If the DataSource also supports transfer method PSA, you can maintain the transfer rules (tab page Transfer Rules).
If it is possible and useful, we recommend that you use the transfer method PSA and set the indicator Expand Leaf Values and Node InfoObjects. You can then also load hierarchies with characteristics whose node name has a length >32.
5. Save your entries and go back. The InfoSource tree for the Data Warehousing Workbench is displayed.
6. Choose Create InfoPackage from the context menu (see Maintaining InfoPackages). The Create InfoPackage dialog box appears.
7. Enter the description for the InfoPackage. Select the DataSource (data element Hierarchies) that you require and confirm your entries.
8. On the Tab Page: Hierarchy Selection, select the hierarchy that you want to load into your BI system.
Specify if the hierarchy should be automatically activated after loading or be marked for activation.
Select an update method (Full Update, Insert Subtree, Update Subtree).
If you want to load a hierarchy from an external system with BAPI functionality, make BAPI-specific restrictions, if necessary.
9. If you want to load a hierarchy from a flat file, maintain the tab page: external data.
10. Maintain the tab page: processing.
11. Maintain the tab page: updating.
12. To schedule the InfoPackage, you have the following options:
○ (Manually) in the scheduler, see Scheduling InfoPackages
○ (Automatically) using a process chain (see Loading Hierarchies Using a Process Chain)
When you upload hierarchies, the system carries out a consistency check, making sure that the hierarchy structure is correct. Error messages are logged in the Monitor. You can get technical details about the error and how to correct it in the long text for the respective message.
For more info visit this help pages on SAP Help:
http://help.sap.com/saphelp_nw04s/helpdata/en/80/1a6729e07211d2acb80000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/3d/320e3d89195c59e10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6729e07211d2acb80000e829fbfe/frameset.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4dae0795-0501-0010-cc96-fe3a9e8959dc
Cheers,
Habeeb
Maybe you are looking for
-
Records missing in data load.
Hi All, we have one load(DSO-->CUBE). EX: In DSO for customer number 1 there are 20 entries. after uploading the data into Cube for this customer only 2 or 3 records loading into cube. after applying the delete source package conditions at tran
-
How to update screensaver that no longer works with Leopard or Snow Leopard
Hello. I have a favorite screen saver that would no longer work when I installed Leopard...and it also does not work with Snow Leopard either. Can anyone tell me if I might be able to fix it and make it Snow Leopard compatible? Could I possibly open
-
How to display data in tableview based on a dropdown filter selection
Hi All, I have implemented a flow logic based BSP page to display the SFLIGHTS table when I open this page it displays all records in the table SFLIGHTS. I would like the set a drop down box filter on CARRID and CONNIND. Only once the user selects th
-
SCAM ATTEMPT in AFRICA/GHANA
On Syke desktop June/July 2015: Scammer's email: [e-mail removed for privacy and security] Shut this scammers Skype and Gmail accounts. A semi-literate person in GHANA called DAVID, pretends to be a CAPTAIN EDMONSTON, US ARMY who is attempting a swin
-
Problem with search method in AM called from JSP
Hi, im trying to get the real value from an foreign key of a view, and i have been created a custom search method in the AM, but i got a problem, the search only get results the first time that is called, the next times gets null result : public Stri