2012 Apr 19 7:13 PM
I have enhanced the CNMASS_WBS_ELEMENT structure (by appending a structure) to allow the custom fields to be updated. However, upon executing the transaction CNMASS for updating WBS it results in a short dump:
· Category ABAP Programming Error
· Runtime Errors CONNE_IMPORT_WRONG_STRUCTURE
· Except. CX_SY_IMPORT_MISMATCH_ERROR
· ABAP Program R_BAPI_PROJECT_MAINTAIN
· Application Component PS-ST-OPR
Upon debug, we have the following analysis for the dump:
Analysis: While EXPORT (in the FM CNMASS_DO_MASS_CHANGES), the table I_WBS_ELEMENT_TABLE is of type CNMASS_WBS_ELEMENT [with 93 fields: 87 std. + 6 custom]. While IMPORT (in the report R_BAPI_PROJECT_MAINTAIN), the table I_WBS_ELEMENT_TABLE is of type BAPI_WBS_ELEMENT (which also has the same append structure as the CNMASS_WBS_ELEMENT). This BAPI structure has 89 fields [83 std. + 6 custom]. The following 4 fields are present in CNMASS_WBS_ELEMENT but not in BAPI_WBS_ELEMENT:
· RELEASE
· LOCK
· TECH_COMPLETE
· DELETE
Interestingly, if the append structure is removed from CNMASS structure, the dump does not occur.
Ques: Is there any way to make the 2 structures similar to avoid this dump? (We tried to append the 4 fields in BAPI structure, but it does not work).
Thanks,
I have enhanced the CNMASS_WBS_ELEMENT structure (by appending a structure) to allow the custom fields to be updated. However, upon executing the transaction CNMASS for updating WBS it results in a short dump:
· Category ABAP Programming Error
· Runtime Errors CONNE_IMPORT_WRONG_STRUCTURE
· Except. CX_SY_IMPORT_MISMATCH_ERROR
· ABAP Program R_BAPI_PROJECT_MAINTAIN
· Application Component PS-ST-OPR
Upon debug, we have the following analysis for the dump:
Analysis: While EXPORT (in the FM CNMASS_DO_MASS_CHANGES), the table I_WBS_ELEMENT_TABLE is of type CNMASS_WBS_ELEMENT [with 93 fields: 87 std. + 6 custom]. While IMPORT (in the report R_BAPI_PROJECT_MAINTAIN), the table I_WBS_ELEMENT_TABLE is of type BAPI_WBS_ELEMENT (which also has the same append structure as the CNMASS_WBS_ELEMENT). This BAPI structure has 89 fields [83 std. + 6 custom]. The following 4 fields are present in CNMASS_WBS_ELEMENT but not in BAPI_WBS_ELEMENT:
· RELEASE
· LOCK
· TECH_COMPLETE
· DELETE
Interestingly, if the append structure is removed from CNMASS structure, the dump does not occur.
Ques: Is there any way to make the 2 structures similar to avoid this dump? (We tried to append the 4 fields in BAPI structure, but it does not work).
Thanks,
2012 Apr 19 7:31 PM
You will have to enhance the BAPI using the "Customer Enhancement Concept for BAPI's". All Customer-defined fields will be processed automatically because the use of BAPI table extensions. These extensions are searched for in the ExtensionIn parameter in the BAPI program code.
The standard SAP Documentation: http://help.sap.com/saphelp_45b/helpdata/en/b9/323056db5d11d1ad10080009b0fb56/frameset.htm
The steps are as follows:
1. Append Z structure in table with the customize fields.
2. In BAPI you need to use EXTENSIONIN parameter for BAPI extension
3. Define these customer structures in the structures using INCLUDE or APPEND.
5. Add the customer structures to the BAPI structures using the APPEND technique.
4. If the EXTENSIONIN parameter contains customer data, you must complete at least the key fields in the relevant standard parameters.
5. Add logic for BAPI extension in customized program
Regards,
Shyam
2012 Apr 19 8:55 PM
Hi Shyam,
CNMASS is a standard transaction. The BAPI is trigerred by the std. code itself to update/enhance the fields. There is no code written to disrupt the CNMASS change flow.
The BAPI structure is enhanced for a different custom program. Infact even while development of the Z-program, the EXTENSIONIN structure did NOT update the custom fields of the PRPS table, hence the append structure was used to enhance the BAPI_WBS_ELEMENT.
Thanks!
2013 Feb 18 2:24 PM
We tried to integrate the 4 fields
· RELEASE
· LOCK
· TECH_COMPLETE
· DELETE
as append 1 to bapi_wbs_element, then as second structure the ZZ fields of PRPS.
BAPI_PROJECT_MAINTAIN starts in a correct way, but when he tries to import from memory, we get a shortdump.
Even if the exporting table has structure BAPI_WBS_ELEMENT and the importing table has structure BAPI_WBS_ELEMENT.
Could you find a solution? We are facing the same problem! I can't understand why it is dumping.
2014 May 22 3:46 PM
Actually, I searched in vain for a solution for this issue but couldn't find one till yesterday. So here is how it worked for me. We had custom fields on the WBS which were added to the screens (CJ20n etc.) and could be maintained from there.
Our requirement was that based on values on a standard field, the custom fields must be populated with a value from a custom table. This worked fine in the PBO/PAI screen flow logic as well as the for FM BAPI_BUS2054_CHANGE_MULTI using the EXTENSIONIN approach. The issue was that CNMASS for whatever reason, did not use either the screen or the aforementioned BAPI. CNMASS, uses FM BAPI_PROJECT_MAINTAIN which really has not support for custom fields.
And so I began debugging this FM and found an appropriate spot to implement an Enhancement point. I used the start and end of FM CNIF_CHANGE_STRUCTURE to implement the enhancement point.
I hope this helps someone looking for this in the future. No SAP modification is required to achieve this (whether in code or in Data dictionary)
Thanks,
Ash