Description | Query Projects |
Name | QueryProjectIn |
Namespace | http://sap.com/xi/A1S/Global |
Process Component Description | Project Processing |
Process Component Name | ProjectProcessing |
Process Component Namespace | http://sap.com/xi/AP/ProjectManagement/Global |
Deployment Unit Description | Project Management |
Endpoint Activation | By Scoping of Process Component | Operations |
Release Status | Released |
An interface to query project data.
This web service is used to query projects. It has the FindProjectByElements operation which is used to query for one or more instances of the project based on the query filter parameters passed.
Example to query a specific project by project ID:
<?xml version="1.0" encoding="utf-8"?> <n0:ProjectByElementsQuery xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ProcessingConditions> <QueryHitsMaximumNumberValue>10</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <ProjectSelectionByElements> <SelectionByProjectID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryProjectID>CPSO1</LowerBoundaryProjectID> </SelectionByProjectID> </ProjectSelectionByElements> </n0:ProjectByElementsQuery>
Due to the stateless behaviour of the A2X service operations, it is not possible to enforce any kind of transactional or logical locking. In spite of this, the client may have to at least enforce that a modifying operation is not executed because the state of the underlying business object instance in the database has changed ever since the client read its data. To this end, the notion of the change state identifier ("ChangeStateID") has been introduced. From the point of view of the client, is it an uninterpretable string that is provided by all operations and may be consumed by all modifying operations. If the change state identifier is provided when calling a modifying operation, the system does not perform the operation if the state of the business object instance in the database has changed since the change state identifier was computed. This means that specifying the change state identifier enables the client to implement optimisic locking. The only guarantee is that the content of the string changes when the content of the business object changes. The reverse is not necessarily true and must not be accounted on.
If the change state identifier is specified and the specified value for a business object instance is different from the actual value computed from the database, an error message with the value SBM.SBM.CSM (change state mismatch, defined by the constant IF_ESI_MESSAGE_SYMPTOMS=> CO_SRVC_BO_CHNG_STATE_MISMATCH) in the element LogItem.LogItemCategoryCode shall be returned for that business object instance.
Sample XML if the wrong ChangeStateID is provided in the request:
<?xml version="1.0" encoding="UTF-8"?> <nm:ProjectByElementsResponse_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:ACL:/1SAI/TAE6A11EDD80ECE674C166F:804"> <Log> <MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode> <Item> <TypeID>031(/MBF_A2X_CORE/)</TypeID> <CategoryCode>SBM.SBM.CSM</CategoryCode> <SeverityCode>3</SeverityCode> <ReferenceObjectNodeSenderTechnicalID>72</ReferenceObjectNodeSenderTechnicalID> <Note>Update failed; change state ID 20111011112138.8012470 differs from change state ID 20111011112713.9587020 in DB</Note> </Item> </Log> </nm:ProjectByElementsResponse_sync>
For certain nodes with cardinality from 0 - *, the UUID / TechnicalIDs are used as identifier for each of the respective nodes.
You can find general information about Web services, their structure and consumption in the Web Services documentation.
<?xml version="1.0" encoding="utf-8"?> <n0:ProjectByElementsQuery xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ProcessingConditions> <QueryHitsMaximumNumberValue>10</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <ProjectSelectionByElements> <SelectionByProjectID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryProjectID>CPSO1</LowerBoundaryProjectID> </SelectionByProjectID> </ProjectSelectionByElements> </n0:ProjectByElementsQuery>
<n0:ProjectByElementsResponse_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:ACL:/1SAI/TAE6A11EDD80ECE674C166F:804"> <ProcessingConditions> <ReturnedQueryHitsNumberValue>1</ReturnedQueryHitsNumberValue> <MoreHitsAvailableIndicator>false</MoreHitsAvailableIndicator> <LastReturnedObjectID>00163E04DC331EE2BCD04BD7AAE6632A</LastReturnedObjectID> </ProcessingConditions> <ProjectQueryResponse> <ProjectID>CPSO1</ProjectID> <UUID>00163e04-dc33-1ee2-bcd0-4bd7aae6632a</UUID> <ProjectStatus> <ProjectLifeCycleStatusCode>3</ProjectLifeCycleStatusCode> <SchedulingUpToDatenessStatusCode>3</SchedulingUpToDatenessStatusCode> <StartingStatusCode>2</StartingStatusCode> <TaskLifeCycleStatusCode>2</TaskLifeCycleStatusCode> <TaskBlockingStatusCode>1</TaskBlockingStatusCode> </ProjectStatus> <ProjectTask> <UUID>00163e04-dc33-1ee2-bcd0-4bd7aae6632a</UUID> <ChangeStateID> 20130906050648.0000000</ChangeStateID> <ProjectElementID>CPSO1</ProjectElementID> <SummaryTaskIndicator>true</SummaryTaskIndicator> <EarliestStartDate timeZoneCode="CST">2013-07-22T00:00:00Z</EarliestStartDate> <LatestEndDate timeZoneCode="CST">2013-07-22T00:00:00Z</LatestEndDate> <ResponsibleEmployeeID>AXUS-E0008</ResponsibleEmployeeID> <ResponsibleEmployeeUUID>00145ef5-88e6-02dc-81ff-054bb3d840a4</ResponsibleEmployeeUUID> <Status> <ProjectStartingStatusCode>2</ProjectStartingStatusCode> <ReleaseStatusCode>3</ReleaseStatusCode> <StoppingStatusCode>1</StoppingStatusCode> <ClosureStatusCode>1</ClosureStatusCode> <LifeCycleStatusCode>2</LifeCycleStatusCode> <BlockingStatusCode>1</BlockingStatusCode> <FulfilmentProcessingStatusCode>2</FulfilmentProcessingStatusCode> </Status> <TaskName> <Name languageCode="EN">391</Name> </TaskName> </ProjectTask> <ProjectTask> <UUID>00163e04-dc33-1ee2-bcd0-4bd7aae6832a</UUID> <ChangeStateID> 20130912054218.0000000</ChangeStateID> <ProjectElementID>CPSO1-1</ProjectElementID> <ParentTaskUUID>00163e04-dc33-1ee2-bcd0-4bd7aae6632a</ParentTaskUUID> <RightNeighbourTaskUUID>00163e04-f8f9-1ee2-beb8-2fea5614620e</RightNeighbourTaskUUID> <EarliestStartDate timeZoneCode="CST">2013-07-22T00:00:00Z</EarliestStartDate> <LatestEndDate timeZoneCode="CST">2013-07-22T00:00:00Z</LatestEndDate> <Status> <ProjectStartingStatusCode>2</ProjectStartingStatusCode> <ReleaseStatusCode>3</ReleaseStatusCode> <StoppingStatusCode>1</StoppingStatusCode> <ClosureStatusCode>1</ClosureStatusCode> <LifeCycleStatusCode>2</LifeCycleStatusCode> <BlockingStatusCode>1</BlockingStatusCode> <ProjectMilestoneStatusCode>3</ProjectMilestoneStatusCode> <FulfilmentProcessingStatusCode>2</FulfilmentProcessingStatusCode> </Status> <TaskName> <Name languageCode="EN">Senior Consultancy</Name> </TaskName> <TaskExpense> <UUID>00163e04-dc33-1ee3-86ed-c28dace98bd3</UUID> <Description>Now1</Description> <PlannedCostsAmount currencyCode="USD">22.0</PlannedCostsAmount> <GeneralLedgerAccountAliasCode>7220</GeneralLedgerAccountAliasCode> <PlannedPeriod> <StartDateTime timeZoneCode="CST">2013-07-22T00:00:00Z</StartDateTime> <EndDateTime timeZoneCode="CST">2013-07-22T00:00:00Z</EndDateTime> </PlannedPeriod> </TaskExpense> </ProjectTask> <ProjectTask> <UUID>00163e04-f8f9-1ee2-beb8-2fea5614620e</UUID> <ChangeStateID> 20130912054218.0000000</ChangeStateID> <ProjectElementID>CPSO1-2</ProjectElementID> <ParentTaskUUID>00163e04-dc33-1ee2-bcd0-4bd7aae6632a</ParentTaskUUID> <LeftNeighbourTaskUUID>00163e04-dc33-1ee2-bcd0-4bd7aae6832a</LeftNeighbourTaskUUID> <EarliestStartDate timeZoneCode="CST">2013-07-22T00:00:00Z</EarliestStartDate> <LatestEndDate timeZoneCode="CST">2013-07-22T00:00:00Z</LatestEndDate> <ResponsibleEmployeeID>AXUS-E0009</ResponsibleEmployeeID> <ResponsibleEmployeeUUID>00145ef5-88e6-02dc-81ff-07259a7cc233</ResponsibleEmployeeUUID> <Status> <ProjectStartingStatusCode>2</ProjectStartingStatusCode> <ReleaseStatusCode>3</ReleaseStatusCode> <StoppingStatusCode>1</StoppingStatusCode> <ClosureStatusCode>1</ClosureStatusCode> <LifeCycleStatusCode>2</LifeCycleStatusCode> <BlockingStatusCode>1</BlockingStatusCode> <ProjectMilestoneStatusCode>3</ProjectMilestoneStatusCode> <FulfilmentProcessingStatusCode>2</FulfilmentProcessingStatusCode> </Status> <TaskName> <Name languageCode="EN">jUNIOR cONSULTANCY</Name> </TaskName> <TaskExpense> <UUID>00163e04-dc33-1ee3-86ed-c28dace9abd3</UUID> <Description>Now2</Description> <PlannedCostsAmount currencyCode="USD">33.0</PlannedCostsAmount> <GeneralLedgerAccountAliasCode>7130</GeneralLedgerAccountAliasCode> <PlannedPeriod> <StartDateTime timeZoneCode="CST">2013-07-22T00:00:00Z</StartDateTime> <EndDateTime timeZoneCode="CST">2013-07-22T00:00:00Z</EndDateTime> </PlannedPeriod> </TaskExpense> </ProjectTask> <LanguageCode>EN</LanguageCode> <BuyerParty> <BuyerPartyKey> <PartyID>AXUS-C127</PartyID> </BuyerPartyKey> <RoleCategoryCode>1</RoleCategoryCode> <UUID>00300571-cc0f-02db-b89a-92de5e7f842a</UUID> </BuyerParty> </ProjectQueryResponse> </n0:ProjectByElementsResponse_sync>
Description | Find projects |
Name | FindProjectByElements |
Synchronous | yes |
Release Status | Released |
To query projects by elements.
FindProjectByElements is an operation to query the project data by the selection elements passed in the request.
Below is the list of selection elements available and their corresponding business context with the UI:
SelectionByElements | UI Element |
---|---|
SelectionByResponsibleUnitID | Responsible Unit ID |
SelectionByProjectID | Project ID |
SelectionByProjectName | Project Name |
SelectionByProjectType | Project Type |
SelectionByCustomerID | Customer ID |
SelectionByRequestingUnitID | Requesting Unit ID |
SelectionByBillableIndicator | Billable Indicator |
SelectionByIntercompanyIndicator | Intercompany Indicator |
SelectionByResponsibleEmployeeID | Person Responsible ID |
Billable indicator takes the values 'True' or 'False'. To query for projects that are billable, set the value for field IntervalBoundaryTypeCode under the tag SelectionByBillableIndicator to 'True'.
In the ProcessingConditions tag, the QueryHitsUnlimitedIndicator field is mandatory, which takes the values 'True' or 'False'.
IntervalBoundaryTypeCode field is a mandatory field in each of the selection tags. This field takes the values as given in the generic document.
If a large volume of data is to be retrieved, the consumer must implement the retrieval logic in batches. The data can be limited by using QueryHitsMaximumNumberValue field in the ProcessingConditions tag.
For the selection fields, in each SelectionField tag, the field InclusionExclusionCode takes the values 'E' Or 'I'.
E- Excluding
I- Including
The project types provided by SAP are:
Project Type Code | Value |
---|---|
10 | Cost collecting project |
20 | Direct cost project |
21 | Marketing project |
22 | Strategic sourcing project |
23 | Research and development project |
24 | Customer project w/o sales integration |
25 | Customer project with sales integration |
26 | Multi-customer project |
27 | Intercompany Project |
Example for using various query paramaters:
Example (i): Query a specific project by project ID
<?xml version="1.0" encoding="utf-8"?> <n0:ProjectByElementsQuery xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ProcessingConditions> <QueryHitsMaximumNumberValue>10</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <ProjectSelectionByElements> <SelectionByProjectID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryProjectID>CPSO1</LowerBoundaryProjectID> </SelectionByProjectID> </ProjectSelectionByElements> </n0:ProjectByElementsQuery>
Example (ii): Query for projects using person responsible
<?xml version="1.0" encoding="utf-8"?> <n0:ProjectByElementsQuery xmlns:n0 "http://sap.com/xi/SAPGlobal20/Global"> <ProcessingConditions> <QueryHitsMaximumNumberValue>10</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <ProjectSelectionByElements> <SelectionByResponsibleEmployeeID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryEmployeeID>AXUS-E0008</LowerBoundaryEmployeeID> </SelectionByResponsibleEmployeeID> </ProjectSelectionByElements> </n0:ProjectByElementsQuery>
Example (iii): Query for projects using wild card character for project ID
<?xml version="1.0" encoding="utf-8"?> <n0:ProjectByElementsQuery xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ProcessingConditions> <QueryHitsMaximumNumberValue>10</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <ProjectSelectionByElements> <SelectionByProjectID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryProjectID>CPSO*</LowerBoundaryProjectID> </SelectionByProjectID> </ProjectSelectionByElements> </n0:ProjectByElementsQuery>
Example (iv): Query for projects using a combination of project type and person responsible
<?xml version="1.0" encoding="utf-8"?> <n0:ProjectByElementsQuery xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ProcessingConditions> <QueryHitsMaximumNumberValue>10</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> <LastReturnedObjectID></LastReturnedObjectID> </ProcessingConditions> <ProjectSelectionByElements> <SelectionByProjectType> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryProjectType>25</LowerBoundaryProjectType> </SelectionByProjectType> <SelectionByResponsibleEmployeeID> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryEmployeeID>TestEmpID</LowerBoundaryEmployeeID> </SelectionByResponsibleEmployeeID> </ProjectSelectionByElements> </n0:ProjectByElementsQuery>