09-11-2009 8:12 AM
Dear All,
According to my requirement Closed Projects have to be Opened using Program .So i tried the BAPI - BAPI_BUS2001_SET_STATUS . But i am getting Error as "'Processing not possible because there is no initialization".
Please Help me How to use this BAPI.
Please check my codings below.
********************************************************************************************************
DATA : e_result LIKE TABLE OF bapi_status_result WITH HEADER LINE.
DATA : return LIKE TABLE OF bapireturn1 WITH HEADER LINE,
l_wait LIKE bapita-wait.
DATA : s_pspid LIKE proj-pspid.
LOOP AT it_bdc.
CLEAR : s_pspid.
CALL FUNCTION 'CONVERSION_EXIT_PROJN_INPUT'
EXPORTING
input = it_bdc-pspid
IMPORTING
output = s_pspid.
REFRESH: return,e_result.CLEAR : return,e_result.
CALL FUNCTION 'BAPI_BUS2001_SET_STATUS'
EXPORTING
project_definition = s_pspid
undo_system_status = 'MDLK' " I am unlocking locked project definition
undo_user_status = ''
set_system_status = ''
set_user_status = ''
IMPORTING
return = return
TABLES
e_result = e_result.
READ TABLE return WITH KEY type = 'S'.
IF sy-subrc = 0.
CLEAR l_wait.
l_wait = 2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = l_wait
IMPORTING
RETURN =
.
ENDIF.
ENDLOOP.
09-11-2009 8:17 AM
09-11-2009 8:17 AM
09-11-2009 8:21 AM
Hi,
The first step in a processing unit is initialization, which is done by calling the BAPI BAPI_PS_INITIALIZATION.
Afterwards, the individual BAPIs listed below can be used several times, if required.
The processing unit ends when the final precommit (call BAPI BAPI_PS_PRECOMMIT) is executed with a subsequent COMMIT WORK (for example, the statement COMMIT WORK, the BAPI "BAPI_TRANSACTION_COMMIT" or the BapiService.TransactionCommit method).
After the final COMMIT WORK, the next initialization opens a new processing unit via the BAPI "BAPI_PS_INITIALIZATION".
Please check the FM/BAPI documentation for BAPI_PS_PRECOMMIT and BAPI_PS_INITIALIZATION for more details
Hope this helps
Regards
Shiva
09-11-2009 8:56 AM
09-12-2009 6:58 AM
Dear all,
I have done this program working fine.Thanks for your help