WBS hierarchy not working in BAPI_PROJECT_MAINTAIN
I have created the following code. Before I added the section for the hierarchy table the structure was created ok, but with all WBS elements at level 1.
Now I have added the entries into the hierarchy table I am getting an error when I run BAPI_PROJECT_MAINTAIN.
The error message is CN 189 E - A reference object cannot be entered for the method 'Update'
I'd appreciate it if someone can see what I have done wrong.
Many thanks
Karen
Code **
wa_method_project-REFNUMBER = '00001'.
wa_method_project-OBJECTTYPE = 'WBS-Element'.
wa_method_project-METHOD = 'Create'.
wa_method_project-OBJECTKEY = wbs1.
append wa_method_project to i_method_project.
wa_method_project-REFNUMBER = '00002'.
wa_method_project-OBJECTTYPE = 'WBS-Element'.
wa_method_project-METHOD = 'Create'.
wa_method_project-OBJECTKEY = wbs2.
append wa_method_project to i_method_project.
wa_method_project-REFNUMBER = '00003'.
wa_method_project-OBJECTTYPE = 'WBS-Element'.
wa_method_project-METHOD = 'Create'.
wa_method_project-OBJECTKEY = wbs3.
append wa_method_project to i_method_project.
move-corresponding t_bid_definition to wa_WBS_ELEMENT_TABLE.
wa_WBS_ELEMENT_TABLE-PROJ_TYPE = 'BD'.
wa_WBS_ELEMENT_TABLE-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = 'X'.
wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs1.
wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_WBS_ELEMENT_TABLE-DESCRIPTION = t_bid_definition-DESCRIPTION.
append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs2.
wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_WBS_ELEMENT_TABLE-DESCRIPTION = 'WBS description 1'.
append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs3.
wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_WBS_ELEMENT_TABLE-DESCRIPTION = 'WBS Description 2'.
append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
clear wa_WBS_ELEMENT_TABLE.
wa_project_definition_upd-project_definition =
t_bid_definition-PROJECT_DEFINITION.
append wa_project_definition_upd to i_project_definition_upd.
wa_method_project-METHOD = 'Save'.
append wa_method_project to i_method_project.
clear: wa_method_project.
This is the section I added that stopped the thing working *****************
Create correct WBS Hierarchy
wa_method_project-OBJECTTYPE = 'WBS-Hierarchy'.
wa_method_project-METHOD = 'Create'.
append wa_method_project to i_method_project.
clear: wa_method_project.
wa_wbs_hierarchie_table-WBS_ELEMENT = wbs1.
wa_wbs_hierarchie_table-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_wbs_hierarchie_table-DOWN = wbs2.
append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
clear wa_wbs_hierarchie_table.
wa_wbs_hierarchie_table-WBS_ELEMENT = wbs2.
wa_wbs_hierarchie_table-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_wbs_hierarchie_table-UP = wbs1.
wa_wbs_hierarchie_table-RIGHT = wbs3.
append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
clear wa_wbs_hierarchie_table.
wa_wbs_hierarchie_table-WBS_ELEMENT = wbs3.
wa_wbs_hierarchie_table-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_wbs_hierarchie_table-LEFT = wbs2.
append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
clear wa_wbs_hierarchie_table.
CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
EXPORTING
i_project_definition = t_bid_definition
tables
i_method_project = i_method_project
I_WBS_ELEMENT_TABLE = I_WBS_ELEMENT_TABLE
I_WBS_HIERARCHIE_TABLE = i_wbs_hierarchie_table
E_MESSAGE_TABLE = i_bapi_message.
Here is the final code.
The Project Definition is created before you do this bit using BAPI_PROJECTDEF_CREATE which is where the entries for t_bid_definition come from.
I hope this helps
Karen
data: wbs1 type ps_posid,
wbs2 type ps_posid,
wbs3 type ps_posid.
clear: wbs1, wbs2, wbs3.
wbs1 = 'WBS1'.
wbs2 = 'WBS2'.
wbs3 = 'WBS3'.
wa_method_project-REFNUMBER = '00001'.
wa_method_project-OBJECTTYPE = 'WBS-Element'.
wa_method_project-METHOD = 'Create'.
wa_method_project-OBJECTKEY = wbs1.
append wa_method_project to i_method_project.
clear: wa_method_project.
wa_method_project-REFNUMBER = '00002'.
wa_method_project-OBJECTTYPE = 'WBS-Element'.
wa_method_project-METHOD = 'Create'.
wa_method_project-OBJECTKEY = wbs2.
append wa_method_project to i_method_project.
clear: wa_method_project.
wa_method_project-REFNUMBER = '00003'.
wa_method_project-OBJECTTYPE = 'WBS-Element'.
wa_method_project-METHOD = 'Create'.
wa_method_project-OBJECTKEY = wbs3.
append wa_method_project to i_method_project.
clear: wa_method_project.
move-corresponding t_bid_definition to wa_WBS_ELEMENT_TABLE.
wa_WBS_ELEMENT_TABLE-PROJ_TYPE = 'XX'.
wa_WBS_ELEMENT_TABLE-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = 'X'.
wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs1.
wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_WBS_ELEMENT_TABLE-DESCRIPTION = 'WBS 1 description'.
append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
wa_WBS_ELEMENT_TABLE-WBS_PLANNING_ELEMENT = ''.
wa_WBS_ELEMENT_TABLE-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = 'X'.
wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs2.
wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_WBS_ELEMENT_TABLE-DESCRIPTION = ''WBS 2 description'.
append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
wa_WBS_ELEMENT_TABLE-WBS_ELEMENT = wbs3.
wa_WBS_ELEMENT_TABLE-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_WBS_ELEMENT_TABLE-DESCRIPTION = ''WBS 3 description'.
append wa_WBS_ELEMENT_TABLE to i_WBS_ELEMENT_TABLE.
clear wa_WBS_ELEMENT_TABLE.
wa_project_definition_upd-project_definition =
t_bid_definition-PROJECT_DEFINITION.
append wa_project_definition_upd to i_project_definition_upd.
Create correct WBS Hierarchy
wa_method_project-OBJECTTYPE = 'WBS-Hierarchy'.
wa_method_project-METHOD = 'Create'.
append wa_method_project to i_method_project.
clear: wa_method_project.
wa_method_project-METHOD = 'Save'.
append wa_method_project to i_method_project.
clear: wa_method_project.
wa_wbs_hierarchie_table-WBS_ELEMENT = wbs1.
wa_wbs_hierarchie_table-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_wbs_hierarchie_table-DOWN = wbs2.
ppend wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
clear wa_wbs_hierarchie_table.
wa_wbs_hierarchie_table-WBS_ELEMENT = wbs2.
wa_wbs_hierarchie_table-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_wbs_hierarchie_table-UP = wbs1.
wa_wbs_hierarchie_table-RIGHT = wbs3.
append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
clear wa_wbs_hierarchie_table.
wa_wbs_hierarchie_table-WBS_ELEMENT = wbs3.
wa_wbs_hierarchie_table-PROJECT_DEFINITION =
t_bid_definition-PROJECT_DEFINITION.
wa_wbs_hierarchie_table-UP = wbs1.
wa_wbs_hierarchie_table-LEFT = wbs2.
append wa_wbs_hierarchie_table to i_wbs_hierarchie_table.
clear wa_wbs_hierarchie_table.
CALL FUNCTION 'ZBAPI_PROJECT_MAINTAIN'
EXPORTING
i_project_definition = t_bid_definition
tables
i_method_project = i_method_project
I_WBS_ELEMENT_TABLE = I_WBS_ELEMENT_TABLE
I_WBS_HIERARCHIE_TABLE = i_wbs_hierarchie_table
E_MESSAGE_TABLE = i_bapi_message.
Message was edited by:
Karen Dean
Similar Messages
-
Webi report on OLAP Bex query - Cost element Hierarchy not working Drill down
Hello,
We have a BO report on Bex query, Not on universe, we have a Hierarchy for Cost Element Group, and we are expecting the Drill down functionality for that in BO report, but it does not.
Webi report on OLAP Bex query - Cost element Hierarchy not working Drill down
Any pointers how to do it please
Thanks
KrishnaHi,
WebI reports on BEx source don't use same Drill feature as other sources, it's replaced by expland/collapse of hierarchy nodes (documented in WebI user guide in § "24.1 Drill defined"). This means you have to create query which selects all hierarchy sub-tree you plan on exploring later in report, otherwise if no data is available under a node there will be no '+/-' sign to visit this part of tree.
You could try first to select "All members" from hierarchy in QueryPanel and see if behavior in report suits your needs. Then you should restrict hierarchy member selection to what's really needed to avoid performance issues.
Regards,
Loic -
Hierarchy not working at report
Hi
I have created level based hierarchy in RPD on one dimension table, but hierarchy is not working in report level.
Can any one help.
ThanksHi
Actually we are not getting any error message.
But when we have enabled hierarchy on particular column, when we are using that column in report it should be getting some under line when we place cursor on that column data and when we click on one of the specified data we might be getting data related to that particular data. But it is not happening like that and we are able to see data as normal column data. This is my issue.
Please suggest
Thanks -
Modelling of hierarchy not working
Hi All,
As per the link given below
http://help.sap.com/saphelp_nw70/helpdata/EN/43/f4fab876eb7062e10000000a1553f6/content.htm
I have created a query in BI7.0
enabled the hierarchy display
created the model with with 2 buttons just as mentioned in the link.
But still drill down & drill up functionality is not working.
Please provide pointers for resolution.
Hoping for immediate replies.
Thanks & Regards,
Rashmi.Hi,
I am modeling hierarchy of 0EMPLOYEE.
I have created the model just as given in the article.
Whenever I go to some node & press drill down, cursor automatically comes to the top most node but no drill down happens,
whereas if I press Drill up & drill down from top most node it works only for first time i.e. once.
can this issue be due to patch problem? or is there something that i am missing?
My formulas for Drilldown :
'FILTER_NODE_IOBJNM=0HIER_NODE;FILTER_VALUE= '&#ID[ACC7GR]@Employee_key&';FILTER_COLLAPSE= ;FILTER_IOBJNM=0EMPLOYEE;CMD_1=CMD%3DDRILL_TO_LEVEL%26LEVEL%3D2%26IOBJNM%3D0EMPLOYEE%26DATA_PROVIDER%3DDP;'
for Drillup :
'CMD_1=CMD%3DDRILL_TO_LEVEL%26LEVEL%3D'&NSTR(#ID[ACC7GR]@Employee_node_level,'B')&'%26IOBJNM%3D0EMPLOYEE%26DATA_PROVIDER%3DDP;'
Kindly provide the pointers.
Thanks,
Rashmi. -
Input help for cost center & WBS element not working
Hi ALL
We are using SRM 4.0 with backend ECC 5.0.
Input help for attributes cost center (CNT), WBS element (PRO) are not functioning.
When tried to search for input help (F4) on the above attributes, I am getting message "Display not possible (Inconsistency in the input help)".
I even applied SAP note 746788 for cost center search help.
Can you tell me if I have missed any config settings?
Thanks in advance
JagdishHi,
Did you managed the transactional RFC destination in the customizing (where you define all your log. systems it is an additional field in the table control).
Regards.
Vadim -
Dimension with Parent-Child Hierarchy - not working
hi,
i tried making "Dimension with Parent-Child Hierarchy" as described in your tutorials.
i finished with the admin tool and database changes and with no errors.
when trying to create a new answer, by only puting the hierarchy column in the answer.
the result show "no result" exist.
i am not sure what i am doing wrong. maybe you can point me to the problem?
thanks
Mirit.956850 wrote:
hi,
i tried making "Dimension with Parent-Child Hierarchy" as described in your tutorials.
i finished with the admin tool and database changes and with no errors.
when trying to create a new answer, by only puting the hierarchy column in the answer.
the result show "no result" exist.
i am not sure what i am doing wrong. maybe you can point me to the problem?
thanks
Mirit.Hi Mirit,
What is the table that you created hierarchy on?
Which column in the hierarchy you pulled into your reports to see the No Result message?
Please query the table and see if has data.
Thanks,
G. SK -
Mssql2012 - traversing hierarchy not working as expected. please advise.
Techies--
When I try to look for descendent organizations, I am seeing the level I am descending from and the descendents (screen shot). I did not expect to see the row hightlighted.
When I try to find the ancestor on level 1 for OrgId 3, I don't receive any rows. I expected to see only the highlighted row. I have either generated the data incorrectly, or I am thinking about hierarchies in a wrong way.
Here is the sql for the queries
-- query#1 (descendents)
declare @OrgIdofInterest hierarchyid
select @OrgIdofInterest = OrgNode
from [stakeholder].OrganizationInheritance
where OrgId =2;
SELECT
orgtree.OrgNode.ToString() AS Text_OrgNode,
orgtree.OrgNode,
orgtree.OrgLevel,
orgtree.OrgId
FROM stakeholder.OrganizationInheritance orgtree
where OrgNode.IsDescendantOf(@OrgIdofInterest) = 1
-- query #2 (ancestor[s])
declare @NewOrgIdofInterest hierarchyid
select @NewOrgIdofInterest = OrgNode
from [stakeholder].OrganizationInheritance
where OrgId = 3;
SELECT
orgtree.OrgNode.ToString() AS Text_OrgNode,
orgtree.OrgNode,
orgtree.OrgLevel,
orgtree.OrgId
FROM stakeholder.OrganizationInheritance orgtree
where OrgNode.GetAncestor(1) = @NewOrgIdofInterest
Here is the build SQL for the tables and stored proc.
use [scratchdb]
go
ALTER TABLE stakeholder.OrganizationInheritance
DROP CONSTRAINT FK_OrganizationInheritance_OrganizationType
GO
ALTER TABLE stakeholder.OrganizationInheritance
DROP CONSTRAINT FK_OrganizationInheritance_Organization
GO
ALTER TABLE stakeholder.Organization
DROP CONSTRAINT FK_Organization_OrganizationType
GO
ALTER TABLE stakeholder.OrganizationInheritance
DROP CONSTRAINT UQ__Organiza__420C9E6DA211482A
GO
ALTER TABLE stakeholder.OrganizationInheritance
DROP CONSTRAINT PK_OrganizationInheritance
GO
ALTER TABLE stakeholder.Organization
DROP CONSTRAINT PK_Organization
GO
DROP INDEX stakeholder.OrganizationInheritance.OrganizationNode
GO
DROP TABLE stakeholder.OrganizationInheritance
GO
DROP TABLE stakeholder.Organization
GO
CREATE TABLE stakeholder.Organization (
OrgId int IDENTITY NOT NULL,
LegacyOrgCode nvarchar(50) NULL,
CustomIdentifier nvarchar(50) NULL,
OrgTypeId int NULL,
OrgShortName nvarchar(50) NULL,
OrgName nvarchar(200) NULL,
OrgURL nvarchar(300) NULL,
associationYears smallint NULL
GO
CREATE TABLE stakeholder.OrganizationInheritance (
OrgNode hierarchyid NOT NULL,
OrgLevel smallint NULL,
OrgId int NOT NULL,
OrgName varchar(200) NOT NULL,
OrgTypeId int NOT NULL
GO
SET IDENTITY_INSERT stakeholder.Organization ON
GO
INSERT INTO stakeholder.Organization(OrgId, LegacyOrgCode, CustomIdentifier, OrgTypeId, OrgShortName, OrgName, OrgURL, associationYears)
VALUES(-1, N'-1', N'', 1, N'All Fleets', N'ALL FLEETS', NULL, NULL)
GO
INSERT INTO stakeholder.Organization(OrgId, LegacyOrgCode, CustomIdentifier, OrgTypeId, OrgShortName, OrgName, OrgURL, associationYears)
VALUES(1, N'506', NULL, 1, N'S', N'S-0', NULL, NULL)
GO
INSERT INTO stakeholder.Organization(OrgId, LegacyOrgCode, CustomIdentifier, OrgTypeId, OrgShortName, OrgName, OrgURL, associationYears)
VALUES(2, N'626', NULL, 1, N'JJ Inc.', N'JJ-0', NULL, NULL)
GO
INSERT INTO stakeholder.Organization(OrgId, LegacyOrgCode, CustomIdentifier, OrgTypeId, OrgShortName, OrgName, OrgURL, associationYears)
VALUES(3, N'69066', NULL, 1, N'JJ-Northeast', N'JJ-1-A', NULL, NULL)
GO
INSERT INTO stakeholder.Organization(OrgId, LegacyOrgCode, CustomIdentifier, OrgTypeId, OrgShortName, OrgName, OrgURL, associationYears)
VALUES(4, N'70809', NULL, 1, N'JJ-Southeast', N'JJ-1-B', NULL, NULL)
GO
SET IDENTITY_INSERT stakeholder.Organization OFF
GO
CREATE PROCEDURE [stakeholder].[AddOrganizationInheritance]
@topOrgId int,
@Orgid int,
@OrgName varchar(100),
@OrgTypeId int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @mOrgNode hierarchyid, @lc hierarchyid
SELECT @mOrgNode = OrgNode
FROM UnifiedStakeholder.stakeholder.OrganizationInheritance
WHERE OrgId = @topOrgId
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
BEGIN TRANSACTION
SELECT @lc = max(OrgNode)
FROM UnifiedStakeholder.stakeholder.OrganizationInheritance
WHERE OrgNode.GetAncestor(1) =@mOrgNode ;
INSERT UnifiedStakeholder.stakeholder.OrganizationInheritance
(OrgNode, OrgId, OrgName, OrgTypeId)
VALUES(@mOrgNode.GetDescendant(@lc, NULL), @OrgId, @OrgName, @OrgTypeId)
COMMIT
END
GO
insert UnifiedStakeholder.stakeholder.OrganizationInheritance
(OrgNode, OrgId,OrgName,OrgTypeId)
values (hierarchyid::GetRoot(),-1,'ALL FLEETS',1)
GO
insert UnifiedStakeholder.stakeholder.OrganizationInheritance
(OrgNode, OrgId,OrgName,OrgTypeId)
values (@Fleet.GetDescendant(NULL,NULL),1,'S',1)
GO
-- // Note: I could have this wrong. I think I'm putting in the level above the level I want as @topOrgId.
exec unifiedstakeholder.stakeholder.AddOrganizationInheritance -1,2,'JJ Inc.',1
GO
exec unifiedstakeholder.stakeholder.AddOrganizationInheritance 2,3,'JJ-Northeast',1
GO
exec unifiedstakeholder.stakeholder.AddOrganizationInheritance 2,4,'JJ-Southeast',1
GO
CREATE UNIQUE INDEX OrganizationNode
ON stakeholder.OrganizationInheritance(OrgNode, OrgLevel)
WITH FILLFACTOR = 95
GO
ALTER TABLE stakeholder.Organization
ADD CONSTRAINT PK_Organization
PRIMARY KEY (OrgId)
GO
ALTER TABLE stakeholder.OrganizationInheritance
ADD CONSTRAINT PK_OrganizationInheritance
PRIMARY KEY (OrgNode)
GO
ALTER TABLE stakeholder.OrganizationInheritance
ADD CONSTRAINT UQ__Organiza__420C9E6DA211482A
UNIQUE (OrgId)
GO
ALTER TABLE stakeholder.Organization
ADD CONSTRAINT FK_Organization_OrganizationType
FOREIGN KEY(OrgTypeId)
REFERENCES reference.OrganizationType(OrgTypeId)
ON DELETE NO ACTION
ON UPDATE NO ACTION
GO
ALTER TABLE stakeholder.OrganizationInheritance
ADD CONSTRAINT FK_OrganizationInheritance_OrganizationType
FOREIGN KEY(OrgTypeId)
REFERENCES reference.OrganizationType(OrgTypeId)
ON DELETE NO ACTION
ON UPDATE NO ACTION
GO
ALTER TABLE stakeholder.OrganizationInheritance
ADD CONSTRAINT FK_OrganizationInheritance_Organization
FOREIGN KEY(OrgId)
REFERENCES stakeholder.Organization(OrgId)
ON DELETE NO ACTION
ON UPDATE NO ACTION
GOIsDescendantOf
Returns true for all the nodes in the sub-tree rooted at parent, and false for all other nodes.
Parent is considered its own descendant.
GetAncestor
Returns a hierarchyid representing the
nth ancestor of this.
ordid=3 is the ancestor of nobody. -
WBS element field in transaction CS71-F4 help is not working in ECC 6.0
Hii
In SAP, while working in SAP 4.7, tcode cs71, WBS element is coming via F4 Help. But after upgradation to ECC 6.0 EHP 5, this F4 help is not working. I can enter value manually.but F4 help is not working.
Please Help.Hi,
You can do it manually too
1. Choose function group 'CSDI' via Transaction SE80.
2. Choose screen '0260'in the 'Screens' area and switch to change mode
3. Choose the 'Element list' tab index.
4. In this area, choose the 'Reference' tab index and enter the value
'PRP' in the 'Search help' column in the line for field
'RC29N-PSPNR'.
5. Save your change and regenerate the screen.
6. The correct input help for the WBS element is now available in the
initial screen of Transaction CS71/72/73.
I hope F4 helps works for "Existing WBS BOM's" in CS71 after this
Refer to Note : 714824 as well , it has reverted back the changes done by note : 422265
Regards
Gaurav -
Top_of_page is not working in ALV hierarchy?
Hi,
I have written following code for top_of_page using event but which is not working...This report is developed for interactive report.
Note: passed the it_events into ALV hierarchy functional module.
FORM build_event_tab .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 1
IMPORTING
et_events = it_events[].
READ TABLE it_events INTO wa_events WITH KEY form = 'TOP_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'TOP_OF_PAGE'.
APPEND wa_events TO it_events.
ENDIF.
ENDFORM. "Get_events
FORM top_of_page USING document TYPE REF TO cl_dd_document.
DATA: dl_text(255) TYPE c,
lv_cutime TYPE sy-uzeit,
lv_cudt(20) TYPE c.
lv_cudt = sy-datum.
*--Passing Date----*
WRITE lv_cudt TO dl_text.
CONCATENATE 'Date : ' lv_cudt+6(2) '-'
lv_cudt+4(2) '-'
lv_cudt+0(4) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
WRITE 'Company Name' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 150.
lv_cutime = sy-uzeit.
CONCATENATE 'Time : ' lv_cutime+0(2) ':'
lv_cutime+2(2) ':'
lv_cutime+4(2) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 60.
WRITE 'Title' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
ENDFORM. "html_top_of_page
Thanks
ShreePERFORM build_fieldcat.
PERFORM build_event_tab.
PERFORM alv_display.
*---Build fieldcat
FORM build_fieldcat.
wa_fieldcat-tabname = 'IT_VENDOR'.
wa_fieldcat-fieldname = 'LIFNR'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = 'SUPPLIER'.
wa_fieldcat-outputlen = 20.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_VENDOR'.
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = 'VENDOR NAME'.
wa_fieldcat-outputlen = 40.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-col_pos = '1'.
wa_fieldcat-seltext_l = 'Plant'.
wa_fieldcat-outputlen = 5.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'AWKEY'.
wa_fieldcat-col_pos = '2'.
wa_fieldcat-seltext_l = ' Document'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BELNR'.
wa_fieldcat-col_pos = '3'.
wa_fieldcat-seltext_l = 'A/c Document'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BUDAT'.
wa_fieldcat-col_pos = '4'.
wa_fieldcat-seltext_l = 'PJ Date'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'XBLNR'.
wa_fieldcat-col_pos = '5'.
wa_fieldcat-seltext_l = 'Inv'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'BLDAT'.
wa_fieldcat-col_pos = '6'.
wa_fieldcat-seltext_l = 'PJ Date'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'DMBTR'.
wa_fieldcat-col_pos = '7'.
wa_fieldcat-seltext_l = 'Bill.Amount'.
wa_fieldcat-outputlen = 19.
wa_fieldcat-do_sum = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-fieldname = 'HKONT'.
wa_fieldcat-col_pos = '8'.
wa_fieldcat-seltext_l = 'Cost Ctr'.
wa_fieldcat-outputlen = 16.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "Build_fieldcat
*----ALV Display-----*
FORM alv_display.
key-header01 = 'LIFNR'.
key-item01 = 'LIFNR'.
DELETE ADJACENT DUPLICATES FROM it_vendor.
DELETE ADJACENT DUPLICATES FROM it_final.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'PFSTATUS'
it_fieldcat = it_fieldcat[]
i_tabname_header = 'IT_VENDOR'
i_tabname_item = 'IT_FINAL'
it_events = it_events[]
is_keyinfo = key
TABLES
t_outtab_header = it_vendor[]
t_outtab_item = it_final[].
ENDFORM. "alv_display
*----interactive method--
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
READ TABLE it_final INTO wa_final INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
IF rs_selfield-fieldname = 'BELNR'.
SET PARAMETER ID 'BLN' FIELD wa_final-belnr.
SET PARAMETER ID 'BUK' FIELD pa_bukrs.
SET PARAMETER ID 'GJA' FIELD pa_gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'AWKEY'.
SET PARAMETER ID 'RBN' FIELD wa_final-awkey.
SET PARAMETER ID 'GJR' FIELD pa_gjahr.
CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'LFBNR'.
SET PARAMETER ID 'BLN' FIELD it_bsak-lfbnr.
SET PARAMETER ID 'BUK' FIELD pa_bukrs.
SET PARAMETER ID 'GJA' FIELD pa_gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'EBELN'.
SELECT SINGLE
ebeln
INTO wk_ebeln
FROM ekko
WHERE ebeln = it_bsak-ebeln
AND bstyp = 'F'.
IF sy-subrc EQ 0.
SET PARAMETER ID 'BES' FIELD it_bsak-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ELSE.
SET PARAMETER ID 'VRT' FIELD it_bsak-ebeln.
CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. "user_command
FORM pfstatus USING ut_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
ENDFORM. "pfstatus
*---Authorization check---
FORM bukrs_check.
SELECT SINGLE
butxt "Name of the Company Code / Company
ort01 "City
INTO (wk_company, wk_city) FROM t001
WHERE bukrs = pa_bukrs.
IF sy-subrc <> 0.
MESSAGE 'create your own message' TYPE 'I'.
ENDIF.
ENDFORM. " BUKRS_CHECK
FORM build_event_tab.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events[].
READ TABLE it_events INTO wa_events
WITH KEY name = 'SLIS_EV_TOP_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'TOP_OF_PAGE'.
MODIFY it_events FROM wa_events INDEX sy-tabix.
ENDIF.
READ TABLE it_events INTO wa_events WITH KEY name =
'SLIS_EV_END_OF_PAGE'.
IF sy-subrc = 0.
wa_events-form = 'END_OF_PAGE'.
MODIFY it_events FROM wa_events INDEX sy-tabix.
ENDIF.
ENDFORM. "Get_events
FORM end_of_page.
DATA: it_header TYPE slis_t_listheader,
wa_header TYPE slis_listheader.
wa_header-typ = 'S'.
wa_header-key = 'MATERIAL'.
* wa_line-info = p1.
APPEND wa_header TO it_header.
CLEAR wa_header.
* READ TABLE it_maktx WITH KEY matnr = p1.
wa_header-typ = 'S'.
wa_header-key = 'DESCRIPTION'.
* wa_line-info = it_maktx-maktx.
APPEND wa_header TO it_header.
CLEAR wa_header.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
* i_logo = 'ENJOYSAP_LOGO'
it_list_commentary = it_header.
ENDFORM. "END_OF_PAGE
FORM top_of_page USING document TYPE REF TO cl_dd_document.
DATA: dl_text(255) TYPE c,
lv_cutime TYPE sy-uzeit,
lv_cudt(20) TYPE c.
lv_cudt = sy-datum.
*--Passing Date----*
WRITE lv_cudt TO dl_text.
CONCATENATE 'Date : ' lv_cudt+6(2) '-'
lv_cudt+4(2) '-'
lv_cudt+0(4) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
WRITE 'INCAP CON MFG SER (P) LTD' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 150.
lv_cutime = sy-uzeit.
CONCATENATE 'Time : ' lv_cutime+0(2) ':'
lv_cutime+2(2) ':'
lv_cutime+4(2) INTO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 60.
WRITE 'Purchase Journal' TO dl_text.
CALL METHOD document->add_text
EXPORTING
text = dl_text
sap_emphasis = cl_dd_area=>heading
sap_style = cl_dd_area=>heading
sap_color = cl_dd_area=>list_total_inv.
CLEAR : dl_text.
CALL METHOD document->add_gap
EXPORTING
width = 50.
ENDFORM. "html_top_of_page -
BW hierarchy variable not working in Crystal Report 2008
Hi,
I have created BEx 7.0 report which has hierarchy on 0customer object, the report is working fine whith hierarchy variable. I have created Crystal Report by using this query as source. I have followed below link to create grouping to get data through hierarchy variable.
http://wiki.sdn.sap.com/wiki/display/BOBJ/BWHierarchiesinCrystalReports
But report does not work for hierarchy variable and report is blank. When I give filter of child node which has actual data then I get report output. For ex.
Below hierarchy for 0customer
11396
- 737007
- 123456
When I run report for 11396 then no data display but when I run 737007 child node I get report output but with blank group name.
Can anyone came accross this issue. Please guide me . Thanks in advance.Thanks Ingo for your reply..
The word filter means, I have hierarchy node variable in the BEx report that has become Parameter in CR. When I give hierarchy node variable value of parent node then there is not data display but for the child node I get the data.
For ex. In the info cube there is data for 730707 customer but in the customer hierarchy the parent node of 73707 is 11396. I am giving 11396 in the variable pop screen for hierarchy variable. I do not see any data but for 73707 I get data.
User does not know 73707, he always enter 11396 customer no. and he gets data in BEx query that is source of CR. but crystal report is not showing data for 11396.
One more point I want to tell here, I am saving CR at my local system not to SAP BW server.
Hope this clear my issue.
Harish Swami
Edited by: hswami27 on Jan 31, 2011 8:17 PM -
Hierarchy Analysis Authorization does not work after transport
Hi Gurus,
I am facing a issue in hierarchy analysis authorization in quality system but the same authorization works perfectly fine in development.
All hierarchy authorizations works in Quality except for this one. I found one old sap note describing this as program error but this note is not applicable in BW 7.3.
I have checked the table RSECVAL, RSECHIER and authorization is active so everything looks good. Please advise if anyone faced this issue after transporting hierarchy auths to other systems
Regards,
SalmanSalman,
What I understood from your description is that you have same role+AA in Dev and QA, which provides access in Dev for all the nodes for said hierarchy but in QA, same role+AA provides access to the same hierarchy for all the nodes but one. Try to create a ZTEST analysis authorization in QA itself with access for the problematic hierarchy node and see if it works ? This will rule out the case if there is a difference in hierarchy in DEV & QA.
Regards,
Shivraj Singh -
Hierarchy Node Variable search (find) option not working
Hi Experts - I have created a hierarchy node varibale on a fixed hierarchy. When user run the report and click on hierarchy node variable selection option , A new window will pop up which has all the nodes.
As the list is quite big and has many levels , On the same pop up , we have find option , when we enter any node in the find box , its always give a ABAP Dump , It never works for me...
Is node find/search in not working in Bi 7.0 .
Thanks
RHi Rohan,
We can restrict the hierchey level at property of of the hiearchey enabled characteristic.
Hope this hels...let me know if u require any further info on this..
Best Regards,
Maruthi -
PS - Substitution not working in WBS create
Hi,
I have this requirement. I want the last level of WBS to be automatically ticked as account assigned. I created a substituion with a user exit with a prerequisite as PRPS-STUFE >=1
I used the following logic in the substitution exit
Check in PRHI for every WBS element (POSNR) if 1st subordinate (PRHI-DOWN) is blank.
If it is blank then for that WBS element Account assignment element BLEKZ = "X"
The substitution works perfectly alright in the change mode but it does not work in the creation mode of the Project or WBS elements.
Any solution to this problem is highly appreciated.
Best Regards,
Manoj BhootaHi Mango,
Substitution in WBS-element is called in function module G_VSR_SUBSTITUTION_CALL, you may set break point in the FM and the user-exit to check the import and export data during the project creation to see if the substitution do have called and the user-exit do export correct data.
Regards,
Rachel -
Hierarchy restrictons not working with Basis servicepack upgrade to 14
Hi All,
We recently upgraded our system with basis sp 14, and we having the below problems with out hierarchy restrictions:
Problem #1
We recently upgraded our system from then onwards hierarchy restrictions not working, users are getting authorization error when they execute the query. However we tried by adding aggregates now hierarchy restrictions seems to be working.
Problem #2
We are testing hierarchy restrictions for budget planning function, after we add aggregate its allowing the user to plan the data, but when they try to distribute or escalate the data its again throwing authorization error. When I checked error log for Orgunit hierarchy restriction, the query is looking for single values it is not considering the node restriction, the orgunit values appeared in error log all belong to the node I restricted in analysis authorization.
We implemented note#1133674 as this was relevant to our issue with planning function. But this didnt fix the issue.
We are now on BI SP 16 and Basis SP 14
Just wondering If any of you came across with the same kind of issue, Any help is appreciated.
Thanks,
KavithaHi Kavitha,
Please check SAP note 1229602 Error when using hierarchies: Authorization error.
Regards
Imran -
Services for WBS - WebDynpro Links do not work
Hi SDN,
please, can anyone help me with the links for WBS Services on the Account Assignment tab, for Projects ?
I had no success on searching for this answer on the SDN.
The web Links on the screen are not set up for the services.
1 - Open a Project in cProjects
2 - Select Accounting tab
3 - Click on any Account Assignment Element
4 - On "Services for WBS" screen, click on any Service.
An ITS (SAP GUI for HTML) window should open, with relative transaction for the selected WBS Service.
However, nothing happens.
We have an environmet where it works, and the link points to the following address:
http://server.company.domain:8000/sap/bc/gui/sap/its/webgui/!?MESSAGESERVER=SERVER.COMPANY.DOMAIN&PROJ-PSPID=PM/6728&PRPS-POSID=PM/6728&OKCODE=UCCOST&~TRANSACTION=CJ9ECP&sap-client=400&sap-language=EN
But on the environment where it's not working, there is only this in the reference of the link:
https:///scripts/wgate/webguiPROJ-PSPID=PM/101&PRPS-POSID=PM/101&OKCODE=UCCOST&TRANSACTION=CJ9ECP&=&=
Please, where can I configure these links, so that the new window is called pointing to the HTML SAP GUI, when a Service is selected ?
Many thanks,
FabioHi Fabio,
Please refer to my answer for your query on the same subject.
Hope this will resolve your issue.
Regards,
Niraj
Maybe you are looking for
-
I upgraded to Snow Loepard OS. But not all the information in the address book was transfered. How can I recover the lost information from my old address book?
-
TS1398 WiFi not even on or able to be selected in Settings
I have a few devices connect in my household for Wifi. I even have two identical iPhones that were working perfectly until a few days ago. One that has no problems and then mine that has a few. I am unable now to connected to my home Wifi. Openin
-
ADF Table filtering in JDev 10.1.3
Hi, I wonder how to do ADF Table filtering in JDev 10.1.3. I know in JDev 11 have a query listener property but i want to know how to do this in JDev 10.1.3 For example : Based on HR schema, i have a search form and table result in the same page. The
-
Hi everyone, I'm getting a X position over time and I want to plot the position during the acquisition (online). I use a shift register to keep in memory both time and position and then I use a the XY Graph. I have to display all the signals from the
-
Bonsoir, je viens d'avoir un problème avec mon i pad mini
Bonsoir, c'est la première fois que je viens sur un forum j'ai un problème avec mon i pad mini je viens de perdre une partie de mes icônes tel que facebook, la messagerie, mon appareil photo ... je ne sais pas ce qu'il y a lieu de faire