Need a trigger Syntax

I want to auto generate invoice No. (inv_ID) user manualy punch date in date field (DATE).
for example
when user input date in date field 11-01-2010 and commit the transuction Auto generate (inv_ID) in this format (RRRRMMdd0001).
201001110001
201001110002
201001110003
if user input date in date field 15-11-2009
200911150004
200911150005
200911150006
Advance Thanks for yor cooperation
talk4ever

Hi,
I think Manu had given you some solution
you can twist that to ur own ..
Try the following code.
SELECT TO_CHAR(SYSDAYE, 'RRRRmmdd') || NVL(MAX(TO_NUMBER(SUBSTR(ORDER_ID, 9))), 0) + 1 INTO :<block_name>.<field_name> FROM <table_name> WHERE SUBSTR(ORDER_ID, 1, 8) = TO_CHAR(SYSDAYE, 'RRRRMMDD');
Regards,

Similar Messages

  • Need to trigger change pointers for a change in std text

    I need to trigger an idoc via change pointers when any change in a std text occurs. I am doing this for changes in Customer Master. For example, if the std text obtained via tcode XD02 is changed, then I need to trigger an idoc. Is this possible? What is the object class used?
    Thanks,
    Keerthi

    Hi,
    All Standard text views are stored in V_E071.
    Use the View for V_E071 for checking standard text transport
    Give Object Filed Name = TEXT and check
    And search the standard object
    Go to se09 create workbench request and
    Double Click the request and go to program give R3TR and Object: TEXT and object Name: TEXT, Nike_FT_AB_4700, ZEPC, D
    Object: TEXT
    Where   Nike_FT_AB_4700 is Customized Name of Standard Text
    Text Id: ZEPC (Default: ST)
    Language: D (DE)
    Go to SE03  double click the Search for Objects in Requests/Tasks in the
    R3TR Object ; TEXT and do search.. with respective to that you will get change request.
    Do rewards points.

  • Need to Trigger a Program in ECC after the DSO load has completed

    HI Experts,
    I have scenario where i need to trigger a Program in ECC after the load to DSO has been completed successfully. Basically opposite of the everyday scenario.
    Can i still use the  the RSSM_EVENT_RAISE FM in the program to call the event in ECC.
    If the above is true.Do i need to have code in the program to confirm the DSO has been loaded or can i just have the program (which basically calls the FM RSSM_EVENT_RAISE) appended to the process chain after the DSO Activation?
    Appreciate your advice

    Hi,
    To help future proof your solution, lean towards using the process chain as much as possible.
    A "Green/Success" only link from the DataStore Activation process variant to an ABAP Program process variant will work nicely. It will also still allow your program to be executed by other scenarios (like manually because you want the event raised now without any dependency on the DataStore status).
    SAP now recommends you use the CL_BATCH_EVENT class and it's methods to interact with the system events. Use transaction SE24 to review the methods and parameters available and then use the sample code below to test your solution.
    Here is a starting point for coding that is used within an ABAP Program process variant in a process chain.
    Use transaction SE38 to store this code to be called by the ABAP Program process variant.
    constants:
      c_interrupt_eventid   type btceventid  value '[Event]',
      c_interrupt_eventparm type btcevtparm  value '[Parameter]'.
    data:
      l_interrupt_eventid   type btceventid value c_interrupt_eventid,
      l_interrupt_eventparm type btcevtparm value c_interrupt_eventparm.
    call method cl_batch_event=>raise
      EXPORTING
        i_eventid                      = l_interrupt_eventid
        i_eventparm                    = l_interrupt_eventparm
      EXCEPTIONS
        excpt_raise_failed             = 2
        excpt_server_accepts_no_events = 3
        excpt_raise_forbidden          = 4
        excpt_unknown_event            = 5
        excpt_no_authority             = 6
        others                         = 1.
    if sy-subrc <> 0.
      message e051(rsar) with 'Failed to raise background event.' c_interrupt_eventid c_interrupt_eventparm.
    endif.
    Note: The error message is process chain friendly and will appear in the RSPC transaction GUI and system logs.
    Hope this helps,
    John.

  • Need to trigger an idoc from transfer order on confirmation

    Hi,
    I need to trigger an outbound idoc on the confirmation of a Transfer Order, but I don't know how to do.
    The IDoc type i'll use WMTOID02.
    Any Help would be greatly appreciated.
    Regards,
    Supaporn R.

    Hi
    I think you need to do some configuration using OMKY transaction, pls take help from functional consultant
    Regards
    MD

  • Fixing this TRIGGER Syntax

    I am practicing Triggers in SQL Server 2012.  Please help me correct this Trigger Syntax for this practice question below.
     Build a trigger on the emp table after insert that adds a record into the emp_History table and marks IsActive column to 1
    CREATE TRIGGER trgAfterInsert ON [dbo].[emp_triggers] 
    FOR INSERT
    AS
    declare @empid int;
    declare @empname varchar(100);
           declare @isactive int;
    select @empid=i.empid from inserted i;
    select @empname=i.empname from inserted i;
    set   @isactive= 1;
    insert into emphistory
               (empid, empname) 
    values(@empid, @empname, @isactive) ;
    PRINT 'AFTER INSERT trigger fired.'

    Your trigger does not work if an insert statement inserts multiple rows into your emp_triggers table.  Never write triggers that only work correctly when 1 row is inserted, updated, or deleted by one command.  You want
    CREATE TRIGGER trgAfterInsert ON [dbo].[emp_triggers]
    FOR INSERT
    AS
    insert into emphistory
    (empid, empname, isactive)
    select empid, empname, 1 from inserted ;
    which will work correctly no matter how many rows (0, 1, or many) are inserted by one INSERT command.
    Tom

  • Added custom date fields at contract;need to trigger mail using those dates

    Hi,
    II have added 14 custom fields in the service order quotation for handling waranty start date and end dates capturing for the maximum of 7 years contract.
    Then its usual yearly action of the waranty team to put the dates in those fields.
    The first set of 2 input fields will be filled at the quotation creation itself; rest the set of 12 fields will be updated in this 7 years time.
    My requirement is such that to the capture all the waranty end dates filled in the input fields and trigger a mail 30 days prior to that days.
    Example : I have contract from 01/08/2004 to 31/07/2010.
    Then my waranty startdate / end date can be filled by waranty team as 01/08/2004 to 31/07/2005 in the waranty first year.the i need to trigger a mail to waranty team on 01/07/2005.
    For the second year if we have dates filled as 01/08/2005 to 31/07/2006; then to trigger mail on 01/07/2006.
    I have tried using ACTIONS but couldn't get much help.
    As a work around thinking for a report to fetch the contract for that Trans.type and check the dates with the present date + 30 and collect those to perfrom the respective actions.This is workaround.
    Tried using the DATE TYPES creating 7 different DATE TYPES and assigning the ( end dates - 30 ) to that manually upon save.
    and using this DATE TYPE along with the action definition can we acheive ?  but it too will be work around.
    How to acheive this one. It became critical now in the project. 
    Thanks and Regards,
    Satish Akkina

    Hi,
    In your scenario, you don't need synchronous email facility.
    Probably you can create a z table and maintain all required dates in this table (before saving your transaction somewhere you would have to read your custom fields and save them in this table along with object ID/GUID). Then create a report that would read dates from z table and then send emails to your warranty team. Schedule this report in background with frequency of once day.
    Hope that helps.
    Regards,
    BJ

  • Need to Trigger an outbound Idoc when shipment manually deleted thru VT02N

    Hello All,
    Can anyone help me on this issue. I need to Trigger an outbound Idoc when shipment is manually deleted thru VT02N transaction.
    Please help me, how to do the output detemination or if is there any event trigger mechanism for this.
    Waiting for your response.
    Thank you.
    Sridhar Kanchibotla

    Hi,
    We need to display all the IDOC data on a Smartform layout. But we dont need the IDOC to be used for our requirement. So we want to make sure that IDOC is triggered but will not stay in 02 or other status.
    We have a process to monitor the failed idocs (02 status) and we do not want our idoc to have failed status. So we need the idocs to be tirggered directly with status 31 (thanks for letting me know that i cant use status 68 for outbound idocs).
    Thanks!

  • Need to trigger output type when BAPI is run

    I need to trigger an output type which generates an idoc when material group is updated using a BAPI.....Can anyone tell me is there a bapi which does this ?

    I just want to know whether there is any BAPI which triggers the output also when we make an update ?

  • Need to trigger mail to requestor along with creator in SRM 7.0

    Hi Experts,
    We are using SRM 7.0 Extended classic scenario with process controlled Workflow in our system.
    As I am very much new to the workflow concept need your help in this regard.
    We have a requirement where we need to trigger a rejection email when Shooping cart got rejected by the approver to the requestor along with creator.
    As per our current design rejection mail is going only to creator but not requestor.
    Can somebody help me in this regard how to get this functionality.
    Thanks.
    Regards,
    Kalyani

    Hi Konstantin,
    We tried with suggested badi BBP_ALERTING BADI. But when I set the break-point in the enhancement of this badi and tried to trigger by rejecting the Shopping cart, i dont see any entries in the structure CT_RECEPIENTS[].
    Some entries should be there in CT_RECEPIENTS[] by the time this badi triggers or how to figure this out?
    Small change in my requirement is rejection mail is going successfully to requestor and we are expecting same mail to creator.
    Thanks in advance.
    Regards,
    Kalyani

  • How to do it? Need help in syntax - new to Oracle syntax

    create or replace
    PROCEDURE "SP_SAMPLE_data" (prodName in VARCHAR2) AS
    where_criteria char(100);
    BEGIN
    if prodName = 'A' then
    I want to build the where criteria string as “product_name in (‘iPod’,’iPad’)”
    else
    I want to build the where criteria string as “product_name = directly read from the passed variable(prodName)”
    end if;
    select *
    from “MySchema”.”MyTable”
    where where_criteria concatenated here – do not know how to concatenate;
    END SP_SAMPLE_data;
    New to Oracle PL/SQL syntax.
    Oracle 10gR2

    You could try someting like this
    create or replace procedure SP_SAMPLE_data (prodName in VARCHAR2) AS
       where_criteria char(100);
       sql_stmt varchar2(1000);
    BEGIN
       if prodName = 'A' then
          -- I want to build the where criteria string as "product_name in ('iPod','iPad')"
          where_criteria := 'product_name in (''iPod'',''iPad'')';
       else
          -- I want to build the where criteria string as
          -- "product_name = directly read from the passed variable(prodName)"
          where_criteria := 'product_name = '''||prodName||'''';
      end if;
      sql_stmt := 'select * from MySchema.MyTable'||where_criteria;
    END SP_SAMPLE_data;I added SQL_STMT variable as I am not sure what do you want to do with SQL statement once it is created. Do you plan to execute it in the procedure or pass it back to the calling environment? If you need to pass it back, then specify SQL_STMT as out parameter.

  • Need to trigger workflow after g/l document posted in FB50

    Hi all
    When a user posts a document in FB50 (G/L journal entry), I need it to trigger a workflow.  I can find BTE's that come in to play before the document number is assigned, but I need it triggered after the document number is assigned.  I tried BTE processes 1120 and 1140 but they're too early.  I also looked at many function modules and user exits suggested by various SDN threads but nothing seems to be triggering.
    I already have a workflow created using BO BKPF and can trigger it manually, but not through FB50.  There's lots of info on BO FIPP, but I'm looking at posted documents, not parked documents.  Tracing FB50 with SWELS/SWEL doesn't show anything.
    Any help would be greatly appreciated.
    Ron

    Hi Ronald,
    If you are using ECC 6.0 try to look explicit enhancement, that is kernel BADI (key words: GET BADI and ENHANCEMENT). If there is none also then use implicit enhancement. Implicit enhancement is always available at the beginning and the end of Function Module, Routines, Program, Methods, etc.
    Regards,
    Lim...

  • VL01N - needs to trigger outbound idoc

    Hi all,
    As per requirement please tell me information of how to trigger the outbound idoc on save that consist of delivery data with ref to sales order data.
    I am not able to create the Output type please tell me steps if possible of provide me some link that helps me.
    Regards,

    Hello,
    You have to create an OUTPUT in the configuration and maintain the condition records in VV21 for the Partner LS which means an output for IDOC
    For this configration, Goto the spro
    SPRO->LOGISTIC-EXECTION>SHIPPING->OUTPUT DETERMINATION->MAINTAIN OUTPUT DETERMINATION FOR OUTBOUND DELIVERIES---.DEFINE OUTPUT TYPES.
    Try to create the output type and maintain the condition records .
    Revert back if you need any clarifications
    regards,
    santosh

  • Trigger syntax

    Hi,
    I following some tutorials on SQL triggers but I have a question regarding the syntax, which none of the tutorials i looked at explains:
    The aim of my trigger is when the table dbo.RBD_Measure is updated then the trigger fires and (after the update) inserts the Primary Key values from PK column in dbo.RBD_Dimension table into the FK column in dbo.RBD_Measure where RBD columns contain
    same values in both table.
    I have the code below and it works fine but what i would like to know is what exactly is the difference between having the SQL statements after AS (as in the example below), or having it between BEGIN...END part of the code. Can someone explain what should
    come after AS (or what not) and what should come between BEGIN...END?
    CREATE TRIGGER [dbo].[Trigger_Update]
    ON [dbo].[RBD_Measure]
    for insert
    AS
    update RBD_Measure
    Set RBD_Measure.FK=RBD_Dimension.PK
    FROM RBD_Measure
    INNER JOIN RBD_Dimension
    on Rbd_Measure.RBD=RBD_Dimension.RBD
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for trigger here
    END
    Thanks!

    The aim of my trigger is when the table dbo.RBD_Measure is updated then the trigger fires and (after the update) inserts the Primary Key values from PK column in dbo.RBD_Dimension table into the FK column in dbo.RBD_Measure where RBD columns contain
    same values in both table.
    I have the code below and it works fine but what i would like to know is what exactly is the difference between having the SQL statements after AS (as in the example below), or having it between BEGIN...END part of the code. Can someone explain what should
    come after AS (or what not) and what should come between BEGIN...END?
    Although it is common practice to specify BEGIN/END to encapsulate the entire code block in triggers (and other modules), it is optional.
    Be aware that because you are not joining to the inserted table in your trigger, every row in the RBD_Measure is updated every time this trigger executes regardless of whether the row was inserted by the statement that fired the trigger.  You mention
    "after update" but this trigger fires only after INSERT statements.  You can fire the trigger after both inserts and updates, and also join to the inserted table to identify the updated and inserted rows.  Below is an example that assumes the RDB_Measure
    table has a primary key column named RBD_Message_PK:
    CREATE TRIGGER [dbo].[Trigger_Update_Insert]
    ON [dbo].[RBD_Measure]
    FOR UPDATE, INSERT
    AS
    UPDATE m
    SET FK = RBD_Dimension.PK
    FROM RBD_Measure AS m
    INNER JOIN RBD_Dimension AS d
    ON m.RBD = d.RBD
    INNER JOIN inserted AS i ON
    i.RBD_Measure_PK = m.RBD_Measure_PK;
    GO
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Need to trigger InputProcessor after user login

    Hello All,
    We have a workflow where we need to display some data in a portlet (list of catalogs
    which user has access to).
    This data should be visible when the portlet gets displayed.
    We have an InputProcessor which retrieves this data.
    The question is which event should fire the InputProcessor.
    Could we link the PostLoginProcessor to this InputProcessor?
    So that when a user successfully logs in, this workflow would get executed and the
    portlet would show the list.
    Is this the right approach or there is some other way?
    Would greatly appreciate any help or suggestions.
    Thnx.
    Mukul

    Dave,
    The problem I was having was how to trigger the InputProcessor after user logs in?
    Is there a processor node I can use or some postlogin event?
    Mukul
    "David Anderson" <[email protected]> wrote:
    I'm assuming that you have supplied a particular .JSP to be dispayed when
    you created your portlet definition. Instead of doing this, create a
    webflow that is executed when the portlet is displayed. In this webflow,
    make the input processor you refer to the start node of the webflow and
    then
    pass control to the .JSP that will display the information. Again, I'm
    assuming that the information that is retrieved as part of the input
    processor is being added to the pipeline session.
    This is probably the best route for accomplishing the loading of the data
    when the portlet is displayed.
    Dave
    "Mukul Sood" <[email protected]> wrote in message
    news:3cc60322$[email protected]..
    Hello All,
    We have a workflow where we need to display some data in a portlet (listof catalogs
    which user has access to).
    This data should be visible when the portlet gets displayed.
    We have an InputProcessor which retrieves this data.
    The question is which event should fire the InputProcessor.
    Could we link the PostLoginProcessor to this InputProcessor?
    So that when a user successfully logs in, this workflow would get executedand the
    portlet would show the list.
    Is this the right approach or there is some other way?
    Would greatly appreciate any help or suggestions.
    Thnx.
    Mukul

  • URGENT:I need to trigger an idoc..HOW

    Hi Gurus,
    I need some help on the detailed steps on how to trigger MATMAS03 from R/3...i was told we can use transaction code we19.
    Can some one please help on this.
    Venkat

    Hey...
    Just for testing purpose..you can use WE19..
    First goto transaction WE02 and put Basic type : MATMAS03 as filter criteria, change your creation date to select little old idocs and run...on next screen your will see number of idocs "MATMAS03" with green status(if there is any in that period..otheriwse change period again).
    Then goto WE19 and put existing idoc number in the field existing idoc and and presss F8...On next screen press "Standard  outbound processing".
    Before that have you done your partner profile  / rfc port and destination configuration for XI system?
    If so then in we19 change control record ( Double click in EDIDC segment) to your sender / recever partner profile.. and run.. :)..thats all..
    Nilesh

Maybe you are looking for

  • HT1386 can i sync 20 iphones with the same itunes?

    can i sync 20 iphones with the same itunes?

  • ISE 1.2 Active Directory Question

    Hi, I have a question regarding using Active Directory as an External Identity Source. Our customer has 4 AD servers in their domain and thus 4 DNS entries for the domain. When I join ISE to the domain DNS resolves to one address and uses that machin

  • Email Test Error

    Hi there, We're using the workflow aplication on the ECM and we want to send a email at the end of the workflow, notifying an entity that the content has been rejected or approved but we don't know how to do this. We also have tried to test if the em

  • How to turn off secondary voicemail notification?

    Every time someone leaves me a voicemail it sounds the notification chime twice. This is a new irritating "feature" that I can NOT figure out how to disable. ONCE is plenty! It even does it when I am ON THE PHONE. Please tell me I have overlooked the

  • Automatic Database Failover

    What is the best way to do automatic Failover in 9i. I have the DataGuard Environment setup. (Primary/Standby) Can you use Transparent Application failover, Can you use a script that monitors the Windows Service? Help?