Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XML related question

Former Member
0 Likes
511

Hi all,

I want to make an internal table's data xml file but I do not know much on XML.

Please direct me how to start and how to go on this topic.

Note the xml file should be like this:

<?xml version="1.0" encoding="UTF-8" ?>

- <Transaction>

- <TXNHEAD>

<RecordID>01</RecordID>

<FileName>002</FileName>

<IntermediaryCode>66000004</IntermediaryCode>

<ActualizationDate>20041201</ActualizationDate>

<SequenceNumber>001</SequenceNumber>

<NumberofRecords>0002</NumberofRecords>

<AmountofRecords>2000</AmountofRecords>

</TXNHEAD>

- <TXNDETAIL>

<RecordID>02</RecordID>

<SequenceNumber>001</SequenceNumber>

<TransactionType>01</TransactionType>

<ActionCode>01</ActionCode>

<TransactionID>WF1UPL1</TransactionID>

<SellerCode>66000002</SellerCode>

<BuyerCode>66000004</BuyerCode>

<TransactionReference>Transaction file with id WF1UPL1</TransactionReference>

<TransactionDescription1>To check the amount</TransactionDescription1>

<TransactionDescription2>To check the buy sell account</TransactionDescription2>

<DocumentType>01</DocumentType>

<DocumentNumber>00001</DocumentNumber>

<DocumentDate>20041202</DocumentDate>

<DocumentAmount>1000</DocumentAmount>

<CurrencyCode>840</CurrencyCode>

<TransactionAmount>1000</TransactionAmount>

<TransactionDueDate>20050425</TransactionDueDate>

<AdditionalInformation1>Please check the transaction amount

</AdditionalInformation1>

<AdditionalInformation2>

Should be same as invoice amount where approving

</AdditionalInformation2>

<payaccount>00000012345677</payaccount>

<payswift>0000000010</payswift>

</TXNDETAIL>

- <TXNDETAIL>

<RecordID>02</RecordID>

<SequenceNumber>002</SequenceNumber>

<TransactionType>01</TransactionType>

<ActionCode>01</ActionCode>

<TransactionID>WF1UPL1</TransactionID>

<SellerCode>66000002</SellerCode>

<BuyerCode>66000004</BuyerCode>

<TransactionReference>

Transaction file with id WF1UPL1

</TransactionReference>

<DocumentType>01</DocumentType>

<DocumentNumber>00001</DocumentNumber>

<DocumentDate>20041202</DocumentDate>

<DocumentAmount>1000</DocumentAmount>

<CurrencyCode>840</CurrencyCode>

<TransactionAmount>1000</TransactionAmount>

<TransactionDueDate>20050425</TransactionDueDate>

<AdditionalInformation1>Please check the transaction amount</AdditionalInformation1>

<AdditionalInformation2>Please check the payment amount</AdditionalInformation2>

<payaccount>00000012345678</payaccount>

<payswift>0000000010</payswift>

</TXNDETAIL>

</Transaction>

First question:

Is an internal table is enough or we need one for header data and one for details.

Secondly, How can I create such a file via XML class?

Thanks.

Hi all,

I want to make an internal table's data xml file but I do not know much on XML.

Please direct me how to start and how to go on this topic.

Note the xml file should be like this:

<?xml version="1.0" encoding="UTF-8" ?>

- <Transaction>

- <TXNHEAD>

<RecordID>01</RecordID>

<FileName>002</FileName>

<IntermediaryCode>66000004</IntermediaryCode>

<ActualizationDate>20041201</ActualizationDate>

<SequenceNumber>001</SequenceNumber>

<NumberofRecords>0002</NumberofRecords>

<AmountofRecords>2000</AmountofRecords>

</TXNHEAD>

- <TXNDETAIL>

<RecordID>02</RecordID>

<SequenceNumber>001</SequenceNumber>

<TransactionType>01</TransactionType>

<ActionCode>01</ActionCode>

<TransactionID>WF1UPL1</TransactionID>

<SellerCode>66000002</SellerCode>

<BuyerCode>66000004</BuyerCode>

<TransactionReference>Transaction file with id WF1UPL1</TransactionReference>

<TransactionDescription1>To check the amount</TransactionDescription1>

<TransactionDescription2>To check the buy sell account</TransactionDescription2>

<DocumentType>01</DocumentType>

<DocumentNumber>00001</DocumentNumber>

<DocumentDate>20041202</DocumentDate>

<DocumentAmount>1000</DocumentAmount>

<CurrencyCode>840</CurrencyCode>

<TransactionAmount>1000</TransactionAmount>

<TransactionDueDate>20050425</TransactionDueDate>

<AdditionalInformation1>Please check the transaction amount

</AdditionalInformation1>

<AdditionalInformation2>

Should be same as invoice amount where approving

</AdditionalInformation2>

<payaccount>00000012345677</payaccount>

<payswift>0000000010</payswift>

</TXNDETAIL>

- <TXNDETAIL>

<RecordID>02</RecordID>

<SequenceNumber>002</SequenceNumber>

<TransactionType>01</TransactionType>

<ActionCode>01</ActionCode>

<TransactionID>WF1UPL1</TransactionID>

<SellerCode>66000002</SellerCode>

<BuyerCode>66000004</BuyerCode>

<TransactionReference>

Transaction file with id WF1UPL1

</TransactionReference>

<DocumentType>01</DocumentType>

<DocumentNumber>00001</DocumentNumber>

<DocumentDate>20041202</DocumentDate>

<DocumentAmount>1000</DocumentAmount>

<CurrencyCode>840</CurrencyCode>

<TransactionAmount>1000</TransactionAmount>

<TransactionDueDate>20050425</TransactionDueDate>

<AdditionalInformation1>Please check the transaction amount</AdditionalInformation1>

<AdditionalInformation2>Please check the payment amount</AdditionalInformation2>

<payaccount>00000012345678</payaccount>

<payswift>0000000010</payswift>

</TXNDETAIL>

</Transaction>

First question:

Is an internal table is enough or we need one for header data and one for details.

Secondly, How can I create such a file via XML class?

Thanks.

2 REPLIES 2
Read only

Former Member
0 Likes
481

You could write your opinions also, not just the exact answer.

Thoughts also may be useful.

Please write.

Read only

Former Member
0 Likes
481

Hi,

Check the following link:

http://www.sap-img.com/abap/sample-xml-source-code-for-sap.htm

Regards,

Bhaskar