<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Running in background in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601030#M867335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is when you are running the report in background, the output is sent to spool. and the maximum width of any spool output is only 255 characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's why you don't see the remaining fields in the spool output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Mar 2008 14:29:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-30T14:29:17Z</dc:date>
    <item>
      <title>Running in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601029#M867334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my report I am displaying some 30 fields in alv.When I run it in background and see the spool request only 5 fields are displaying.What may the problem?Plz help me...........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2008 14:17:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601029#M867334</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-30T14:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Running in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601030#M867335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is when you are running the report in background, the output is sent to spool. and the maximum width of any spool output is only 255 characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's why you don't see the remaining fields in the spool output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2008 14:29:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601030#M867335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-30T14:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Running in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601031#M867336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to see all the fields. What is the solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2008 14:34:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601031#M867336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-30T14:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Running in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601032#M867337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Veera,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You write the file to the application server and see it in AL11.&lt;/P&gt;&lt;P&gt;or you can send the entire report to a mail Id as an excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2008 19:28:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601032#M867337</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-30T19:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Running in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601033#M867338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can refer to below sample program for sending multiple attachments in E-mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PARAMETERS: p_mail TYPE ad_smtpadr OBLIGATORY.
 
DATA: i_mara TYPE STANDARD TABLE OF mara,  " MARA Entries
      i_marc TYPE STANDARD TABLE OF marc.  " MARC Entries
DATA: l_text TYPE char255.  " Text
DATA: l_lines TYPE i,
      l_size            TYPE           sood-objlen.
" Size of Attachment
 
 
* Mail related
DATA: i_content         TYPE   soli_tab, " Mail content
      i_attach          TYPE   soli_tab, " Attachment
      i_attach1         TYPE   soli_tab. " Attachment
 
DATA: l_send_request    TYPE REF TO    cl_bcs,
                                            " E-Mail Send Request
      l_document        TYPE REF TO    cl_document_bcs,
                                            " E-Mail Attachment
      l_recipient       TYPE REF TO    if_recipient_bcs,
                                            " Distribution List
      l_sender          TYPE REF TO    if_sender_bcs,
                                            " Address of Sender
      l_uname           TYPE           salrtdrcpt,
                                            " Sender Name(SY-UNAME)
      l_bcs_exception   TYPE REF TO    cx_document_bcs,
                                            " BCS Exception
      l_addr_exception  TYPE REF TO    cx_address_bcs,
                                            " Address Exception
      l_send_exception  TYPE REF TO    cx_send_req_bcs.
" E-Mail sending Exception
 
*Constants------------------------------------------------------------*
CONSTANTS: c_tab(1) TYPE c VALUE
               cl_abap_char_utilities=&amp;gt;horizontal_tab,
                                     " Tab Character
 
           c_cr(1)  TYPE c VALUE cl_abap_char_utilities=&amp;gt;cr_lf,
                                     " Line Feed for End-Of_line
 
           c_ext    TYPE soodk-objtp VALUE 'XLS'. " XLS Extension
 
START-OF-SELECTION.
 
  SELECT * FROM mara INTO TABLE i_mara UP TO 20 ROWS.
 
  SELECT * FROM marc INTO TABLE i_marc UP TO 20 ROWS.
 
* Preparing body of the Mail
  MOVE 'Mail Body' TO l_text.
  APPEND l_text TO i_content.
 
* Creates persistent send request
  TRY.
      l_send_request = cl_bcs=&amp;gt;create_persistent( ).
 
* Creating Document
      l_document = cl_document_bcs=&amp;gt;create_document(
                                    i_type  = 'RAW'
                                    i_text  = i_content[]
                                    i_subject = 'Material Details' ).
 
* Preparing contents of attachment with Change Log
  PERFORM prepare_attachment.
 
  DESCRIBE TABLE i_mara LINES l_lines.
* Size to multiplied by 2 for UNICODE enabled systems
      l_size = l_lines * 2 * 255.
 
* Adding Attachment
      CALL METHOD l_document-&amp;gt;add_attachment
        EXPORTING
          i_attachment_type    = c_ext
          i_attachment_size    = l_size
          i_attachment_subject = 'Material Details'
          i_att_content_text   = i_attach[].
 
  DESCRIBE TABLE i_marc LINES l_lines.
* Size to multiplied by 2 for UNICODE enabled systems
      l_size = l_lines * 2 * 255.
 
* Adding Attachment
      CALL METHOD l_document-&amp;gt;add_attachment
        EXPORTING
          i_attachment_type    = c_ext
          i_attachment_size    = l_size
          i_attachment_subject = 'Material Plant Details'
          i_att_content_text   = i_attach1[].
 
 
* Add document to send request
      CALL METHOD l_send_request-&amp;gt;set_document( l_document ).
 
* Get Sender Object
      l_uname = sy-uname.
 
      l_sender = cl_sapuser_bcs=&amp;gt;create( l_uname ).
 
      CALL METHOD l_send_request-&amp;gt;set_sender
        EXPORTING
          i_sender = l_sender.
 
* E-Mail
      TRANSLATE p_mail TO LOWER CASE.
 
    l_recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( p_mail )
.
 
      CALL METHOD l_send_request-&amp;gt;add_recipient
        EXPORTING
          i_recipient  = l_recipient
          i_express    = 'U'
          i_copy       = ' '
          i_blind_copy = ' '
          i_no_forward = ' '.
 
 
*Trigger E-Mail immediately
      l_send_request-&amp;gt;set_send_immediately( 'X' ).
 
      CALL METHOD l_send_request-&amp;gt;send( ).
 
      COMMIT WORK.
 
    CATCH cx_document_bcs INTO l_bcs_exception.
 
    CATCH cx_send_req_bcs INTO l_send_exception.
 
    CATCH cx_address_bcs  INTO l_addr_exception.
 
  ENDTRY.
 
 
*&amp;amp;---------------------------------------------------------------------
*
*&amp;amp;      Form  PREPARE_ATTACHMENT
*&amp;amp;---------------------------------------------------------------------
*
FORM prepare_attachment.
 
  FIELD-SYMBOLS: &amp;lt;lfs_table&amp;gt;,    " Internal table structure
                 &amp;lt;lfs_con&amp;gt;.      " Field Content
  DATA: l_text TYPE char1024.     " Text content for mail attachment
  DATA: l_con(50) TYPE c.        " Field Content in character format
 
* Columns to be tab delimeted
  LOOP AT i_mara ASSIGNING &amp;lt;lfs_table&amp;gt;.
    DO.
      ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;lfs_table&amp;gt;
             TO &amp;lt;lfs_con&amp;gt;.
      IF sy-subrc NE 0.
        CONCATENATE c_cr l_text INTO l_text.
        APPEND l_text TO i_attach.
        EXIT.
      ELSE.
        CLEAR: l_con.
        MOVE &amp;lt;lfs_con&amp;gt; TO l_con.
        CONDENSE l_con.
        IF sy-index = 1.
          CLEAR: l_text.
          MOVE l_con TO l_text.
        ELSE.
          CONCATENATE l_text l_con INTO l_text
             SEPARATED BY c_tab.
        ENDIF.
      ENDIF.
    ENDDO.
  ENDLOOP.
 
  LOOP AT i_marc ASSIGNING &amp;lt;lfs_table&amp;gt;.
    DO.
      ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;lfs_table&amp;gt;
             TO &amp;lt;lfs_con&amp;gt;.
      IF sy-subrc NE 0.
        CONCATENATE c_cr l_text INTO l_text.
        APPEND l_text TO i_attach1.
        EXIT.
      ELSE.
        CLEAR: l_con.
        MOVE &amp;lt;lfs_con&amp;gt; TO l_con.
        CONDENSE l_con.
        IF sy-index = 1.
          CLEAR: l_text.
          MOVE l_con TO l_text.
        ELSE.
          CONCATENATE l_text l_con INTO l_text
             SEPARATED BY c_tab.
        ENDIF.
      ENDIF.
    ENDDO.
  ENDLOOP.
 
ENDFORM.                    " PREPARE_ATTACHMENT

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please treat above code just as reference...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 03:58:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601033#M867338</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T03:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Running in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601034#M867339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In your program do the following changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Report &amp;lt;program_name&amp;gt; no standard page heading line size 200. Even your report could be of ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sanki.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 04:04:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601034#M867339</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T04:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Running in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601035#M867340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Balaji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even I am having a similar problem where I am having 30 fields as ouput which is fine in the foreground but when executed in the background I am getting only 19 fields due to the above mentioned limitation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will this work even in background?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;K.Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 04:29:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/running-in-background/m-p/3601035#M867340</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2008-03-31T04:29:47Z</dc:date>
    </item>
  </channel>
</rss>

