Can We Run a ABAP Program in Background

Hi,
How to run an ABAP Program in Background.
Points willbe awarded.
Regards,
Jayasimha

Hi,
<b>Please see this document also
http://help.sap.com/saphelp_nw04/helpdata/en/fa/096ccb543b11d1898e0000e8322d00/content.htm
Easy Job Scheduling Using BP_JOBVARIANT_SCHEDULE</b>
To schedule a job from within a program using the express method, you need only call the BP_JOBVARIANT_SCHEDULE function module.
The express method has the following characteristics:
Simplified job structure: The function module schedules a job that includes only a single job step.
The function module uses default values for most job-processing options. You cannot, for example, specify a target printer as part of the call to the function module. Instead, the job step uses the print defaults of the scheduling user.
Only ABAP reports can be scheduled. You must use the "full-control" method to start external programs.
The range of start-time options is restricted. Event-based scheduling is not supported.
The function module works as follows:
You name the report that is to be scheduled in your call to the function module.
The function module displays a list of variants to the user. The user must select a variant for the report.
You must ensure that the variants required by your users have already been defined.
The user picks either "immediate start" or enters a start date and start time. Optionally, the user can also make the job restart periodically. The job is then scheduled.
Example
You could use the following code to let users schedule report RSTWGZS2 for checking on the status of online documentation:
call function 'BP_JOBVARIANT_SCHEDULE'
exporting
title_name = 'Documentation Check' " Displayed as title of
" of scheduling screens
job_name = 'DocuCheck' " Name of background
" processing job
prog_name = 'RSTWGZS2' " Name of ABAP
" report that is to be
" run -- used also to
" select variants
exceptions
no_such_report = 01. " PROG_NAME program
" not found.
call function 'BP_JOBVARIANT_OVERVIEW' " List the jobs that
exporting " have been scheduled
title_name = 'Documentation Check' " Displayed as title
" of overview screen
job_name = 'DokuCheck' " Jobs with this name
" are listed
prog_name = 'RSTWGZS2'
exceptions
no_such_job = 01.
Regards, ABY

Similar Messages

  • How can i run my java program in background process?

    hi all,
    i am working on desktop monitoring so when i start my program on client machine that is visible to all but i want this program client not visible to all instead of this can be run in background process . so, nobody can see that.
    so, how i can do this ?
    pls pls help me
    thanks in advanced to helper
    regards
    maulik & ritesh

    this will run the java program in the background.It'll just use the Windows Java Console instead of the command-line console. It has nothing to do with running as a background process.
    Edit: though this might be exactly what the OP wants: not "background process" but "no DOS console".

  • How to run a ABAP Program in Batch JOB

    How to run a ABAP Program in Batch JOB ?

    Hello Manish,
    Using transaction SM36 you can define the batch job along with the start conditions for that job.
    1. Transaction SM36.
    2. Give the Z name of the job in the 'Job Name' input field.
    3. Click on 'Steps' button from the application toolbar.
    4. On the 'Create Step 1' dialog box, give the name of the ABAP program in the 'ABAP Program' section' along with the variant.
    5. Click on 'Check Input' button from the dialog box.
    6. Click on 'Save' button from the dialog box once the check is successful.
    7. One list will be shown. Click on Back button from the standard toolbar.
    8. Click on 'Start Conditions' button from the application toolbar. Specify the start condition e.g. immediate. Click on save.
    9. The job staus is now scheduled.
    10.Click on Save button from the standard toolbar of SM36. The job status will be released.
    Using SM37 you can monitor the status of the job.
    This will sort out your problem.
    PS If the answer solves your query, plz reward points.
    Regards

  • Run an ABAP program using Data Services/Integrator

    Hi,
    Its it possible to run an ABAP program from Data serives
    There is an aBAP program already created , what it does is to move file from working dir to another directrory
    Can i execute the ABAP prgram from Data Integrator. If it;s possible
    Any suggestions on how to do it
    Thanks

    Yes it might be possible.
    First of all create a batch file based on the following link ...
    http://webcache.googleusercontent.com/search?q=cache:V-Qc73pxxVcJ:www.sap-basis-abap.com/abap/how-can-we-run-abap-program-from-command-line.htmtoexecuteanabapfromwindows&cd=4&hl=en&ct=clnk&gl=uk
    After doing so call the batch file from the following DS command exec() ... exec(command_file, parameter_list, flag)
    Thanks

  • After running a BDC program in background, next

    After running a BDC program in background, next
    day morning when you see the results, few records
    are not updated(error records). What will you do
    then?
    plx explain clearly

    In that BDC u have to process like this .
    1.call transaction
    if sy-subrc ne 0.
    get the records.
    endif.
    2.Create a new Session with Failed records , So u can process there after.
    Regards
    Prabhu

  • Can you run a pc program on a mac?

    Can I run a PC program on the a new mac?

    Yes. But.
    You will need some kind of software environment such as Boot Camp (free from Apple) or Parallels.  Then you will need to buy and install Windoze.
    charlie

  • How can I run external console program, printing output to JTextPane?

    How can I run external console program, printing output to JTextPane?
    I have a console app. written in C++ and I would like to run in it from java swing app. and I would like to see its output in a JTextPane.

    I have used this article
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    to successfully pipe output from jboss batch files to a JTextPane.

  • Can I run my J2ME programs in my Zire71 Palm Top ?

    Can I run my J2ME programs in my Zire71 Palm Top ?
    If yes then please describe me the way
    Advance Thanks to you
    Best regards
    -Nahid

    PalmOne claims not to support the Zire 71 at the moment.
    http://www.palmone.com/us/support/jvm/

  • How can i run my java program with out java language

    Hai to every one ..Iam new to java language ...am using windows xp operating system , i did not installed java language in my system .. how can i run a java program with out installing java language... Which files is requied to run java program..?
    any one can help me??

    Hai to every one ..Iam new to java language ...am
    using windows xp operating system , i did not
    installed java language in my system .. how can i run
    a java program with out installing java language...
    you ... can ... not ... do ... this
    Which files is requied to run java program..?
    any one can help me??a JVM. Download it from sun's website.
    [url http://java.sun.com/javase/downloads/index.jsp]Download JavaSE here

  • 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

  • How can I run a method as a background process?

    Hello,
    I am currently working on a report where depending on the number of items selected, the user may choose to process all the items right now or as a background process.
    How can I do that in ABAP?
    Thanks

    To run a job in the background it has to be scheduled as batch job. You would usually do that using transaction SM36. As I understand your problem you want to schedule such a job directly from your coding. You may want to have a look at function group BTCH. It overs quite a few FMs to programmatically add a batch job.
    regards
    Daniel

  • Run a java program in background

    Hi, I am implementing a bot that's supposed to do something when it receives mesages. My question is how I can make the program keep running. I guess the idea of threading would help but I just dunno how to do it. some hints will be appreciated. I dun wanna put a while(true){} there it just takes too much CPU time. I have some Listeners that will do something when some event happens.
    examples will be helpful.

    I am implementing a bot that's supposed to do something when it receives mesages.Which way does it receive a message? You could run the program in background. It would block on an incoming message. If it listens a socket, you can use
    java.net.ServerSocket's accept()
    which will block until a connection request arrives.

  • How to lock running of abap program?

    Hi Friends,
    I want to lock my abap program. So, I want to provide that my program can be once at any time. And I need to unlock my program. Is there any functions that do my requests?

    HI Nail.
    YOu can set a flag in a ztable with date and time stamp.
    In the at selection-screen event, do this.
    at selection-screen.
    select single * from ztab where repid = sy-repid.
    if ztab-run_date = sy-datum.
    if sy-ucomm = 'ONLI'.
    message a000(zz) 'YOu cannot run this program'.
    endif.
    endif.
    end-of-selection.
    ztab-repid = sy-repid.
    ztab-run_date = sy-datum.
    modify ztab from ztab.
    Regards,
    ravi

  • Is there any way to run signcode.exe program under background mode

    Hi everyone,
    I am finding the solutions to build the project automatically but the situation is still unchanged. When building the project i have use the signcode tool to sign my .cab files therefore the system shows me the "Enter Private Key Password" dialog and ask me to enter my password into the Password field.
    If all you guy have any ways for packing the project by the mechanism of the running signcode program under background mode. Below is my script.
    [b]signcode -spc ms.spc -v ms.pvk -n abc.cab -i URL -t http://timestamp.verisign.com/scripts/timstamp.dll abc.cab
    Thank you for your ideas and regards
    Tan

    Hi,
    you can use the tool signcode-pwd to automate the signing:
    http://www.stephan-brenner.com/blog/?page_id=9

  • How can I run an external program from a PLSQL procedure?

    Is there a package to run an external program from PLSQL? or is there another way to do that?
    thanks.

    here there is an example about how a PL/SQL procedure can
    work with an external C program.
    http://download-east.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76936/dbms_pi2.htm#1003384
    Apart from that you have Java Stored Procedures option
    to carry out your task.
    Java Stored Procedures Developer's Guide Contents / Search / Index / PDF
    http://download-east.oracle.com/docs/cd/B10501_01/java.920/a96659.pdf
    Joel P�rez

Maybe you are looking for

  • 3TB Drive Only Shows Up on My Mac as 750GB

    I have a new Western Digital 3TB drive that I am using as an external drive in a NexStar Hard Drive Dock  to connect to my computer. I formatted it in Disk Utility but it only shows up as 746.5 GB and not the full 3TB. I formatted it through Guid Par

  • Premiere Elements 8 Initial Impressions

    Premiere Elements 8 First Look: Part 1. Photoshop Elements 8 and Premiere Elements 8 are now installed on my Windows XP SP3 with about available 1 GB RAM and 70 GB free hard drive space and the virtual memory controlled by the operating system…not gr

  • Problem in Restricting a Query

    Hi All ,   I have a scenario where we have a Keyfigure say A . In Query the user gives the input for CALWEEK which is mandatory. Let say he gives the Input B . I want to display the result as "the values for A in Calweek (B-1)" i.e. one week before t

  • Dialog Queue Standstill

    Hi, Our production server stopped today with the dispatcher giving the follwoing message "Dispatcher runing,dialogue queue standstill" We found all dialog work processes being filled up y user SAPSYS. We restarted SAP and this resolved the issue. I w

  • No LUNs in Xsan admin

    I'm using Xsan 1.1 on OSX 10.4.7 and I added an new Xserve RAID into the mix. But the trouble is that the LUNs are not showing up in Xsan Admin (v.1.3). `cvlabel -l` shows the two LUNs, labeled "unknown". so does `diskutil list`. All Xserve RAIDs hav