How to schedule a Process Chain using ABAP Program?

Hi All,
I want to schedule the activity of extracting data from the query to a flatfile.
Currently we are schedulling it using the transaction rscrm_bapi.
I need to know , how we can achieve the same using an abap program and not ( rscrm_bapi) in a process chain.
Any help would be appreciated.
Regards
Purva

Your problem will be solved if you use the Function Module "RSPC_API_CHAIN_GET_STATUS" instead of the function module "RSPC_API_CHAIN_GET_LOG".
The function module "RSPC_API_CHAIN_GET_STATUS" gives you the STatus of the process chain, when you pass the Chain Name and the Log ID.
If you get an output
G or F - Report that the Chain is Successfully Completed.
A - The chain is Currently running
R or X - Report that the chain has ended with Errors.
Sample code :
REPORT Z_BW_GET_STATUS_PROZESSKETTE.
TABLES rspclogchain.
DATA: gt_rspclogchain LIKE rspclogchain OCCURS 0,
wa_rspclogchain LIKE rspclogchain.
DATA: gt_log LIKE rspc_s_msg OCCURS 0,
wa_log LIKE rspc_s_msg,
gt_status like RSPC_STATE.
SELECT * FROM rspclogchain
INTO CORRESPONDING FIELDS OF TABLE gt_rspclogchain
WHERE datum = sy-datum
AND chain_id = 'BD_C02_1D'.
IF sy-subrc = 0.
SORT gt_rspclogchain BY datum DESCENDING
zeit DESCENDING.
READ TABLE gt_rspclogchain
INTO wa_rspclogchain INDEX 1.
CALL FUNCTION 'RSPC_API_CHAIN_GET_STATUS'
EXPORTING
i_chain = wa_rspclogchain-chain_id
i_logid = wa_rspclogchain-log_id
IMPORTING
E_STATUS = gt_status.
IF gt_status = 'G' or gt_status = 'F'.
WRITE :/ 'BD_C02_2D chain COMPLETED'.
ELSE.
WRITE :/ 'BD_CO2_2D chain is Running or Ended with Errors'.
ENDIF.
ELSE.
WRITE :/ 'No chain BD_C02_2D started for today ! or keine Kette BD_C02_2D gestartet !'.
ENDIF.
I have just provided a sample code, you might have to edit or add necessary messages to the program.
Regards,
Ramya

Similar Messages

  • How-to trigger a process chain using ABAP?

    Does anybody know how to trigger a process chain using ABAP code?
    Any help would be appreciated!
    Thanks
    Ioan

    Hi Ioan,
    try this in your ABAP:
        CALL FUNCTION 'BP_EVENT_RAISE'
          EXPORTING
            eventid         = 'Your Event'
            eventparm       = 'START'
            target_instance = ' '
          EXCEPTIONS
            OTHERS          = 01.
    and schedule your process chain, waiting for 'Your Event'.
    regards
    Siggi

  • 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,

  • Trigger process chains using  ABAP program selection screen.

    Hi All
    I am loading flat files through process chains. My requirment is such that i need to create a ABAP selection screen so that user can load the flat file from his PC. when the user is loading the flat file i have to copy the file onto the application server folder and then display him the monitor errors/warnings (if any). when my data load is complete i need to archive the file with time stamp onto the application server folder.
    Please help me in this regard....
    thanks and regards
    sairam phani

    Hi,
    1. Using TA: AL11 create a folder in application server.
    2. There is a program to send the flat file to application server on r/3 side.
    Program Name:RC1TCG3Z.
    3. Regarding archiving...I have no idea.
    Regards,
    Vijay.

  • How to Trigger a Process Chain through ABAP Program

    Hi
    I have a Requirement to trigger a process Chain on 1st, 2nd and 3rd day of the month for 2 times in a Day.
    Can any one give me any idea, how i can do it by writing a ABAP program and triggering the Process chain.
    If anyone can share the Logic for ABAP program means, that will be helpful for me, as i dont have much expertise on writing ABAP program.
    Regards,
    Muruganand.K

    Hi,
    you can achieve this in a following way.
    DATA : v_date type sy-datum,
    v_day(2) type c.
    v_date = sy-datum.
    v_day = v_date6(2).+
    if v_day = '01' or
       v_day = '02" or
       v_day = '03".
    CALL FUNCTION RSPC_API_CHAIN_START.
    pass the name of the chain to this function module.
    hope this wil help.

  • How to process process chain in ABAP program

    Hi,buddy:
        If I want to start Process Chain in ABAP program,then which code or function can be used?
        Best Regards.
    Martin Xie

    Hi Martin,
    How-to trigger a process chain using ABAP?
    Hope it suffice,
    Cheers
    SRS

  • Trigger Process chain using ABAP code

    Hi All,
    As per my knowledge there are 2 ways to trigger a process chain using ABAP code :
    1) Using FM ‘RSPC_API_CHAIN_START’ and passing process chain name as the parameter
    2)Using FM 'BP_EVENT_RAISE' and passing process event as the parameter, which you can create using SM62 transaction.
    I would like to know which one is better to use, in terms of advantage and disadvantage.
    Thanks,
    Praveena

    Hi praveena,
    check these links ..u .may get some help
    Process Chain
    Process Chain
    How to run a Process Chain
    Process chain-parallel process
    Regards
    BILL

  • How to schedule the process chain

    hi
    guys,
                       how to schedule the process chain to run on thirsday and friday b/w 8pm to 11:55pm which has already been scheduled for daily loads at 9am to 11am?
    (Tell me the answer in detail)
    your regards
    suresh

    Hi Suresh,
    If you want to change in the Production system, you may not have the Authorizations. If you have authorization;
    1. Goto RSPC-->double click on the Process chain
    2. double click on the Start variant of the process chain-->Click on the EDIT button
    3. Click on the CHANGE SELECTIONS then click on the DATE/TIME Tab;
    4. There pls give from which date this process chain has to run to with your requirement time,
    then give the time and select the periodic job and select with your requirement.
    Save and exit.
    It is done!!
    Hope you understood.
    Regards,
    Ravi Kanth

  • Trigger process chain in ABAP program

    Hi Experts,
    We have a requirement to trigger the process chain from an ABAP program. I used the function module RSPC_API_CHAIN_START to trigger the process by passing the process chain name in 'I_CHAIN' and it worked. However, the client wants to trigger this using batch user name as few planners do not have authorization when they executed the custom transaction.
    Based on the return code of the function module I am capturing the status for tracking.
    Please suggest if there is any alternate solution to pass the user name while triggering a process chain in an abap program.
    Thanks and Regards,
    Pavithra

    hi Chintai,
    in bw side, you create a abap program to trigger an event in r/3,
    and include this abap program in your process chain, the abap program like
    CALL FUNCTION 'BP_EVENT_RAISE'
    EXPORTING
    eventid = 'ZRUNJOB_DEL'
    and in r/3 schedule the program to delete previous data with 'after event',
    the event name is same as raise by bw process chain, in this sample ZRUNJOB_DEL.
    hope this helps.

  • How to schedule the process chain fr the report

    hai experts,
    i have a query which i need to generate for every five hours? i know that we can generate the report thr process chain but i dont know how to build that..
    my question is how to schedule the report,how to build the process chain,....
    can any one plz tell me how to start this generating report for every five hours
    thanks in advance..points will be alloted surely ,i need this urgently..
    Suri

    First of all you need to Identify the InfoObjects if you want to take up Master Data Loads, and if you want take up transaction loads then select the Data Targets to which the data has to be updated. Then plan the dataflow accordingly.
    You want to create a Process Chain, Go to RSPC, and then select the create option and from the Process categories available on the left handside drag and drop the Start process, then define the Variant for the same. In the same way you need to identify the other Process Types available on the lefthand side. For Eg: Start Process>Load to ODS>Activation of ODS Data>Delete Indexes for the InfoCube>Load to InfoCube>Create Indexes>Delete Overlapping Req-->Agg. Rollup.
    This is how you need to specify the dataflow, several other Process Types also included based on the requirement For Eg: Sending Mail Alerts when the Job is Success or Terminated.
    Also, have a look at this links to make urself clear about the steps in creating Process Chain.
    http://help.sap.com/saphelp_nw04/helpdata/en/67/13843b74f7be0fe10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/sap-teched-03/using%20process%20chains%20in%20sap%20business%20information%20warehouse
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    Hope it helps.
    Regards,
    Archna

  • How to trigger a process chain using external scheduler ?

    Hi all,
             we have a requirement wherein we need to trigger the process chains from an external scheduler used by client rather than directly scheduling it through BW scheduler.So any pointers on this will be heplful.

    Hi we have had a same scenario like this. You can schedule it using schedulers like autosys. Speak to your basis team and see if you have the autosys software installed or some thing similar to that. You have to write a program which calls the function RSPC_CHAIN_START. When you excute this program, it willl ask for a variant to execute. this variant will be the start variant of the process chain you want to trigger.
    the flow will be like the basis team will schedule the autosys or the scheduler to run the program and this program will in turn trigger the process chain.
    regards,
    Satish.

  • How to Trigger the process chain using Excel Files?

    Hi All,
    We have 9 excel files(4 master data attributes and text files and 1 transaction file).
    Everyday new records will be added into the excel sheets and we need to trigger all these files into the bw server through process chain automatically . As we have all these Excel files in the desktop.
    Please suggest how to achieve this task?
    Thanks
    Gowtham

    Hi,
    You cannot load flat files to BW automatically using process chains.
    You have to upload them to Apllication server and point your Infopackage to the directory path of the flat file in application server. then process chains can load it.
    How to guide for loading flat file to application server.
    Program to load CSV file from local desktop to Application server(For flat file Data extraction)
    -Sriram

  • How to execute the process chain using function module

    Hi,
    How can we execute the process chain when there is any process failed. For ex. when we are running many processes. when loading fails in local process chain, after fixing this error, how can we execute the rest of processes. Can we execute the rest of processes using any function module. Kindly guide me.

    Hi,
    Chk the weblog.
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3149. [original link is broken] [original link is broken] [original link is broken]
    Regards,
    Balaji

  • Schedule a process chain using factory calender

    Hi All,
    My requirement: the user wishes to see the report every month, 1 working day prior to the month end.
    I am trying to do this usnig processing chain and factory calender to restrict it.
    1. How can a factory calender be used ?
    3. how do i give the offset of 1 working day prior to month end?
    2. If you have any such experience please share.
    Please help.
    Rohit Kumar.

    Hi,
    In the start process open the start time parameters screen. Then click on the button '>>' next to 'at operation mode' button. In the following screen, give the factory calender. In the workday column give 2. Choose radio button 'end of month'. In the period field give the frequency of the loads, i guess it should be 1 for you as you want to load monthly. So the job runs on the day before the last working day.
    regards,
    Murali.
    Edited by: Murali Krishna K on Jun 23, 2008 5:27 PM

  • Trigger Process chains through ABAP program using selection screens

    Hi All
       I am loading flat files through process chains. My requirment is such that i need to create a ABAP selection screen so that user can load the flat file from his PC. when the user is loading the flat file i have to copy the file onto the application server folder and then display him the monitor errors/warnings (if any). when my data load is complete i need to archive the file with time stamp onto the application server folder.
    Please help me in this regard....
    thanks and regards
    sairam phani

    Hi sairam
    can you check this link hope this might help you out
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    Going thru your query hope i get the right   solution
    Thanks=points in SDN
    Sanjeev kumar hamsala

Maybe you are looking for