Skip to Content
avatar image
Former Member

What is the best way to send 8 lakh records from ZTABLE to FTP location in XML file.

Hello all

What is the best way to send 8 lakh records from ZTABLE to FTP location in XML file.

System: SAP BASIS 6.2 SP57

While i am doing it in Z program i get numerous dumps.

Runtime errors:

1. tvs_tnew_page_alloc_failed Description: No storage available for extending the internal table.

2. Runtime errors: call_function_remote_error Description: The termination occurred in the ABAP program ""SAPLSFTP"" in ""FTP_R3_TO_SERVER""." Showing nothing (only like that "" "")

Any suggestion of handling bulk data.

Sachin Jain

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 06, 2017 at 04:58 AM

    Try to use the Underneath Function Modules and tell if it works(Depends on ur EHP version)...

    Regards,

    Abid Ali

    SAP Abap Consultant

    type-pools: ixml.

    tables: vbak.

    types: begin of ty_vbak,
    vbeln type vbak-vbeln,
    auart type vbak-auart,
    end of ty_vbak.

    data: ty_ftp type standard table of zftpinfo,
    wa_ftp type zftpi,
    l_slen type i,
    lv_user(30) type c,
    lv_pwd(30) type c,
    c_key type i value 26101957.

    data: begin of t_title occurs 0,
    title(4000) type c,
    end of t_title.
    data: temp_file(200) type c.
    data: to_file type char30000.
    data: c_gw type string.
    data: mi_handle type i.

    data: t_vbak type ty_vbak occurs 0 with header line.

    selection-screen begin of block b1 with frame title text-001.
    select-options: so_num for vbak-vbeln.
    selection-screen end of block b1.

    *START OF SELECTION
    start-of-selection.

    select
    vbeln auart
    from vbak into corresponding fields of table t_vbak
    where vbeln in so_num.

    "" FOR GETTING FTP SEVER CONNECTION INFO FROM MAINTAING TABLE

    select * from zftpinfo client specified
    into corresponding fields of table ty_ftp
    where mandt = sy-mandt
    and zcountry = 'BD'.

    clear wa_ftp.
    read table ty_ftp into wa_ftp index 1.

    *CONNECTING TO FTP SERVER.
    perform ftp_connect using wa_ftp-zuser wa_ftp-zpasswd wa_ftp-zhost.

    *CHECKING SUCCESSFUL FTP CONNECTION
    check sy-subrc = 0.

    if t_vbak[] is not initial.
    perform c_xml. " FOR CREATING XML FILE
    endif.

    form c_xml.

    clear t_title[].

    *SERVER DESTINATION FILE PATH.
    concatenate 'SERVER FILE PATH' 'SOINFO' '.xml' into to_file.

    *BUILDING THE XML FILE
    t_title-title = '<?xml version="1.0" encoding="UTF-8"?>'.
    append t_title.
    t_title-title = ' http://www.w3.org/2001/XMLSchema-instance">'.
    append t_title.

    loop at t_vbak.
    concatenate '<SONUM>' t_vbak-vbeln '</SONUM>' into temp_file.
    t_title-title = temp_file.
    append t_title.
    clear temp_file.

    concatenate '<DOCTYPE>' t_vbak-auart '</DOCTYPE>' into temp_file.
    t_title-title = temp_file.
    append t_title.
    clear temp_file.

    endloop.

    t_title-title = '</n1:SalesOderInfo>'.
    append t_title.

    perform r3_ftp using to_file.
    endform.


    form r3_ftp using to_file.
    call function 'FTP_R3_TO_SERVER'
    exporting
    handle = mi_handle
    fname = to_file "file path of destination system
    character_mode = 'X'
    tables
    text = t_title
    exceptions
    tcpip_error = 1
    command_error = 2
    data_error = 3
    others = 4.
    endform.

    form ftp_connect using lv_user lv_pwd lv_host.

    l_slen = strlen( lv_pwd ).

    call function 'HTTP_SCRAMBLE'
    exporting
    source = lv_pwd
    sourcelen = l_slen
    key = c_key
    importing
    destination = lv_pwd.

    call function 'FTP_CONNECT'
    exporting
    user = lv_user "Your SAP-UNIX FTP user name (case sensitive)
    password = lv_pwd "Your SAP-UNIX server host name (case sensitive)
    host = lv_host
    rfc_destination = 'SAPFTPA'
    importing
    handle = mi_handle
    exceptions
    not_connected = 1
    others = 2.

    endform.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2017 at 05:52 AM

    Hi Abid

    Thanks for response. Let me rewrite program as per your suggestions, and i will revert if it is working or not.

    Sachin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 07, 2017 at 12:28 PM

    Hi Abid

    It works for some set of records but when another data set is used, it gives same dump. We are further investigating.

    Sachin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 09, 2017 at 06:03 AM

    Hi

    It is working using the suggested code in this thread and i have tested with few sets of data. This thread can be marked as answered.

    Sachin

    Add comment
    10|10000 characters needed characters exceeded