Muttating in triggers

Hi!
When i move code into database from aplication i have problem with database control of muttating data.
I have to call plsql procedure wich do some actions by example after updating some data.
Example:
create table tab (col1 Number, col2 ..., colN Number) ;
CREATE OR REPLACE TRIGGER tr_tab_upd AFTER UPDATE OF col2,col3
ON tab
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
BEGIN
DECLARE
p_res ....
BEGIN
proc(:NEW.COL1,p_res);
If (p_res....) Then
Raise ERROR;
End If;
END;
end;
Where proc is plsql procedure and inside this procedure i ONLY READ data from tab (vs. calling procedure with many arguments - :NEW.COL1, :NEW.COL2, ... , :NEW.COLN - asume that number of columns is big and that procedure will be called not only from trigger). Is there possible to tell database before calling (something like commit :)) that i will only select data without changing in table tab, but leave possibility to break transaction which fire trigger depending on result of procedure?

Thanks, there is many solutions but i try to find best and my idea is not duplicate objects (creating new log tables) because i have many tables that i have to resolve.
Simply i have to find best way to move most code from aplications to database. One of my solutiuon is to make procedure like this:
create or replace procedure proc (ar_pk In number, ar_res Out Varchar2,
ar_col1 In N/V Default null, ar_col2 In N/V Default null,..., ar_colN In N/V Default null) is
v_col1 N/V;
v_col2 N/V;
v_col3 N/V;
BEGIN
If (ar_col1 Is Not null) Then -- procedure is called from trigger
v_col1:=ar_col1;
v_colN:=ar_colN;
Else
BEGIN
Select col1,...,colN
Into v_col1,...,v_colN
From tab
Where col1=ar_pk; -- Asume that col1 is primary key
EXCEPTION
END;
End if;
END;
When call proc from trigger send alll arguments as :NEW.COL1,..., :NEW.COLN. Otherway just call proc (pk,res)
There are no new tables. Be aware that in future table tab will be altered in this case you must change trigger and procedure, may be not other
code who call proc and not log table.
Have anyone better idea - this is big job and will like to know easy way.

Similar Messages

  • How to find out which event is triggered in SDK

    Hi all
    From SDK, I am would like to know which event is triggered when the user select navigation menu Follow up -> Create Lead (screen 1).
    I am guessing, it calls LeadCreateWithRef outport event but I don't see any absl code?? (screen 2)
    When I try to switch from Display to Edit, I got error "Component which you are trying to edit comes from a lower layer. Please use Extensibility Explore to Edit" (screen 3)
    Also in Extensibility Explorer, I can't open the button details (can't even see it in the buttongroup).
    Any advice is welcomed.
    Thanks
    Anthony

    Hi Meghna
    Thanks for the info. I am trying to do reverse engineering, to understand how to existing UI screen is built, how and what events get called when button is pressed and which screen will be opened.
    For example, in Ticket screen, when I select Follow up then Create Lead:
    I cannot drill down to see the button and its properties??
    nb. Also there is no left right scroll bar to see the rest of button group. Is it a bug?? I am using Windows 8.1.
    And in outport setting, I don't see which action/event triggered? and what screen to show?
    Thanks again,
    Anthony

  • How can I implement a recursive update within triggers?

    Given
    INSTANCE (table)
    INST_ID
    etc.
    INSTANCE_STRUCTURE (table)
    PARENT_ID (fk to INST_ID)
    CHILD_ID (fk to INST_ID)
    And that I COULD write code which recursively navigates the hierarchy (ie. START WITH parent_id = ? CONNECT BY PRIOR child_id = parent_id) and issues UPDATEs to each "child" along the way, thereby propogating the desired update, how can I accomplish the same thing using triggers?
    Keep in mind I am using Oracle 7.3 and I have no choice. Also, the DBA is very difficult to get a hold of and I have no idea if there may be some server settings which are preventing some of my attempts from succeeding.
    Of course the simplest method is to make an update trigger on INSTANCE select all CHILD_ID from INSTANCE_STRUCTURE and issue UPDATE to each which, in turn, would invoke the same trigger, however, we can't have a mutating table, now can we?
    Next, I tried the old global variable in a package bit. That's when I first started getting this "end of channel" business which essentially disconnects me from Oracle (while using SQLPlus). I started to debug that, and then other users started getting errors ... apparently due to the global variable being global ACROSS sessions ... which I did not expect (correct me if I'm wrong and I can try it again), however, due to the amount of data I'm dealing with in any one particular line of hierarchy, I'm not sure I wouldn't get an error anyhow ... particularly if I have to maintain a global array for everyone at once. Anyhow, it was during that, that I realized the "too many open cursors" thing and so I started working with START WITH CONNECT BY to identify all rows which must be dealt with.
    Then, I tried setting up some new tables (as opposed to global variables) in which I would identify userenv('sessionid') and other data so that a BEFORE UPDATE, FOR EACH ROW trigger could check to make sure that the AFTER UPDATE trigger had not begun yet (IOW, not recursing yet). Basically, everything's fine until the AFTER UPDATE trigger tries to apply UPDATEs for the children (identified from a cursor on START WITH CONNECT BY) ... then I get the "end of channel" thing again.
    Obviously, this whole thing is an attempt to denormalize some data for performance reasons.
    Any help would be appreciated.
    Thanks.

    Nevermind, I figured somethin' out.

  • PO creation triggering orders05

    Hi Experts,
        We are using IDOC PORDCR102 idoc for creating purchase order. In the inbound FM after creating the purchase order we are posting good issue. After the creation of purchase order ORDERS05 idoc is getting triggered which needs to happen after Post goods issue. The issue is happening because we are commiting after purchase order creation which creates an entry in NAST table and posts the ORDERS05 Idoc. Is there any way to stop posting orders05 idoc after the purchase order creation.
    Regards
    Sridevi S

    Hi,
    In the inbound side create a new entry in WE57 tcode.. with the functio mdoule as "IDOC_INPUT_ORDERS", basic type "ORDERS05", extn< specify the extn u created at outbound side>, message type "ORDERS". Now see if it is working.
    Regards,
    Nagaraj

  • Error in MIGO of Subcon PO in MTO scn, not triggering Movement type 543/E

    Dear Consultants,
                                  I am trying to perform Goods receipt against a Subconctracting PO, in a MTO scenario. The components are linked to Sales Order (Special Stock - E). I have maintained '0' in the Individual / Coll requirements field in the MRP 4 view of the component.
    So after creation of PO(Subcon), I am trying to perform MIGO - without issuing components to vendor as 541/E movement type for componenets is not allowed in standard.
    While performing MIGO I am getting the error no stock available with vendor, the system is trying to trigger 543/O movement type whereas I am expecting 543/E to be triggered for the components.
    I am also not able to perform 311/411 E movement type for the components as they are linked to WIP Batch.
    Can anyone sujjest if there is a way by which the MIGO should trigger 543/E during MIGO.
    Thanks
    Arindam.

    Hi
    i donr think the movement type 543 E will trigger as the subcontracting only supports 543 O in standard , you need to do customizing as follows
    Also check in SPRO > Logistics - General > Tax on Goods Movements > India > Business Transactions > Subcontracting > Maintain Movement Type Groups > here for Movement Type Group "0002", Movement Type "543 E" should be maintained.
    just check following link for the subcontracting with sales order ,
    [Sub Con 1|http://help.sap.com/saphelp_470/helpdata/en/4d/2b90b043ad11d189410000e829fbbd/content.htm]
    [subcon 2|Subcontracting for project stock;

  • Creation of triggers using CFQUERY tag is giving error

    Hi,
    I am creating triggers and stored procedure on ORACLE data
    base using <CFQUERY>.
    <CFQUERY DATASOURCE="CRM">
    create or replace trigger AWC_ACCOUNTINGPERIODSID_TRI
    before insert on AWC_ACCOUNTINGPERIODS
    for each row
    begin
    select AWC_ACCOUNTINGPERIODSID_SEQ.nextval into :new.AP_ID
    from dual;
    end;
    </CFQUERY>
    But the created trigger is not compiled, it is giving the
    following error
    "Line # = 1 Column # = 6 Error Text = PLS-00103: Encountered the
    symbol "" when expecting one of the following: begin case declare
    exit for goto if loop mod null pragma raise return select update
    while with <an identifier> << close current delete
    fetch lock insert open rollback savepoint set sql execute commit
    forall merge pipe The symbol "" was ignored."
    If I edit that trigger in enterprise manager console by
    pressing space and compile that, it is working fine with out any
    error. If i run the above statement in sql *plus, It is working
    fine with out any error. Can you please tell me why this is
    happening if i run it using cfquery tag and also the possible
    solutions.
    Thanks in advance,
    Vinod

    I can't tell you why your particular trigger is failing, but
    here is some "typical" reasons from Oracle's metalink.
    Common reasons for PLS-00103
    Error Summary
    PLS-00103 Encountered the symbol "%s" when expecting one of
    the following (Oerr
    LS.103)
    Error Details
    ~~~~~~~~~~~~~
    Error: PLS-00103
    Text: Encountered the symbol "%s" when expecting one of the
    following:
    Cause: This error message is from the parser. It found a
    token
    (language element) that is inappropriate in this context.
    Action: Check previous tokens as well as the one given in the
    error message. The line and column numbers given in the
    error
    message refer to the end of the faulty language construct.
    PLS-00103 errors can often be difficult to localize what the
    error is so here are some
    common reasons for PLS-00103 errors..
    A very common reason for PLS-00103 is when a reserved word is
    used, with a reserved word
    means words that names an oracle object or a built in
    procedure, for example MOD, ABS,
    TABLE, VIEW etc..
    When trying to use SQL*PLUS commands in PL/SQL procedures,
    like SPOOL, SET and other
    commands that belongs to SQL*PLUS can result in this error.
    Using parameter declaration at the IN/OUT clause in a
    procedure, this works in versions
    prior to 8.0.4, but it just ignored the declaration.
    Using DDL commands in PL/SQL will fail in PLS-00103, the way
    to use DDL commands is
    to build a procedure in dynamic sql.
    When creating package specification and a package body, a
    PLS-00103 error will occur
    if there is no slash, '/', after the package specification.
    Phil

  • Logical database sdf in custom program not triggering selection screen?

    I added logical Database SDF (screen 905) to a custom program - but the selection screen is not getting triggered.
    Do I have to associate these somewhere?
    Thanks,
    Ven

    HI,
    Declare this statement after the Report Statement in the program.
    TABLES : SKA1, SKB1.
    You will get the selection screen now.

  • Simple Bridge script will not read metadata and triggers Adobe Stock Photos

    I have been trying to learn to write scripts for bridge but can't get past the most basic tasks. When I run the script on an open window in bridge it throws an "Uncaught exception metadata" error. The most bizarre thing is it sometimes causes an Adobe Stock Photo script to launch in the extendscript toolkit and throw and the "Uncaught exception metadata" error in that script. My script is as follows:
    #target "bridge"
    if (BridgeTalk.appName == "bridge")
    var items = app.document.visibleThumbnails
    for (i=0; i< items.length; i++)
    item = items[i]
    md=item.metadata
    md.namespace = "http://ns.adobe.com/photoshop/1.0/";
    Window.alert(md.Title)
    Window.alert(i + " "+ " Files Finished")
    Basically I was asking to extract the title of each thumbnail from the metadata and show it in a window. I figured if I could do something as basic as that then I could move on and tackle the more complicated tasks that I need to do.
    Any ideas of what is going on? Has anyone else accidentally triggered Adobe Stock Photos?

    Another bit of info....   As I looked at this further, it seems to be occuring only on those photos where I previously ran camera raw from CS3. I've upgraded to CS5 but have not rerun camera raw since. I understand the camera raw engine in CS3 was different. Could this be involved? Could Lightroom be changing the metadata because the engine is updating the information and I have to save TO file to get this to synch?
    update about this camera raw engine possibilty..... it would not appear to be the answer. I have some files that synch even tho lightroom develop says they are using the 2003 process version. I have some files that are on the new version that won't synch.

  • Triggerring PXI-4110 to measure 1 current value while HSDIO PXI-6552 generating waveform

    Hi,
    Some question about PXI-4110 to measure current while PXI-6552 is generating the waveform. 
    1. Let say, I need to measure 3 points of current values, i.e. while PXI-6552 is generating sample-1000, 2000 and 3500. On the edge of sample 1000,2000 and 3500, the PXI-6552 will send a pulse via PFI line or via PXI backplane trigger line. My question is, is it possible to trigger PXI-4110 (hardware trigger or software trigger) to measure current values at these points ?
    2. Let say I need to measure the current on 0ms (start of waveform generation by PXI-6552) , 1ms, 2ms, 3ms, 4ms... and so on for 1000 points of measurement, code diagram as shown at the figure below. It is possible for the VI "niDCPower Measure Multiple" to measure exactly at 1ms, 2ms, 3ms .. ? How much time will have to spend to complete acquire 1 point of measurement by "niDCPower Measure Multiple" ?
    Thanks for viewing this post. Your advice on hardware used or software method is much appreciated. Thanks in advance.  
    Message Edited by engwei on 02-02-2009 04:24 AM
    Attachments:
    [email protected] ‏46 KB

    Hi engwei,
    1. Unfortunately, the 4110 does not support hardware triggering. Therefore you cannot implement direct triggering through the backplane or anything like that. However, there are a couple of possible workarounds you can try:
    a) Use software triggering: Say your 6552 is generating in one while loop, and your 4110 is to measure in another while loop. You can use a software syncrhonization method like notifiers to send a notification to your 4110 loop when your 6552 has generated the desired sample. This method, however, will not be very deterministic because the delay between the trigger and the response depends on your processor speed and load. Therefore, if you have other applications running in the background (like antivirus) it will increase the delay.
    b) Use hardware triggering on another device: If you have another device that supports hardware triggering (like maybe an M-series multifunction DAQ module), you can configure this device to be triggered by a signal from the 6552, perform a very quick task (like a very short finite acquisition) then immediately execute the DCPower VI to perform the measurement. The trigger can be configured to be re-triggerable for multiple usage. This will most likely have a smaller time delay then the first option, but there will still be a delay (the time it takes to perform the short finite acquisiton on the M-series). Please refer to the attached screenshot for an idea of how to implement this.
    2. To make your 4110 measure at specific time intervals, you can use one of the methods discussed above. As for how long it will take to acquire 1 measurement point, you may find this link helpful: http://zone.ni.com/devzone/cda/tut/p/id/7034
    This article is meant for the PXI-4130 but the 4110 has the same maximum sampling rate (3 kHz) and so the section discussing the speed should apply for both devices.
    Under the Software Measurement Rate section, it is stated that the default behavior of the VI is to take an average of 10 samples. This corresponds to a maximum sampling rate of 300 samples/second. However, if you configure it to not do averaging (take only 1 sample) then the maximum rate of 3000 samples/second can be achieved.
    It is also important to note that your program can only achieve this maximum sampling rate if your software loop takes less time to execute than the actual physical sampling. For example, if you want to sample at 3000 samples/second, that means that taking one sample takes 1/3000 seconds or 333 microseconds. If you software execution time is less than 333 microseconds, then you can achieve this maximum rate (because the speed is limited by the hardware, not the software). However, if your software takes more than 333 microseconds to execute, then the software loop time will define the maximum sampling rate you can get, which will be lower than 3000 samples/second.
    I hope this answers your question.
    Best regards,
    Vern Yew
    Applications Engineer, NI ASEAN
    Best regards,
    Vern Yew
    Applications Engineer
    Attachments:
    untitled.JPG ‏18 KB

  • Workflow PE_APPROVE01 is not triggering in PV7i .

    Dear SAP Workflow Experts .
    Friends i found workFlow for Training & Event Mgmt , it is : PE_APPROVE01 .
    workflow event : WS01200151 .
    activated the object type : PDRELA_025 .
    After Activation it become green then i ran this workflow .
    But issue is remain same  , when i book a training for emp by t-code PV7I and click button proceed for booking , the workflow mail is not going to his manager's mail box .
    Sir May u suggest me what step i missed out or what is required in order to achieve the workflow mail about booking .
    Regards : rajneesh

    Dear Saumya .
    I am very thankful for your reply .
    the steps suggested by i tried them .
    Step 3 : I tried to check in t-code SWEL if this event is getting triggered and the reciever type of the same is WS01200151.
    as u suggest me i entered creator ,(user id) , it is 0734 .
    it is actaully emp's pernr .when i execute it it shows me that event trace is ON .
    It is not giving me all the events careted by me in the selected time duration.
    So how to  search for the PDRELA_025 - CREATED event which had created.
    Please tell me how to check in t-code SWEL that event is s getting triggered and the reciever type of the same is WS01200151. ???
    I am badly stuckup sister ...plz help me .
    regards : rajneesh
    Edited by: Rajneesh Kumar on Feb 11, 2009 8:04 AM

  • End_of_page is not triggering in ALV

    hi mates
             the code below is not triggering end-of-page event, can anyone help me. reply asap
    TABLES:VBAP.
    TYPE-POOLS:SLIS.
    DATA: BEGIN OF VBAP_TYPE OCCURS 0,
          VBELN TYPE VBAP-VBELN,
          POSNR TYPE VBAP-POSNR,
          MATKL TYPE VBAP-MATKL,
          MATNR TYPE VBAP-MATNR,
          END OF VBAP_TYPE.
    DATA:GET_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
         WA_FIELDCAT  TYPE SLIS_FIELDCAT_ALV,
         HT_EVENT    TYPE SLIS_T_EVENT,
         WA_EVENT     TYPE SLIS_ALV_EVENT,
         HT_HEADER   TYPE SLIS_T_LISTHEADER,
         WA_HEADER   TYPE SLIS_LISTHEADER.
    START-OF-SELECTION.
      PERFORM GET_DATA.
      PERFORM GET_FIELDCATALOG.
      PERFORM FIELD_EVENT.
      PERFORM FIELD_DISPLAY.
    *&      Form  get_data
          text
    FORM GET_DATA.
      SELECT VBELN
             POSNR
             MATKL
             MATNR
           FROM VBAP
           INTO TABLE VBAP_TYPE.
    ENDFORM.                    "get_data
    *&      Form  get_fieldcatalog
          text
    FORM GET_FIELDCATALOG.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-COL_POS = 1.
      WA_FIELDCAT-FIELDNAME = 'VBELN'.
      WA_FIELDCAT-SELTEXT_L = 'sales doc'.
      APPEND WA_FIELDCAT TO GET_FIELDCAT.
      CLEAR WA_FIELDCAT.
    clear wa_fieldcat.
    wa_fieldcat-col_pos = 1.
    wa_fieldcat-fieldname = 'VBELN'.
    wa_fieldcat-seltext_l = 'sales doc'.
    append wa_fieldcat to get_fieldcat.
    clear wa_fieldcat.
      WA_FIELDCAT-COL_POS = 2.
      WA_FIELDCAT-FIELDNAME = 'POSNR'.
      WA_FIELDCAT-SELTEXT_L = 'sales doc item'.
      APPEND WA_FIELDCAT TO GET_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-COL_POS = 3.
      WA_FIELDCAT-FIELDNAME = 'MATKL'.
      WA_FIELDCAT-SELTEXT_L = 'Material Group'.
      APPEND WA_FIELDCAT TO GET_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-COL_POS = 4.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-SELTEXT_L = 'Material No'.
      APPEND WA_FIELDCAT TO GET_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "get_fieldcatalog
    *&      Form  field_display
          text
    FORM FIELD_DISPLAY.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
       I_INTERFACE_CHECK              = ' '
       I_BYPASSING_BUFFER             =
       I_BUFFER_ACTIVE                = ' '
          I_CALLBACK_PROGRAM             = SY-CPROG
       I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = ' '
       I_STRUCTURE_NAME               =
       IS_LAYOUT                      =
          IT_FIELDCAT                    = GET_FIELDCAT[]
       IT_EXCLUDING                   =
       IT_SPECIAL_GROUPS              =
       IT_SORT                        =
       IT_FILTER                      =
       IS_SEL_HIDE                    =
       I_DEFAULT                      = 'X'
       I_SAVE                         = ' '
       IS_VARIANT                     =
          IT_EVENTS                      = HT_EVENT
       IT_EVENT_EXIT                  =
       IS_PRINT                       =
       IS_REPREP_ID                   =
       I_SCREEN_START_COLUMN          = 0
       I_SCREEN_START_LINE            = 0
       I_SCREEN_END_COLUMN            = 0
       I_SCREEN_END_LINE              = 0
       IR_SALV_LIST_ADAPTER           =
       IT_EXCEPT_QINFO                =
       I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
       E_EXIT_CAUSED_BY_CALLER        =
       ES_EXIT_CAUSED_BY_USER         =
        TABLES
          T_OUTTAB                       = VBAP_TYPE
       EXCEPTIONS
         PROGRAM_ERROR                  = 1
         OTHERS                         = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "field_display
    *&      Form  field_event
          text
    FORM FIELD_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = HT_EVENT.
    WA_EVENT-NAME = SLIS_EV_TOP_OF_PAGE .
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    APPEND WA_EVENT TO HT_EVENT.
    CLEAR WA_EVENT.
      WA_EVENT-NAME = SLIS_EV_END_OF_PAGE .
      WA_EVENT-FORM = 'END_OF_PAGE'.
    APPEND WA_EVENT TO HT_EVENT.
    CLEAR WA_EVENT.
    READ TABLE ht_event INTO wa_event
                         WITH KEY name = slis_ev_top_of_page .
    EXCEPTIONS
       LIST_TYPE_WRONG       = 1
       OTHERS                = 2
    IF sy-subrc = 0.
       wa_event-form = 'TOP-OF-PAGE'.
       wa_event-form = 'END_OF_PAGE'.
       MODIFY ht_event FROM wa_event INDEX sy-tabix.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    "field_event
    *&      Form  top_of_page
          text
    FORM TOP_OF_PAGE.
      CLEAR WA_HEADER.
      WA_HEADER-TYP = 'H'.
      WA_HEADER-INFO = ' this is the sales document data'.
      APPEND WA_HEADER TO HT_HEADER.
      CLEAR WA_HEADER.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = HT_HEADER
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    "top_of_page
    *&      Form  END_OF_Page
          text
    FORM END_OF_PAGE.
      WA_HEADER-TYP = 'H'.
      WA_HEADER-INFO = ' this is the end of page'.
      APPEND WA_HEADER TO HT_HEADER.
      CLEAR WA_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = HT_HEADER
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
         it_list_commentary       = ht_header
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    endform.

    Hi,
    Try this code for end_of_page is not triggering in ALV
    TYPE-POOLS : slis.
    TABLES : mara,
             makt,
             marc.
    DATA : BEGIN OF itab OCCURS 0,
            matnr LIKE mara-matnr,
            maktx LIKE makt-maktx,
            werks LIKE marc-werks,
           END OF itab.
    DATA : t_fcat TYPE slis_t_fieldcat_alv,
           t_eve TYPE slis_t_event,
           st_line TYPE slis_listheader,
           t_list_top_page TYPE slis_t_listheader,
           t_list_end_page TYPE slis_t_listheader.
    DATA : t_mat LIKE mara-matnr.
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : mat FOR mara-matnr.
    SELECTION-SCREEN : END OF BLOCK blk1.
    INITIALIZATION.
      PERFORM build_cat USING t_fcat.
      PERFORM build_eve.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM build_header USING t_list_top_page[].
      PERFORM build_footer USING t_list_end_page[].
      PERFORM dis_data.
    *&      Form  buils_cat
          text
         -->TEMP_FCAT  text
    FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
      DATA : wa_fcat TYPE slis_fieldcat_alv.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-seltext_m = 'Material'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MAKTX'.
      wa_fcat-seltext_m = 'Material Description'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'WERKS'.
      wa_fcat-seltext_m = 'Plant'.
    wa_fcat-row_pos = 2.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
    ENDFORM.                    "build_cat
    *&      Form  build_eve
          text
    FORM build_eve.
      DATA : wa_eve TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         i_list_type           = 0
       IMPORTING
         et_events             = t_eve
    EXCEPTIONS
      LIST_TYPE_WRONG       = 1
      OTHERS                = 2
      IF sy-subrc  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE t_eve INTO wa_eve WITH KEY name = 'END_OF_LIST'.
      IF sy-subrc = 0.
        wa_eve-form = 'END_OF_PAGE'.
        MODIFY t_eve FROM wa_eve INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "build_eve
    *&      Form  get_data
          text
    FORM get_data.
      SELECT maramatnr maktmaktx marc~werks INTO CORRESPONDING FIELDS OF TABLE itab
      FROM mara INNER JOIN makt ON
      maramatnr = maktmatnr
      INNER JOIN marc ON
      maramatnr = marcmatnr
      WHERE mara~matnr IN mat.
    ENDFORM.                    "get_data
    *&      Form  dis_data
          text
    FORM dis_data.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = 'ZALV_PRDS'
         i_callback_top_of_page            = 'TOP_OF_PAGE'
         it_fieldcat                       = t_fcat
         i_save                            = 'A'
         it_events                         = t_eve
       TABLES
          t_outtab                          = itab
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF sy-subrc  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "dis_data
    *&      Form  build_header
          text
         -->TEMP_LIST          text
         -->TTYPE              text
         -->SLIS_T_LISTHEADER  text
    FORM build_header USING temp_list TYPE slis_t_listheader.
      CLEAR st_line.
      st_line-typ = 'H'.
      st_line-info = 'Material Info'.
      APPEND st_line TO temp_list.
    ENDFORM.                    "build_header
    *&      Form  build_footer
          text
         -->TEMP_LIST  text
    FORM build_footer USING temp_list TYPE slis_t_listheader.
      CLEAR st_line.
      st_line-typ = 'H'.
      st_line-info = 'Dhwani Shah'.
      APPEND st_line TO temp_list.
    ENDFORM.                    "build_header
    *&      Form  top_Of_page
          text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_list_top_page.
    ENDFORM.                    "top_Of_page
    *&      Form  end_of_page
          text
    FORM end_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_list_end_page.
    ENDFORM.                    "end_of_page
    Reward Points if usefull
    Regards
    Fareedas

  • Re: Dynamic Action is not triggering in LSMW Recording

    Hello All,
    In SAP HRMS personnel actions if i do using LSMW Recording it is not triggering  the dynamic actions.
    Is there any mechanism to Trigger dynamic action in LSMW Recording ?
    How to find the differences in process with and with out recording ?
    Small help is also highly appreciated.
    With Regards,
    Sunil,
    +91-9903695384.

    Yes. Do one  thing. First study the dynamic action. Try to understand what the dynamic action is doing. Is it creating data in other infotype or is it updating some other table. Once it is clear what the dynamic action is doing then you can try to implement the same logic in LSMW. In LSMW there is a provision to add more than one recording and this recording can be called based on some logic..
    Thanks & Regards,
    Sandip

  • Break points are not triggering in RFC from portal application

    Helllo,
    I am running Biller Direct application from portal, which is triggering a standard SAP RFC FM back end, am trying to debug my execution from portal, for this i put the External Break point, Session break-poiint at the beginning of this SAP RFC FM, but, its not stoppping at ll, here the user is a Web user, not dialog user.
    How can i stop my execution in this SAP RFC FM to check how the structures are populated?
    Thank you

    Hi Raju,
    Please try the below way and check if it works.
    Open the RFC in R/3 i.e.
    SE37 -> give FM NAME -> DISPLAY.
    Click on UTILITIES -> SETTINGS -> CLICK THE TAB debugging.
    In the screen against the field users : give the value 'WEBLOGIN'.
    Uncheck the FLAG 'IP MATCHING'.
    And at the bottom check the check box against the field
    'Session Break Point Activate Immediately'.
    Save these settings.
    Then go to the line at which you want to debug the code and put an external break point over there.
    But, please take care of one thing as we are giving it as a WEBLOGIN, when ever some logs in, it will reach the brteak point and stop there. We have to click F8 to continue. Or else, the portal will be hanged for them.
    Thanks & regards,
    Y Gautham

  • ActionListener Problem - Event not triggering properly

    Hello,
    I have slight problem ith action listeners. Below is an exercise from a book on java i'm reading. I have constructed rectangle with 3 circles inside.
    When the button in one panel is pushed the colors of these cicles should change from green,black,black to black,yellow,black to black,black,red and start over.
    When the button is clicked the event isn't triggered. However when I push the button and click the frame of the window the colors change.
    I would be grateful if anyone could explain why this is happening?
    // Zepang
    import javax.swing.*;
    import java.awt.*;
    public class Pp415
         public static void main(String [] args)
              JFrame frame = new JFrame("Traffic Lights");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              Prime panel = new Prime();
              frame.getContentPane().add(panel);
              frame.pack();
              frame.setVisible(true);
         JButton lightButton = new JButton("Change the Lights!");
         lightButton.addActionListener(this);
         buttonLight.add(lightButton);
            add(buttonLight);
         add(light);
         int color = 0;
         public void actionPerformed (ActionEvent event)
              Color g = light.getGreenLight();
              Color y=  light.getYellowLight();
              Color r=  light.getRedLight();
              if (g.equals(Color.green))
                   light.setGreenLight(Color.black);
                   light.setYellowLight(Color.yellow);
              if (y.equals(Color.yellow))
                   light.setYellowLight(Color.black);
                   light.setRedLight(Color.red);
              if (r.equals(Color.red))
                   light.setRedLight(Color.black);
                   light.setGreenLight(Color.green);
    import javax.swing.*;
    import java.awt.*;
    class TrafficLight extends JPanel
         Color redLight = Color.black;
         Color yellowLight = Color.black;
         Color greenLight = Color.green;
    public TrafficLight()
         setBackground(Color.black);
         setPreferredSize(new Dimension (200,300));
      public void setRedLight(Color c)
         redLight = c;
      public void setYellowLight(Color c)
         yellowLight = c;
      public void setGreenLight(Color c)
         greenLight = c;
      public Color getRedLight()
      return redLight;
      public Color getGreenLight()
      return greenLight;
      public Color getYellowLight()
      return yellowLight;
      public void paintComponent(Graphics page)
         final int C = 25;
         page.setColor(Color.blue);
         page.fillRect(C, C, 100, 250);
         page.setColor(greenLight);
         page.fillOval(C+10,C+5,80,80);
         page.setColor(yellowLight);
         page.fillOval(C+10,C+90,80,80);
         page.setColor(redLight);
         page.fillOval(C+10,C+170,80,80);
    }Edited by: Zepang on Dec 4, 2008 4:24 PM
    Edited by: Zepang on Dec 4, 2008 4:25 PM

    I don't in general do GUI stuff. But I can see for sure that you're never telling the system that it needs to repaint when you change state. That's why it doesn't show up until you cause an external event causing it to repaint itself, such as resizing the frame or dragging another window across the window.

  • PRD is not triggering in Negative Stocks allowed scenario

    I am trying to do Subcontracting process with Negative Stocks allowed for the final material and raw materials even & all of them are checked for negative stocks allowed. When I am trying to issue, say 10 units of materials to SC Vendor with ZERO stocks in storage, the stock's updating accordingly as 10-, but while doing MIGO for say 5 units, the stock's updating accordingly, but in FI documents so created, the PRD key is missing. I read bout PRD and it states : Price differences can also arise in the case of materials with moving average price if there is not enough stock to cover the invoiced quantity. In the case of goods movements in the negative range, the moving average price is not changed. Instead, any price differences arising are posted to a price difference account. Depending on the settings for the posting rules for transaction/event key PRD, it is possible to work with or without account modification. If you use account modification, the following modifications are available in the standard system. So, what steps are to be taken in order to trigger PRD key in the FI Documents.
    Regards,
    Sowmyesh Maniyar

    Sowmyesh Maniyar wrote:
    I read bout PRD and it states : Price differences can also arise in the case of materials with moving average price if there is not enough stock to cover the invoiced quantity.
    Yes its correct.. At the time MIRO, if any price difference occurs, then first system checks stock is available or not.. If stock is there then system will take the amount from stock account, if not, then system take the amount in PRD account...
    But here you have activated negative stock. I think because of this your stock account triggered instead of PRD account..
    Can you check and analysis the accounting entry, where the price different amount goes ?

Maybe you are looking for