Skip to Content
author's profile photo Former Member
Former Member

XML file

Hello guys,

I ve a XML file, can I upload it into SAP and get all the tags present in the XML file into one single line.

Eg: If i have 10 tags in 10 different lines, can I do something in SAP to get all the 10 tags into a single line?

Regards,

Greg

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2009 at 11:00 AM

    hi,

    try this,

    DATA: xml_data TYPE xstring,

    lt_xml_data TYPE STANDARD TABLE OF xstring.

    APPEND xml_data TO lt_xml_data.

    lo_pdfobj->get_data(

    IMPORTING

    formdata = xml_data ).

    • Convert XML data from XSTRING format to STRING format

    DATA: lv_xml_data_string TYPE string.

    CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'

    EXPORTING

    im_xstring = xml_data

    IMPORTING

    ex_string = lv_xml_data_string.

    • Remove NEW-LINE character from XML data in STRING format

    CLASS cl_abap_char_utilities DEFINITION LOAD.

    REPLACE ALL OCCURENCES OF cl_abap_char_utilities=>newline IN

    lv_xml_data_string WITH ''.

    • Make the XML envelope compliant with identity transform

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

    IN lv_xml_data_string

    WITH '<?xml version="1.0" encoding="iso-8859-1"?><asx:abap xmlns

    :asx="http://www.sap.com/abapxml" version="1.0"> '.

    REPLACE '</data>'

    IN lv_xml_data_string

    WITH '</asx:values></asx:abap>'.

    • Apply the identity transform and convert XML into ABAP in one step

    DATA: wa_VNDBNK type ZVK_VNDBNK VALUE IS INITIAL,

    wa_VENDOR type ZHD_VENDOR value is initial,

    lv_subrc TYPE sysubrc VALUE IS INITIAL,

    lt_messtab TYPE STANDARD TABLE OF bdcmsgcoll,

    l_key type SWR_STRUCT-OBJECT_KEY,

    l_pack type zhd_vendor-lifnr.

    CALL TRANSFORMATION id

    SOURCE XML lv_xml_data_string

    RESULT Z_VNDBNK = wa_vndbnk.

    Regards,

    Arunsri

    Edited by: Arunsri on Sep 17, 2009 1:00 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2009 at 12:20 PM

    HeY Arun,

    Thanks for your reply. Unfortunately this doesnot seem to work. I getting error 'lo_pdfobj Un´known'

    regards,

    greg

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.