2012 Aug 03 10:16 AM
Hi All,
Can you help me figure out why on executing below program i keep receiving runtime error
Short text of error message: Precommit has not be called yet
Long text of error message:
Technical information about the message:
Message class....... "CNIF_PI"
Number.............. 030
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
Error in internal table it_ret1 is
NIF_PI 032 |No data has been changed, precommit will not be executed.
See below code
DATA: it_proj_def TYPE TABLE OF bapi_project_definition_ex
WITH HEADER LINE,
it_wbs_elmnt TYPE TABLE OF bapi_bus2054_new WITH HEADER LINE,
it_ret1 TYPE TABLE OF bapiret2 WITH HEADER LINE.
*it_wbs_elmnt-wbs_element = 'N12G16T011'.
*it_wbs_elmnt-description = 'WBS_Upload'.
*it_wbs_elmnt-responsible_no = it_proj_def-responsible_no.
*it_wbs_elmnt-applicant_no = it_proj_def-applicant_no.
*it_wbs_elmnt-company_code = it_proj_def-comp_code.
*it_wbs_elmnt-business_area = it_proj_def-bus_area.
*it_wbs_elmnt-controlling_area = it_proj_def-controlling_area.
*it_wbs_elmnt-profit_ctr = it_proj_def-profit_ctr.
*it_wbs_elmnt-request_cctr = itab-req_cc.
*it_wbs_elmnt-calendar = it_proj_def-calendar.
*it_wbs_elmnt-currency = it_proj_def-project_currency.
*it_wbs_elmnt-currency_iso = it_proj_def-project_currency_iso.
*it_wbs_elmnt-plant = it_proj_def-plant.
*it_wbs_elmnt-user_field_key = '0000001'.
*it_wbs_elmnt-wbs_summarization = 'X'.
*it_wbs_elmnt-objectclass = it_proj_def-objectclass.
*it_wbs_elmnt-interest_prof = '0000001'.
*start
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
it_wbs_elmnt-WBS_ELEMENT = 'N12G16T011'.
it_wbs_elmnt-DESCRIPTION = 'WBS Upload'.
it_wbs_elmnt-RESPONSIBLE_NO = '00000100'.
it_wbs_elmnt-APPLICANT_NO = '00000000'.
it_wbs_elmnt-COMPANY_CODE = 'NSSF'.
it_wbs_elmnt-BUSINESS_AREA = ' '.
it_wbs_elmnt-CONTROLLING_AREA = 'NSSF'.
it_wbs_elmnt-PROFIT_CTR = '10100'.
it_wbs_elmnt-PROJ_TYPE = 'ZG'.
it_wbs_elmnt-WBS_PLANNING_ELEMENT = ' '.
it_wbs_elmnt-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = ' '.
it_wbs_elmnt-WBS_BILLING_ELEMENT = ' '.
it_wbs_elmnt-CSTG_SHEET = 'A00000'.
it_wbs_elmnt-OVERHEAD_KEY = ' '.
it_wbs_elmnt-RES_ANAL_KEY = '000001'.
it_wbs_elmnt-REQUEST_CCTR_CONTROLLING_AREA = ' '.
it_wbs_elmnt-REQUEST_CCTR = ' '.
it_wbs_elmnt-RESPSBL_CCTR_CONTROLLING_AREA = ' '.
it_wbs_elmnt-RESPSBL_CCTR = ' '.
it_wbs_elmnt-CALENDAR = 'KE'.
it_wbs_elmnt-PRIORITY = ' '.
it_wbs_elmnt-EQUIPMENT = ' '.
it_wbs_elmnt-FUNCT_LOC = ' '.
it_wbs_elmnt-CURRENCY = 'KES'.
it_wbs_elmnt-CURRENCY_ISO = 'KES'.
it_wbs_elmnt-PLANT = '1000'.
it_wbs_elmnt-USER_FIELD_KEY = 'ZNSSF'.
it_wbs_elmnt-USER_FIELD_CHAR20_1 = ' '.
it_wbs_elmnt-USER_FIELD_CHAR20_2 = ' '.
it_wbs_elmnt-USER_FIELD_CHAR10_1 = ' '.
it_wbs_elmnt-USER_FIELD_CHAR10_2 = ' '.
it_wbs_elmnt-USER_FIELD_QUAN1 = '0.000'.
it_wbs_elmnt-USER_FIELD_UNIT1 = ' '.
it_wbs_elmnt-USER_FIELD_UNIT1_ISO = ' '.
it_wbs_elmnt-USER_FIELD_QUAN2 = '0.000'.
it_wbs_elmnt-USER_FIELD_UNIT2 = ' '.
it_wbs_elmnt-USER_FIELD_UNIT2_ISO = ' '.
it_wbs_elmnt-USER_FIELD_CURR1 = ' '.
it_wbs_elmnt-USER_FIELD_CUKY1 = ' '.
it_wbs_elmnt-USER_FIELD_CUKY1_ISO = ' '.
it_wbs_elmnt-USER_FIELD_CURR2 = '0.000'.
it_wbs_elmnt-USER_FIELD_CUKY2 = ' '.
it_wbs_elmnt-USER_FIELD_CUKY2_ISO = ' '.
it_wbs_elmnt-USER_FIELD_DATE1 = ' '.
it_wbs_elmnt-USER_FIELD_DATE2 = ' '.
it_wbs_elmnt-USER_FIELD_FLAG1 = ' '.
it_wbs_elmnt-USER_FIELD_FLAG2 = ' '.
it_wbs_elmnt-WBS_CCTR_POSTED_ACTUAL = ' '.
it_wbs_elmnt-WBS_SUMMARIZATION = 'X'.
it_wbs_elmnt-OBJECTCLASS = 'PROFT'.
it_wbs_elmnt-STATISTICAL = ' '.
it_wbs_elmnt-TAXJURCODE = ' '.
it_wbs_elmnt-INTEREST_PROF = '0000001'.
it_wbs_elmnt-INVEST_PROFILE = ' '.
it_wbs_elmnt-EVGEW = ' '.
it_wbs_elmnt-CHANGE_NO = ' '.
it_wbs_elmnt-SUBPROJECT = ' '.
it_wbs_elmnt-PLANINTEGRATED = ' '.
it_wbs_elmnt-INV_REASON = ' '.
it_wbs_elmnt-SCALE = ' '.
it_wbs_elmnt-ENVIR_INVEST = ' '.
it_wbs_elmnt-REQUEST_COMP_CODE = ' '.
it_wbs_elmnt-WBS_MRP_ELEMENT = ' '.
it_wbs_elmnt-LOCATION = 'NAI'.
it_wbs_elmnt-VENTURE = ' '.
it_wbs_elmnt-REC_IND = ' '.
it_wbs_elmnt-EQUITY_TYP = ' '.
it_wbs_elmnt-JV_OTYPE = ' '.
it_wbs_elmnt-JV_JIBCL = ' '.
it_wbs_elmnt-JV_JIBSA = ' '.
it_wbs_elmnt-WBS_BASIC_START_DATE = ' '.
it_wbs_elmnt-WBS_BASIC_FINISH_DATE = ' '.
it_wbs_elmnt-WBS_FORECAST_START_DATE = ' '.
it_wbs_elmnt-WBS_FORECAST_FINISH_DATE = ' '.
it_wbs_elmnt-WBS_ACTUAL_START_DATE = ' '.
it_wbs_elmnt-WBS_ACTUAL_FINISH_DATE = ' '.
it_wbs_elmnt-WBS_BASIC_DURATION = '0.0'.
it_wbs_elmnt-WBS_BASIC_DUR_UNIT = ' '.
it_wbs_elmnt-WBS_BASIC_DUR_UNIT_ISO = ' '.
it_wbs_elmnt-WBS_FORECAST_DURATION = '0.0'.
it_wbs_elmnt-WBS_FORCAST_DUR_UNIT = ' '.
it_wbs_elmnt-WBS_FORECAST_DUR_UNIT_ISO = ' '.
it_wbs_elmnt-WBS_ACTUAL_DURATION = '0.0'.
it_wbs_elmnt-WBS_ACTUAL_DUR_UNIT = ' '.
it_wbs_elmnt-WBS_ACTUAL_DUR_UNIT_ISO = ' '.
it_wbs_elmnt-WBS_LEFT = ' '.
it_wbs_elmnt-WBS_UP = ' '.
it_wbs_elmnt-FUNC_AREA = ' '.
CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
EXPORTING
i_project_definition = 'N12G16T01'
TABLES
it_wbs_element = it_wbs_elmnt
et_return = it_ret1
* EXTENSIONIN =
* EXTENSIONOUT =
.
if it_ret1 is initial.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
TABLES
et_return = it_ret1.
*READ TABLE it_ret1 WITH KEY type = 'E'.
*IF sy-subrc NE 0.
* CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*ENDIF.
if it_ret1 is initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
endif.
endif.
What could be the problem?
Regards.
2012 Aug 03 10:40 AM
Hi,
The internal table IT_WBS_ELEMENT doesn't seem to have any value.
I think you forgot to append the header line to internal table.
Check the table in debug mode.
Thanks,
Shambu
Hi All,
Can you help me figure out why on executing below program i keep receiving runtime error
Short text of error message: Precommit has not be called yet
Long text of error message:
Technical information about the message:
Message class....... "CNIF_PI"
Number.............. 030
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
Error in internal table it_ret1 is
NIF_PI 032 |No data has been changed, precommit will not be executed.
See below code
DATA: it_proj_def TYPE TABLE OF bapi_project_definition_ex
WITH HEADER LINE,
it_wbs_elmnt TYPE TABLE OF bapi_bus2054_new WITH HEADER LINE,
it_ret1 TYPE TABLE OF bapiret2 WITH HEADER LINE.
*it_wbs_elmnt-wbs_element = 'N12G16T011'.
*it_wbs_elmnt-description = 'WBS_Upload'.
*it_wbs_elmnt-responsible_no = it_proj_def-responsible_no.
*it_wbs_elmnt-applicant_no = it_proj_def-applicant_no.
*it_wbs_elmnt-company_code = it_proj_def-comp_code.
*it_wbs_elmnt-business_area = it_proj_def-bus_area.
*it_wbs_elmnt-controlling_area = it_proj_def-controlling_area.
*it_wbs_elmnt-profit_ctr = it_proj_def-profit_ctr.
*it_wbs_elmnt-request_cctr = itab-req_cc.
*it_wbs_elmnt-calendar = it_proj_def-calendar.
*it_wbs_elmnt-currency = it_proj_def-project_currency.
*it_wbs_elmnt-currency_iso = it_proj_def-project_currency_iso.
*it_wbs_elmnt-plant = it_proj_def-plant.
*it_wbs_elmnt-user_field_key = '0000001'.
*it_wbs_elmnt-wbs_summarization = 'X'.
*it_wbs_elmnt-objectclass = it_proj_def-objectclass.
*it_wbs_elmnt-interest_prof = '0000001'.
*start
CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
it_wbs_elmnt-WBS_ELEMENT = 'N12G16T011'.
it_wbs_elmnt-DESCRIPTION = 'WBS Upload'.
it_wbs_elmnt-RESPONSIBLE_NO = '00000100'.
it_wbs_elmnt-APPLICANT_NO = '00000000'.
it_wbs_elmnt-COMPANY_CODE = 'NSSF'.
it_wbs_elmnt-BUSINESS_AREA = ' '.
it_wbs_elmnt-CONTROLLING_AREA = 'NSSF'.
it_wbs_elmnt-PROFIT_CTR = '10100'.
it_wbs_elmnt-PROJ_TYPE = 'ZG'.
it_wbs_elmnt-WBS_PLANNING_ELEMENT = ' '.
it_wbs_elmnt-WBS_ACCOUNT_ASSIGNMENT_ELEMENT = ' '.
it_wbs_elmnt-WBS_BILLING_ELEMENT = ' '.
it_wbs_elmnt-CSTG_SHEET = 'A00000'.
it_wbs_elmnt-OVERHEAD_KEY = ' '.
it_wbs_elmnt-RES_ANAL_KEY = '000001'.
it_wbs_elmnt-REQUEST_CCTR_CONTROLLING_AREA = ' '.
it_wbs_elmnt-REQUEST_CCTR = ' '.
it_wbs_elmnt-RESPSBL_CCTR_CONTROLLING_AREA = ' '.
it_wbs_elmnt-RESPSBL_CCTR = ' '.
it_wbs_elmnt-CALENDAR = 'KE'.
it_wbs_elmnt-PRIORITY = ' '.
it_wbs_elmnt-EQUIPMENT = ' '.
it_wbs_elmnt-FUNCT_LOC = ' '.
it_wbs_elmnt-CURRENCY = 'KES'.
it_wbs_elmnt-CURRENCY_ISO = 'KES'.
it_wbs_elmnt-PLANT = '1000'.
it_wbs_elmnt-USER_FIELD_KEY = 'ZNSSF'.
it_wbs_elmnt-USER_FIELD_CHAR20_1 = ' '.
it_wbs_elmnt-USER_FIELD_CHAR20_2 = ' '.
it_wbs_elmnt-USER_FIELD_CHAR10_1 = ' '.
it_wbs_elmnt-USER_FIELD_CHAR10_2 = ' '.
it_wbs_elmnt-USER_FIELD_QUAN1 = '0.000'.
it_wbs_elmnt-USER_FIELD_UNIT1 = ' '.
it_wbs_elmnt-USER_FIELD_UNIT1_ISO = ' '.
it_wbs_elmnt-USER_FIELD_QUAN2 = '0.000'.
it_wbs_elmnt-USER_FIELD_UNIT2 = ' '.
it_wbs_elmnt-USER_FIELD_UNIT2_ISO = ' '.
it_wbs_elmnt-USER_FIELD_CURR1 = ' '.
it_wbs_elmnt-USER_FIELD_CUKY1 = ' '.
it_wbs_elmnt-USER_FIELD_CUKY1_ISO = ' '.
it_wbs_elmnt-USER_FIELD_CURR2 = '0.000'.
it_wbs_elmnt-USER_FIELD_CUKY2 = ' '.
it_wbs_elmnt-USER_FIELD_CUKY2_ISO = ' '.
it_wbs_elmnt-USER_FIELD_DATE1 = ' '.
it_wbs_elmnt-USER_FIELD_DATE2 = ' '.
it_wbs_elmnt-USER_FIELD_FLAG1 = ' '.
it_wbs_elmnt-USER_FIELD_FLAG2 = ' '.
it_wbs_elmnt-WBS_CCTR_POSTED_ACTUAL = ' '.
it_wbs_elmnt-WBS_SUMMARIZATION = 'X'.
it_wbs_elmnt-OBJECTCLASS = 'PROFT'.
it_wbs_elmnt-STATISTICAL = ' '.
it_wbs_elmnt-TAXJURCODE = ' '.
it_wbs_elmnt-INTEREST_PROF = '0000001'.
it_wbs_elmnt-INVEST_PROFILE = ' '.
it_wbs_elmnt-EVGEW = ' '.
it_wbs_elmnt-CHANGE_NO = ' '.
it_wbs_elmnt-SUBPROJECT = ' '.
it_wbs_elmnt-PLANINTEGRATED = ' '.
it_wbs_elmnt-INV_REASON = ' '.
it_wbs_elmnt-SCALE = ' '.
it_wbs_elmnt-ENVIR_INVEST = ' '.
it_wbs_elmnt-REQUEST_COMP_CODE = ' '.
it_wbs_elmnt-WBS_MRP_ELEMENT = ' '.
it_wbs_elmnt-LOCATION = 'NAI'.
it_wbs_elmnt-VENTURE = ' '.
it_wbs_elmnt-REC_IND = ' '.
it_wbs_elmnt-EQUITY_TYP = ' '.
it_wbs_elmnt-JV_OTYPE = ' '.
it_wbs_elmnt-JV_JIBCL = ' '.
it_wbs_elmnt-JV_JIBSA = ' '.
it_wbs_elmnt-WBS_BASIC_START_DATE = ' '.
it_wbs_elmnt-WBS_BASIC_FINISH_DATE = ' '.
it_wbs_elmnt-WBS_FORECAST_START_DATE = ' '.
it_wbs_elmnt-WBS_FORECAST_FINISH_DATE = ' '.
it_wbs_elmnt-WBS_ACTUAL_START_DATE = ' '.
it_wbs_elmnt-WBS_ACTUAL_FINISH_DATE = ' '.
it_wbs_elmnt-WBS_BASIC_DURATION = '0.0'.
it_wbs_elmnt-WBS_BASIC_DUR_UNIT = ' '.
it_wbs_elmnt-WBS_BASIC_DUR_UNIT_ISO = ' '.
it_wbs_elmnt-WBS_FORECAST_DURATION = '0.0'.
it_wbs_elmnt-WBS_FORCAST_DUR_UNIT = ' '.
it_wbs_elmnt-WBS_FORECAST_DUR_UNIT_ISO = ' '.
it_wbs_elmnt-WBS_ACTUAL_DURATION = '0.0'.
it_wbs_elmnt-WBS_ACTUAL_DUR_UNIT = ' '.
it_wbs_elmnt-WBS_ACTUAL_DUR_UNIT_ISO = ' '.
it_wbs_elmnt-WBS_LEFT = ' '.
it_wbs_elmnt-WBS_UP = ' '.
it_wbs_elmnt-FUNC_AREA = ' '.
CALL FUNCTION 'BAPI_BUS2054_CREATE_MULTI'
EXPORTING
i_project_definition = 'N12G16T01'
TABLES
it_wbs_element = it_wbs_elmnt
et_return = it_ret1
* EXTENSIONIN =
* EXTENSIONOUT =
.
if it_ret1 is initial.
CALL FUNCTION 'BAPI_PS_PRECOMMIT'
TABLES
et_return = it_ret1.
*READ TABLE it_ret1 WITH KEY type = 'E'.
*IF sy-subrc NE 0.
* CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*ENDIF.
if it_ret1 is initial.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
endif.
endif.
What could be the problem?
Regards.
2012 Aug 03 10:40 AM
Hi,
The internal table IT_WBS_ELEMENT doesn't seem to have any value.
I think you forgot to append the header line to internal table.
Check the table in debug mode.
Thanks,
Shambu
2012 Aug 03 11:06 AM
Thank you Shambu sometimes extra pairs of eyes can be of great help in solving .
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |