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: 

Error "The project definition could not be created" using BAPI_PROJECTDEF_CREATE

Former Member
0 Kudos
626

Hi,

I need to use this BAPI in order to create a new project.

This is the test code:

_____________________________________________________________________

REPORT  ztest_bapi_projectdefinition.

DATA: proj_def TYPE bapi_project_definition.
DATA: ret TYPE bapireturn1.

* Populate some fields

proj_def-project_definition = '15GD'.
proj_def-description = 'inv linea distr'.
proj_def-comp_code = 's150'.
proj_def-project_profile = 'zlghinv'.


CALL FUNCTION 'BAPI_PS_INITIALIZATION'.

CALL FUNCTION 'BAPI_PROJECTDEF_CREATE'
   EXPORTING
     project_definition_stru = proj_def
   IMPORTING
     return                  = ret.

WRITE: ret-type, /, ret-message.

_____________________________________________________________________

I get the error "The project definition could not be created" with no other explanations, and I can't figure out the reason even debugging the standard code.

Anyone could help me?

Thank you.

Simone

1 ACCEPTED SOLUTION

Former Member
0 Kudos
249

I answer to myself: error details are present in the TABLES e_message_table parameter.

In my test case the company code was incorrect ('S150' with the capital S is correct) and this error message is contained in the message_text field of that table.

2 REPLIES 2

Former Member
0 Kudos
250

I answer to myself: error details are present in the TABLES e_message_table parameter.

In my test case the company code was incorrect ('S150' with the capital S is correct) and this error message is contained in the message_text field of that table.

0 Kudos
249

This message was moderated.