2008 Nov 06 10:09 AM
Hi Friends,
We are reading a XML file for AP Posting in FB01.
XML file has two elements called - Name1 and Name2 which goes directly into Name1 and Name2 fields for onetime customer during posting.
Name1- 35char
Name2- 35 char.
Problem.
When ever there is a space in 1st position in Name2 of source data, while reading it from xml to string, leading spaces are ignored, which is causing problem.
code in brief: (not the complete code)
DATA: wa_xmltab TYPE xstring,
g_selementvalue TYPE string,
g_selementname TYPE string,
g_childnode TYPE REF TO if_ixml_node,
*l_file is xml file name.
READ DATASET l_file INTO wa_xmltab.
*get element name
g_selementname = g_childnode->get_name( ).
*get value stored in this node.
g_selementvalue = g_childnode->get_value( ).
if name2 = ' ABCDEFGH' ( 3 leading spaces in name2)
it is being read as 'ABCDEFGH' which is causing the problem.
Same is the case if there are trailing spaces.
Appreciate if someone could suggest me an alternative approach of reading the XML data so that leading or trailing spaces are not ignored and retained.
Regards,
Simha
Edited by: Simha on Nov 6, 2008 11:10 AM
Hi Friends,
We are reading a XML file for AP Posting in FB01.
XML file has two elements called - Name1 and Name2 which goes directly into Name1 and Name2 fields for onetime customer during posting.
Name1- 35char
Name2- 35 char.
Problem.
When ever there is a space in 1st position in Name2 of source data, while reading it from xml to string, leading spaces are ignored, which is causing problem.
code in brief: (not the complete code)
DATA: wa_xmltab TYPE xstring,
g_selementvalue TYPE string,
g_selementname TYPE string,
g_childnode TYPE REF TO if_ixml_node,
*l_file is xml file name.
READ DATASET l_file INTO wa_xmltab.
*get element name
g_selementname = g_childnode->get_name( ).
*get value stored in this node.
g_selementvalue = g_childnode->get_value( ).
if name2 = ' ABCDEFGH' ( 3 leading spaces in name2)
it is being read as 'ABCDEFGH' which is causing the problem.
Same is the case if there are trailing spaces.
Appreciate if someone could suggest me an alternative approach of reading the XML data so that leading or trailing spaces are not ignored and retained.
Regards,
Simha
Edited by: Simha on Nov 6, 2008 11:10 AM
2008 Nov 06 10:22 AM
2008 Nov 07 9:33 AM
Hi Renu Gusain,
Thanks for your inputs.
Could you please be more specific towards the problem.
I read the blog and could not relate how to solve the space problem. Thanks
Simha.
Edited by: Simha on Nov 12, 2008 3:57 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |