Event Triggering ABAP Programs
Hi SDN User,
I have a strange issue. We have many process chains and there are triggering by Events and these events are triggering by ABAP programs. My question is I want to know which even is triggering by which ABAP program.
Any idea guys.
Thanks
Sravu2019
Hi VIkram
Thanks foir u r input but thiis also not working and am not able to fine the ABAP Program name.
Thanks
Srav's
Similar Messages
-
Hi,
Can anybody please list out the exact differences between the events 'LOAD-OF-PROGRAM', 'INITIALIZATION' and 'AT SELECTION-SCREEN OUTPUT'.
Thanks in advance,
Sujit.Hi,
<u><b>LOAD-OF-PROGRAM:</b></u> When an ABAP program is loaded in an internal session, the runtime environment triggers the LOAD-OF-PROGRAM event, and the corresponding event block is executed.
The processing block LOAD-OF-PROGRAM has approximately the same function in an ABAP program with type 1, M, F, or S as the constructor method of a class in ABAP Objects.
Programs wiht type 1, M, F, or S can be loaded into an internal session in two ways:
Program calls
Whenever you call a program using SUBMIT or a transaction code, a new internal session is opened. The LOAD-OF-PROGRAM event is therefore called in each program call.
External procedure calls
The first time you call an external procedure (subroutine or function module), the main program of the procedure that you called is loaded into the internal session of the calling program. The eventLOAD-OF-PROGRAM is triggered and the corresponding processing block is executed before the procedure that you called. However, subsequent calls from the same calling program to a procedure in the same subroutine pool or function group do not trigger the LOAD-OF-PROGRAM event.
so it's before the program is loaded in the memory for execution.
<u><b>INITIALIZATION:</b></u>
This event occurs before the standard selection screen is called. You can use it, for example, to initialize the input fields of the standard selection screen. This is the only possible way to change the default values of parameters or selection criteria defined in logical databases. To change a selection criterion, you must fill at least the components <seltab>-SIGN, <seltab>-OPTION, and <seltab>-LOW of the selection table <seltab>, otherwise it remains undefined.
If you want to initialize input fields of the logical database, you need to find out the names of the fields. To do this for the logical database SAPDB<ldb>, use Transaction SLDB or choose Tools
ABAP Workbench, followed by Development Programming environ. Logical databases. You
can also display the technical information for the required field on the selection screen. To do
this, call the F1 help for the required field and then choose Technical info. In the field Scrn Field
of the following dialog box, you then see the name of the field used in the program.
<u><b>AT SELECTION-SCREEN OUTPUT</b></u>
event is triggered. This event block allows you to modify the selection screen directly before it is displayed. -
Problem in triggering abap program in process chain
i m running a infopackage in a process chain .
this infopackage creates the request in the DSO .
after infopackage i m including the abap program to delete the same request in the process chain .
but the abap program is not getting triggered .i have maintained the variant correctly for the program in the process chain .
what can be done so that the program gets triggered .Hi,
You can trigger you ABASP program from
1. SM64 : copy the ABAP program's Afer event and parambeter and give it there and execute
2.or go to
SE37 >>Program : BP_EVENT_RAISE >> say test execute
and give the same after event and parameter ..and execute
this might trigger your program
Hope this helps you,
Regrads,
shikha -
ALE triggering ABAP program instead of iDoc
Is it possible to have ALE trigger an ABAP program instead of an iDoc?
We need to send changes in Master Data to a system that can't handle iDoc, but does know what to do with SOAP.We're talking about an All-in-One system on NetWeaver 700 and ECC 6.0. My company has developed an Add-On for Business One and now they want to develop a similar Add-On for All-in-One. That Add-On should integrate an Open Source system into an SAP system, or at least make the flow of data seem seamless.
I should be very careful with my comments, as I'm not really understanding enough about your requirements. I must admit key words changes in master data and ALE triggered my initial comment.
On second thought it might actually be worthwhile to think about other alternatives. E.g. you could look at the technique SAP uses for BW extractors, which might also be suitable.
I might just be able to hook into the Change Doc system by defining new Change Doc and Change Pointer Types.
Well, per my comment above, maybe you don't even need change pointers. However, if you do, you can mostly rely on existing change documents unless you're dealing with some odd or custom object.
Am I right if I think that IDocs handle those Change Pointers from some kind of scheduled background job?
Part of the setup for change pointers for a specific message type is to define which function module is used for evaluating the change pointers. All change pointers are then evaluated via transaction BD21, program RBDMIDOC, which can also be scheduled in the background.
but we only need less than 5% of the information contained in an iDoc
Well, in theory SAP offers some options: You can filter segments via ALE, use reduced message types or define IDoc views. However, depending on the technique this sometimes requires that the actual application (function module creating the IDocs) has to support it (because it's additional API calls that have to be present).
Defining new IDoc types isn't that attractive to us.
Though I do understand such statement in specific cases, it's hard to relate to it on a general level. I.e. in the latter case it's often more driven by strange company policies than by good design choices.
Anyhow, in the end I'm tempted to think that change pointers with IDocs are one option among many. In your specific case however it sounds as if there's possibly other techniques that might be more suitable. So I'll stop for now before I tell you too much crap pushing you in a wrong direction... -
Triggering ABAP Program upon file drop
Hi Gurus,
I would like to trigger an ABAP program as and when a file is dropped in a drive. Please let me know what is the best way to do this.
Also please let me know how to handle in the program if 2 or more files are dropped at a time.
Appreciate it. thanks.Hello,
You can create a Z program and schedule a job for the time what you need.
Sample code:
"......... definitions .......
START-OF-SELECTION.
PERFORM read_files_in_dir_on_server USING p_wfile
CHANGING gt_files.
LOOP AT gt_files INTO gv_filepath.
gv_progress = sy-tabix / lines( gt_files ).
PERFORM read_server_file USING gv_filepath
CHANGING gt_file_content
gv_filelenght.
"do what you need here!
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = gv_progress
text = 'Processing the files'(003).
ENDLOOP.
*& Form READ_FILES_IN_DIR_ON_SERVER
* Read all files in a directory (server)
* -->IV_DIR Directory
* <--CT_FILES Files in Directory
FORM read_files_in_dir_on_server USING iv_dir TYPE string
CHANGING ct_files LIKE gt_files.
DATA: lv_dir_name TYPE ocs_file-name,
lt_filelist TYPE STANDARD TABLE OF ocs_file,
ls_filelist LIKE LINE OF lt_filelist,
ls_file LIKE LINE OF ct_files,
lv_offset TYPE i,
lv_dummy TYPE i,
lv_error TYPE boolean.
lv_dir_name = iv_dir.
CALL FUNCTION 'OCS_GET_FILE_INFO'
EXPORTING
dir_name = lv_dir_name
TABLES
dir_list = lt_filelist
EXCEPTIONS
no_authority = 1
activity_unknown = 2
not_a_directory = 3
no_media_in_drive = 4
too_many_errors = 5
too_many_files = 6
bracket_error_in_filename = 7
no_such_parameter = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE 'Error on directory selected' TYPE 'E'.
ENDIF.
LOOP AT lt_filelist INTO ls_filelist.
lv_error = abap_false.
"check a specific prefix
IF ls_filelist-name(4) NE 'out_'.
lv_error = abap_true.
ENDIF.
"check a specific extension
FIND '.xml' IN ls_filelist-name MATCH OFFSET lv_offset.
IF sy-subrc IS NOT INITIAL.
lv_error = abap_true.
ENDIF.
"needs to end with a number (not chars allowed)
lv_offset = lv_offset - 1.
TRY .
lv_dummy = ls_filelist-name+lv_offset(1).
CATCH cx_root.
lv_error = abap_true.
ENDTRY.
"check if the dir is complete filled (end with \ )
lv_offset = strlen( iv_dir ) - 1.
IF iv_dir+lv_offset EQ '\'.
CONCATENATE iv_dir
ls_filelist-name
INTO ls_file.
ELSE.
CONCATENATE iv_dir '\'
ls_filelist-name
INTO ls_file.
ENDIF.
IF lv_error NE abap_true.
APPEND ls_file TO ct_files.
CLEAR ls_file.
ENDIF.
ENDLOOP.
ENDFORM. " READ_FILES_IN_DIR_ON_SERVER
*& Form READ_SERVER_FILE
* Read server file
* -->IV_FILEPATH text
* <--CT_FILE_CONTENT text
* <--CV_FILELENGHT text
FORM read_server_file USING iv_filepath TYPE string
CHANGING ct_file_content TYPE table_of_strings
cv_filelenght TYPE i.
DATA: lv_content LIKE LINE OF ct_file_content,
lv_msg TYPE string.
REFRESH ct_file_content.
CLEAR cv_filelenght.
OPEN DATASET iv_filepath FOR INPUT
IN TEXT MODE
ENCODING UTF-8
MESSAGE lv_msg.
DO.
READ DATASET iv_filepath INTO lv_content.
IF sy-subrc IS NOT INITIAL.
EXIT.
ENDIF.
APPEND lv_content TO ct_file_content.
gv_filelenght = gv_filelenght + strlen( lv_content ).
ENDDO.
ENDFORM. " READ_SERVER_FILE -
Trigger abap program from process chain
hello...i have an external source system which is a SAP client, I have a table with the fields i wanted, when the field of the table change to "ctmd end", the abap program in this source client will trigger the process chain in SAP BW and the selection of the infopackage which is a business date will be triggered as well to load the data based on the business key date in the source systems. I am new in abap program and wanna know can this be done so? If can, how can this be done? Thanks!
generate an event through ABAP program and use that event to trigger that start process type of that process chain
-- Amit -
Triggering Event in BW through a ABAP Program in R/3
Hello Friends,
I am working on triggering a process chain in BW using ABAP program in R/3.
1. I have created a test process-chain in BW which sends test email upon running. This process chain is triggered by an event "Z_START_PC".
2. I created a function module "ZBW_EVENT_RAISE" which triggers this event.
( This function module is "remote enabled module")
3. I tested running the process chain, with function-module (SE37), which works fine.
( i.e. I do receive test-email after..)
4. Now I created a ABAP program "ZBW_EVENT_RAISE" in R/3.
The code of which is as follows:
REPORT ZBW_EVENT_RAISE.
parameters: rfcdest like t000-logsys.
parameters: bwevent like tbtco-eventid.
call function 'ZBW_EVENT_RAISE'
destination rfcdest
exporting
eventid = bwevent.
5. When I try to run this ABAP program in R/3 (SE38),
The process chain does not get triggered.
(a) The "<b>rfcdest</b>" i got from SM59 - RFC Destinations -
R/3 Connections - BW Development Server Client
Value is "BWDCLNT999".
How do I go about debugging this issue? I know for sure, the BW- function module -- to Trigger -- to Process-chain is working fine. Only part is R/3 to B/W function module starting.
Any help is appreciated.
I promise to award points.
Thanks
PKin ST05 there is an option for RFC trace. Not sure how much detail that will give you but you can try.
It is possible that your userid doesn't have an RFC call authorization in R/3. Do a SU53 immediately after running the program.
Also, replace the FM with any other FM that you know for sure runs (eg some BAPI FM) and run it - either in SE37 in R/3 with RFC destination for BW, or, from your code itself and see if that works (you can check return code). -
Write an ABAP program in BW which triggers an event in R/3
Hello People
Method: I need to create a Process Chain in BW for info package loading. In the PC, after the loading occurs, I need to write an ABAP program which has the FM: RSSM_EVENT _RAISE , which triggers a pre-defined event in R/3. This event in turn triggers a 'z' program in R/3.
Now, I know that we can use SM62 in R/3 to create the event. But how and where do i need to write the abap code in BW. And do i just place it in the PC after the loading process? Do i need to inculde the FM in the ABAP code? Does the FM know the server in R/3 ( DEV or QA or PROD ) where it needs to trigger the event? And how do i schedule the 'z' prog, so that it starts after the event?
Please help.
Thanks in advance.Create and rfc function module in r/3 in which code you trigger the event, created in r/3 too.
You can, and should to do it, include a report as step in your process chain in order to trigger event at finish of process chain.
Here a sample
r/3 side.RFC function (get and trigger event)
FUNCTION Z_RAISE_EVENT.
""Interfase local
*" IMPORTING
*" VALUE(EVENTID) TYPE TBTCO-EVENTID
*" EXCEPTIONS
*" BAD_EVENTID
*" EVENTID_DOES_NOT_EXIST
*" EVENTID_MISSING
*" RAISE_FAILED
*" OTHERS
CALL FUNCTION 'BP_EVENT_RAISE'
EXPORTING
EVENTID = EVENTID
EXCEPTIONS
BAD_EVENTID = 1
EVENTID_DOES_NOT_EXIST = 2
EVENTID_MISSING = 3
RAISE_FAILED = 4
OTHERS = 5
CASE SY-SUBRC .
WHEN 1.
RAISE BAD_EVENTID.
WHEN 2.
RAISE EVENTID_DOES_NOT_EXIST.
WHEN 3.
RAISE EVENTID_MISSING.
WHEN 4.
RAISE RAISE_FAILED.
WHEN 5.
RAISE OTHERS.
endcase.
ENDFUNCTION..
BW side.Report to call previous rfc function
REPORT Z_RAISE_EVENT .
parameters: EVENTID like TBTCO-EVENTID.
parameters: destino like RFCDES-RFCDEST.
parameters: test as checkbox default 'X'.
IF TEST EQ SPACE.
CALL FUNCTION 'Z_RAISE_EVENT'
DESTINATION DESTINO
EXPORTING
EVENTID = EVENTID
EXCEPTIONS
BAD_EVENTID = 1
EVENTID_DOES_NOT_EXIST = 2
EVENTID_MISSING = 3
RAISE_FAILED = 4
OTHERS = 5
CASE SY-SUBRC .
WHEN 1.
RAISE BAD_EVENTID.
WHEN 2.
RAISE EVENTID_DOES_NOT_EXIST.
WHEN 3.
RAISE EVENTID_MISSING.
WHEN 4.
RAISE RAISE_FAILED.
WHEN 5.
RAISE OTHERS.
ENDCASE.
ENDIF. -
Link BOR Event with ABAP code (program or function)!
Hello experts,
I am trying to link program or function to bor event. Change of data in HR IT0002 trigger event CHANGE of PERSDATA Object. I need to execute some ABAP code (program or function) on CHANGE event, so I have to link event and ABAP code.
Question: is it possible and how?Hi,
It is very much possible....
You can use the Workflow & use BO as PERSDATA & this workflow can be triggered on event change.
& You can write your code ...
Regards,
Rahul -
How to pass background event parameters to ABAP program in SM36
Hi team,
I want to pass background event parameters to ABAP program on job scheduling in SM36. For example, Background jobs will trigger, once background event triggered from Non-SAP system using SAPEVT command with parameters.
I want to pass the event parameter values to the ABAP program . Can you please help me on this.
Regards,
Anand KrishnanHi,
Which ABAP program - the one that will be executed as a job step? If yes, I don't believe you can "pass" something to it because it will be started by "job starter" of SAP background processing run-time system. The ABAP program executed in background can, however, get the job run-time information using FM GET_JOB_RUNTIME_INFO, which also returns EVENTID and EVENTPARM. Is that the event parameters you were looking for?
cheers
Jānis -
How can I trigger an event from an ABAP Program
Hi everyone,
I have a requirement, where I have to create an ABAP program, that has to execute (trigger) an event which belongs to a Process Chain. when I run the program, the Process Chain has to run.
So, how can I do it?
Thanks for your help, FedericoHI ,
The program can call function module BP_EVENT_RAISE to raise the event. you can create vent in sm64 and sm62 .There you give the parameter of the event same as what you will define in the event of start variant of your process chian ..
Regards,
shikha -
How to create schedule job and event trigger in XI to start a ABAP program?
Dear All:
Here are what i need to do:
1.To run a ABAP program to start an XI scenario per hour.
2.To run a ABAP program to start an XI scenario per day at 6 PM.
3.To run a ABAP program used event trigger to make sure that XI scenario has finished the process and after that wait for 10 min later and run again.
only i know is used sm36 & sm37 to set up a schedule job.
but what i don't know is how to do it step by step.
especially point 3.
are there any step by step example can show me how?
it better be simple and details...
thanks you all
Regards
Jack LeeHi,
If you want to trigger the event manually from within SAP, use transaction
SM64
in SAP this is done by scheduling a job
once a new customer is entered
your scheduled report sends customer master data
you can schedule your report (TCODE - BD12 I think) to one day or every 5 minutes... it depend on your needs and the system performence
Regards,
Surya -
Hi Experts,
while i am doing MIGO(Goods Issue to Production Order, I am getting the below ABAP Error:
Please give solution, It is urgent requirement.
THE ERROR IS:
Short text
Illegal interruption of the event LOAD-OF-PROGRAM.
What happened?
Error in the ABAP Application Program
The current ABAP program "/MRSS/SAPLRAP_INT_OB" had to be terminated because it
has come across a statement that unfortunately cannot be executed.
Error analysis
During the flow of the event LOAD-OF-PROGRAM (event for the
initialization of an ABAP program), a condition occurred under which
the event was to be left early. This is not permitted as it would
result in an inconsistent status in the ABAP program.
Trigger Location of Runtime Error
Program /MRSS/SAPLRAP_INT_OB
Include /MRSS/LRAP_INT_OBF00
Row 34
Module type (FORM)
Module Name GLOBAL_INIT
Source Code Extract
Line SourceCde
4
5 *&---------------------------------------------------------------------*
6 *& Form global_init
7 *&---------------------------------------------------------------------*
8 * text
9 *----------------------------------------------------------------------*
10 FORM global_init.
11
12 * local data
13 DATA lv_badi_impl_exists TYPE flag.
14
15
16 * get ref to BAdIs
17 CALL METHOD cl_exithandler=>get_instance "#EC CI_BADI_GETINST
18 CHANGING
19 instance = gv_ref_badi_inter_company.
20 * CALL METHOD cl_exithandler=>get_instance
21 * CHANGING
22 * instance = gv_ref_badi_rap_back.
23 * CALL METHOD cl_exithandler=>get_instance
24 * CHANGING
25 * instance = gv_ref_badi_ps_int.
26 CALL METHOD cl_exithandler=>get_instance "#EC CI_BADI_GETINSTHi Rob thanks for your response. I thought about doing an OSS note however; I would think I would need to get the problem in config corrected first as it contradicts each other. The problem I am talking about is how they are to return material to vendor....I have never even seen this as a process in my 10 years....
Process.....when the PO is a return to vendor PO they go to migo and choose the goods receipt and mvmt type 101 and the system will default the 161 in the item level....the two are inconsistent. If I try to change the top level to a 161 mvmt (as this is what I am used to seeing) it gives the error that the PO is not a stock transport order... Would you agree that I should correct that problem first before creating an OSS note? -
Issue regarding [Work Flow] Business Object Event Raise in ABAP Program
Hi All,
I have one issue regarding [Work Flow] Business Object Event Raise in ABAP Program.
Actual TDS is as below:
If E message type written, raise Business object BUS2005 (Production order) Event PickShortage for production order passing warehouse, transfer request
(BUS2065 Object key) in event container. Also include table of text version of error
messages for this set of Transfer
Request.
Can anybody tell me how can i write it technically in ABAP Code.
Can anybody solve this issue!
Thanks in advance.
Thanks,
Deep.Hi,
Can anybody solve above posted issue!
Thanks,
Deep. -
How to Raise Event in BW using ABAP program
Hi BW Experts,
Can anyone tell how to raise event in BW using a ABAP program.
Program should ask for the event to be raised and destination server.
Edited by: Arun Purohit on May 14, 2008 11:04 AMHi Arun,
By Using BP_EVENT_RAISE function module you can raise an event.Create an ABAP program and call the function module BP_EVENT_RAISE and create a avariant to specify the event to be raised. Schedule this ABAP code. Go to the start process type and set the schedule to "after event" and mention the event name that you created. Also, I think now you can mention the time as well and you can also schedule for periodic scheduling.
T Code : SM62 --> To Create an Event.
T Code : SE38 --> To Create an ABAP Program
Use Function Module : BP_EVENT_RAISE to raise an event.
Related links:
http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset.htm
http://help.sap.com/saphelp_sem40bw/helpdata/EN/86/6ff03b166c8d66e10000000a11402f/frameset
Hope this helps
Regards
CSM Reddy
Maybe you are looking for
-
Based On E-Mail Sales order automatically Created
Hi, Customer will send the Email to Client for his / Her Sales Order (PO Order from Customer Side ) once client will get the Email from customer side, system will generate the popup Menu in that system has to show Details what customer wants with Acc
-
Top Tip #4 - How to use Search in the community
Why should I use the search in the community? It’s a quick and easy way to get help with your problem – other people may have had the same or similar issue in the past, so if you can use search to find the answer then you will save yourself time wait
-
Can I use existing 10g iAS install with Application Express?
I apologize if this has been addressed somewhere else, but I haven't been able to find a definitive answer yet. I have a 10g DB installed on machine A, and have been following the instructions to install Application Express. Instead of installing ano
-
Whenever I want to open a new window to a site, that window tends to open on the back of the old window. What I want to happen is that new window to open in front of the old browser. I am using the latest Firefox 4 browser.
-
Create "Rotate Picture" function for Iphone Camera?
Just wondering - why hasn't Apple added a "rotate" image function on the iphone? I receive MMS photos or send photos to others that aren't in the necessarily "right" orientation. They should really allow this function within the phone itself without