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 file creation

Former Member
0 Kudos
174

Hi All,

I have to create an XML file, The input kind is not decided yet . It may be a string or an internal table. I have searched various questions posted here. But they have either the length of the string or they are using the maximum length 255 in the examples.

In my case, if i use string , how will it be handle data which exceeds 255 chars? Also in case, I have to go for internal table, the structure is not fixed yet. But the file generated should look like this :

                                              • XML file contents ***********************

<outgoing_mail>

<document>Document Number</document>

<strsrv_direction>

<archiving>

<archive></archive>

<object> </object>

<objectkey></objectkey>

</archiving>

<local_printing>

<local_print> </local_print>

<printer> </printer>

</local_printing>

<printshop>

<print></print>

</printshop>

<emailing>

<as_text></as_text> (As text or Attachment)

<email_address>Receiver email address</email_address>

</emailing>

</strsrv_direction>

<naw>

<number></number>

<name></name>

<street></street>

<housenumber></housenumber>

<housenr_supplement></housenr_supplement>

<postal_code></postalcode>

<city></city>

</naw>

<textblock_01>

The text from the send email

</textblock_01>

</outgoing_mail>

                                              • XML file contents ***********************

2 REPLIES 2
Read only

former_member221770
Contributor
0 Kudos
149

Namita,

Type string can handle more than 255 characters (look up SAP Help for "string" under "Built in ABAP Types").

If you are using an internal table define it's record type as a string.

eg.


types: begin of ty_rec,
            rec type string,
          end of ty_rec.

data: tbl_data type table of ty_rec.

Hope this helps.

Pat.

Read only

0 Kudos
149

Hi,

I agree to that. But in the case I mentioned, how do I acccept the entire contents in a string?