Program or function module to get active Batch jobs

Hi Experts,
                 I need a program or a FM that would give me the list of active batch jobs and also the time they were running
for.
Plz help me out

You Just follow the below code, It is exactly same as your requirement.
TYPES:   BEGIN OF ty_itbl,
           jobname   TYPE   tbtcp-jobname,
           jobcount  TYPE   tbtcp-jobcount,
           stepcount TYPE   i,"tbtcp-stepcount,
           sdldate   TYPE   tbtcp-sdldate,
           sdltime   TYPE   tbtcp-sdltime,
           sdluname  TYPE   tbtcp-sdluname,
           status    TYPE   tbtco-status,
           END OF ty_itbl.
  DATA :   wt_itbl TYPE TABLE OF ty_itbl,
           wa_itbl TYPE ty_itbl.
SELECT     a~jobname
               a~jobcount
               a~stepcount
               a~sdldate
               a~sdltime
               a~sdluname
               b~status
               INTO CORRESPONDING FIELDS OF TABLE wt_itbl
               FROM tbtcp AS a
               INNER JOIN tbtco AS b
               ON    b~jobname    EQ    a~jobname
               AND   b~jobcount   EQ    a~jobcount
               WHERE a~progname IN wp_prog
               AND   a~sdldate  IN wp_date
               AND  b~status eq <STATUS>. "<-Give the Active Status here

Similar Messages

  • Function Module to get Active Serial Numbers of Material Stock

    Hi Experts,
    Do we have any function module to get all the active serial numbers of Material Stock? Or any suggestions on how to get these through SQL Queries?
    Thanks a lot for your help!

    GET_SERNOS_OF_DOCUMENT

  • Function Module Not Getting Activated

    Hi,
    We are using a customised function module which we are calling in a user exit. We would like to call this function module in update task in the user exit to populate data in a custom table.
    We have given the following parameters to the function module
    Import Parameters
    ITAB     LIKE     ZPRUNDAT
    Export Parameters
    l_subrc     TYPE     sy-subrc
    On the attributes tab of the function module, Update Module has been selected under processing type.
    When we try to activate this function module we get the following message
    EXPORTING parameters are not allowed in the update task.
    and the function module does not get activated. What should we change to get the function module activated?
    Mick

    Hi,
    Please try this....
    In function module
    In tables Section add this...
    RETURN TYPE BAPIRET2 and then activate.
    if its useful reward points

  • Function module to start failed batch job

    Hi all,
    Any function module in ABAP to start the failed batch job run which i will use in a report.
    I am using SAP 4.7.
    Thanks
    Raj

    Hi Minish,
    Normally, we can call an RFC in background task as below:
    CALL FUNCTION func IN BACKGROUND TASK
                         [DESTINATION dest]
                         parameter_list
                         [AS SEPARATE UNIT].
    But I am not sure whether your external application can call this RFC in background. But you can create an another RFC and inside call this RFC in background.
    Then call the new RFC so that it will internally call the required RFC in background and Immediately after it will be closed.
    Regards,
    Selva K.

  • Function Module to get the Screen

    Hello All,
    Can anybody provide me a Function Module to get the Screen by giving Program Name and Screen Number.
    Thanks,

    Hello
      check FM  RS_IMPORT_DYNPRO
       CALL FUNCTION 'RS_IMPORT_DYNPRO'
          EXPORTING
            dylang = pmlang
            dyname = programname
            dynumb = screen
          IMPORTING
            header = header
          TABLES
            ftab   = ifields
            pltab  = iflowlogic.
    or you have to create join b/w table reposrc and tadir .
    Thanks
    Anirudh

  • BAPI function module to get condition type and its values based on delivery number?

    Hi All,
    I would like to have the BAPI function module to get condition type value based on delivery number before invoice is created.please provide detail program for as a reference .please reply as soon as possible its urgent.
    Regards,
    saaikumar.

    If you haven't already, you may first need to search via the SAP transaction "BAPI" in the area this is applicable to.  Failing that I do hope you get an answer.

  • Function module to get the difference of dates ..

    Hi ,
    Can somebody pls help me with the function module to get the difference between two dates?
    I need to find the difference value and delete records if >1.
    Thanks in advance.
    Regds,
    Leeza.

    Leeza,
       When I tested the FM in my Program, it is <b>working</b>!!!!!
       Note that the Two Input Dates are to be in the format of <b>DATS</b> type (Eg: <b>vimimv-dmibeg</b>).
      U can want the Day which u have specified in the parameter I_DATUM_BIS (eg: 20050101) to be included for
    the calculation , then put X in the parameter I_KZ_INCL_BIS.
    Sample Code :
    report zkam01.
    data:           
    <b>sav_nlaufz like rf60v-nlaufz, 
    date1 type vimimv-dmibeg,
    date2 type vimimv-dmiend.</b>
    date1 = '20050101'.
    date2 = '20051001'.
    call function 'MONTHS_BETWEEN_TWO_DATES'
         exporting
             i_datum_von   = date1
             i_datum_bis   = date2
             i_kz_incl_bis = 'X'
         importing
             e_monate      = sav_nlaufz.
    write:
    date1,
    / date2,
    / sav_nlaufz.
    Please allot points if the problem is solved.
    Thanks
    Kam
    Message was edited by: Kam

  • Function module to get PR00 price

    I would like to get PR00 price(not manually changed value, but maintained in VK13, that means not the value in VBAP or KONV, but KONP I think) by inputting sales order number as import number(just like when I click analysis button as item condition view, the
    price will show up by SAP standard program). which function module can be used?
    I find a module RV_KONV_SELECT. There is one import parameter including so many fields. I just entered client and order number(I think it is enought, but i cannot get the result).Please could you give some clue or where i can find the help doc about it and if any other pricing module according to my requirement.
    Many thanks.

    Hi!
    You can try BAPISDORDER_GETDETAILEDLIST and check return condition tables for info you need:
      DATA:
        wa_bapi_view TYPE order_view,
        it_sales_documents TYPE STANDARD TABLE OF sales_key,
        wa_sales_documents LIKE LINE OF it_sales_documents,
        it_order_conditions_out TYPE STANDARD TABLE OF bapisdcond,
        it_order_cond_head TYPE STANDARD TABLE OF bapicondhd,
        it_order_cond_item TYPE STANDARD TABLE OF bapicondit,
        it_order_cond_qty_scale TYPE STANDARD TABLE OF bapicondqs,
        it_order_cond_val_scale TYPE STANDARD TABLE OF bapicondvs.
      wa_bapi_view-sdcond = 'X'.
      wa_bapi_view-sdcond_add = 'X'.
      wa_sales_documents = 'SALES_ORDER_NUMBER'.
      APPEND wa_sales_documents TO it_sales_documents.
      CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
        EXPORTING
          i_bapi_view                   = wa_bapi_view
      I_MEMORY_READ                 =
        TABLES
          sales_documents               = it_sales_documents
      ORDER_HEADERS_OUT             =
      ORDER_ITEMS_OUT               =
      ORDER_SCHEDULES_OUT           =
      ORDER_BUSINESS_OUT            =
      ORDER_PARTNERS_OUT            =
      ORDER_ADDRESS_OUT             =
      ORDER_STATUSHEADERS_OUT       =
      ORDER_STATUSITEMS_OUT         =
         order_conditions_out          = it_order_conditions_out
         order_cond_head               = it_order_cond_head
         order_cond_item               = it_order_cond_item
         order_cond_qty_scale          = it_order_cond_qty_scale
         order_cond_val_scale          = it_order_cond_val_scale
      ORDER_CONTRACTS_OUT           =
      ORDER_TEXTHEADERS_OUT         =
      ORDER_TEXTLINES_OUT           =
      ORDER_FLOWS_OUT               =
      ORDER_CFGS_CUREFS_OUT         =
      ORDER_CFGS_CUCFGS_OUT         =
      ORDER_CFGS_CUINS_OUT          =
      ORDER_CFGS_CUPRTS_OUT         =
      ORDER_CFGS_CUVALS_OUT         =
      ORDER_CFGS_CUBLBS_OUT         =
      ORDER_CFGS_CUVKS_OUT          =
      ORDER_BILLINGPLANS_OUT        =
      ORDER_BILLINGDATES_OUT        =
      ORDER_CREDITCARDS_OUT         =
      EXTENSIONOUT                  =
    Regards,
    Maxim.

  • Function module to get Structure components

    Hi friends,
    is there a function module to get structure components,if we give a structure name.
    regards
    kaushik

    Sample program using the function module.
    report zrich_0003.
    types: begin of type_item,
           f1(3),
           f2(3),
           f3(3),
           f4(3),
           end of type_item.
    types: begin of type_data,
           data(800),
           end of type_data.
    data:  lineitems type table of type_item with header line,
           t_output type table of type_data with header line,
           fieldlist type table of rstrucinfo with header line,
           fieldsym  type table of rfieldlist with header line.
    data:  syrepid type sy-repid.
    data:  fieldname like fieldlist-compname,
           data_line type type_data.
    field-symbols : <fs1> type any,
                    <fs2> type any.
    lineitems-f1 = 'a1'.
    lineitems-f2 = 'a2'.
    lineitems-f3 = 'a3'.
    lineitems-f4 = 'a4'.
    append lineitems.
    lineitems-f1 = 'b1'.
    lineitems-f2 = 'b2'.
    lineitems-f3 = 'b3'.
    lineitems-f4 = 'b4'.
    append lineitems.
    lineitems-f1 = 'c1'.
    lineitems-f2 = 'c2'.
    lineitems-f3 = 'c3'.
    lineitems-f4 = 'c4'.
    append lineitems.
    lineitems-f1 = 'd1'.
    lineitems-f2 = 'd2'.
    lineitems-f3 = 'd3'.
    lineitems-f4 = 'd4'.
    append lineitems.
    syrepid = sy-repid.
    * Gets all of the global data types.
    call function 'GET_GLOBAL_SYMBOLS'
         exporting
              program   = syrepid
         tables
              fieldlist = fieldsym.
    * gets all of the components of a structure
    call function 'GET_COMPONENT_LIST'
         exporting
              program    = syrepid
              fieldname  = 'lineitems'
         tables
              components = fieldlist.
    format color 3.
    loop at lineitems assigning <fs2> .
      loop at fieldlist.
        fieldname = fieldlist-compname .
        assign component  fieldname  of structure <fs2> to <fs1>.
        concatenate data_line <fs1> into data_line .
      endloop.
      append data_line to t_output.
      clear data_line.
    endloop.
    loop at t_output.
      write:/ t_output.
    endloop.
    Regards,
    Rich Heilman

  • ABAP Program or Function Module to activate infospoke/openhub table

    Hi,
    Post migration to production, when i am trying to load the data in open hub table, its showing OH table is not active. i had tried to all aspect but i am unable to load the data.
    is there any ABAP Program or Function Module to activate infospoke/openhub table
    Thanks & Regards,
    Pankaj Bansal

    Hello Pankaj,
    Please check whether you have access to TCode SE14 . If Yes , You can use this TCode to activate the Tables.
    There are lot of  Posts talk about the procedure for activation through SE14. please refer the same
    Thanks & regards,
    Prasath

  • Function module to get components

    Hi,
    Anyone knows of a function module that gets the components attached to an activity?

    Hi Jackie,
    Please consider BAPI_NETWORK_COMP_GETDETAIL and BAPI_NETWORK_GETDETAIL
    Thanks
    Martina

  • Function module for getting Vendor Address details

    Hi,
    Im new to this group,and new to ABAP
    plz hep me out by solving ABAP Query...
    i want to generate a report for getting Vendor Details
    like Vendor address,Ph num and Email
    input fields are Company code,country key and Account Group.
    im Using Smart Forms for this..
    but im not getting the Exact Function module to get All Required Details..
    regards
    Smitha

    thanks for ur quick reply...
    SELECT SINGLE LIFNR
      FROM LFB1
      INTO V_LIFNR
      WHERE BUKRS EQ V_BUKRS.
      CALL FUNCTION 'VENDOR_READ'
        EXPORTING
          i_bukrs         = V_BUKRS
          i_lifnr         = V_LIFNR
        EXCEPTIONS
         NOT_FOUND       = 1
         OTHERS          = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    this is the code i have written...
    but my problem is there no table in the Function module....
    for Example...
    CALL FUNCTION 'QPAX_PLMKB_READ_FROM_PLKO'
        EXPORTING
          i_plnty            = 'Q'
          i_plnnr            = V_PLNNR
          I_PLNAL            = V_PLNAL
          i_sttag            = V_DATUV
       TABLES
        T_PLMKB_TAB        = IT_TAB
    i want the function modules with tables and proper input...

  • Function module for getting the open qty

    HI experts,
                      I have a PO quantity(EKPO_MENGE).against same PO and item item(EBELN and EBELP) if Goods receipt has happened (MSEG_ERFMG) then i need to calculate the open qty.and also by netting the open quantity if multiple GRs has done against the same PO and item.
    Can you suggest any function module to get this open PO quantity.

    Hello,
    Hope this link can help you.
    [Po Open Quantity;
    Thanks
    Jayant

  • ABAP - Function module to get the number of working days between 2 days

    Hi gentlemen,
    I have been asked to produce a report that gives the number of working days between 2 days, based on a calendar.
    I didn't find anything...
    Has any of you already written a function module to get this ?
    A great thanks in advance.
    Jacques Lagrif

    Hi ,
    you can try this ,
    when you require the number of working days between D1 and D2
    Total No of Days will be
    D2 - D1
    No of holidays between D1 and D2 , use the FM HOLIDAY_GET
    Pass the From date , to date , and the factory calendar to get the of Holidays
    Total no of days - Number of Holidays will your Working days
    Regards,
    Sathya

  • Program or Function module to delete data from Open Hub Destination Table

    Hi All,
    Can anybody suggest me a Program or Function module to delete data from Open Hub Destination Table.
    Thanks & Regards,
    Vinay Kumar

    You can simply goto t-code SE14 mention the open hub destination table and Delete data by clicking on "Activate and Adjust database" with radio button "Delete Data".
    Regards,
    Arminder

Maybe you are looking for