Generate File Using Event
Generate File Using Event
Applies to:
SAP BW 3.x & SAP BI Net Weaver 2004s. For more information, visit the EDW homepage.
Summary
This document gives step by step procedure to generate a file using an event based process chain.
Author:
Mayuri Sinha
Author Bio
Mayuri Sinha is working as a Technology Analyst with Infosys Technologies Limited.
Table of Contents
Scenario ....................................................................................................................................................... 3
Step-By-Step Solution ................................................................................................................................... 3
Step 1:....................................................................................................................................................... 3
Step 2:....................................................................................................................................................... 3
Step 3:....................................................................................................................................................... 3
Step 4:....................................................................................................................................................... 4
Step 5:....................................................................................................................................................... 5
Step 6:....................................................................................................................................................... 6
Step 7:....................................................................................................................................................... 6
Step 8:....................................................................................................................................................... 7
Step 9:....................................................................................................................................................... 8
Step 10:..................................................................................................................................................... 8
Step 11:..................................................................................................................................................... 9
Related Content .......................................................................................................................................... 10
Disclaimer and Liability Notice ..................................................................................................................... 11
Scenario
In this article we extract a data using RSCRM_BAPI using event based process chain. This will help us
execute the RSCRM_BAPI in a process chain automatically.
Below described is the step-by-step solution for the same.
Step-By-Step Solution
Step 1:
First of all we will create an event. For this we need to go to TCode SM64.
Step 2:
Create an event by clicking on the create icon as shown below
We get the pop up as below. Here we specify the name of the event. (Technical Name and Description)
And choose the query for which we want to extract the data.
Step 4:
Click on the extract icon on the top.
The below screen will pop up. Here we specify the below details:
File Name
Separator
Step 5:
In order to schedule the job, click on the below icon, Selection Options.
Step 6:
Click on the button After Event.
On executing the job is successfully scheduled. We get the message as shown below.
Step 8:
Now in order to check the scheduled job, go to TCode SM37
On trying to view the jobs dependant on the event ZTEST we get the screen below. This is the same job
which got generated on execution of the extract.
The job is in released status.
Step 9:
Our next step is to create a program to raise the event.
For this we create the executable program in TCode SE38.
REPORT
Z_TEST.
*parameters
parameters: p_event like RSPCTRIGGER-VARIANTE.
start-of-selection.
CALL FUNCTION 'BP_EVENT_RAISE'
EXPORTING
EVENTID
= p_event
EVENTPARM
= ' '
TARGET_INSTANCE
= ' '
EXCEPTIONS
BAD_EVENTID
= 1
EVENTID_DOES_NOT_EXIST
= 2
EVENTID_MISSING
= 3
RAISE_FAILED
= 4
OTHERS
= 5
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Note: This program is created using the SAP standard function module BP_EVENT_RAISE as process chain can be
called in a process chain with variant. We define the variant in this process chain as the event name which is then
passed to the function module. We get the selection screen as below on using this program.
Step 10:
We create a simple process chain with ABAP Process Type.
Here we specify the program name as Z_TEST and the variant is created for the event ZTEST.
Step 11:
On executing this process chain, event is generated and a file is created automatically.
Related Content
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/oss_notes/sdn_oss_bw_ei/~form/handler%7b5f415050
3d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d3
63035323133%7d
http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/60ca31f1-3ff7-2a10-a49d-eea80739601d
www.help.sap.com
For more information, visit the EDW homepage