2009 Nov 18 1:06 PM
I need to create to a projekt the network header with one activity. so I want top proceed the following coding:
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
CALL FUNCTION 'BAPI_BUS2002_CREATE'
EXPORTING
i_network = gs_network
TABLES
et_return = et_return.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = es_return.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
CALL FUNCTION 'BAPI_BUS2002_ACT_CREATE_MULTI'
EXPORTING
i_number = ls_number
TABLES
it_activity = gt_activity.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = es_return.But I get an Runtime Error with "MESSAGE_TYPE_X" because the PRECOMMIT was not successful.
Has anyone an idea how to handle that ??
thx a lot
Edited by: Rob Burbank on Nov 18, 2009 9:42 AM
I need to create to a projekt the network header with one activity. so I want top proceed the following coding:
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
CALL FUNCTION 'BAPI_BUS2002_CREATE'
EXPORTING
i_network = gs_network
TABLES
et_return = et_return.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = es_return.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
CALL FUNCTION 'BAPI_BUS2002_ACT_CREATE_MULTI'
EXPORTING
i_number = ls_number
TABLES
it_activity = gt_activity.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = es_return.But I get an Runtime Error with "MESSAGE_TYPE_X" because the PRECOMMIT was not successful.
Has anyone an idea how to handle that ??
thx a lot
Edited by: Rob Burbank on Nov 18, 2009 9:42 AM
2009 Nov 18 1:14 PM
use the bapi as given bellow with return parameter
CALL FUNCTION 'BAPI_PS_PRECOMMIT'.
TABLES
ET_RETURN = IT_RETURN.
2009 Nov 18 1:22 PM
2009 Nov 18 2:46 PM
Moderator message - Welcome to SCN.
Where do you get the error - the precommit, the commit or elsewhere. What is the message with the error?
Rob
2009 Nov 18 3:29 PM
*Error analysis*
Short text of error message:
Precommit did not run successfully
Long text of error message:
Technical information about the message:
Message class....... "CNIF_PI"
Number.............. 033
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
*How to correct the error*
Probably the only way to eliminate the error is to correct the progra
-
If the error occures in a non-modified SAP program, you may be able t
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the followin
keywords:
"MESSAGE_TYPE_X" " "
"SAPLPS_BAPI" or "LPS_BAPIF01"
"CHK_PRECOMMIT"
Edited by: Rob Burbank on Nov 18, 2009 10:30 AM
2009 Nov 18 3:37 PM
The error comes after a call to FM PS_FLAG_GET_GLOBAL_FLAGS. Put a breakpoint there anbd see why it is failing.
Rob
2013 Jan 23 6:47 AM
Hello Markus,
Is your issue resolved?...Can you able to create network with one activity?...
If yes,can you please send me sample code for creating network with one activity using BAPI : BAPI_BUS2002_CREATE
Because i'm unable to create networks for WBS in project definition
Katrice
2014 Oct 09 6:57 PM
Hi!
Try this code, without using 'BAPI_PS_PRECOMMIT':
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
EXPORTING
i_project_definition = lv_prj_def
TABLES
it_wbs_element = lt_wbs_elm
et_return = lt_ret.
READ TABLE lt_ret WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
CALL FUNCTION 'PS_FLAG_SET_GLOBAL_FLAGS'
EXPORTING
I_PRECOMMIT_OK = 'Y'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
2014 Oct 20 5:38 AM
DATA: lt_return TYPE TABLE OF bapiret2,
l_wa_return TYPE bapiret2.
CALL FUNCTION 'BAPI_PS_INITIALIZATION'
.
CALL FUNCTION 'BAPI_BUS2002_CREATE'
EXPORTING
i_network = pi_wa_aufnr
TABLES
et_return = lt_return.
READ TABLE lt_return WITH KEY type = 'S'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
REFRESH lt_return.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
TABLES
et_return = lt_return.
READ TABLE lt_return WITH KEY type = 'S'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
READ TABLE lt_return INTO l_wa_return INDEX 3.
pc_aufnr_new = l_wa_return-message_v2.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
IMPORTING
return = l_wa_return.
ENDIF.
this is the sample code to create network & to get the network number created
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |