PDF to spool to run program in background

Hi Experts,
i have created a custom program by copying FP_TEST_00 and gave nodialog mode for out parameters which will supress the prompt for printer and that i can run it in background. i just want the data to written to spool.
call function 'FP_JOB_OPEN'
changing
ie_outputparams = iwa_outputparams
exceptions
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
others = 5.
call function module with import params
call function function_name
parameter-table
para_tab.
close job
call function 'FP_JOB_CLOSE'
exceptions
usage_error = 1
system_error = 2
internal_error = 3
others = 4.
Any pointers in this regard will be help ful.
Please provide some inputs if we can send the PDF to a spool.
Thanks in Advance,
Deepa

Try:
iwa_outputparams-REQNEW = 'X'.
iwa_outputparams-REQFINAL = 'X'.
Cheers,
Andres.

Similar Messages

  • Run program in background spool is generated with zero page

    Dear all,
    I am new in abap. I change existing program and add SED column if I give the input and run that program in foreground I will see ALV output but when in same input same program I run in background spool is generated with zero page report is too heavy that is why I want to run it in background but I canu2019t.
    regards
    shahid

    shahid,
    goto SM37, select your job, then in command bar type JDBG, press Enter. it will debug the back ground job, and you can check why you didnot get an output.

  • Issue while capturing messages when running program in background

    Hi,
    I have a program where we have BDC for transaction KSU5 and this is using CALL TRANSACTION method to post the documents after this we have to check a table COEP for the document no's generated in ksu5.
    This program works absolutely fine in foreground printing the output on screen the document numbers that we get once we use
        CALL TRANSACTION 'KSU5' USING bdcdata MODE 'E'  MESSAGES INTO return.
    but the same gets spoiled if we run this program in background !! the return table where I use to get the document no it shows additional data of the KSU5 transaction which is not required I am just trying to print the document no from the return table with variable msgv1 and msgv2.
    Can someone explain or give solution to run this program in background and get the result printed correctly for the user.
    Thanks
    Sudharshan

    Sudarshan,
    I guess your code was recorded for  Online mode , try to compare it with Simulated background BDC code for the transaction and see if there is any difference for your required functionality . 
    You can generate 'Simulated background BDC code' by SHDB->New recording-> and then check 'Simulate background BDC code'  option in popup window .
    -Tushar Shukla
    Edited by: TUSHAR SHUKLA on Oct 8, 2010 2:23 AM

  • Popup to run Program in Background

    Hi,
    I have a report which when the user clicks the execute button, a popup should display mentioning it to run the program in background mode.
    Please let me know how to achieve it.
    Regards
    Krish

    hi,
    at first you are right there are really LOTS of ways to make that popup thing. Which one you take or if you do it manually, doesn play any role, as long as it works.
    But well BEFORE throwing that popup on your screen you should check whether the program is already run in background, cause you do NOT want to throw a popup when beeing in background task.

  • Problem with the ABAP List output while running program in background.

    Hi ,
        This is Sudhir S . I am trying to run a report in background which has 60 columns , but only 13 are displayed when we view it through the spool abap list .
    But when I run in foreground all the 60 columns are displayed. Since the data which I am trying to fetch is large I am running the report as a background job .
    I just need to know what can be done to get the 60 columns in spool abap list output.
    waiting for your  reply.
    <removed by moderator>
    With Regards
    Sudhir S
    Edited by: Thomas Zloch on Oct 6, 2010 1:51 PM - please do something else while waiting, all posts have the same priority here

    Hi,
    Check if SAP note 1226758 resolves this problem.
    Regards,
    Aidan

  • Run Program in background

    Hi
    I know there is a post about this already in the newsgroup but I think I
    need something different.
    I need a way to make my program completely invisible to my users basically
    have it running as a service. I can't for some reason remove the FP in the
    app builder of my toplevel vi, I don't know why. And anyway, would removing
    the FP in the app builder also remove the vi in the taskbar? Does anyone
    know how to do this?
    Thanks
    Jacob Thastrup

    The program is for a Win2K/NT4 enviroment. I have never herd of a Win2K/NT4
    command/program called "Xvfb". Do I need to use a different command or can
    I send the display to another place?
    Thanks
    Jacob Thastrup
    [email protected] (Ricardo Leal) wrote in
    <[email protected]>:
    >Content-Type: text/plain; charset=us-ascii
    >Content-Transfer-Encoding: 7bit
    >
    >Jacob Thastrup wrote:
    >
    >> Hi
    >>
    >> I know there is a post about this already in the newsgroup but I think
    >> I need something different.
    >> I need a way to make my program completely invisible to my users
    >> basically have it running as a service. I can't for some reason remove
    >> the FP in the app builder of my toplevel vi, I don't know why. And
    >> anyway, would removing the FP in the app builder also remove the vi in
    >> the taskbar? Does anyone know how to do this?
    >>
    >> Thanks
    >>
    >> Jacob Thastrup
    >
    >Jacob:
    >
    >I tryied to hide the front panel with labview application builder for
    >linux but it doesn't remove the front panel. I got this
    >in Linux, you must create a virtual frame buffer first and then send the
    >graphical out of labview to this virtual x-window.
    >
    >For create the virtual frame, execute the following command:
    >
    >Xvfb :1 -screen 0 160x120x16 &
    >
    >with this you create a virtual frame buffer of 160x120 and 16 bits, then
    >you must send the application to this x-window:
    >
    >Application -display :1 &
    >
    >With this you can execute a program whithout graphical out and also you
    >can mantain in background with nohup command.
    >
    >
    >
    >--
    >*********************************************************
    >Ricardo Leal Pacheco.
    >e-mail: [email protected]/[email protected]
    >FONO: (09)7111100, 654622.
    >INGENIERIA CIVIL ELECTRONICA U.T.F.S.M
    >*********************************************************
    >
    >
    >
    >--------------25B9B630C9B3D0B8D29F4A83
    >Content-Type: text/html; charset=us-ascii
    >Content-Transfer-Encoding: 7bit
    >
    >
    >
    >Jacob Thastrup wrote:
    >Hi
    >I know there is a post about this already in the newsgroup but I
    >
    >I
    >
    need something different.
    >
    I need a way to make my program completely invisible to my users
    >have it running as a service. I can't for some reason
    >
    >in the
    >
    app builder of my toplevel vi, I don't know why. And anyway, would
    >removing
    >
    the FP in the app builder also remove the vi in the taskbar? Does
    >know how to do this?
    >
    Thanks
    >
    Jacob Thastrup
    >Jacob:
    >I tryied to hide the front panel with labview application builder for
    >linux but it doesn't remove the front panel. I got this
    >
    in Linux, you must create a virtual frame buffer first and then send
    >the graphical out of labview to this virtual x-window.
    >
    For create the  virtual frame, execute the following command:
    >
    Xvfb :1 -screen 0 160x120x16  &
    >
    with this you create a virtual frame buffer of 160x120 and 16 bits,
    >then you must send the application to this x-window:
    >
    Application -display :1  &
    >
    With this you can execute a program whithout graphical out and also
    >you can mantain in background with nohup command.
    >
    >
    >
    >*********************************************************
    >Ricardo Leal Pacheco.
    >e-mail: [email protected]/[email protected]
    >FONO: (09)7111100, 654622.
    >INGENIERIA CIVIL ELECTRONICA U.T.F.S.M
    >*********************************************************

    >
    >--------------25B9B630C9B3D0B8D29F4A83--

  • How to run program in background?

    Hi Experts.
    Please tell me wht is the procedure for scheduling a Job in background? I need all steps
    thanks in advance

    Hi,
    You can a schedule a batch job in SM36.
    Steps
    Go to SM36
    Give the job name.
    Give the job class A
    Press Enter.
    Give the abap program name..
    Press save..
    Press F3 to go back to the main screen..
    Press the start condition button..
    Give the date time..
    Check the period job check box..
    Press the period values button..
    In the popup press the daily button..
    Press save..
    Press save..
    Then in the menu..Job -> save..This will release the job..
    Thanks,
    Naren

  • How to run a program in background?

    Hi abapers,
    I want to run a program in background using sm36 and sm37.But i am not aware of input in that tansaction.So kindly tell me the steps ho run a program in background.
    Regards
    Ansuman

    Hi Ansuman Parhi,
    by useing T-codes
    First go to transaction SM36 to schedule the job.
    When you enter the "Start condition" for job, do as follow.
    Select processing by "Date/Time".
    Enter date as current date.
    Let us say you are scheduling this job today then give date 08/30/2007.
    Check "periodic job" checkbox.
    Hit "periodic value" button and select to run "Daily"
    Also have a look on below thread
    Re: How to run program in background?
    This is how to do it through code
    data: lv_job_name like tbtco-jobname,
    lv_job_nr like tbtco-jobcount,
    lv_job_released type c,
    lv_job_start_sofort type c,
    lv_print_parameters type pri_params.
    lv_job_name = 'Z_test'. " your background program name
    call function 'JOB_OPEN'
    exporting
    jobname = lv_job_name
    importing
    jobcount = lv_job_nr
    exceptions
    cant_create_job = 1
    invalid_job_data = 2
    jobname_missing = 3
    others = 4.
    if syst-subrc = 0.
    *submit job with all the selection screen params...
    submit (lv_job_name)
    with applfile = applfile
    with p_lines = p_lines
    with rfc_dest = rfcdest
    with p_selmtd = lv_selmtd
    with px_shsim = px_shsim
    with px_sherr = px_sherr
    user syst-uname
    via job lv_job_name number lv_job_nr and return.
    if sy-subrc = 0.
    call function 'JOB_CLOSE'
    exporting
    jobcount = lv_job_nr
    jobname = lv_job_name
    strtimmed = 'X'
    importing
    job_was_released = lv_job_released
    exceptions
    cant_start_immediate = 1
    invalid_startdate = 2
    jobname_missing = 3
    job_close_failed = 4
    job_nosteps = 5
    job_notex = 6
    lock_failed = 7
    others = 8.
    if syst-subrc 0.
    message i162(00) with
    'An error occured while closing the background job.'.
    stop.
    endif.
    endif.
    endif.
    skip 1.
    write: / 'Background process', lv_job_name ,
    'called successfully' no-gap.
    write: / 'You can check the job in transaction SM37'.
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • Alv show in report but when see in spool (after run background job) there i

    my program have some error when i run result alv show in report but when see in spool (after run background job) there is no data, (other program can see result in spool)
    Please help
    here is some example of my program
    ********************************declare internal table*****************************
    internal table output for BDC
    data : begin of t_output occurs 0,
    bukrs type anla-bukrs,
    anln1 type anla-anln1,
    anln2 type anla-anln2,
    zugdt type anla-zugdt,
    result(70) type c,
    end of t_output.
    *****get data from loop********************************
      loop at t_anla.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  INPUT  = t_anla-anln1
             IMPORTING
                  OUTPUT = t_anla-anln1.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  INPUT  = t_anla-anln2
             IMPORTING
                  OUTPUT = t_anla-anln2.
    check record is correct or not
        select single bukrs anln1 anln2 zugdt
        into w_output
        from anla
        where bukrs = t_anla-bukrs and
        anln1 = t_anla-anln1 and
        anln2 = t_anla-anln2
       zugdt = '00000000'
    if record is correct
        if sy-subrc = 0 and w_output-zugdt = '00000000'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Yes : this asset can delete'.
          append w_output to t_output.
    if record is not correct
        elseif sy-subrc = 0 and w_output-zugdt <> '00000000'.
    there is error record  this asset have value already
          v_have_error = 'X'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Error : this asset have value already'.
          append w_output to t_output.
        else.
    there is error record this asset donot exist in table anla
          v_have_error = 'X'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Error : this asset doest not exist'.
          append w_output to t_output.
        endif.
    *end of check record is correct or not
        clear w_output.
      endloop.
    ******************************show data in ALV***************************************************
    show data from file in ALV
      perform display_report_ALV.
    *&      Form  display_report_ALV
    form display_report_ALV.
      DATA: LT_FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV,
          LT_EVENTS TYPE SLIS_T_EVENT,
          LV_REPID LIKE SY-REPID.
      PERFORM ALV_DEFINE_FIELD_CAT USING LT_FIELD_CAT.
      PERFORM ALV_HEADER_BUILD USING T_LIST_TOP_OF_PAGE[].
      PERFORM ALV_EVENTTAB_BUILD USING LT_EVENTS[].
      LV_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = LV_REPID
                IT_FIELDCAT        = LT_FIELD_CAT
                I_SAVE             = 'A'
                IT_EVENTS          = LT_EVENTS[]
           TABLES
                T_OUTTAB           = t_output
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
      IF SY-SUBRC NE 0.
        WRITE: / 'Return Code : ', SY-SUBRC,
          'from FUNCTION REUSE_ALV_GRID_DISPLAY'.
      ENDIF.
    endform.
    *&      Form  alv_define_field_cat
          text
         -->P_LT_FIELD_CAT  text
    FORM ALV_DEFINE_FIELD_CAT USING  TB_FCAT TYPE SLIS_T_FIELDCAT_ALV.
      DATA: WA_FIELDCAT LIKE LINE OF TB_FCAT,
        LV_COL_POS TYPE I.
      DEFINE FIELD_CAT.
        CLEAR WA_FIELDCAT.
        ADD 1 TO LV_COL_POS.
        WA_FIELDCAT-FIELDNAME = &1.
        WA_FIELDCAT-REF_TABNAME = &2.
        WA_FIELDCAT-COL_POS = LV_COL_POS.
        WA_FIELDCAT-KEY = &3.
        WA_FIELDCAT-NO_OUT = &4.
        WA_FIELDCAT-REF_FIELDNAME = &5.
        WA_FIELDCAT-DDICTXT = 'M'.
        IF NOT &6 IS INITIAL.
          WA_FIELDCAT-SELTEXT_L = &6.
          WA_FIELDCAT-SELTEXT_M = &6.
          WA_FIELDCAT-SELTEXT_S = &6.
        ENDIF.
        WA_FIELDCAT-DO_SUM = &7.
        WA_FIELDCAT-OUTPUTLEN = &8.
        APPEND WA_FIELDCAT TO TB_FCAT.
      END-OF-DEFINITION.
      FIELD_CAT  'BUKRS'  'ANLA'     'X' '' 'BUKRS' 'Company Code' '' ''.
      FIELD_CAT  'ANLN1'  'ANLA'     'X' '' 'ANLN1' 'Asset Number' '' ''.
      FIELD_CAT  'ANLN2'  'ANLA'     'X' '' 'ANLN2' 'Asset Sub Number' '' ''.
    FIELD_CAT  'ATEXT'   'T5EAE'     'X' '' 'ATEXT' 'Result' '' ''.
      FIELD_CAT  'RESULT'  ''     'X' '' 'RESULT' 'RESULT' '' ''.
    ENDFORM.                    " alv_define_field_cat

    Hi,
    Check this code..
    FORM display_report_alv.
      DATA: lt_field_cat TYPE slis_t_fieldcat_alv,
      lt_events TYPE slis_t_event,
      lv_repid LIKE sy-repid.
      PERFORM alv_define_field_cat USING lt_field_cat.
      PERFORM alv_header_build USING t_list_top_of_page[].
      PERFORM alv_eventtab_build USING lt_events[].
      lv_repid = sy-repid.
      IF sy-batch EQ 'X'.  ----> " System Field for Backgroud..if Background use list display
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_callback_program = lv_repid
            it_fieldcat        = lt_field_cat
            i_save             = 'A'
            it_events          = lt_events[]
          TABLES
            t_outtab           = t_output
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
      ELSE.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = lv_repid
            it_fieldcat        = lt_field_cat
            i_save             = 'A'
            it_events          = lt_events[]
          TABLES
            t_outtab           = t_output
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
      ENDIF.
      IF sy-subrc NE 0.
        WRITE: / 'Return Code : ', sy-subrc,
        'from FUNCTION REUSE_ALV_GRID_DISPLAY'.
      ENDIF.
    ENDFORM.                    "display_report_ALV

  • How to run a program in background and how to check the output

    I have to run my program as background job... it has a selection screen...... and i need to check the output after its complete.

    hi,
    u need to create one program for this.
    tables:btcevtjob.
    parameters:job(32).
    data:count like btcevtjob-jobcount.
    call the function modules JOB_OPEN,JOB_SUBMIT AND JOB_CLOSE
    and pass the parameters in those function modules.
    once u execute this program,
    go with sm37->provide jobname->select the option scheduled
    ->execute
    selct the entry->go with release option.
    under releasae select immediate option
    save
    select the job name again
    go with release
    status is in finished stage
    now go with spool option
    give spool no
    go for display
    o/p displayed.
    before this,go for se38->provide the name of program which u want to run in back ground->seelct variants->change->provide variant name->go for create->provide input value->go with attributes->provide description->save
    this variant name u have to give in the job_submit fm.
    or
    se38->program->execute->in back ground
    Reward points if useful,
    Thanks,
    Usha

  • It has an error when run a program in background job

    Dear Expert,
    we have a program
    when run it in background,it has a error "Error during import of clipboard contents" but when run it normally(run in front workbench se38 or run the t-code),everything is ok.i've used typingJDBG in the command box to debuge the background job,there has no error.
    whould you like to tell me what had happen? thanks a lot!
    addition: the program used a function ALSM_EXCEL_TO_INTERNAL_TABLE
    Thanks & Regards,
    Kerry
    Edited by: Kerry Wang on Aug 24, 2009 2:12 PM
    Edited by: Kerry Wang on Aug 24, 2009 2:14 PM
    Edited by: Kerry Wang on Aug 24, 2009 2:14 PM

    Hi,
      You cannot use FMs to get data directly from the presentation server when program is executed in the backgroud.
    Check the thread : GUI_DOWNLOAD
    Regards,
    Himanshu

  • Failed to Run OLE Excel program in background JOB (SM36)

    Please help.
    I have write a program to use OLE to create a Excel file.
    The program can run successful in front end workstation. However, when I run the program in background job by SM36.
    The statement "CREATE OBJECT EXCEL 'EXCEL.APPLICATION'" return with error "SY-SUBRC = 2".
    How can I solve it ?
    Can OLE Excel be run on background job ?
    Thanks so much,
    Mark

    Hi Mark:
    Your need is a very common one. I also was asked to generate an Excel in Background.
    It is not possible to work with OLE in background mode.
    The reason is: In background mode there is no presentation server. OLE is executed in presentation server.
    Below I paste the code I wrote to solve my problem.
    This class sends a mail with an excel attached. The Excel content will be the internal table you pass to the class. But the Excel is not binary, it is a plain text file, separated by tabulators. Anyway, when you open it with Excel, the columns are properly shown.
    Sorry. Comments are in spanish, I don't have time to translate it.
    I kindly ask to everybody which want to use it to keep my name in the code.
    * Autor: Jordi Escoda, 30/10/2008.
    * Descripción: Esta clase genera un correo electrónico destinado a
    *  una persona, adjuntando el contenido de una tabla interna como
    *  Excel (campos separados por tabuladores).
    *  La virtud de esta clase es su sencillez de utilización. Para lanzar
    *  el mail con el excel adjunto basta con declarar la tabla interna,
    *  llenarla, colocar el asunto del mensaje, el destinatario, el nombre
    *  del excel adjunto, y pasar la tabla interna.
    * Ejemplo de utilización:
    *  DATA: lc_mail TYPE REF TO cl_mail_builder_xls_attach.
    *  DATA: lt_anla TYPE STANDARD TABLE OF anla.
    *    SELECT * INTO TABLE lt_anla  FROM anla.
    *    CREATE OBJECT lc_mail.
    *    CALL METHOD lc_mail->set_subject( 'Excel adjunto' ).
    *    CALL METHOD lc_mail->set_recipient( 'XXX@XXXDOTCOM' ).
    *    CALL METHOD lc_mail->set_attach_filename( 'ANLA' ).
    *    APPEND 'Cuerpo del mensaje' TO  lt_body.
    *    APPEND 'Saludos cordiales' TO  lt_body.
    *    CALL METHOD lc_mail->set_bodytext( lt_body ).
    *    CALL METHOD lc_mail->set_attach_table( lt_anla ).
    *    CALL METHOD lc_mail->send( ).
    *       CLASS cl_mail_builder_xls_attach DEFINITION
    CLASS cl_mail_builder_xls_attach DEFINITION.
      PUBLIC SECTION.
        METHODS: set_subject
                               IMPORTING im_subject TYPE so_obj_des,
                 set_bodytext
                               IMPORTING im_body TYPE bcsy_text,
                 set_recipient
                               IMPORTING im_recipient TYPE ad_smtpadr,
                 set_attach_table
                               IMPORTING im_table TYPE ANY TABLE,
                 set_attach_filename
                               IMPORTING im_attach_name TYPE sood-objdes,
                 send.
      PRIVATE SECTION.
        CONSTANTS:
          c_tab  TYPE c VALUE cl_bcs_convert=>gc_tab,
          c_crlf TYPE c VALUE cl_bcs_convert=>gc_crlf,
          c_singlequote TYPE c VALUE '.
        DATA: l_recipient_addr TYPE ad_smtpadr.
        DATA: send_request   TYPE REF TO cl_bcs,
              document       TYPE REF TO cl_document_bcs,
              recipient      TYPE REF TO if_recipient_bcs,
              bcs_exception  TYPE REF TO cx_bcs.
        DATA: binary_content TYPE solix_tab,
              size           TYPE so_obj_len.
        DATA: l_string TYPE string,
              l_body_text TYPE bcsy_text,
              l_subject TYPE so_obj_des,
              l_attach_name TYPE sood-objdes.
        METHODS: create_binary_content,
                 get_dataelement_medium_text
                        IMPORTING im_table_name TYPE tabname
                                  im_field_name TYPE fieldname
                        EXPORTING ex_medium_text TYPE scrtext_m.
    ENDCLASS.                    "cl_mail_builder_xls_attach DEFINITION
    *       CLASS cl_mail_builder_xls_attach IMPLEMENTATION
    CLASS cl_mail_builder_xls_attach IMPLEMENTATION.
      METHOD set_bodytext.
        l_body_text[] = im_body[].
      ENDMETHOD.                    "add_bodytext
      METHOD set_subject.
        l_subject = im_subject.
      ENDMETHOD.                    "add_subject
      METHOD set_attach_filename.
        l_attach_name = im_attach_name.
      ENDMETHOD.                    "add_subject
      METHOD set_recipient.
        l_recipient_addr = im_recipient.
      ENDMETHOD.                    "add_subject
      METHOD set_attach_table.
    *   Rellena en un string el contenido de la tabla interna recibida
        DATA: ref_to_struct  TYPE REF TO cl_abap_structdescr.
        DATA: my_like TYPE fieldname,
              nombretabla TYPE tabname,
              nombrecampo TYPE fieldname,
              texto_mediano TYPE scrtext_m.
        DATA: l_idx TYPE i,
              l_valorcampo(16) TYPE c,
              l_long TYPE i.
        FIELD-SYMBOLS: <fs_linea> TYPE ANY,
                       <fs_campo> TYPE ANY.
        FIELD-SYMBOLS: <comp_descr> TYPE abap_compdescr.
        CHECK NOT im_table[] IS INITIAL.
    *   Línea con los nombres de las columnas.
        CLEAR l_string.
        LOOP AT im_table ASSIGNING <fs_linea>.
    *     Toma los atributos del componente
          ref_to_struct  =
                     cl_abap_structdescr=>describe_by_data( <fs_linea> ).
          LOOP AT ref_to_struct->components ASSIGNING <comp_descr>.
            ASSIGN COMPONENT <comp_descr>-name
                                OF STRUCTURE <fs_linea> TO <fs_campo>.
    *       Obtenemos el origen de donde proviene (like). Ej:BKPF-BUDAT
            DESCRIBE FIELD <fs_campo> HELP-ID my_like.
            SPLIT my_like AT '-' INTO nombretabla nombrecampo.
            CALL METHOD get_dataelement_medium_text
              EXPORTING
                im_table_name  = nombretabla
                im_field_name  = nombrecampo
              IMPORTING
                ex_medium_text = texto_mediano.
            IF texto_mediano IS INITIAL.
              CONCATENATE l_string <comp_descr>-name INTO l_string.
            ELSE.
              CONCATENATE l_string texto_mediano INTO l_string.
            ENDIF.
            AT LAST.
              CONCATENATE l_string c_crlf INTO l_string.
              EXIT.
            ENDAT.
            CONCATENATE l_string c_tab INTO l_string.
          ENDLOOP.
          EXIT.
        ENDLOOP.
    *   Contenido de la tabla
        LOOP AT im_table ASSIGNING <fs_linea>.
    *     Toma los atributos del componente
          ref_to_struct  =
                     cl_abap_structdescr=>describe_by_data( <fs_linea> ).
          LOOP AT ref_to_struct->components ASSIGNING <comp_descr>.
    *       Asignamos el componente ue tratamos, para obtener
    *       el valor del mismo
            ASSIGN COMPONENT <comp_descr>-name OF STRUCTURE <fs_linea>
                                            TO <fs_campo>.
            CASE <comp_descr>-type_kind.
              WHEN 'P'. "Packed Number
    *           Convierte a caracter
                WRITE <fs_campo> TO l_valorcampo.
                CONCATENATE l_string l_valorcampo INTO l_string.
              WHEN OTHERS.
                l_long = STRLEN( <fs_campo> ).
                IF l_long > 11 AND <fs_campo> CO ' 0123456789'.
    *             El Excel muestra un número tal como 190000000006
    *             en formato 1,9E+11.
    *             Para eviarlo, los números de más de 11 dígitos los
    *             concatenamos con comillas simples.
                  CONCATENATE l_string c_singlequote
                              <fs_campo> c_singlequote INTO l_string.
                ELSE.
                  CONCATENATE l_string <fs_campo> INTO l_string.
                ENDIF.
            ENDCASE.
            AT LAST.
    *         Añade CRLF
              CONCATENATE l_string c_crlf INTO l_string.
              EXIT.
            ENDAT.
    *       Añade tabulador
            CONCATENATE l_string c_tab INTO l_string.
          ENDLOOP.
        ENDLOOP.
        create_binary_content( ).
      ENDMETHOD.                    "set_attach_table
      METHOD create_binary_content.
        DATA: l_size TYPE so_obj_len.
    *   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   = l_string
                iv_codepage = '4103'  "suitable for MS Excel, leave empty
                iv_add_bom  = 'X'     "for other doc types
              IMPORTING
                et_solix  = binary_content
                ev_size   = size ).
          CATCH cx_bcs.
            MESSAGE e445(so).
        ENDTRY.
      ENDMETHOD.                    "create_binary_content
      METHOD send.
        DATA: l_sent_to_all TYPE os_boolean.
        TRY.
    *       create persistent send request
            send_request = cl_bcs=>create_persistent( ).
    *       create and set document with attachment
    *       create document object
            document = cl_document_bcs=>create_document(
              i_type    = 'RAW'
              i_text    = l_body_text
              i_subject = l_subject ).
    *       add the spread sheet as attachment to document object
            document->add_attachment(
              i_attachment_type    = 'xls'
              i_attachment_subject = l_attach_name
              i_attachment_size    = size
              i_att_content_hex    = binary_content ).
    *       add document object to send request
            send_request->set_document( document ).
    *       add recipient (e-mail address)
            recipient =
               cl_cam_address_bcs=>create_internet_address(
                                          l_recipient_addr ).
    *       add recipient object to send request
            send_request->add_recipient( recipient ).
    *       send document
            l_sent_to_all = send_request->send(
                                 i_with_error_screen = 'X' ).
            COMMIT WORK.
            IF l_sent_to_all IS INITIAL.
              MESSAGE i500(sbcoms) WITH l_recipient_addr.
            ELSE.
              MESSAGE s022(so).
            ENDIF.
          CATCH cx_bcs INTO bcs_exception.
            MESSAGE i865(so) WITH bcs_exception->error_type.
        ENDTRY.
      ENDMETHOD.                    "lcl_mail_xls_attachment
      METHOD get_dataelement_medium_text.
        DATA: lt_fld_info TYPE STANDARD TABLE OF dfies,
          wa_fld_info TYPE dfies.
    *   Busca en el diccionario los datos del campo
        CALL FUNCTION 'DDIF_FIELDINFO_GET'
          EXPORTING
            tabname        = im_table_name
            fieldname      = im_field_name
            langu          = sy-langu
          TABLES
            dfies_tab      = lt_fld_info
          EXCEPTIONS
            not_found      = 1
            internal_error = 2
            OTHERS         = 3.
        CLEAR ex_medium_text.
        IF sy-subrc = 0.
          READ TABLE lt_fld_info INDEX 1 INTO wa_fld_info.
    *     Si lo ha podido tomar del diccionario...
          IF NOT wa_fld_info-scrtext_m IS INITIAL.
    *       Toma el nombre del nombre de campo del diccionario
            ex_medium_text = wa_fld_info-scrtext_m.
          ENDIF.
        ENDIF.
      ENDMETHOD.                    "get_dataelement_medium_text
    ENDCLASS.                    "cl_mail_builder_xls_attach IMPLEMENTATION

  • To run a program in BACKGROUND using SUBMIT

    I need to run a program in background using the SUBMIT option. Here i have to pass an internal table form one program to another which will be used to update sales orders using BDC.
    Questions
    1} Can we execute a program in background using SUBMIT?
    2} I am sending data to a MEMORY ID , if i run the program in background will the memory id work. As in do  memory IDs work in the background.
    Thanks in Advance

    refer  same thread.
    Re: Problem with SUBMIT in Background

  • Running BDC program in background for the transaction VL02N

    Hi All,
    I have coded a BDC program (call transaction method) for the transaction code VL02N. I can able to run the program manually & successfully. But if I execute the program in background(SM36), it is going to dump giving CNTL_ERROR.
    Note: I am not using any of the GUI_UPLOAD, GUI_DOWNLOAD funciton modules in the program. But I am using the FTP command funtion modules like( FTP_COMMAND, FTP_CONNECT, FTP_DISCONNECT and FTP_SERVER_TO_R/3).
    <removed_by_moderator>
    Thanks in advance.
    Ramesh.
    Edited by: Julius Bussche on Jul 8, 2008 5:55 PM

    VL02N is an enjoy transaction. You cant run it in background. Please try VL02.
    Thanks
    Romit

  • How can I run a Module pool program in Background

    Hi all,
           I have created report program and called a dialog screen e.g call screen 0100.
    this screen contains only one table control and a tabstrip control which allows user to select diffrent options.there is a push button on the application tool bar named as Background. once u click , the report has to run in background.
    if its a selection screen , i can easily create a variant n can run it in background.but here its a dialog screen, i m unable to create a variant for it. can anybody tell me how can i saves the user input values and run in background ..plz help me ....
    Bishnu Dash

    Hi ..
    Create a Transaction code for this Program.
    Then implement the BDC Code to Process the SCreens with the Required input Values.
    Schedule this BDC Session in Backgound using RSBDCSUB.
    reward if Helpful.

Maybe you are looking for

  • Unreadable Book Titles in iOS 8 Books App

    There seems to have been an "enhancement" to Books in iOS 8 that renders the book titles nearly ureadable in My Books view. Unfortunately, there is a new background effect that uses a grayed out version of the home screen. In addition, the book title

  • Trigger's execution hierarchy

    HI, EVERYONE; I AM NEW TO DEVELOPER, SO PLZ HELP ME. I HAVE CREATED A FORM WITH A DATABLOCK. I HAVE WRITTEN A "WHEN_MOUSE_CLICK" TRIGGER ON FORM,BLOCK,ITEM LEVEL ECAH HAVING EXECUTION-HIERARCHY PROPERTY TO "BEFORE" WITH DIFFERENT MESSAGES. WHEN FIRST

  • "column ambigously defined" error

    ORA-00918: column ambigously defined 00918.00000 - "column ambigously defined" *Cause: *Action Vendor code 918      I've gotten this error on a few of the queries I've ran in SQL Developer 1.5 and tried to export to xls, but when I run and try to exp

  • Recommended Partitioing for Mac OS X, Windows and Linux

    I have a Mac Pro with three 500 GB Hard Drives. I would like to put Mac OS X on one, Windows on another and Linux on the third Drive. I also would lik to share data between them. I understand that Windows cannot read or write to HFS+. But Linux can r

  • Inbox help

    My inbox keeps automatically deteling my old email, is there any way to stop or limit this? iBook G4   Mac OS X (10.4.5)