Back ground process using abap program

Hi,
How to create background process using job_open,Job_submit,job_close function modules

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_BGPROGRAM'.
  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 " these are the parameters of the background program
        WITH p_lines = p_lines
        USER syst-uname " you must use this
       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'.

Similar Messages

  • Run time error in Back ground processing using LSMW

    Hi all,
        We are runnig LSMW to create Positions using tcode PP03. We are able to create positions in the foreground but we are getting error "RAISE_EXCEPTION" in the Backgrond for the same LSMW.
        Kindly suggest me suitable solution if any.
    Thanks in advance,
    Vasanth.

    Hi all,
    Thanks for your reply.
    I  got the solution. When a program is scheduled in background, if it is written in classes and ALV grid display is used, we get this error. I am able to schedule when I change the function module to LIST_DISPLAY.

  • Server Proxy in back ground mode in ABAP?

    Hi,
    I would like to schedule server proxy in back ground mode using ABAP report. I already have the payload available in XSTRING(binary) saved in Z table. I know how to convert binary string to XML (using FMs -  SCMS_BINARY_TO_STRING).
    However, is there any way to pass binaryXML(XSTRING) to server proxy (without converting the paylolad to XML and use SAX/DOM parser to populate proxy input structure ) ?
    Not sure, if SET_XML(IF_WS_PAYLOAD) method can be used.
    Thank you,
    Mallik

    Hi Malik,
    I would like to schedule server proxy in back ground mode using ABAP report. I already have the payload available in XSTRING(binary) saved in Z table. I know how to convert binary string to XML (using FMs -  SCMS_BINARY_TO_STRING).
    If you think about this, it hasnt sense, a server always need to be alive wainting a communication. If you want to stop the server reception, the middleware system (in this case PI) would need to store the messages for a future server availability, then this would work only with async messages. I dont see right now the utility of this, may be don't overload the ECC system in a work hours, is this the problem?
    However, is there any way to pass binaryXML(XSTRING) to server proxy (without converting the paylolad to XML and use SAX/DOM parser to populate proxy input structure ) ?
    Are you talking about to do this conversion in a java mapping inside the PI? aren't you?
    Regards.

  • Fork in process chain using ABAP program

    Hello everyone.
    I need a fork in my chain. Depending on the values in some db table I will make a decision: do some process or skip and go further. The only solution I can see is using ABAP program. But unfortunately It doesn't return status. Any suggestion will be appreciated.

    Hi,
    You have few process to run after the abap program. So make all those process as a different chain, and at the end of the ABAP program include a function module to trigger this chain, based on your condition.
    If you like this idea, please revert for more information.
    Hope this helps.
    Thank you,

  • Error in BDC Back Ground Processing

    Dear All,
    I am facing problem on while executing BDC program. First i am executing in Foreground method there it displaying errors occured,
    means it showing full discription or error.
    But when i used Back ground processing its displayig the full error discription like "No posting object defined for 1230/ / / " here i need full error discription.
    please do the need full.
    Regrads,
    Srinivas.

    Hi
    In background processing you cannot see the error message, for that you have to write logic for capturing messages.
    Use 'Format_Message' function module so that you can get the complete message and then you can display that on the screen.
    Hope it helps...

  • Back Ground Process In OOABAP

    Hi all,
    How can i process Back ground process on Object oriented
    Thanks Rayeez,

    Hi Rayeez,
    I had a requirement wherein I had to call ALV Grid display in background, here I used OO ABAP and just before creating the custom container I checked IF cl_gui_alv_grid=>offline( ) IS INITIAL.
    You can find similar methods for your OO Class and check if it is initial.
    <b>Please reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Is it possible to reset password for any user using abap program

    Hi friends,
    Is it possible to reset password for any user using abap program by specifying client number and user id. in selection screen.
    if any code for that to reset password please mail me.
    Thanks & Regards,
    Yogesh

    Hello Yogesh,
    Yes you can reset the password for any body using ABAP Code. But for that you really don't need any client number.
    If this process is on regular basis, then recommended is to use BAPI for changing the user details Otherwise BDC also works fine.
    => Function Module - BAPI_USER_CHANGE
    Call this in the program for resetting the password.
    => CALL TRANSACTION 'SU01' USING InternalTable
    This will be executed in the BDC of SU01 transaction recording. Use the Password Change button in the application toolbar of transaction while recording.
    Hope this helps.
    PS If the answer solves your query, plz close the thread by marking it solved and rewarding each reply.
    Regards

  • Unzip files using ABAP program

    Hi All,
    Can anybody guide me how to Unzip a .zip file using ABAP program... Appreciate your immediate reply...
    actually, my scenario is to check whether zip file is created in appl.server or not.., and if zip file created then i need to check whether its blank file or any content exist inside the file...
    Thanks in advance
    Bhasker

    hi
    good
    parameters: command(236) lower case.
    data: std_lines(255) occurs 0 with header line.
      call function 'RFC_REMOTE_PIPE'
        destination 'SERVER_EXEC'
        exporting
          command = command
          read = 'X'
        tables
          pipedata = std_lines
        exceptions
          communication_failure = 1
          system_failure = 2.
    You should put your Unix command in the command parameter. "gunzip /yourfilepath/yourfilename" works on my Unix system. Once you determine the proper Unix command, you should be set. This technique is also nice because it provides you with echos back from Unix in table std_lines. For more complex Unix activity, you may want to consider throwing together a Unix script, and calling that via this code.
    reward point if helpful.
    thanks
    mrutyun^

  • Back ground processes, dialogue processes and Process chains

    Hai all,
               I am going through making process chains and I am struck with one thing:
    "How many background process chains and dialogue processes you have during run time"
    This is the problem. I understood everything else except this.The concept says that I have to know what is the capacity of the system, how many background and dialogue processes it could accomodate, how many are left and how many you can use for your process chain.How do we find out this? and could somebody please explain me or refer to documentation about the Back ground processes, dialogue processes and Process chains.
    Thanks.

    Hi Visu,
      You can see the number of dialog and background processes by using transaction SM51 and then double clicking on the server (we only have one but it may be different for each). Our BASIS folks take care of the number of processes as well. And, for us we have a schedule that changes the number at a certain time of day because you tend to need more dialog during the day but more batch at night.
      The transaction to look at and change the settings is RZ03. Then use the menu path Edit->Operation Modes you can select either Configuration or Timetable here. Both give information in different ways. I tend to double click around to see what it might tell me.
      I hope this helps a bit,
    Diane

  • Back ground processing of the LDAP

    Hi,
    We are on XI3.1, SP2.
    We are using LDAP authentication.
    We wants to know the  back ground processing when a using login to the deski using LDAP authentication.
    Any one please help on this.
    Thanks in advance.
    Thanks & regards,
    Collin Powell.

    When logging with client tools the LDAP logon will be sent from the client, then the username will be authorized by the CMS which will in turn send a number of queries to the LDAP server to verify group membership. The variables include, graphtimeout (set or not) version/patch of BO (this behavior is different in 3.x vs XIR2 and even different in XIR2 SP2 vs SP4.
    If you are not using SSL then all the traffic can be packet scanned using a tool like Micr4osoft netmon or wireshark.
    Regards,
    Tim

  • Genetare the back ground jobs of the program from the SM36 tcode

    Hi All,
        Consider the following points:
    -- My main program will schedule the jobs using the CALL TRANSACTION method
    -- Now i want to create a Variant for the Main program and generate the back ground job using the SM36 Tcode
    -- Finally it has all the jobs of the main program
    -- Program is working fine from the Frontend only.....
    Please provide solution for the same.
    Thanks in Advance.
    Regards,
    Ramana

    Sravya,
    On SM36 when you schedule jobs, you will see options like AFTER EVENT and AFTER JOB. You can use these to schedule you jobs accordingly. Else you can also think of making each of these jobs as a steps in one single job if your requirement allows you to do the same.
    In case of using events, you should make sure to raise the event using available FMs.
    thanks,
    Vikram.M

  • Regarding back ground processing for excel.

    Hi,
    i want to create the Excel sheet and i want to save in Back ground Processing....
    give me some suggestionss.......................

    This can create any file (spreadsheet/plain text/ dat files). but to add workbooks to the sheet you need to use OLE Object concepts.
    PARAMETERS:    p_terms(256) TYPE c OBLIGATORY,
                p_del(1)     TYPE c OBLIGATORY DEFAULT cl_abap_char_utilities=>horizontal_tab.
    DATA:       lv_str       TYPE string,
          lv_char(256) TYPE c,
          lr_descrref  TYPE REF TO cl_abap_typedescr.
    FIELD-SYMBOLS: <comp> TYPE ANY.
      IF itab IS NOT INITIAL.
        OPEN DATASET p_terms FOR OUTPUT IN LEGACY TEXT MODE .
        IF sy-subrc EQ 0.
          CLEAR : lv_str.
    Header of the file
          CONCATENATE
            'Action'
            'Name'
            'EE User ID'
            'Termination Date'
            'Last Day Worked'
            'End Of Notice'
            'Employee Type'
            'Department'
            'Department_type'
            'Office Location'
            'Manager Name'
            'Has Cellphone'
            'Has Home Office'
            'VP and Above'
           cl_abap_char_utilities=>cr_lf
          INTO lv_str SEPARATED BY p_del.
          LOOP AT itab INTO ls_terms.
            WHILE sy-subrc EQ 0.
              ASSIGN COMPONENT sy-index  OF STRUCTURE ls_terms TO <comp>.
              IF sy-subrc NE 0.
                EXIT.
              ENDIF.
              lr_descrref = cl_abap_typedescr=>describe_by_data( <comp> ).
              IF lr_descrref->type_kind = 'P'.
                WRITE <comp> TO lv_char DECIMALS 2.
              ELSE.
                WRITE <comp> TO lv_char.
              ENDIF.
              SHIFT lv_char LEFT DELETING LEADING space.
              IF sy-index NE 1.
                CONCATENATE lv_str lv_char INTO lv_str SEPARATED BY p_del.
              ELSE.
                CONCATENATE lv_str lv_char INTO lv_str.
              ENDIF.
              CLEAR: lv_char.
            ENDWHILE.
            TRY.
    This statement passes the content of data object to the file specified
                TRANSFER lv_str TO p_terms.
              CATCH cx_sy_file_authority .
                FORMAT COLOR 6 ON.
                WRITE:/ 'No authorization to access the Term file'.
            ENDTRY.
            CLEAR lv_str.
          ENDLOOP.
          CLOSE DATASET p_terms.
        ENDIF.
      ENDIF.

  • Can a transaction be called in background dynamically using ABAP program??

    Hi Experts,
    Can a transaction be called in background dynamically using ABAP program without BDC???
    Regards,
    Mansi.

    u can create job dynamically through programming..Try this sample code..
    data: jobname like tbtcjob-jobname value
                                 ' TRANSFER TRANSLATION'.
    data: jobcount like tbtcjob-jobcount,
          host like msxxlist-host.
    data: begin of starttime.
            include structure tbtcstrt.
    data: end of starttime.
    data: starttimeimmediate like btch0000-char1.
    Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = ' '
                jobgroup         = ' '
                jobname          = jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = jobcount
           exceptions
                cant_create_job  = 01
                invalid_job_data = 02
                jobname_missing  = 03.
      if sy-subrc ne 0.
                                           "error processing
      endif.
    Insert process into job
    SUBMIT zreport and return               << Here it is a static call but u can make it dynamic
                    with p_param1 = 'value'
                    with p_param2 = 'value'
                    user sy-uname
                    via job jobname
                    number jobcount.
      if sy-subrc > 0.
                                           "error processing
      endif.
    Close job
      starttime-sdlstrtdt = sy-datum + 1.
      starttime-sdlstrttm = '220000'.
      call function 'JOB_CLOSE'
           exporting
                event_id             = starttime-eventid
                event_param          = starttime-eventparm
                event_periodic       = starttime-periodic
                jobcount             = jobcount
                jobname              = jobname
                laststrtdt           = starttime-laststrtdt
                laststrttm           = starttime-laststrttm
                prddays              = 1
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = starttime-sdlstrtdt
                sdlstrttm            = starttime-sdlstrttm
                strtimmed            = starttimeimmediate
                targetsystem         = host
           exceptions
                cant_start_immediate = 01
                invalid_startdate    = 02
                jobname_missing      = 03
                job_close_failed     = 04
                job_nosteps          = 05
                job_notex            = 06
                lock_failed          = 07
                others               = 99.
      if sy-subrc eq 0.
                                           "error processing
      endif.
    Regards,
    JOy.

  • Synchronizing Two Custom Z Tables Using Abap Program

    Hi,
        My requirement is Synchronizing two custom z tables using abap program me.
    I have vendors in two tables, i have to select the common vendors from first which are existing in second  table also.
    In first table each vendor can have more than one supplier types in one field only. In second table these supplier types are divided into
    different fields.
         My requirement is I have to check supplier types in first table and i have to pass X to corresponding supplier types in second table vendor.
    I have to pass X value for each depending in Second table depending upon supplier type in first table.
    . How to do it can any one suggest with code.
    Thanks in Advance,
    Vivek
    <subject edited by moderator>
    Message was edited by: Manish Kumar

    Hi,
    Imho, you need to get (meaning, extract into separate fields) the different supplier types from Table1 first. Your key for Table1 is the vendor no, which is also the key in Table2 (or the key for Table2 is Vendor no & Type).
    For better performance, better select multiple/all required entries from Table1 instead of doing a select endselect.
    Depending on the format of the vendortypes in Table1, put them in a new itab (for our purpose named Table1New where vendor no & type are the only 2 fields. For example, if the type length is fixed to 2 chars, or divided by space,... use your coding accordingly.
    Next step is to select all vendor no's in Table2 which you have selected in Table1. If in Table2, the vendor no is the only key (and the all vendor types are filled in a single record), then loop check the vendor types from Table1New against the types in Table2.
    If the key of Table2 is vendor no & vendor type, then do a read table for the key.
    The logic in pseudo-code:
    Select from Table1 into table. If you'd like to limit the selection size, add package size statement.
         extract the vendor types in to itab Table1New.
         Select the vendor & types from Table2 by using the for all entries option (better performance).
         loop at Table1New
              check in Table2:
                   if the unique key is vendor no: check all fields for the vendor type from Table1New
                   if the unique key combo is vendor no & type: check by using a read table.
              If not found => add entry to Table2
         endloop.
    endselect Table1 (when using package size)
    I guess the most difficult step is to extract the types from Table1 into separate fields, all the rest seems straight forward. Please keep in mind the itab type definitions for a better performance.
    Good luck!
    Best regards,
    Zhou

  • Access table using ABAP program in other database

    Dear SAP Expert,
    We have requirement that related to SAP interface.
    Our SAP system run on Oracle database 11g (Unix).
    Illustration: SAP system = A non SAP system = B
    We need to access a table using ABAP program (from SAP system A) in other database (system B) that are not necessarily SAP database. The non-SAP system using SQL Server 2008 (Windows).
    What is the best practice for this interface
    Do we need database link? If yes, please help to inform me the details step to configure it.
    Thanks and Regards

    Hi Friend,
    You try using an intermediate system..passing your input required to fetch the data..and PI should call the respective query to retrive record..once the full flow is completed you should get the return through some table in the calling program.
    else.
    ask the other system guy to write a function with select query and ask him to expose as RFC and that RFC we have to call it as RFC in our program to get the required values and only thing we need here is a proper connector in place.
    Regards
    S.Janagar

Maybe you are looking for

  • Problem closing an ActiveX created with the bridge and used in a scada.

    Hi all, I cretaed an ActiveX (using the bridge) to be used in a scada software. I inserted the activex in a panel and it opens and work properly when the panel is open. The problem is that when I close the panel, the scada doesnt free the memory. Is

  • Linking to external video in Captivate 7

    I develop video-based training. Each slide includes mostly video. I've been successfully embedding f4v videos into Captivate projects for some time but video quality and file size issues make it necessary to begin linking to videos on external server

  • W540 sleep mode buttons are not working

    Hello, My question concerns the non-functioning  sleep mode buttons on my Lenovo W540 20BG. In my current power management settings, the W540 is suppose to enter sleep mode by pressing Fn4 or by pressing the round power button shortly. However, eithe

  • Transfer posting of subcontracting stock with mvt type 541 from project stk

    Hi, we run project MRP and the requirement is raised for subcontracting item also ,after converting the PR into PO when I try to transfer post material in MB1B using 541 ,system shows Error Purchase order does not contain any item even I have  materi

  • How can i install Ubuntu 12.10 alongside Mac OS X

    Hello, I want some help on how to install Ubuntu 12.10 alongside my macbook pro retina, from the scrach including drivers and else ! Thanks a lot