‎2008 May 05 3:39 PM
Hi experts,
In my spec I am using the bapis:
BAPI_BUS2002_GETDATA
BAPI_PS_INITIALIZATION
BAPI_PROJECTDEF_EXISTENCECHECK
BAPI_BUS2001_GETDATA
BAPI_BUS2001_CREATE
BAPI_TRANSACTION_ROLLBACK
BAPI_BUS2054_GETDATA
BAPI_PROJECT_EXISTENCECHECK
BAPI_BUS2054_CREATE_MULTI
BAPI_BUS2002_CREATE
BAPI_BUS2002_ACT_CREATE_MULTI
BAPI_NETWORK_COMP_ADD
BAPI_PS_PRECOMMIT
BAPI_TRANSACTION_COMMIT
It works fine, the def project are created, then it creates the element pep, the network and the activity. All items are created without errors. The components will be created after this proccess done.
I am having problems to use the BAPI_PS_PRECOMMIT, showing dump error: Exception condition "PSPNR" raised. Dump screen:
408 * end of ldst modification
409
410 * old syntax (do that also if ldst not activated)
411 IF *proj-pspnr <> i_proj-pspnr.
------------ RAISE pspnr.
413 ENDIF.
414 * BEAKZ_PROJ initial: File completely unchanged
415 * BEAKZ_PROJ set and ARC_PROJ initial: Status change
416 IF beakz_proj IS INITIAL OR
417 arc_proj IS INITIAL.
418 arc_proj = *proj. "-> Merken f. Aenderungshist.
This is my code
IF NOT tg_defi IS INITIAL.
SORT: tg_tran BY projeto,
tg_resp BY elemento.
LOOP AT tg_defi INTO wa_defi.
CLEAR vg_erro.
PERFORM f_bapi_ps_initialization.
CONCATENATE wa_defi-letra
c_ponto
wa_defi-empresa
c_ponto
wa_defi-divisao
INTO vg_proj_def.
PERFORM f_create_def_prj.
CHECK vg_continue IS INITIAL.
PERFORM f_create_pep.
CHECK vg_continue IS INITIAL.
PERFORM f_create_network.
PERFORM f_create_activity.
IF vg_erro IS INITIAL.
PERFORM f_bapi_ps_precommit.
READ TABLE tg_return WITH KEY type = c_e TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
PERFORM f_bapi_transaction_commit.
READ TABLE tg_tran INTO wa_tran
WITH KEY projeto = vg_proj_def BINARY SEARCH.
CLEAR wa_cn33.
PERFORM f_de_para_6.
APPEND wa_cn33 TO tg_cn33.
ELSE.
vg_errors = vg_errors + 1.
ENDIF.
ELSE.
PERFORM f_bapi_transaction_rollback.
vg_errors = vg_errors + 1.
wa_resumo-proj_def = vg_proj_def.
wa_resumo-descricao = wa_defi-descr.
wa_resumo-processado = c_n.
wa_resumo-no_msg_erro = vg_errors.
APPEND wa_resumo TO tg_resumo.
CLEAR: vg_errors, wa_resumo.
CONTINUE.
ENDIF.
wa_resumo-proj_def = vg_proj_def.
wa_resumo-descricao = wa_defi-descr.
IF vg_errors IS INITIAL.
wa_resumo-processado = c_s.
ELSE.
wa_resumo-processado = c_n.
ENDIF.
wa_resumo-no_msg_erro = vg_errors.
APPEND wa_resumo TO tg_resumo.
ENDLOOP.
PERFORM f_create_comp.
ENDIF.
ENDFORM.
Please, if you know what is wrong and how I can do this, please tell me. I tried to do only bapi_transaction_commit, but it checks if the pre_commit is ok...
Thanks in advance.
RP
‎2008 May 05 4:00 PM
Please see the links below listed:
[http://abap.wikiprog.com/wiki/BAPI_BUS2001_DELETE#Recommendation_.22COMMIT_WORK_AND_WAIT.22]
[http://www.mundosap.com/foro/showthread.php?t=12184]
Pls don't forget to mention reward points!
Regards!
‎2008 May 05 3:49 PM
I have same trouble...
I tryied comment this BAPI but it' doesn't work.
When execute the line: COMMIT WORK is done a check in a pre commit.
Best Regards.
PA
‎2008 May 05 4:00 PM
Please see the links below listed:
[http://abap.wikiprog.com/wiki/BAPI_BUS2001_DELETE#Recommendation_.22COMMIT_WORK_AND_WAIT.22]
[http://www.mundosap.com/foro/showthread.php?t=12184]
Pls don't forget to mention reward points!
Regards!
‎2008 May 05 8:51 PM
Hi,
Did you take look in a SAP Note for that case?
Check if there's not an additional field to mark on that BAPI structure, where RAISE occurs.
If it's being created, maybe it's necessary to make an additional configuration for it.
Regards,
Brian Gonsales
‎2010 Oct 14 12:50 PM
Hello !
I have exactly the same issue. Did you have solution already ?
Only I noticed following specific . When I execute following BAPIs chain it works ok :
*----
BAPI_PS_INITIALIZATION (Initialization of the Current Process Unit),
BAPI_BUS2001_CREATE ( Project definition),
BAPI_BUS2054_CREATE_MULTI ( WBS elements definition ),
BAPI_BUS2054_CHANGE_MULTI ( Change WBS Elements Using BAPI )
BAPI_PS_PRECOMMIT - Precommit for PS BAPIs
BAPI_TRANSACTION_COMMIT - Execute external Commit when using BAPIs
*----
But when I added u201CCreate network headeru201D BAPI :
*----
BAPI_PS_INITIALIZATION (Initialization of the Current Process Unit),
BAPI_BUS2001_CREATE ( Project definition),
BAPI_BUS2054_CREATE_MULTI ( WBS elements definition ),
BAPI_BUS2054_CHANGE_MULTI ( Change WBS Elements Using BAPI )
BAPI_BUS2002_CREATE ( Create network header assigned to WBS ), ***
BAPI_PS_PRECOMMIT - Precommit for PS BAPIs
BAPI_TRANSACTION_COMMIT - Execute external Commit when using BAPIs
*----
I got dump from BAPI_PS_PRECOMMIT :
*---
Function module CJDW_PROJ_MODIFY :
old syntax (do that also if ldst not activated)
IF *proj-pspnr <> i_proj-pspnr.
RAISE pspnr.
ENDIF.
*----
i_proj-pspnr = 999999999 but
*proj-pspnr = 00000229 ( itu2019s next after last existing project NUMBER. SAP assigned it )
Interesting that added BAPI_BUS2002_CREATE has not error messages and executed successfully .
Any ideas pleeeeeeaaaaaase !
Regards,
Anatoly