Events in ABAP Programming

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.

Similar Messages

  • 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

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

    in 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).

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

    HI ,
    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 Lee

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

  • ABAP Error:Illegal interruption of the event LOAD-OF-PROGRAM (in MIGO-Goods issue to Production)

    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_GETINST

    Hi 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 AM

    Hi 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

  • Process Chain Review Question: function module/ABAP program/Event

    Hi,
    1. Can you tell me a bit more about function modules such as RSPC_CHAIN_ACTIVATE_REMOTE
    2. What are function modules in general terms. i.e.  What is their role?
    3. How do I see all function module available?
    4. When is function module used instead of ABAP program?
    5. How do they help in the support and monitoring of Process Chains?
    6. I am getting confused over the following under process chains “job”, “event”, “function module” and “ABAP Program”
    Thanks

    2. What are function modules in general terms. i.e. What is their role?
    Function module return a value ( most of the time), they return some value either a single value of rane of value or even a table. Example: FM to return fiscal period gieven the fiscal vaeiant and system date.
    3. How do I see all function module available?
    Go to Se37 and this is function builder. You will find FM starting with RS* more useful. You cna also create your own in Se37.
    4. When is function module used instead of ABAP program?
    In addtion to answer I gave in 3 above, program is used to check some logic and update some tables or give screen output.
    You may note FM is also a program.
    5. How do they help in the support and monitoring of Process Chains?
    As I said, for monitoring chains, use Sm37  and logs in RSPC.
    6. I am getting confused over the following under process chains “job”, “event”, “function module” and “ABAP Program”
    I am not clear what are you looking for.
    You cna schedule a FM or a program to run in a chain. Is that what you mean?
    Ravi Thothadri

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

  • 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

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

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

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

  • Capturing failure event of Process Type ABAP program in Process Chain

    Hi all
    I am calling an ABAP program in a Process Chain, there are subsequent steps after the ABAP program. The subsequent steps should execute if the ABAP program fails. While running the process cahin, if the ABAP program fails, then a pop-up comes up asking for triggering subsequent process. Since this Process Chain has to run in background mode, we dont want this pop-up. How can this be stopped?
    Please help.

    Hi Arnab,
    Welcome to SDN!!
    When you define the next step after the ABAP program select the action for as "error".
    Hope I have made things clear.
    Bye
    Dinesh

Maybe you are looking for

  • Multiple copies of the same song iPad 2

    I recently purchased two items on iTunes - a full cd from my MacBook and a single from my iPhone. However, on my iPad, in the "Recently Added" playlist, it shows that each song has a duplicate copy. But, these copies cannot be swiped to be deleted an

  • I want to upgrade my p6240d hp pavillion video card.

    I want to upgrade my p6240d hp pavillion video card but i don't know what is compatible for my computer. Somebody help me. Because my video card is too low I don't know if this one " Sapphire ATI Radeon HD5670 1GB GDDR5/128bit Dual-Link DVI/HDMI/Disp

  • Suggestions for new (used) machine

    Hello group! I'm finally able to move up to an intel machine and FINALLY get up to L9 / Snow leopard. I'm turing to you all for some guidelines as to what machine to get. My studio world is pretty simple: Logic, a couple 3rd party plugs (soft synths,

  • IfThen Error

    Can anyone help me with the following. Pretty new to reports and getting an error everytime i try to use the IfThen formulae this is an example of what i was trying IfThen ( ( IsNN([D]) OR IsNN([C]) ) , 1, ([C]- [D])/ [D]) Giving me an error on the "

  • What is ABAP all about & How it helps an Enterprise to help in its Business

    Moderator nessage - welcome to SCN But before posting, please take the time to read the rules of engagement - please do not ask vague, basic questions Hello friends ,         I am Rudra,I want to know what is ABAP and it can help an enterprise to imp