Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

problem using BAPI_BUS2001_CREATE to create project definition

Former Member
0 Kudos

Hi,

i have a problem using BAPI_BUS2001_CREATE to create project definition.

i have customer fields in CI_PROJ structure.

i used help structure BAPI_TE_PROJECT_DEFINITION in EXTENSIONIN table

the problem is that customer fields that i have populated in BAPI_TE_PROJECT_DEFINITION are not processed.

please help.

thanks.

4 REPLIES 4

Former Member
0 Kudos

Hi,

To Create a Project Definition we can use following BAPIs

BAPI_PROJECTDEF_CREATE - To Create a Project Definition

BAPI_BUS2001_CREATE - To Create a Project Definition

BAPI_PROJECT_MAINTAIN -- It will creates total structure of

Project/WBS/Network Header/Milestone

After using above any bapi we have to use BAPI_TRANSACTION_COMMIT

Then only it will updates

Thanks

Ganesh

0 Kudos

thanks for your replay,

i looked at the badi BAdI BAPIEXT_BUS2001, i see that the customers fields are passed, i dont have ti implement any method.

i think the problem is in the BAPI_PS_PRECOMMIT function module, it clears the customers fields !

Former Member
0 Kudos

solved,

applay oss note 637345

0 Kudos

Th snote given cannot be implemented,follow the solution given below.

Solution

According to the BAPI customer enhancement concept, you must define your own data structures containing your additional data that is then either transferred to the BAPI or returned by the BAPI. Copy the name of these structures to the STRUCTURE field of the ExtensionIn parameter (or ExtensionOut) for data interpretation.

These data structures must only contain character-like data! Change your data structures accordingly. Otherwise there is no guarantee that data will be transferred correctly.

Unfortunately, no explicit reference was made to this important point in older versions of the documentation for the BAPI customer enhancement concept. This note is intended to correct the documentation concerned.

In many cases, it will be necessary to use non-character-type data (such as DEC, INT). In this case, we recommend recommend the following procedure:

- Define a structure S1. This contains all your required fields in their actual data type (DEC and INT are allowed here).

- Define a second structure S2. This contains the same fields as S1, but in the CHAR format. Make sure that you select the CHAR fields so they are long enough to include the complete values.

- When processing ExtensionOut entries in the source code, proceed as follows: Your starting point is a data record X1 in the internal format of structure S1. First, map this to a data record X2 in the format of structure S2 using move-corresponding. Then map X2 to a data record X3 in the format of structure BAPIPAREX using move.

- When processing ExtensionIn entries in the source code, proceed in the same way: This time your starting point is a data record X3 in the format BAPIPAREX. Map this to a data record X2 in the format of structure S2 using move. Then map X2 to a data record X1 in the format of structure S1 using move-corresponding.

- In the STRUCTURE field of the ExtensionIn or ExtensionOut parameters, you must always transfer S2 for interpretation of the data.

Remarks:

- With this procedure, the Unicode-critical move is performed between two character-like data structures and does not cause any problems. Mapping between character-like and non-character-like data occurs on a field by field basis and is therefore not critical.

- If this additional mapping step is necessary, 100 % of the source code examples specified in the documentation cannot be transferred so you must adapt them to your system requirements.

- Using the BAPI Table Extension concept with SAP-designed processing of the additional fields only works when only character-like data is used in the BAPI table extension.

If you wish to process non-character-like data using the above workaround, you should not use any SAP-designed BAPI Table Extensions. Instead, define your own data structures as described above and execute the conversion between the extension parameters and internal data structures in the Customer Exits / BadIs yourself.