Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in open dataset

Former Member
0 Likes
529

Hi Friends

Earlier I used FTP option for picking and transferring files, now Instaed of FTP I am going with application server concept.

while receving, there is no problem between two types.But while transfrring the XML file from SAP to application server it generated some error, the format is not correect like that.But if I pass the same value in foreground its working fine.

here I am attaching the coding for application server and foreground method

open dataset filename for output in binary mode.
*open dataset filename for output in TEXT MODE Encoding UTF-8.

loop at it_xml.

  transfer it_xml to filename.

endloop.

  close dataset filename.

foreground coding

CALL METHOD cl_gui_frontend_services=>gui_download
  EXPORTING
    bin_filesize = l_xml_size
    filename     = 'C:\Delete_Parked_data.xml'
    filetype     = 'BIN'
  CHANGING
    data_tab     = l_xml_table
  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.

I dont know how to convert this binary file into xml format in Application server concept.

please help me to resolve this.

Thanks

Gowrishankar

3 REPLIES 3
Read only

Former Member
0 Likes
491

HI,

YOu can use CALL TRANSFORMATION for converting into XML format .

CALL TRANSFORMATION id SOURCE root = lt_TABLE

RESULT XML it_xml.

Then call DATASET

Regards,

Seema

Read only

Former Member
0 Likes
491

I solved this issue.

Read only

0 Likes
491

Could you please share your solution?

Greetings,

Blag.