Skip to Content
avatar image
Former Member

Download to excel problem

Hi Friends,

DATA lo_nd_hr_update TYPE REF TO if_wd_context_node.

DATA lt_hr_update TYPE wd_this->elements_hr_update.

DATA ls_hr_update TYPE wd_this->element_hr_update.

  • navigate from <CONTEXT> to <HR_UPDATE> via lead selection

lo_nd_hr_update = wd_context->get_child_node( name = wd_this->wdctx_hr_update ).

  • @TODO handle non existant child

  • IF lo_nd_hr_update IS INITIAL.

  • ENDIF.

lo_nd_hr_update->get_static_attributes_table( IMPORTING table = lt_hr_update ).

DATA text TYPE string.

DATA xtext TYPE xstring.

LOOP AT lt_hr_update INTO ls_hr_update.

CONCATENATE text ls_hr_update-mandt

ls_hr_update-pernr

ls_hr_update-effdt

ls_hr_update-upddt

ls_hr_update-ename

ls_hr_update-aedat

ls_hr_update-aenam

ls_hr_update-sigempno

ls_hr_update-signame

ls_hr_update-emailid

ls_hr_update-rejuvem

ls_hr_update-rejuvey

ls_hr_update-enrich1

ls_hr_update-enrich2

ls_hr_update-offdt

ls_hr_update-status

ls_hr_update-accdt

ls_hr_update-tedempno

ls_hr_update-tedname

ls_hr_update-skill1

ls_hr_update-skill2

ls_hr_update-skill3

ls_hr_update-skill4

ls_hr_update-comments

ls_hr_update-letter_rel

ls_hr_update-reldt

ls_hr_update-practice

ls_hr_update-practext

ls_hr_update-location

ls_hr_update-email

ls_hr_update-bill_date

cl_abap_char_utilities=>newline INTO text SEPARATED BY

cl_abap_char_utilities=>horizontal_tab.

ENDLOOP.

CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

EXPORTING

text = text

IMPORTING

buffer = xtext.

wdr_task=>client_window->client->attach_file_to_response(

**path to the word file

i_filename = 'WDP.xls'

  • String Variable

i_content = xtext

  • File Type

i_mime_type = 'EXCEL' ).

The problem is i'm facing is i'm unable to download all the contents.

Is there any restriction on string size.....whether i need to increase string size....

Is it the problem with table size it has more than 25 fields & around 150 reocrds but every time when i use above code getting arnd 11 rows of data.

Kindly reply.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jul 22, 2009 at 06:13 AM

    Hi,

    Data type string has length restriction upto some 288 characters...

    So instead use string_table.

    data : lt_table type string_table,

    ls_table type string.

    loop at ur table.

    concatenate ls_table <ur fields>

    append ls_table to lt_table.

    clear ls_table.

    endloop.

    This will solve ur problem.

    Thanks,

    Divya.S

    Add comment
    10|10000 characters needed characters exceeded

    • >

      > Hi,

      >

      > Data type string has length restriction upto some 288 characters...

      >

      > Thanks,

      > Divya.S

      Absolutely and totally incorrect! String is not limited in length to 288 characters. It is only limited by the amount of memory that can be allocated and assigned to the internal session. On 32-bit based systems this would 2Gb. Both the stirng and string_table would have the same maximum memory allocation. Whatever your problem, it is not because of some size limitation on the STRING data type as you have been told by Divya.S. This person has mislead you.

  • Jul 22, 2009 at 03:54 PM

    Have you tried setting break points to see where you are loosing data? Is the complete data present in the string or xstring? Track back to see where you are losing the data.

    Add comment
    10|10000 characters needed characters exceeded