‎2021 Sep 08 1:33 PM
Hello,
I have to create an XML output file with multiple header lines in ABAP. Below is the detailed requirement.
Standard header generated in XSLT transformation is giving this line- <?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
But I have to add an additional header line like below along with the standard header
<?xmlversion="1.0" encoding="utf-8"?><wm1:PayStubLoad xmlns:wm1="XXXXXXXXXX"
wm1:numberRecords="000000182"
wm1:fileDateTime="2021-06-04T00:37:12.900Z"
wm1:fileToken="XXXXXXXXX"
wm1:employerCode="XXXX"
xmlns:xsi="XXXXXXX"
xsi:schemaLocation="XXXXXXXXXXXXXXXXXX">
<PayStub wm1:forgotPINPostalCode="XXXX"
wm1:employeeDefaultPIN="XXXX"
wm1:payPeriodEndDate="XXXXX"
wm1:payPeriodStartDate="XXXXX"
wm1:payStubAccessibleDate="XXXXX"
wm1:payDate="XXXXX"
wm1:adviceNumber="XXXXX"
wm1:employeeCode="XXXXXX" /></wm1:PayStubLoad>
Could you please help how can we achieve this.
Thanks & Regards,
Srilekha
‎2021 Sep 08 2:04 PM
Please edit your question, select your XML code and press the "CODE" button to make it correctly colorized/indented, so that it's easier for us to analyze it. Thank you.
<?xml version="1.0" encoding="utf-8"?>
<wm1:PayStubLoad xmlns:wm1="XXXXXXXXXX"
wm1:numberRecords="000000182"
wm1:fileDateTime="2021-06-04T00:37:12.900Z"
wm1:fileToken="XXXXXXXXX"
wm1:employerCode="XXXX"
xmlns:xsi="XXXXXXX"
xsi:schemaLocation="XXXXXXXXXXXXXXXXXX">
<PayStub wm1:forgotPINPostalCode="XXXX"
wm1:employeeDefaultPIN="XXXX"
wm1:payPeriodEndDate="XXXXX"
wm1:payPeriodStartDate="XXXXX"
wm1:payStubAccessibleDate="XXXXX"
wm1:payDate="XXXXX"
wm1:adviceNumber="XXXXX"
wm1:employeeCode="XXXXXX" />
</wm1:PayStubLoad>
‎2021 Sep 08 2:07 PM
I think you could follow a tutorial to create the simplest XSLT transformation and after that tell us what is your issue, and show your code.
‎2021 Sep 08 2:18 PM
Thanks Sandra.
I have created an XSLT transformation and was able to achieve the below output.

But my question is how to achieve multiple header tags as in below.
<?xml version="1.0" encoding="utf-8"?> <wm1:PayStubLoad xmlns:wm1="XXXXXXXXXX" wm1:numberRecords="000000182" wm1:fileDateTime="2021-06-04T00:37:12.900Z" wm1:fileToken="XXXXXXXXX" wm1:employerCode="XXXX" xmlns:xsi="XXXXXXX" xsi:schemaLocation="XXXXXXXXXXXXXXXXXX">
This is the user expected format from SAP.
Regards,
Srilekha.