Openbravo Issue Tracking System - Modules
View Issue Details
0040968ModulesSAP Connectorpublic2019-05-29 10:222019-06-28 12:06
airaceburu 
AugustoMauch 
normalmajoralways
closedfixed 
5
 
 
caristu
0040968: Idocs without main segment can not be imported
There are idocs without a main segment, that represent a single entity per file. In this case the sub segments are being recognized as different idocs with different structure. There needs to be a way to import this kind of iDocs.

For instance, WP_PER idocs have a main segment called E1WPP01 (see attached WP_PER_WITH_MAIN_SEGMENT.xml file).

Other idocs do not have an idoc segment. For instance, if WP_PER would not have a main segment, it would like like the WP_PER_WITHOUT_MAIN_SEGMENT.xml attached file).
In an environment with the SAP Connector installed:
- Configure the connector to import data from /tmp/idocs:
* Open the Communication with SAP ECC Server window
* Add a new row: Communication Protocol -> Debug, Path to iDoc Folder -> /tmp/idocs
- Copy the attached WP_PER_WITHOUT_MAIN_SEGMENT.xml to /tmp/idocs
- Open the Process Request window, and execute the SAP ECC Import Synchronization Process.
- An EDL request will not be created, and the following error will be shown in the log:

2019-06-25 15:41:47,532 [Import Entry - 1] ERROR org.openbravo.externaldata.integration.process.AsynchronousProcessor - Unexpected error processing item
org.openbravo.base.exception.OBException: Error while importing an item: null
    at org.openbravo.service.external.integration.edl.BaseImportItemProcessor.processItem(BaseImportItemProcessor.java:69) ~[classes/:?]
    at org.openbravo.externaldata.integration.process.AsynchronousProcessor.processBatchWithInput(AsynchronousProcessor.java:235) [classes/:?]
    at org.openbravo.externaldata.integration.process.AsynchronousProcessor.processBatch(AsynchronousProcessor.java:211) [classes/:?]
    at org.openbravo.externaldata.integration.process.ProcessRequest.processRequestLine(ProcessRequest.java:477) [classes/:?]
    at org.openbravo.externaldata.integration.process.EDLImportEntryProcessor$EDLEntryProcessRunnable.processEntry(EDLImportEntryProcessor.java:154) [classes/:?]
    at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.doRunCycle(ImportEntryProcessor.java:372) [classes/:?]
    at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.run(ImportEntryProcessor.java:293) [classes/:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_181]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_181]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_181]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_181]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.lang.NullPointerException
    at org.openbravo.service.external.integration.SynchronizableBusinessObject.getTypeSafeValue(SynchronizableBusinessObject.java:97) ~[classes/:?]
    at org.openbravo.service.external.integration.importer.DalSynchronizableBusinessObjectImporter.getBobFromUniqueProperties(DalSynchronizableBusinessObjectImporter.java:144) ~[classes/:?]
    at org.openbravo.service.external.integration.importer.DalSynchronizableBusinessObjectImporter.getBaseOBObjectFromDatabase(DalSynchronizableBusinessObjectImporter.java:128) ~[classes/:?]
    at org.openbravo.service.external.integration.importer.DalSynchronizableBusinessObjectImporter.getMappedItem(DalSynchronizableBusinessObjectImporter.java:75) ~[classes/:?]
    at org.openbravo.service.external.integration.importer.DalSynchronizableBusinessObjectImporter.getMappedItem(DalSynchronizableBusinessObjectImporter.java:1) ~[classes/:?]
    at org.openbravo.service.external.integration.importer.SynchronizableBusinessObjectImporter.createOrUpdateItem(SynchronizableBusinessObjectImporter.java:132) ~[classes/:?]
    at org.openbravo.service.external.integration.importer.SynchronizableBusinessObjectImporter.importFromSynchronizableBusinessObject(SynchronizableBusinessObjectImporter.java:107) ~[classes/:?]
    at org.openbravo.service.external.integration.edl.BaseImportItemProcessor.importSBO(BaseImportItemProcessor.java:88) ~[classes/:?]
    at org.openbravo.service.external.integration.edl.BaseImportItemProcessor.processItem(BaseImportItemProcessor.java:63) ~[classes/:?]
    ... 11 more
N/A
No tags attached.
diff issue40968.diff (31,626) 2019-05-29 13:22
https://issues.openbravo.com/file_download.php?file_id=12993&type=bug
xml WP_PER_WITH_MAIN_SEGMENT.xml (1,002) 2019-06-25 15:43
https://issues.openbravo.com/file_download.php?file_id=13056&type=bug
xml WP_PER_WITHOUT_MAIN_SEGMENT.xml (961) 2019-06-25 15:43
https://issues.openbravo.com/file_download.php?file_id=13057&type=bug
Issue History
2019-05-29 10:22airaceburuNew Issue
2019-05-29 10:22airaceburuAssigned To => AugustoMauch
2019-05-29 10:22airaceburuFile Added: ORDERS05.xml
2019-05-29 10:22airaceburuResolution time => 1560290400
2019-05-29 13:22AugustoMauchFile Added: issue40968.diff
2019-06-25 11:32AugustoMauchFile Deleted: ORDERS05.xml
2019-06-25 15:43AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=18997#r18997
2019-06-25 15:43AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18999#r18999
2019-06-25 15:43AugustoMauchFile Added: WP_PER_WITH_MAIN_SEGMENT.xml
2019-06-25 15:43AugustoMauchFile Added: WP_PER_WITHOUT_MAIN_SEGMENT.xml
2019-06-25 16:08hgbotCheckin
2019-06-25 16:08hgbotNote Added: 0113010
2019-06-25 16:08hgbotStatusnew => resolved
2019-06-25 16:08hgbotResolutionopen => fixed
2019-06-25 16:08hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sapecc/rev/80e7a7111d9a0cc6b25c5b52a14f01ef3f50cf1c [^]
2019-06-26 08:49hgbotCheckin
2019-06-26 08:49hgbotNote Added: 0113025
2019-06-26 09:44hgbotCheckin
2019-06-26 09:44hgbotNote Added: 0113026
2019-06-28 12:06caristuReview Assigned To => caristu
2019-06-28 12:06caristuNote Added: 0113103
2019-06-28 12:06caristuStatusresolved => closed

Notes
(0113010)
hgbot   
2019-06-25 16:08   
Repository: erp/pmods/org.openbravo.service.integration.sapecc
Changeset: 80e7a7111d9a0cc6b25c5b52a14f01ef3f50cf1c
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 25 16:08:43 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sapecc/rev/80e7a7111d9a0cc6b25c5b52a14f01ef3f50cf1c [^]

Fixes issue 40968: SAP Connector supports idocs that do not have idoc header

Now, when defining a SAP Entity Mapping that defines an entity being import into Openbravo, it is
possible to specify if the given idoc has a header segment. The IdocUnwrapper class requires that
all idocs have header segmentse, so now those headers are added to those idocs that do not define
one.

All idocs defined so far have a header segment, an oncreatedefault has been defined to 'Y' to
ensure those idocs are processed the same way as before.

---
M src-db/database/model/modifiedTables/OBEI_ENTITY_MAPPING.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src/org/openbravo/service/integration/sapecc/edl/ImportDataProcessor.java
---
(0113025)
hgbot   
2019-06-26 08:49   
Repository: erp/pmods/org.openbravo.service.external.integration.tests
Changeset: ac022381aefcf710669eb4f2722ed38cfd9c968f
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Jun 26 08:49:23 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.external.integration.tests/rev/ac022381aefcf710669eb4f2722ed38cfd9c968f [^]

related to issue 40968: fix DB consistency

---
M src-db/database/sourcedata/OBEI_ENTITY_MAPPING.xml
---
(0113026)
hgbot   
2019-06-26 09:44   
Repository: erp/pmods/org.openbravo.service.integration.sap.ecc.mappings
Changeset: 51ae709f7606d8d087d67b4e94dd2995528ae2cb
Author: Álvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Jun 26 09:44:04 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sap.ecc.mappings/rev/51ae709f7606d8d087d67b4e94dd2995528ae2cb [^]

Related to issue 40968: Fix DB consistency

---
M src-db/database/sourcedata/OBEI_ENTITY_MAPPING.xml
---
(0113103)
caristu   
2019-06-28 12:06   
Reviewed + tested OK.

Working for both IDocs: with and without the main segment header