Skip to end of metadata
Go to start of metadata

Purpose

How to use BAPI in Project System Module?

Overview

Use these below mentioned steps to use a BAPI in Project System Module

1. The first step in a processing unit is initialization, by using the BAPI; BAPI_PS_INITIALIZATION.

2. Afterwards, the individual BAPIs can be used several times, if required.

3. The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a BAPI --"BAPI_TRANSACTION_COMMIT" .
After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION".

For Example:

If you wish to change the status of the project to 'CLSD',
Then you need to follow the above steps like this :

CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
CALL FUNCTION 'BAPI_BUS2001_SET_STATUS'

PROJECT_DEFINITION               = LV_PRJDEF
\UNDO_SYSTEM_STATUS              =
*       UNDO_USER_STATUS         =
        SET_SYSTEM_STATUS        = LV_CLSD
*       SET_USER_STATUS          =
     IMPORTING
       RETURN                    = LV_RETURN
     TABLES
       E_RESULT                  = LT_RESULT
*              .
CALL FUNCTION 'BAPI_PS_PRECOMMIT'.
       TABLES
       ET_RETURN                 = IT_RETURN.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT                         =
* IMPORTING
*   RETURN                       =
(Here LV_PRJDEF contains all the projects whose status needs to be
changed Lv_CLSD contains the status to be set like "CLSD'.
Whenever the BAPI is executed, the results are stored in LV-RETURN.
If LV_RETURN is initial , BAPI execution is successful else the
errors are stored in the table LT_RESULT.
As soon as an error occurs in an individual BAPI or in the
BAPI "BAPI_PS_PRECOMMIT", you have the following options:

* Exit the report or the program that calls the BAPIs, the
PRECOMMIT and the COMMIT WORK.
* Execute a rollback in the current processing unit.

List of various BAPIs used in the PS module are as follows:

BAPIs used in PS Transactions

Project Definition:

BAPI to details of Project Definition:

BAPI Name

BAPI Description

BAPI_PROJECTDEF_EXISTENCECHECK

To check whether a project definition exists

BAPI_BUS2001_GETDATA

To get detailed information about a project definition. To do this, you must transfer
the external ID of the project definition in the parameter I_PROJECT_DEFINITION.
If required, you can also specify in which language the language-dependent fields,
such as time units, system status, and so on, are to be returned. If you do not
specify a language, the system language is used

BAPI_PROJECT_GETINFO

To read detailed information about project definitions and the WBS elements of projects from the system.

BAPI_PROJECTDEF_GETDETAIL

To read detail information about the project definition

BAPI_BUS2001_GET_STATUS

To get both the active system statuses and the user statuses for a project definition

BAPI_PROJECTDEF_GETLIST

Provides a list of project definitions

BAPI_GET_PROJECT_STATISTICS

Display project statistics

BAPI to create/update Project Definition data:

BAPI Name

BAPI Description

BAPI_BUS2001_CREATE

Create a project definition

BAPI_PROJECTDEF_CREATE

Create a project definition

BAPI_BUS2001_CHANGE

Change Project Definition

BAPI_PROJECTDEF_UPDATE

Change Project Definition

BAPI_BUS2001_DELETE

Delete Project Definition

BAPI_BUS2001_SET_STATUS

one system status and one user status can be revoked each time, and one system status
and one user status  can be set each time for a project definition

WBS - Work Breakdown Structure

BAPI to details of WBS element:

BAPI Name

BAPI Description

BAPI_BUS2054_GETDATA

To get detailed information about WBS elements

BAPI_BUS2054_GET_GUID_FROM_KEY

Read the GUID (Global Unique Identifier) using the external object key.

BAPI_BUS2054_GET_STATUS

To read the active system statuses and user statuses for a list of PSP elements

BAPI_BUS2054_GET_KEY_FROM_GUID

Read the externalobject key (WBS Key) using the GUID (Global Unique Identifier).

BAPI to create/update of WBS element:

BAPI Name

BAPI Description

BAPI_BUS2054_CREATE_MULTI

Create  WBS Element

BAPI_BUS2054_CHANGE_MULTI

Change  WBS Element

BAPI_BUS2054_DELETE_MULTI

Delete WBS Element

Network:

BAPI to extract details of Network:

BAPI Name

BAPI Description

BAPI_NETWORK_EXISTENCECHECK

Check whether network exists

BAPI_NETWORK_GETDETAIL

Read detailed information about a network including all objects from the system.

BAPI_NETWORK_GETINFO

Read detailed information about a network including all objects from the system.

BAPI_NETWORK_GETLIST

Produces a list of networks with descriptions. Returns a container of network numbers

BAPI_BUS2002_GETDATA

Returns Detail Data for Network Header.

BAPI_BUS2002_GET_GUID_FROM_KEY

Read GUIDS Using the Network Keys

BAPI_BUS2002_GET_KEY_FROM_GUID

Read Network Key Using the GUIDs

BAPI_BUS2002_GET_STATUS

Get network Status

BAPI to create/updatedetails of Network data:

BAPI Name

BAPI Description

BAPI_NETWORK_MAINTAIN

To edit network headers, activities and relationships

BAPI_BUS2002_CREATE

Create Network Header. Only one network can be created each time this BAPI is called.

BAPI_BUS2002_CHANGE

Change Network Header. Only one network header can be changed each time this BAPI is called.

BAPI_BUS2002_DELETE

Delete Network Header. Only one network can be processed each time the BAPI is called.

BAPI_BUS2002_SET_STATUS

Set/Reset Network Status. At the same time, you can revoke one system status and one
user status, or set one system status and one user status in a list of activities for the network.

Activity

BAPI to extract details of Activity: 

BAPI Name

BAPI Description

BAPI_BUS2002_ACT_GETDATA

Detail Data for Activities

BAPI_BUS2002_GET_ACTGUID_4_KEY

Read the GUIDs Using the Network Activity Key. Read the
GUID (Global Unique Identifier) using the external object key.

BAPI_BUS2002_GET_ACTKEY_4_GUID

Read the Network Activity Key Using the GUIDs. Read the
external object key using the GUID (Global Unique Identifier).

BAPI_BUS2002_GET_STATUS

Read active system statuses and user statuses for a network
header (NUMBER) as well as its activities

BAPI create/update Activity data: 

BAPI Name

BAPI Description

BAPI_BUS2002_ACT_CHANGE_MULTI

Change one or more activities. Activities of one network only
can be changed each time this BAPI is called.

BAPI_BUS2002_ACT_CREATE_MULTI

Create one or more activities. Activities of one network only
can be changed each time this BAPI is called.

BAPI_BUS2002_ACT_DELETE_MULTI

Delete one or more activities. Activities of one network only
can be changed each time this BAPI is called.

Activity Element

BAPI to extract details of Activity Element: 

BAPI Name

BAPI Description

BAPI_BUS2002_ACTELEM_GETDATA

Get detailed information about activity elements.

BAPI_BUS2002_GET_ELEGUID_4_KEY

Read the GUIDs Using the Activity Element IDs

BAPI create/update Activity Element data 

BAPI Name

BAPI Description

BAPI_BUS2002_ACTELEM_CHANGE_M

Change one or more activity elements. Each time this BAPI is
called, only the activity elements for one network can be changed

BAPI_BUS2002_ACTELEM_CREATE_M

Create one or more activity elements. Each time this BAPI is
called, only the activity elements for one network can be changed

BAPI_BUS2002_ACTELEM_DELETE_M

Delete one or more activity elements. Each time this BAPI is called,
only the activity elements for one network can be changed

Activity Type

BAPI to extract details of Activity Type:

BAPI Name

BAPI Description

BAPI_ACTIVITYTYPE_GETDETAIL

Detailed information on a selected activity type on Key Date.

BAPI_ACTIVITYTYPE_GETLIST     

List of Activity Types Using Selection Criteria

BAPI_ACTIVITYTYPE_GETPRICES   

Determines, for a given day, activity prices for cost center/activity type combinations.

BAPI to create/update Activity Type data

BAPI Name

BAPI Description

BAPI_ACTTYPE_CHANGEMULTIPLE

Change One or More Activity Types

BAPI_ACTTYPE_CREATEMULTIPLE

Create One or More Activity Types

Confirmation

BAPI to extract details of Confirmations

BAPI Name

BAPI Description

BAPI_NETWORK_CONF_GETDETAIL

Using this method you can make the detail data of a confirmation
for a network available for the transferred object. You can also make
goods movement posted together with the confirmation available.

BAPI_NETWORK_CONF_GETLIST

All confirmations are determined for the specified network activity or
activity element. The transferred capacity category and split are interpreted
as additional constraints

BAPI_NETWORK_CONF_GETPROP

To make default data available for confirming network activities

BAPI to create/update Confirmation data

BAPI Name

BAPI Description

BAPI_NETWORK_CONF_ADD

To enter confirmations for network activities/ activity elements and splits.

BAPI_NETWORK_CONF_CANCEL

To cancel a network confirmation that has already been booked.

5 Comments

  1. Unknown User (zu6c9nw)

  2. Your effort helps lots of ABAPer who are working on Project System

  3. Thanks a lot for your amazing work 

    Regards,

  4. Former Member

    Please help me!

     when I'm inputting the data manually on tcode CN27 there is a popup after the error "Do you want to save anyway?", and when im using the BAPI_NETWORK_CONF_ADD the error occurs and don't save the confirmantions.

    Do you know what do I have to do?

    Thanks

  5. Wonderful Documentation. One place to get all the info about SAP PS BAPI. Great Work. 

     

    Best Regards,

    Nikhil Kulkarni