cancel
Showing results for 
Search instead for 
Did you mean: 

How to update or insert data to XML in MIMES

Former Member
0 Kudos

Hi All,

Am trying to pass the data to the XML which I uploaded in my WDA MIMES , which is having some static data , as per my requirment the data I will get from my FM I need to pass to thos XML @ MIMES.....to generate the graphics.

Your suggestions are more helpful.

Regards

Rajesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

DATA: xmldata TYPE xstring ,

         mr      TYPE REF TO if_mr_api.

   mr = cl_mime_repository_api=>get_api( ).

To read data from mime :


   mr->get( EXPORTING  i_url     = 'SAP/PUBLIC/BC/YOUR_FILE.xml'

IMPORTING  e_content = xmldata ).

To write data into mime:


   mr->put( EXPORTING  i_url     = 'SAP/PUBLIC/BC/YOUR_FILE.xml'

             i_content = xmldata ).

Former Member
0 Kudos

Hi Upendra,

Thanks man, I knew that I will answer from you...your reply met my requirment to solve.

Former Member
0 Kudos

Hi Upendra,

Am facing an  another issue with MIME file update and release ,

Am able to update the XML in the MIME using the above code for first time, but its not updating for the 2nd time...its updating only when I closes the browser...so what I understood is... the XML is still in use after the first time I updated.

  CONCATENATE '<chart numberPrefix='''' yAxisName=''PAY''xAxisName=''RAJESH'' caption=''Weekly Sales Summary''> '
  '<set value=''14400'' label=''1st Week ''/> '
  '<set value=''19600'' label=''2nd Week ''/>'
  '<set value=''24000'' label=''3rd Week ''/>'
  '<set value=''15'' label=''4th Week ''/> '
  '</chart>' INTO XMLDATA_STR.

  CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
      TEXT     = xmldata_str
*     MIMETYPE = ' '
*     ENCODING =
    IMPORTING
      BUFFER   = xmldata.

  mr->PUT(
    exporting
      I_URL                     =   '/sap/bc/webdynpro/sap/Z_FUSIONDEMO/Data.xml'  " Object URL
      I_CONTENT                 =   xmldata   " Object Contents (if exists -> overwrite contents)
  ).


****************** XML read
mr->GET(
   exporting
     I_URL                  =   '/sap/bc/webdynpro/sap/Z_FUSIONDEMO/Data.xml'  " Object URL
   importing
     E_CONTENT              =   XMLDATA1  " Object Contents
).
         cl_abap_conv_in_ce=>create(
              EXPORTING
                encoding    = 'NON-UNICODE'
                endian      = 'L'
              RECEIVING
                conv        = conv
                   ).

            conv->convert(
              EXPORTING
                input           = XMLDATA1     " type xstring
              IMPORTING
                data            = XMLDATA_STR1                     " type string
                   ).

Am getting the update data on text message  , but its not updating on IFrmae,..please suggest me how can I close the XMl after I update ..so that which can be accessable to IFrame.

Answers (0)