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

Limited rows in table

former_member2492
Active Participant
0 Likes
10,779

Hello,

I am trying to send the table content through email,however the table has 926 rows, not all rows and columns are displayed.I am trying to convert it to xstring and all the columns are displaying now but not all the rows only half .

Can anyone help me with this?

 LOOP AT lt_contents_bin.
 CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
 EXPORTING
 text = lt_contents_bin
 IMPORTING
 buffer = lt_contents
 EXCEPTIONS
 failed = 1
 OTHERS = 2.
*Converting the table contents from xstring to binary
 CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
 EXPORTING
 buffer = lt_contents
 APPEND_TO_TABLE = 'X'
 TABLES
 binary_tab = lt_contents_hex.

  LOOP AT lt_contents_hex.
      APPEND lt_contents_hex TO gt_contents_hex.
    ENDLOOP.
  ENDLOOP.

  gt_contents_text = lt_contents_text.
1 ACCEPTED SOLUTION
Read only

Nawanandana
Active Contributor
0 Likes
10,462

Hi

kindly used bellow program to send email with large table



DATA: lo_send_request    TYPE REF TO cl_bcs,

        lv_date(10),

        lv_text            TYPE char255, " Text

        lv_subject         TYPE so_obj_des,

        lo_document        TYPE REF TO cl_document_bcs,

        lv_binary_content  TYPE solix_tab,

        lv_size            TYPE so_obj_len,

        lv_string          TYPE string,

        lt_main_text       TYPE bcsy_text,

        lo_recipient       TYPE REF TO if_recipient_bcs,

        lv_sent_to_all     TYPE os_boolean,

        lo_bcs_exception   TYPE REF TO cx_bcs,

        lv_email           TYPE ad_smtpadr,

        lv_lines           TYPE i.

SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-010.
SELECT-OPTIONS: s_ercpt   FOR  catsxt_sf-email  NO INTERVALS .
SELECTION-SCREEN END OF BLOCK b2.
* Internal tables : move your internal table 

DATA : BEGIN OF gt_up_file OCCURS 0,
          line(200),
       END OF gt_up_file.

*Delimiters for spreadsheet attachment

  CLASS:cl_abap_char_utilities DEFINITION LOAD.

  CONSTANTS: gc_tab            TYPE c VALUE cl_bcs_convert=>gc_tab,

             gc_crlf           TYPE c VALUE cl_bcs_convert=>gc_crlf.

  DATA: gv_tab                 TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,

        gv_newline             TYPE c VALUE cl_abap_char_utilities=>newline,

        gv_line_feed           TYPE c VALUE cl_abap_char_utilities=>cr_lf.


  WRITE sy-datum TO lv_date DD/MM/YYYY.
  lv_lines = lines( gt_up_file ).
  IF lv_lines GT 65000.

    MESSAGE i000(zmm) WITH
    'Report has more than 65,000 lines. Email cannot be'
    'sent - Report can only be displayed.'
    'In order to email report,'
    'please change your selection criteria.'.

    EXIT.

  ENDIF.


  LOOP AT gt_up_file .

    CONCATENATE lv_string gt_up_file gc_crlf gv_newline

           INTO lv_string.

  ENDLOOP.

* --------------------------------------------------------------

* convert the text string into UTF-16LE binary data including

* byte-order-mark. Mircosoft Excel prefers these settings

* all this is done by new class cl_bcs_convert (see note 1151257)

  TRY.
      cl_bcs_convert=>string_to_solix(
        EXPORTING
          iv_string   = lv_string
          iv_codepage = '4103'  "suitable for MS Excel, leave empty
          iv_add_bom  = 'X'     "for other doc types
        IMPORTING
          et_solix  = lv_binary_content
          ev_size   = lv_size ).

    CATCH cx_bcs.

      MESSAGE e445(so).

  ENDTRY.

  TRY.


*     -------- create persistent send request ------------------------

      lo_send_request = cl_bcs=>create_persistent( ).


*     -------- create and set document with attachment ---------------

*     create document object from internal table with text

      lv_text = lv_date.

      APPEND lv_text TO lt_main_text.

      APPEND INITIAL LINE TO lt_main_text.

      lv_text = 'Customer Price List Attached'.

      APPEND lv_text TO lt_main_text.


      CONCATENATE 'Customer Price List' sy-datum  sy-uzeit

                             INTO lv_subject SEPARATED BY '_'.

      lo_document = cl_document_bcs=>create_document(

        i_type    = 'RAW'

        i_text    = lt_main_text

        i_subject = lv_subject ).


*     add the spread sheet as attachment to document object

      lo_document->add_attachment(

      i_attachment_type    = 'XLS'  "

      i_attachment_subject = lv_subject

      i_attachment_size    = lv_size

      i_att_content_hex    = lv_binary_content ).



*     add document object to send request

      lo_send_request->set_document( lo_document ).


*     --------- add recipient (e-mail address) -----------------------

*     create recipient object

      LOOP AT s_ercpt.

        lv_email = s_ercpt-low.

        lo_recipient = cl_cam_address_bcs=>create_internet_address(

        lv_email ).

*     add recipient object to send request

        lo_send_request->add_recipient( lo_recipient ).

      ENDLOOP.

*     ---------- send document ---------------------------------------

      lv_sent_to_all = lo_send_request->send( i_with_error_screen = 'X' ).


      COMMIT WORK.

      IF lv_sent_to_all IS INITIAL.

        MESSAGE s500(sbcoms) WITH ''.

      ELSE.

        MESSAGE s022(so).

      ENDIF.



*   ------------ exception handling ----------------------------------

    CATCH cx_bcs INTO lo_bcs_exception.

      MESSAGE i865(so) WITH lo_bcs_exception->error_type.

  ENDTRY.

Regards,

Nawa

47 REPLIES 47
Read only

0 Likes
3,431

SUBMIT RSCONN01 USING SELECTION-SET 'SAP&CONNECTINT' .

Read only

0 Likes
3,431

do you know how I can send multiple emails?

Read only

former_member2492
Active Participant
0 Likes
3,431

an update I was able to send the email but still not showing all the columns using OO approach

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,431

I find it very long to solve your issue: you'd better post a program that is easy for us to execute. So, I took the test program posted by Nawanandana Edirisinghe, did very few modifications so that it's compatible with any ABAP system >= 7.02, and you could adapt it so that we can reproduce the same issue as yours?

The idea is that it should take us 5 minutes to solve the issue.

Pay attention to make your test program contain the minimum lines needed to reproduce the issue, and don't use custom tables, custom data elements, that we don't have in our systems.

abap-email-johnu-blatvasky.txt

Read only

0 Likes
3,431

I know but this too does not include all the columns.I tried it too.The problem is that it is limited

Read only

0 Likes
3,431
Johnu Blatvasky there's only one column in the code, just add your code to demonstrate the issue.
Read only

0 Likes
3,431

do you know how I can send the email to multiple people?

Read only

0 Likes
3,431

Johnu Blatvasky The forum contains the answer (send the email to multiple people? site:sap.com)