sap-dotnet-connectoridoc

Cast 'IDOCTYPE_READ_COMPLETE' to 'RfcRepository' [.Net Connector 3]


I'm working on C# application for one of our customers. We have already defined some IDOC structures. All the specifications are in an Excel sheet.

So the question is: It's possible to get the whole IDOC structure from the 'IDOCTYPE_READ_COMPLETE' function and parse / load it somehow to a 'RfcStructureMetadata' object?

Additional info: Im allowed to send IDOC to the ABAB backend just with the 'IDOC_INBOUND_ASYNCHRONOUS' function > 'IDOC_DATA_REC_40' table > 'SDATA' field. But I can't create any Structure since I do not have any metadata yet.

Hopefully makes sense, Thank you in advice


Solution

  • There is no easy / build in way to achieve this with the SAP NCO 3 connector. Are the todo's if someone wants to communicate with SAP just with the IDOC_INBOUND_ASYNCHRONOU RFC function.

    1. Get the IDoc structure with IDOCTYPE_READ_COMPLETE function.
    2. Write functions which can cast from and to the SDATA field from the IDOC_DATA_REC_40 table to your own 'business' objects. To 'cut' the SDATA field you will need the EXTLEN field (IDOCTYPE_READ_COMPLETE function PT_FIELDS table). This is something like char offset.
    3. Be aware that IDOC can contain multiple segments and/or list of segments. And the same for segments (recrusion). The references are maintained with the SEGNUM and PARNO, you have to set these in the IDOC_INBOUND_ASYNCHRONOUS function IDOC_DATA_REC_40 table. You can get these values in IDOCTYPE_READ_COMPLETE function and PT_SEGMENTS table.