Edit IDOC document properties
Once the IDOC definition is imported in the Mapping Designer make sure to set Max Occurences on the document root (DC1)
Use unlimited (-1) or 9999
- IDOCs are send from SAP to a queue with append
- File is read and mapped to edifact
- The transaction set header is set in New Mapping and the footer in Mapping End as found in the additional programs (tpå of source message)
- For each document / message you can use New Message and Message End

An utillity to get a random UUID
This is a procedure to use in Seeburger BIC Mapping Designer
/* -----------------------------
Peter Lykkegaard, 25 apr 2023
-----------------------------
procedure getUUID
Parameters:
None
Output
String
Create random UUID
----------------------------- */
#importJavaStart
import java.util.UUID;
#importJavaEnd
local output%;
#javastart
_StrVar_OUTPUT.setString(UUID.randomUUID().toString());
#javaend
exitProc(output%);
Unable to load project or solution in Visual Studio 2022
Windows 10
After updating Visual Studio you are no longer able to load source files in your solution
Error message: Load failed, the project file cannot be loaded
The update has messed up you path settings as you have both 64bit and 32bit version of dotnet running
In the environment settings / system variables move the <drive>\program files\dotnet 64bit path above the <drive>\program files (x86)\dotnet 32bit path
Save and you are ready to use VS 2022 after having updated the platform to latest version
Open Control panel -> System and the Advanced System Settings

Choose Environment Variables

In System Variables edit the Path settings

Move the 64 bit dotnet path above the 32bit path

When done click Ok and restart VS 2022

C# .NET Core 6: Get rootname, namespace or DTD using xmlreader
using (var stream = new MemoryStream())
{
FormFile?.CopyTo(stream);
stream.Seek(0, SeekOrigin.Begin);
var settings = new XmlReaderSettings()
{
// Parse file but do not reolve
DtdProcessing = DtdProcessing.Parse,
XmlResolver = null
};
using (var reader = XmlReader.Create(stream, settings))
{
var done = false;
while (reader.Read() && !done)
{
// something weird happened, bail out
//if (reader.EOF)
// return;
switch (reader.NodeType)
{
// Assume cXML
case XmlNodeType.DocumentType:
DocumentType = reader.GetAttribute("SYSTEM") + "";
break;
case XmlNodeType.Element:
switch (reader.LocalName)
{
// Assume an UBL dpcument of some kind
case "CustomizationID":
reader.Read();
SetCustomization(reader.Value);
break;
// Only OIOUBL, done and exit
case "UBLlVersionID":
reader.Read();
UblVersion = reader.Value;
done = true;
break;
// Only OIOXML, done and exit
case "TypeCode":
reader.Read();
TypeCode = reader.Value;
done = true;
break;
default:
if (string.IsNullOrEmpty(RootName))
{
RootName = reader.Name;
SetNamespace(reader.NamespaceURI);
}
break;
}
break;
}
}
reader.Close();
}
}
23. July 2023
plykkegaard