cancel
Showing results for 
Search instead for 
Did you mean: 

Create version header via abap

Former Member
0 Kudos

Hi expert,

how is possible via abap to create a version header?

I need to create via abap a global version header for snapshot version.

I'm not able to find the right function to do this...

Help me, please.

Thanks,

Luca

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Mariano.

Thanks for your answer but I know well how to use this bapi to create snapshot version.

I need to create via abap the version header, the basket for the version that is possible to create with this bapi.

Thanks,

Luca

mariano_sabiche
Active Participant
0 Kudos

Luca;

I think it's not possible, because you first have to create in PPM, and them assign.

Maybe you can do it, "debugging" when create the version header, because the name of the FM is not easy to find.

Try with to debug, and please inform us the results.

Best regards,

Mariano

mariano_sabiche
Active Participant
0 Kudos

Hi Ulca;

What's the object that you want to create a version snapshot?

For example: Initiative, Item, Project Definition

Best regards,

mariano

Former Member
0 Kudos

Hi Mariano.

The object is project definition.

Thanks for your answer,

Luca

mariano_sabiche
Active Participant
0 Kudos

Hi Ulca;

You have the Bapi --> BAPI_BUS2172_SNAPSHOT_CREATE (BAPI Project: Create Snapshot Version for Project)

You use this BAPI to create a snapshot version of the operational project definition from parameter PROJECT_DEFINITION_GUID.

The parameter IV_VERSION must contain a valid version number that is permitted for snapshots. Make sure that no other snapshots with the same version key already exist for this operational project.

Note that you cannot start the update in the cProjects environment using the COMMIT_WORKcommand, the BAPI_TRANSACTION_COMMIT BAPI, or the BapiService.TransactionCommit method for technical reasons.

Use the BAPI_CPROJECTS_COMMIT_WORK BAPI function module instead.

You can edit several main objects (project definition, project template, and checklist template) in a Logical Unit of Work (LUW) at the same time using various BAPIs.

The current LUW enables you to unlock and unload a single main object using the Free method or the BAPI_xxx_FREE BAPI function module.

If changes have already been made to a main object in the current LUW, you have the following options:

You use the Free method or the BAPI_xxx_FREE BAPI function module and set the IV_REMOVE_CHANGED parameter (the default value is SPACE).

You can start the update for all changes that have been made to main objects in the current LUW using the BAPI_CPROJECTS_COMMIT_WORK BAPI function module.

Once the update via BAPI_CPROJECTS_COMMIT_WORK has taken place, the objects are loaded and locked. Youcan now execute the Free method or the BAPI_xxx_FREE BAPI function module (with the parameter IV_REMOVE_CHANGED = SPACE) for a main object to unlock and unload it.

You can carry out a rollback for the whole LUW using the BAPI_CPROJECTS_ROLLBACK_WORK BAPI function module.

However, all main objects remain loaded and locked. You can now execute the Free method or theBAPI_xxx_FREE BAPI function module (with the IV_REMOVE_CHANGED = SPACE parameter) for a main object to unlock and unload it.

Notes

You use the function module BAPI_CPROJECTS_UNLOCK_OBJECTS to unlock (that is, to convert to display mode) all main objects of a cProjects BAPI LUW to which no changes have been made in the LUW.

You use the function module BAPI_CPROJECTS_REMOVE_OBJECTS to unlock and unload all main objects of acProjects BAPI LUW. Main objects to which a change has already been made in the LUW are only unlockedand unloaded if the parameter IV_REMOVE_CHANGED is set. If the parameter is not set, only those main objects are unlocked and unloaded to which no changes have been made in the LUW.

If the single BAPI for creating the object ends without any errors, the log contains the success message114 from the message class DPR_BAPI. Message variable 1 contains the GUID with which the object is created if saving was successful.

Check this site for more information --> http://www.consolut.com/en/s/sap-ides-access/d/s/doc/F-BAPI_BUS2172_SNAPSHOT_CREATE

Hope this help you.

Best regards,

Mariano