Skip to Content
1
Jan 25 at 10:53 AM

XML file download

57 Views

Hi Experts,

I need to download the XML file format which was done.

But here my issue was ;When i download the XML some dump showing as 'Blue highlighted'

Please advice.

image.png

DATA: ld_filename TYPE string,
file_path TYPE string,
l_filename TYPE string,
ld_path TYPE string,
ld_fullpath TYPE string,
ld_result TYPE i,
lv_path TYPE rlgrap-filename,"string,
lv_data TYPE string.
DATA: gs_name(30) TYPE c VALUE '_Material Received'.

DATA: ls_string TYPE string.

LOOP AT lt_last1 INTO ls_last1.

gs_xml-line = '<Material Received>'.
APPEND gs_xml TO gt_xml.

gs_xml-line = '<Receiving Number>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = ls_last1-mblnr .
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Receiving Number>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = '<Line Item>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = ls_last1-zeile .
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Line Item>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = '<Purshase Order>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = ls_last1-ebeln .
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Purshase Order>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = '<Part Number>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = ls_last1-matnr .
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Part Number>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = '<Unit Of Entry >' .
APPEND gs_xml TO gt_xml.

gs_xml-line = ls_last1-erfme .
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Unit Of Entry >' .
APPEND gs_xml TO gt_xml.

gs_xml-line = '<Qty Of UOM>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = ls_last1-erfmg .
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Qty Of UOM>' .
APPEND gs_xml TO gt_xml.

gs_xml-line = '<Quantity >' .
APPEND gs_xml TO gt_xml.

gs_xml-line = ls_last1-menge.
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Quantity >' .
APPEND gs_xml TO gt_xml.

gs_xml-line = '<Vendor name >' .
APPEND gs_xml TO gt_xml.

gs_xml-line = ls_last1-name1.
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Vendor name >' .
APPEND gs_xml TO gt_xml.

gs_xml-line = '</Material Received>'.
APPEND gs_xml TO gt_xml.

lv_path = p_file.

CLEAR : lv_data.
CONCATENATE ls_last1-matnr '-' ls_last1-mblnr '-' ls_last1-zeile gs_name INTO lv_data.


* l_filename = p_file.
CONCATENATE lv_path lv_data'.XML' INTO ld_fullpath.
* CONCATENATE lv_path l_filename'.XML' INTO ld_fullpath.
* CONCATENATE l_filename '\' lv_data '.XML' INTO ld_fullpath.

*-----------------------------------------------------------------
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = ld_fullpath
filetype = 'DBF'
CHANGING
data_tab = gt_xml
EXCEPTIONS
OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

REFRESH:gt_xml.
CLEAR: ls_last,ls_last1,lv_path,file_path,l_filename,ld_fullpath.

ENDLOOP.

Attachments

image.png (24.2 kB)