How to put RSCRM_BAPI in the process chain?

Dear All,
I've used RSCRM_BAPI to extract data from a query into a table. These data in the table needs to be extracted again to the PSA in BW.
So I need to run the  job defined in RSCRM_BAPI after the data has been  loaded into cube and run the infopackage to extract data after the job has finished.
How can I put these actions in the process chain?
Thanks.
Bolun

Hello Bolun,
Yes you can schedule RSCRM_BAPI extracts in a process chain. You have to write a program that will invoke the RSCRM APIs. You can use the program below.
data  error(50) type c.
data  g_t_return    LIKE bapiret2 OCCURS 0.
data: l_proc        like rscrmmon-processed.
data: gv_batchid    like RSCRMMON-BATCHID,
      gv_jobname    like TBTCO-JOBNAME,
      gv_actstatus  like TBTCJOB-STATUS,
      gv_jobcount   like TBTCO-JOBCOUNT,
      gv_dbstatus   like TBTCJOB-STATUS,
      l_status      type RSCRMBSTAT,
      l_wait        type i.
parameter: repuid TYPE rscrmrepuid obligatory.
parameter: extrname TYPE tabname obligatory.
parameter: repvar like RSCRMSTATUS-REPVAR.
parameter: overwrt like RSCRMCONTXT-ACTIVE default 'X'.
start-of-Selection.
*Open Query
  CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
      i_mode      = 'OPEN'
      i_reportuid = repuid
    TABLES
      e_t_return  = g_t_return.
  if g_t_return is not initial.
    read table g_t_return TRANSPORTING NO FIELDS with key type = 'E'.
    if sy-subrc <> 0.
      concatenate 'Errors occurred when opening query' error into error.
      message error type 'E'.
      exit.
    endif.
  endif.
*use this if you want pass a variant.
*Get variable values
*     CALL FUNCTION 'RSCRMBW_VARIABLE_POPUP'
*         EXPORTING
*               i_reportuid = repuid
*               I_VARIANT = repvar
*         TABLES
*               e_t_return  = g_t_return.
*Execute Report
  CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
      i_mode         = 'START'
      i_reportuid    = repuid
      i_execmode     = 'TABLE'
      i_extract      = extrname
      I_CLEAREXTRACT = overwrt
    IMPORTING
      E_BATCHID      = gv_batchid
      E_JOBNAME      = gv_jobname
      E_JOBCOUNT     = gv_jobcount
    TABLES
      e_t_return     = g_t_return.
  if g_t_return is not initial.
    read table g_t_return TRANSPORTING NO FIELDS with key type = 'E'.
    if sy-subrc <> 0.
      clear error.
      concatenate 'Errors occurred when executing query' error into error.
      message error type 'E'.
      exit.
    endif.
  endif.
  if sy-subrc = 0.
    WHILE ( L_STATUS NE 'SUCC' ).
      CALL FUNCTION 'RSCRMBW_BATCH_STATUS_CHECK'
        EXPORTING
          I_BATCHID       = gv_batchid
        IMPORTING
          E_STATUS        = l_status
        EXCEPTIONS
          NO_JOB_DATA     = 1
          INHERITED_ERROR = 2
          OTHERS          = 3.
      IF l_status = 'RUNN' or l_status = ' ' or l_status = 'SCHE'.
        WAIT UP TO 30 SECONDS.
      ENDIF.
    ENDWHILE.
    IF l_status = 'SUCC'.
      if sy-subrc = 0.
        write 'Query finished'.
      else.
        clear error.
        concatenate 'Job ' gv_batchid ' failed.' into error.
        Message error type 'E'.
      endif.
    ENDIF.
  endif.
*Close report
  CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
      i_mode      = 'CLOSE'
      i_reportuid = repuid.
end-of-selection.
Use the ABAP Program process to execute this program. Create the data load processes so that they execute on successful finish of this program.
I hope this makes things clear.
Regards
Arvind

Similar Messages

  • How to incorporate time in the Process chain messages

    Hi,
    I would like to create message after success or failure of process chain with time of failure in the subject.How to put system variable in the message subject?.
    Your help will be appreciated.
    thanks in advance.
    Manju

    raj,
    thanks for your quick reply but i would like to incorporate the finish time in the mail subject.
    for example mail subject is as follows.
    "GL process chain has been finished at xx:xx time".
    Here time (xx:xx) should automatically read and fill as per the finish time of the process chain.
    hope now it is clear.any idea how it can be done?.
    manju

  • How to stop the process chain

    Hi Sapients,
    I am loading the data from R/3 to BW through Process chain. Please let me know how to stop execution of  the process chain.
    Thanks
    Mahi.

    Hi Mahendra,
    You have to stop the load in the source system if u r loading from R/3 System, for that use transaction SM50 or SM51 to kill the process.
    Hope it helps. Assign points if helpful
    Cheers
    Raj

  • Passing parameters to the process chain

    Hi friends,
    I want to know ,how to pass parameters to the process chain. Suppose i want to pass parameter to my DTP in my process chain in order to filter the data and do the delta upload in my cube .

    Hi,
    I dont think there is any direct way to achieve this.
    There is a work Around which can be achieved with help of abap.
    You need to write ABAP routine to get the selection values from user and store them in the table TVARVC.
    Then you need to write a routine in the DTP filter to fetch these values.
    In the ABAP program where you get the values, you can trigger the process chain once the values are entered for the selections using an event,
    Regds,
    Shashank

  • How to add Abap program in process chain to check the another process chain status and do accordingly

    Hello All,
    My requirement is related to process chain 1 . I have one process chain in that i have to  put abap program in middle of that chain . This program will check the status of one another process chain 2 status ( whether it was completed or it is going on). if it is completed then continue the Process chain 1  to further activity else wait to complete Process chain 2 .
    Here i have to use process chain 2 as a parameter.
    Kindly provide me solution .
    Regards
    Saurabh

    Hi Saurabh,
    You need to create ABAP program in which you check the values for required process chain in
    following table
    RSPCLOGCHAIN (Feilds ANALYZED_STATUS LOG_ID)
    Depend on values you can trigger next process or you can wait unitil this process chain complete.you need to check status from table using ABAP.
    If you are not aware about how to write ABAP program then take help from ABAP Team.
    Regards,
    Ganesh Bothe

  • How to get the process chain name if we know the data target in sap bi

    Hi SAP BI Gurus,
    Can any help me how to find the process chain name if we know the data target name
    i mean if i know the info cube name how to find the relavant process chain which is holding that info cube
    Thanks,
    Joe

    Hi R Kumar,
    Check the table RSPCCHAIN.
    I mean, Use Table RSPCCHAIN and give the local chain tech name in VARIANTE field and search, in out put you will get meta chain name under the field CHAIN_ID.
    Thanks,
    Sreehari.

  • HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING IN THE PRODUCTION?

    HI ALL,
    CAN ANYONE TELL ME HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING DAILY AT 5.00 PM. I NEED TO STOP THE PROCESS CHAIN FOR COUPLE OF DAYS AND THEN RESTART IT AGAIN.
    cAN ANYONE TELL ME THE PROCEDURE TO STOP THE ENTIRE PROCESS CHAIN RUNNING IN THE PRODUCTION.
    THANKS
    HARITHA

    Hi,
    First and foremost let me advice you to be very careful while doing this.
    For Rescheduling
    RSPC> chain > Goto > Planning view and
    click on Execution tab > select > Remove from Schedule and then in Maintain variant of start process reschedule for the day you require it to run.
    For terminating active chain
    You can start from SM37, find the process WID/PID then go to SM50 or SM51 and kill it. Once its done come back to RSMO and check the request, it should be red but again manually force to red and save by clicking on the total status button in the status tab. This shuld ensure that the process is killed properly.
    The next step will be to go to targets that you were loading and remove the red requests from those targets.
    Note: For source system loads you may have to check if the request is running in the source system and kill if needed and pull it again.
    But for BW datamart delta loads u may have reset the datamarts in case u are going to pull the delta again.
    Re: Kill a Job
    Re: Killing a process chain.
    Regards,
    JituK

  • How to stop the process chain showing status as yellow but no process step

    Dear Friends,
    How to stop the process chain showing status as yellow but no process step is running in that process chain.
    We have manually triggered the process chain for sales it finished successfully till load data but the next step is create index and DB statistics. Both of this steps are in unscheduled position only and no background job for this.
    Please guide me.
    Thanking you in advance.
    Regards,
    Shubhangi

    Hi,
      At times even I have faced this situation.  During those times, running the Function module RSPC_PROCESS_FINISH by passing the right parameters came to my rescue.
    Regards,
    Raj

  • How to move the process chain from Unassigned node to a new node in 3.5?

    Hi all,
    I have created a new process chain in the development and it is falling under the Unassigned nodes. I want to move that process chain to an another node. but i am unable to do that
    Can anyone let me know how to move the process chain from unassigned node. I have drag and dropped but still the same in BW 3.5 ?
    Thanks
    Poooja

    Hello,
    Try this....
    Double click on your process chain. Via the menu select:
    Process chain > Attributes > Display components
    Select F4 (possible entries)
    At the bottom of the window you will find a create icon
    to make your own component.
    After you created it, assign it to your process chain.
    Don't forget to save the process chain.
    Regards,
    Sivaram

  • How to find out the process chain

    Hi folks
    Hope every one is doing good..!
    in sm37 my job is running (ABAP program) which is in process chain, but i have to find out the process chain name..!
    Could any one help me on this..!

    hi,
      in SM37 select the job status as active and execute it, in the next screen you  will find only active jobs select your job (ABAP Program) click on step - > in th next screen put the cursor on the job -> select Goto option in menu bar click on variant it gives you the field names and desc like chain name, variant etc information.
    Regards
    Sankar

  • How to test the process chains

    hi sap gurus,
    Can anybody tell me how to test the Process chains before i load real time data,i run process chains every morning 6.15 am,before that i want to test every process is linked to another.
    thanks in advance.

    Hi,
    Scheduling the process is the only way to check whether it is running fine or not. The process chains should be checked first in the Dev server and then in the QA server before transported to Prod.
    You can also check the process chain using the "check" button to see if the processes are in the proper sequence or not.
    There is a "log" button to keep track of the progress of the chain
    suresh

  • 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

  • How to run the process chain immediately?

    Hi experts,
    I'm a beginner for this field, Suppose there is a process chain called "X" which is used to extract the data from SAP R3 side for the purpose of getting the data for BI query called "Q1". "X" has been schedule to run every day in the night in BI side and also there are jobs have been schedule in SAP R3 by using the T-code lbwe. (they also runs once per day in the night)
    According to above explanation, If I execute the BI Query today, I can view only up to yesterday data. Suppose I have updated  some data in the tables at SAP R3 side today. therefore immediately I want to see the changes when I execute the BI query...
    Can you explain me how can I do this? Please explain this in Step by step if you can.
    Thanks,
    Regards,
    Nimesha.

    HI ,
    If u want to schedule the PC immediately, then go to the change mode of the process chain and double click on the start process select immediate button so that the process chain will run immediately after scheduling the PC.
    What job would u like to run in R/3 ? Is it V3 to move the records from the queue delta / unserialized v3 update  to delta queue, if so then go to LBWE --->job control and do the setting there.
    Note: U may get one box for o/ p  device  then type LP01 or ask the BASIS TEAM  .
    Hope u  got it,
    Thanx &Regards,
    RaviChandra

  • How to Stop the process chain if it in the middle of the process?

    Hi,
    Is there anyway that i can stop the process chain if it is in the middle of the process already?
    Raj

    "Hi,
    First and foremost let me advice you to be very careful while doing this.
    You can start from SM37, find the process WID/PID then go to SM50 or SM51 and kill it. Once its done come back to RSMO and check the request, it should be red but again manually force to red and save by clicking on the total status button in the status tab. This shuld ensure that the process is killed properly.
    The next step will be to go to targets that you were loading and remove the red requests from those targets.
    Note: For source system loads you may have to check if the request is running in the source system and kill if needed and pull it again.
    But for BW datamart delta loads u may have reset the datamarts in case u are going to pull the delta again.
    Different Ways to stop process chain
    1)SM37 -->Kill Job
    2)SM50/sm66- ->Kill process
    3)RSPC>Job Log>Make the process RED forecefully.
    4)RSPC>Process chain> main Menu"Remove from Scheduling" OR
    5)se37-->RSPC_API_CHAIN_INTERRUPT
    give RFC BW system name(technical) and process chain name(technical)
    Steps 1 -3 stops the chain running in process
    Steps 4-5 stops the chain AFTER the current job which is running is completed as sucessful or Failure by nature.
    Rationale - 4-5
    This function will only remove the jobs from schedule, which did not yet run. It will not kill running jobs, as this may leave the system in an inconsistent state, moreover killing processes is possible for synchronous processes only anyhow. This means, that there will be no errors with interrupted chains, which on the other
    hand means an interrupted chain is not restartable. So for a running chain this function is intended to be an emergency break only. You can use it, however, to remove a scheduled chain from schedule, such that it does not start except by your product.
    Re: Kill a Job
    Re: Killing a process chain.
    How to stop a process in a process chain?
    Regards,
    JituK

  • How to stop the Process Chains?

    Hi Everyone,
       I have a process chian which is running daily, but i want to stop in a particular day( for ex on wednesday).The process chain has to run on remaining days.So how can i stop the process chain on the particular day. Please do answer me.
    Thanks
    Veerendra

    Hi Virendra,
    After start process , insert a node of abap program and insert program with following code .
    Report zntest.
    data : lt_attr like CASDAYATTr occurs 0 with header line.
    CALL FUNCTION 'DAY_ATTRIBUTES_GET'
    EXPORTING
       DATE_FROM                        = SY-DATUM
       LANGUAGE                         = SY-LANGU
      TABLES
        DAY_ATTRIBUTES                   = Lt_ATTr.
    write : / lt_Attr-WEEKDAY_L.
    read table lt_attr index 1.
    if lt_Attr-WEEKDAY = '3' . "3 Stands for 3rd day of week i.e. Wednesday
      message 'Process chains not to be run on wednesday' type 'E'.
    endif.
    Make sure that this ABAP program is linked to other processes only on  "Success",
    Hope that helps.
    Regards
    Mr Kapadia

Maybe you are looking for

  • Printing lists in ABAP without using the standard button

    Dear community, i've got a little problem and I can't fix it on my own. Some user in our company gave me the instruction to extend an existing SAP Programmm with some defined functionalities. They want to implement an new button for printing in the g

  • Installing Parallels when Boot Camp already running Windows

    I'm considering installing Parallels on my MacBook Pro, which I already have partitioned with a drive running Windows using Boot Camp. What I need to know is, do I need to eliminate the partition with Boot Camp and if so, will I have to completely re

  • Clearing Oracle Parameters to call diferent stored procs

    Sub Main Do While i < 3 make_excel(i) i = i + 1 Loop end Sub Sub make_excel(ByVal array As Integer) objCmd.Parameters.Add(New OracleParameter("p_cursor", OracleType.Cursor)).Direction = ParameterDirection.Output end Sub objCmd.Parameters.Clear() objC

  • How do i make firefox startup automatically from startup on xp

    firefox used to startup at time of startup and now just goes to my desktop, how can i change this

  • String to Blob conversion

    ALL I want to do is update a BLOB field in a DB2 database with a string. The field is updating but I'm getting garbage. Here's the code I'm using to test. What am I doing wrong? The GDTXFT is the BLOB field.    Connection c = DriverManager.getConnect