Ending a process chain with abap program

Hello friends.
Can anyone help me please?
I have a problem with a process chain in BW.
The process chain is triggered by the MF BP_EVENT_RAISE in an custom MF. While the process chain works, the custom MF is monitoring the chain´s log.
This process chain have 2 steps:  one is the initial process and the other is a ABAP program. In the abap program there are validations and if exists some error, the program abort and this job (BI_PROCESS_ABAP) is cancelled. The problem is that i have to go to the Tx. RSPC and view the logs fro this chain and in these moment ends th custom MF. In other wors, the MF ciustom ends until i go to the tx RSPC for view the logs.
I need that the program ends the process chain naturally.
Thanks for your help.
Regards.

Hi,
You can end a process chain by seeing the variant name and instance name of teh process chain from and finding its corresponding log id,type of process from the table RSPCPROCESSLOG and then executing the standard FM RSPC_PROCESS_FINISH. Here you will have to give the log id,type of process ,vairant name and instance name alongwith the status of the process chain as R to end the process chains.
If you want to aurtomate it you can do that by creating a Z program which will read LOG ID and teh TYPE of process from table RSPCPROCESSLOG on the basis of variant name and the instance name of the process chain and the execute the function module RSPC_PROCESS_FINISH from inside the program.
Navesh

Similar Messages

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

  • Transportation of process chains with ABAP variants

    Hi,
    Could you please help me in finding out how to transport process chains with ABAP variants.
    I can transport them, however when transporting them, I overwrite the already existing variants, which is very unfortunate...
    Could you please advice.
    Thank you in advance!
    /Brian

    Hi Ramesh,
    Option 1:
    You can directly create the process chain in Production. Most of the times ppl do have access to create a process chain in Prod. Kindly check whether you have the authorization to do so.
    Option 2:-
    I did not suggest to delete the old info-packages in QA and Prod. Let them continue to exist but you may not use them once the process chain is in place. You create the process chain, test it and move it up to Prod. I dont' think the new infopackages will hamper your delta load. The delta is not dependent on the infopackage.
    If I were you, I would try the second option and if it does not work during testing then go for the first option.
    Bye
    Dinesh.

  • 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 a program in ECC from BI using a process chain with out Program

    Hi,
    How can we trigger a program which is in ECC system from BI using a process chain with out writing any program.
    is it possible? if yes how can we achieve this.
    Thanks & Regards,
    Madhu

    Madhu,
    Not possible, indeed need event or Remote Function Call using an ABAP program.
    Other option would be to use a 3rd party tool like Control-M to run programs/jobs on whatever system in your landscape (but requires investments of course).
    Grtx
    Marco

  • Process chain with ABAP reports included

    Hello !
    I need help regardin an issue.
    I have a process chain with the processes:
    1) Start
    2) Process type ABAP program -> report that has a wait instruction
    3) Process type ABAP program -> report that has a system message , based on a first variant of the report
    4) Process type ABAP program -> report that has a wait instruction
    5) Process type ABAP program -> report that has a system message , based on a second variant of the report
    6) Process type ABAP program -> report that has a wait instruction
    7) Process type ABAP program -> report that has a system message , based on a third variant of the report
    report that has a system message : has 3 variants
      The reports work each individual, but in the chain , when I execute, I must see some system messages and there is nothing
    I assigned for the processes the right reports, including the variants for the processes 3, 5, 7.
    Do you have some clue? I can't imagine why they don't work in this process chain.
    Thank you.

    In RSPC transaction -
    create your process chain
    To include ABAP program --- expand General Services --- Select ABAP program -
    drag and drop it in right panel
    Create process variant -
    provide program name and program variant(if exists)

  • Server name message when triggering process chain through ABAP PROGRAM

    Hi all,
    When I am trying to execute one process chain with variant as a APD ( In this APD data is getting loaded form one Query to Transactional ODS.) This process chainis being executing through one ABAP program using the following code
    CALL FUNCTION 'RSPC_API_CHAIN_SCHEDULE'
         EXPORTING
           I_CHAIN      =  'XYZ'. ( Dummy Process chain name)
    While executing this program I am getting following message :
    You can specify the name of the application server here
    on which all jobs in the chain are scheduled
    If you do not specify a name, the jobs from batch
    management are divided between the available servers
    How to avoid this message.
    Can we write any code in the above program to assign any fixed server name so that it will not ask for any server name.
    Your help is much appreciated.
    Thanks,
    Uday.

    Hi Shanthi,
    How to write exception handling for this.
    Quick reply is nedeed.
    Thanks,
    Uday.

  • 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

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

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

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

  • Process chain with abap report

    Hi all,
    I have an abap report which is used to fill a table . This report is scheduled on daily basis .
    Now i want to do is , whenever this report completes my process chain should start in BI so that data in table can be filled in GDS .
    How to do that ???
    Please help.
    Regards
    Shweta

    Hi,
    You can do it in two ways.
    1) Include the ABAP program as the first process in your process chain. Once the program is completd the following processes will continue.
    2) Use "After Job" Scheduling options to schedule your process chain.
    Mention the job name of the program in the After job.  The process chain will get triggered once the job is completed.
    Regards,
    Balaji V

  • Abap program - end of process chain

    Hi,
    I have a requirement. At the end of each process chain, the ABAP program must trigger email.
    The process chains are having naming format of Z<Module name>. Ex: SD process chain will have ZSD, PS process chain will have ZPS etc.
    Now we are reading a table based on the module and identify the users, and to those users email should be sent.
    Now i am unable to identify the name of the process chain at run time from my ABAP program.
    Is there any way to identify the name of the process chain at runtime from ABAP program?
    Thanks.

    Hi,
    Your question is not clear can you please provide few more detail.
    for sending mail to users you can use "Varient" whatever you required. I am not sure what table you are using.
    Regards,
    satya.

  • Issue with ABAP program execution from process chains

    Hi All:
    We have a process chain with 3 steps, each of them executing the same program with three different variants. The program is ftp's the file from APO's dataexchange (mount) to another ftp server. The first variant transfers file A to a directory in the external ftp server (say /X) . The second and the third variants are supposed to transfer different files, B and C to the same directory.
    That is where the problem is. After the process chain is successful, I see two files B and C but the contents are same and that of C. So, if I switch the steps in the PC to bring in A then C and then B, I see files B and C with content of C. I tried C then A then B. I see the file names correct but now the contents are A, A then B.
    Have any of you come across this issue? Do you know that these is an existing problem? IF you have a solution, pl. let me know.
    Thanks
    Narayanan

    Narayanan,
    Instead of doing it in three steps - would it be possible for you to have one UNIX script or equivalent doing the above and calling the same from your process chain ...?
    We do a lot of FTPs but then our file names are standard and we have a UNIX script for the same executed using a system command through a process chain and it has been working without issues for the past 1 year ...
    Maybe I have not got your situation properly ... some more detail on the program details and what you are doing in more detail would help....  also SP levels please..

Maybe you are looking for