on 03-01-2010 4:10 PM
My scenarion is to generate a xml file,the xml file contains a header line <?xml version="1.0" encoding="utf-8"?>
and this lineis to be relaced with <XYZ>.
it is multi message mapping -- splitting of messages 1:n, i cannot add any extra fields to the target structure to pass the header
I wrote a abap mapping program and included that in the second step of my interface mapping.
the code for abap mapping is as below.
method IF_MAPPING~EXECUTE.
data: lv_new_str type string,
lv_old_str type string,
lv_string type string.
***Convert the XSTRING to STRING
CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
EXPORTING
im_xstring = source
* IM_ENCODING = 'UTF-8'
IMPORTING
EX_STRING = lv_string .
**Pass the Values
lv_old_str = '<?xml version="1.0" encoding="utf-8"?>'.
lv_new_str = '<!XYZ>.
REPLACE ALL OCCURRENCES OF lv_old_str in lv_string with lv_new_str.
***Convert the STRING to XSTRING.
CALL FUNCTION 'ECATT_CONV_STRING_TO_XSTRING'
EXPORTING
im_string = lv_string
* IM_ENCODING = 'UTF-8'
IMPORTING
EX_XSTRING = result
* EX_LEN = .
endmethod.
But iam not able to get the desired output.
Please suggest me how to make this work?
Thanks
Srinivas
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please suggest me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.