Adding One Line Code in all tables in Designer Trigger.

I have 300+ tables in my Schema (All tables generated through Designer), I want to add one line of code in the begining of "Before Inset Row Trigger" of all tables, So what is the fastest way of doing that,
Adding One Line Code in all tables in Designer Trigger.
I don't want to go and modify each and every table

You'll have to write a script that reads out the current contents of your triggers, add your line to this contents and dynamically "create or replace" the new trigger text.
Beware, trigger_body column of user/all/dba_triggers is in a column with datatype LONG, so you'll have to use some sort of conversion.
Good luck.
regards,
Rob.

Similar Messages

  • New-line code in mapping table

    Hi,
    we have a mapping table that stores the footers of all our companies.
    These have text like " <b.>Company Name...</>.....".
    (Note: ignore the '.' after the '<b' in the previous - I needed it here so I could display the command in SDN- it is not in the text on our system). This works fine and the appropriate section is in bold.
    The question I have is that one of our companies needs the footer to have a second line so I need some sort of '<>' command to force a new line.
    I have tried <cr>, <br>, \n and
    n.
    Does anyone know how to do this?
    Thanks.

    Sesh,
    thanks for your help. I managed to get it working. Not the most elegant bit of code but it works:
        FIELD-SYMBOLS <fs> TYPE ANY.
        ASSIGN '0' TO <fs>.
        SEARCH l_text FOR '\NL'. "I decided to call it '\NL'
        IF sy-subrc = 0.
          SPLIT l_text AT '\NL' INTO l_text2 l_text3.
          ASSIGN l_index TO <fs>.
          IF NOT l_text2 IS INITIAL.
            WHILE NOT l_text2+l_n(80) IS INITIAL.
              l_index = l_index + 1.
              CONCATENATE 'DESC' <fs> INTO l_desc.
              READ TABLE outtab WITH KEY = l_desc.
              outtab-value = l_text2+l_n(80).
              MODIFY outtab INDEX sy-tabix.
              CLEAR outtab.
              l_n = l_n + 80.
              l_wa_o_text-tdformat = '*'.
              CONCATENATE l_wa_o_text-tdline '&' l_desc '&' INTO l_wa_o_text-tdline.
            ENDWHILE.
            APPEND l_wa_o_text TO l_o_text.
          ENDIF.
          APPEND l_wa_o_text TO l_o_text.
          CALL FUNCTION 'CREATE_TEXT'
            EXPORTING
              fid         = 'ST'
              flanguage   = sy-langu
              fname       = 'ZDYNAMIC_TEST'
              fobject     = 'TEXT'
              save_direct = 'X'
            TABLES
              flines      = l_o_text
            EXCEPTIONS
              no_init     = 1
              no_save     = 2
              OTHERS      = 3.
    outtab passed back to SAPScript....
    SAPScript Code:
    INCLUDE 'ZDYNAMIC_TEST' OBJECT TEXT ID 'ST' PARAGRAPH 'Z2'.
    Thanks.

  • Shortcut object in Sunopsis- Adding one column in multiple aggregate tables

    Hello,
    We have a situation where we have existing aggregate tables. Now i need to add one column in common to all the aggregate tables(more than 10 aggregate tables). Is there some way out to do all at the same e.g. making some shortcut object or something else.

    Hi,
    have you tried requesting the focus on your newly selected internal frame ?

  • One line code !!!! just tell the output and why it is so ??

    #include<stdio.h>
    int main()
         printf("%d") ;
    OR
    #include<stdio.h>
    int main()
         printf("%f") ;
    }

    You codedoes not have defined behavior.
    When you pass "%d" to print,f you must also pass a second argument of type int.
    When you pass "%f" to print,f you must also pass a second argument of type double.
    If you don't pass required arguments, you cannot predict the results of the program.

  • Want to copy Delivery address of one line item in shopping cart to all item

    Hi Experts,
                    We are upgrading from SRM 5.0 to SRM 7.0,In SC Creation We want to copy Delivery address of one line item in shopping cart to all line items in Shopping cart by clicking Change All Items button.This is custom button we added this button and we had written code to achieve the functionality but it is not working.This is same like Change All Items button in Account Assigment for copy accont details of one line item to all other line items in SC.
    Web Dynpro Component:/SAPSRM/WDC_UI_DO_SHIPTO
    Web Dynpro View:V_DODC_SHIPTO
    Thanks,
    Aarthi.

    Hi Prasad,
                   Our customer needs that button,they want whenever they are clicking the button delivery address should copy to all line items.
    In my action ONCHANGE_ALL_ITEMS i called this method
    wd_this->mo_dodm_shipto->zchange_all_items( ).
    zchange_all_items( ) is  implemented in class /SAPSRM/CL_CH_WD_DODM_SHIPTO.
    the code i wrote inside zchange_all_items( )
    *Error
      DATA: LX_PDO_ABORT               TYPE REF TO /SAPSRM/CX_PDO_ABORT,  " Class for Fatal error caught by PDO Layer
            LX_PDO_ERROR               TYPE REF TO /SAPSRM/CX_PDO_ERROR.  " Class for PDO General Exception
    Object Instances
      DATA: LO_MSG_CONSUMER            TYPE REF TO /SAPSRM/IF_PDO_MSG_CONSUMER,
            LO_PDO_SHIPTO              TYPE REF TO /SAPSRM/IF_PDO_DO_PARTNER.
    Context-Data
      DATA: lte_cll_shipto              TYPE /sapsrm/if_ch_wd_set_facade=>gt_guid_element,
            loe_cll_shipto              TYPE REF TO /sapsrm/if_ch_wd_set_element.
    Field Symbols
      FIELD-SYMBOLS <lse_cll_shipto>    LIKE LINE OF lte_cll_shipto.
    DATA : lo_pdo_acc TYPE REF TO /sapsrm/if_pdo_do_acct_assgmnt.
      DATA : ls_shipto_cll type /SAPSRM/S_CLL_SHIPTO,
             lt_pdo_partnerdetails      TYPE bbp_pdt_partner,
             ls_pdo_partnerdetails      TYPE bbp_pds_partner,
              LV_GUID          TYPE BBP_GUID,
              lv_item_guid type bbp_guid,
             lv_filled TYPE wdy_boolean.
    *exceptions
      DATA : LX_ABORT                  TYPE REF TO /SAPSRM/CX_PDO_ABORT.
    *Constants
      CONSTANTS : LC_OBJECT_ID         TYPE CRMT_SUBOBJECT_CATEGORY_DB VALUE 'BUS2121001',
                  LC_ADDR_ORIGIN       TYPE /SAPSRM/S_CLL_SHIPTO-ADDR_ORIGIN VALUE 'B'.
      IF LV_FILLED = ABAP_TRUE.
    Downcasting to shipto
        LO_PDO_SHIPTO ?= MO_PDO.
    insert the clipboard into facade and update and submit update
        me->/sapsrm/if_cll_do_mapper~insert_from_clipboard( io_set_facade = mon_cll_set_facade ).
    Add new Accounting entries.
        lte_cll_shipto = mon_cll_set_facade->get_data_elements( ). "get all elements from the context
        LOOP AT  lte_cll_shipto ASSIGNING <lse_cll_shipto>.
          loe_cll_shipto = <lse_cll_shipto>-set_element.
          loe_cll_shipto->get_static_attributes( IMPORTING rv_attributes = ls_shipto_cll ).
    Map ui-structure to pdo-structure
          MOVE-CORRESPONDING ls_shipto_cll TO ls_pdo_partnerdetails.
          IF LS_SHIPTO_CLL-PARTNER_FCT =  mv_part_func.
            LS_PDO_PARTNERDETAILS-PARTNER_FCT = ''.
          ELSE.
            LS_PDO_PARTNERDETAILS-PARTNER_FCT = LS_SHIPTO_CLL-PARTNER_FCT.
          ENDIF.
          IF ls_pdo_partnerdetails-del_ind NE 'X'.
            CALL FUNCTION 'GUID_CREATE'
              IMPORTING
                ev_guid_16 = ls_pdo_partnerdetails-p_guid.
           mv_acc_guid_split = ls_pdo_shipto-guid .
            IF mo_scope = 1.
              ls_pdo_partnerdetails-p_guid = mon_cll_set_facade->get_bo_guid( ).
            ELSE.
              ls_pdo_partnerdetails-p_guid = mo_parent_bo_mapper->items_get_lead_selection( ).
            ENDIF.
            APPEND ls_pdo_partnerdetails TO lt_pdo_partnerdetails.
          ENDIF.
          CLEAR : ls_pdo_partnerdetails, ls_shipto_cll.
        ENDLOOP.
    Add New items to PDO
        IF NOT lt_pdo_partnerdetails[] IS INITIAL.
          TRY.
              LO_PDO_SHIPTO->update_item_partners( EXPORTING it_partner = lt_pdo_partnerdetails
                                                               iv_item_guid       = lv_item_guid
                                                   CHANGING co_message_handler = mo_pdo_message_consumer ).
            CATCH /sapsrm/cx_pdo_abort INTO lx_pdo_abort.
              mo_cll_message_handler->set_abort( io_pdo_abort_exception = lx_pdo_abort ).
            CATCH /sapsrm/cx_pdo_error INTO lx_pdo_error.
              mo_cll_message_handler->add_exception( io_pdo_error_exception = lx_pdo_error ).
          ENDTRY.
    Update PDO with the changed data.
          TRY.
              mo_pdo->submit_update( ).
            CATCH /sapsrm/cx_pdo_abort INTO lx_pdo_abort.
              mo_cll_message_handler->set_abort( io_pdo_abort_exception = lx_pdo_abort ).
            CATCH /sapsrm/cx_pdo_error INTO lx_pdo_error.
              mo_cll_message_handler->add_exception( io_pdo_error_exception = lx_pdo_error ).
          ENDTRY.
    Fire refresh of DO Mappers registered for refresh since the item table has acc related data.
          mo_parent_bo_mapper->fire_event_refresh( iv_perform_updates = abap_false ).
        ENDIF.
      ENDIF.
    Thanks,
    Aarthi.

  • Default G/L acct and Cost center in service PO with added Freight line also

    Hi,
    I am doing Service PO my requirement is we need default G/l account and cost center in Service PO, we have added one line as Freight charges that is also required default g/l account.
    please suggest me the configuration.
    Thanks
    Shital

    Hi,
    Can be set with help of following t.codes to have default G/L account with  cost center in Service PO
    OME9, OMGO ,OMQW & OBYC
    Also check the blog:
    http://www.bluemarlinsys.com/ns/0603-03.asp
    Regards,
    Biju K

  • SPA525G permanent CLIR for one line

    Hello,
    how is it possible for one line (not for all) to set up a permanent suppression of the Caller ID. I can not find it in the settings. I can find only the suppression of all line.
    Who can help me?
    regards
    Daniel

    Hi,
    thanks for the reply. Does not seem to work. In the PBX (AVM FritzBox) , I can not suppress the phone number for this line. If I use the code *31# or #31# on the SPA525, it tells me unknown number. On ISDN or DECT terminal it works. Note If the unknown number from the SPA525 or the PBX?
    Sorry for the bad English!
    greeting

  • Export all tables' name under user by informatica

    Hi,
    I have a requirement about informatica mapping,
    we want to user one mapping to export all tables' name under user,
    like sql :
    SELECT t.OWNER || '.' || t.TABLE_NAME ||
    FROM all_tables t
    WHERE t.OWNER = 'BIEBS';
    How to realize it?
    Thank you!

    Get the table all_table in source analyzer save it. While building the map choose this as ur source, modify source qualifier as select table_name,table_name from all_tables where table_name='BIEBS'.
    Once u have this, use an expression transformation to build ur expression and load it into a flat file.
    Please mark this answered or helpful if it solves your purpose.
    Rgds.

  • Mark just one line in ALV

    Hi everybody!
    I'm doing an ALV (with FM REUSE_ALV_GRID_DISPLAY) that the user should mark just one line and click in a button to starting the process... But today the user can mark more than one line. I don't know how to configure just to mark just one line...
    Can you help me???

    HI,
    you check the number of lines selected by the user
    if the user selects more then 1 line you can throw a error message
    refresh gt_selected_rows.                                      
    call method vl31_grid->get_selected_rows                       
                         importing et_index_rows = gt_selected_rows.
    *-- more than one line was marked                              
       READ TABLE gt_selected_rows INDEX 2 TRANSPORTING NO FIELDS.  
       IF sy-subrc = 0.                                             
         MESSAGE s755(06).                                          
         EXIT.                                                      
       ENDIF.                                                                               
    *-- nothing marked                                             
       READ TABLE gt_selected_rows INDEX 1 INTO wa_selected_rows.   
       IF sy-subrc <> 0.                                            
         MESSAGE s277(me).                                          
    Check the above example if the user selects more than one row throws a error message
    Regards,
    siva chalasani.
    <b>Reward points if usefull</b>

  • How to delete all data in all tables in one time ?!

    1 CREATE OR REPLACE PROCEDURE delete_all_data
    2 IS
    3 v_statement VARCHAR2 (200);
    4 BEGIN
    5 FOR i IN (SELECT *
    6 FROM user_tables)
    7 LOOP
    8 v_statement :=
    9 'delete table ' || i.table_name ;
    10 EXECUTE IMMEDIATE v_statement;
    11 END LOOP;
    12 commit;
    13* END;
    SQL> /
    Procedure created.
    SQL> exec delete_all_data
    BEGIN delete_all_data; END;
    ERROR at line 1:
    ORA-00903: invalid table name
    ORA-06512: at "DE2.DELETE_ALL_DATA", line 10
    ORA-06512: at line 1
    I made the previous code , but it's didn't work with me .... any help for this problem please ?!
    I'm just reminder ..... all what I need ,that delete all data in all tables in one time only .
    I'm waiting for the answer ..... and thanks in advance

    create or replace
    FUNCTION TRUNC_SCHEMA RETURN NUMBER AS
    CURSOR select_table IS SELECT TABLE_NAME AS TNAME FROM USER_TABLES ORDER BY 1;
    sTableName Varchar2(128);
    sUser Varchar2(128);
    sConstraintName Varchar2(128);
    plsql_block Varchar2(512);
    BEGIN
    SELECT USER INTO sUser FROM DUAL;
    IF ((sUser='SYSTEM') OR (sUser='SYS')) THEN
    RETURN 1;
    END IF;
    EXECUTE IMMEDIATE 'PURGE RECYCLEBIN';
    -- DISABLE table's constraints
    FOR C1 IN (select CONSTRAINT_NAME, TABLE_NAME from user_constraints where STATUS = 'ENABLED' AND CONSTRAINT_TYPE in ('P','R') ORDER BY R_CONSTRAINT_NAME) LOOP
    sConstraintName := C1.CONSTRAINT_NAME;
    sTableName := C1.TABLE_NAME;
    plsql_block := 'ALTER TABLE ' || sTableName || ' DISABLE CONSTRAINT ' || sConstraintName;
    EXECUTE IMMEDIATE plsql_block ;
    END LOOP;
    FOR D IN select_table LOOP
    --get table name
    sTableName := D.TNAME;
    -- clear table
    plsql_block := 'TRUNCATE TABLE ' || sTableName;
    EXECUTE IMMEDIATE plsql_block ;
    END LOOP;
    -- ENABLE table's constraints
    FOR C2 IN (select CONSTRAINT_NAME, TABLE_NAME from user_constraints where STATUS = 'DISABLED' AND CONSTRAINT_TYPE in ('P','R') ORDER BY R_CONSTRAINT_NAME desc) LOOP
    sConstraintName := C2.CONSTRAINT_NAME;
    sTableName := C2.TABLE_NAME;
    plsql_block := 'ALTER TABLE ' || sTableName || ' ENABLE CONSTRAINT ' || sConstraintName;
    EXECUTE IMMEDIATE plsql_block ;
    END LOOP;
    RETURN 0;
    EXCEPTION WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR: ' || SQLERRM);
    RETURN 1;
    END TRUNC_SCHEMA;
    /

  • Only one line is getting printed in Table in Smartforms (ECC 6.0)

    Hello Sir,
    I am new in ABAP and doing Smartforms (ECC 6.0) on project from customer side.
    I have to deliver the object in time and it is already late, please help me.
    This is my question:
    Object :  Stock Transport Order.
    =======================
    I have created Table in main window after Program Line Node.
    >Main Window
    >>Code2
    >>Table1
    >>>Header
    >>>>Row1
    >>>>>Cell1 to Cell10
    >>>Main Area
    >>>>Row2
    >>>>>Cell1 to Cell10
    >>>Footer
    >>>>Row3
    >>>>>Cell1 to Cell10
    I have mentioned internal tabel as well work area table in "DATA" tab in table Node.
    In Row1 I have created Text Node in every cell having Column Heading.
    In Row2 I have created Text Node in every cell having variable.
    In Row3 all cells are blank.
    On output only one line is getting printed
    What could be the reason.
    =====================================================================
    This is Code1 (is in the beginning of the form in window1)
    ==========
    *& Selection of Purchasing Document No,Plant,Short Text,Quantity,Material No,
    *& Gross order value in PO currency
    select single ebeln werks txz01 menge matnr brtwr
    from ekpo into
    (v_ebeln,v_werks,v_txz01,v_menge,v_matnr,v_brtwr)
    where ebeln = DOCNO.
    *& Selection of Plant address
    select single adrnr from t001w into v_adrnr
    where werks = v_werks.
    *& For Selection of phone,fax
    select single name1 tel_number fax_number from adrc into (v_name1,phone,fax)
    where addrnumber = v_adrnr.
    *& For E-Mail Selection
    select single SMTP_ADDR from adr6 into mail where addrnumber = v_adrnr.
    *& For CST No.,GST No.
    select single J_1ICSTNO J_1ILSTNO
                  from J_1IMOCOMP into (CST,GST)
                  where werks = v_werks.
    *& Selection of Vendor Address No., PO date
    select single reswk aedat from ekko into (v_reswk,v_aedat) where
    ebeln = v_ebeln.
    *& Selection of Supplying (Issuing) Plant address
    select single adrnr from t001w into vendor
    where werks = v_reswk.
    *& Selection of storage location
    select single lgort from ekpo into v_lgort where werks = v_werks
    and ebeln = v_ebeln.
    *& Selection of description of storage location
    select single lgobe from t001l into v_lgobe where werks = v_werks.
    *& Fetching data into internal table from ekpo
    select ebeln ebelp matnr txz01 menge brtwr from ekpo into corresponding fields
    of table iekpo where ebeln = v_ebeln and werks = v_werks.
    Fetching data into internal table from marm for Pck
    select * from marm into corresponding fields of table imarm for all entries
    in iekpo where matnr = iekpo-matnr.
    Fetching data into internal table from mara for Pack Type Code
    select * from mara into corresponding fields of table imara for all entries
    in iekpo where matnr = iekpo-matnr.
    Fetching data into internal table from tvegrt for Pack Type Description
    select * from tvegrt into corresponding fields of table itvegrt
    for all entries in imara where magrv = imara-magrv.
    Fetching data into internal table from eket for Receipt Date
    select * from eket into corresponding fields of table ieket
    where ebeln = v_ebeln.
    Selection of Order Type from mepo_topline
    *select single bsart from mepo_topline into v_bsart where ebeln = v_ebeln
    *and superfield = v_werks.
    *if v_bsart = 'UB'.
    xhead = 'Replenishment Order'.
    *eleseif v_bsart = 'ZSTO'.
    xhead = 'Purchase Order'.
    *endif.
    *& Defining of variable for Printing Line Serial Number,Total Quantity,
    *& Total Value
    =====================================================================
    This is Code2 (is in the main window)
    ==========
    xln = 0.
    tmenge = 0.
    tvalue = 0.
    Loop for printing table
    loop at iekpo into wekpo.
      xln = xln + 1.
      xmatnr = wekpo-matnr.      " Material Number (Code)
      xtxz01 = wekpo-txz01.      " Material Name
      xmenge = wekpo-menge.      " Line Quantiy
      xbrtwr = wekpo-brtwr.      " Basic Rate
    *& Pck
      read table imarm into wmarm with key matnr = wekpo-matnr.
      xpck = wmarm-umren.        " Packing Size
    *& Num
      xnum = xmenge / xpck.      " Numbers of Packing
    *& Line Value
      xvalue = xmenge * xbrtwr.  " Line Basic Value
    *& Packing Type
      read table imara into wmara with key matnr = wekpo-matnr.
      xpacktype = wmara-magrv.   " Packing Type Code
    *& Packing Type Description
    read table itvegrt into wtvegrt with key magrv = imara-magrv.
    xpackdesc = wtvegrt-bezei. " Packing Type Description
    *& Receipt Date
      read table ieket into weket with key ebeln = v_ebeln.
      xrcpdt = weket-eindt.      " Receipt Date
    *& Report Total
      tmenge = tmenge + xmenge.
      tvalue = tvalue + xvalue.
    *& Serial No. increment
    endloop.
    =====================================================================
    Thanks and Regards,
    Yogesh Pathak

    Did you debug and check the umber of values in internal table before calling the TABLE Node....
    seeing all SELECT SINGLE along with WHERE = condition and no loop call on them, my assumption  is there will be on record only. Check in Debug mood. Search forum to find how to debug a smartform.

  • Help for transfering data from one user' all tables to another

    Hello guys,
    I have trim the extra sizes of columns in almost all tables of my database. Before doing this, I saved the data of tables by creating another user "User1" with the same objects and importing dmp file in it. After this I cleared my original objects and reduced the extra sizes of columns alomost in all tables.
    Now I want to transfer data from backup user "User1" into my original user's "User" tables.
    Can any one guid me with the way of doing so, so that I could do it just through 3 or 4 lines of code instead of individualy table wise transfering the data...??
    regards
    Kashif

    SQL> select 'insert into '||table_name||' as select * from user1.'||table_name ||' ;' from user_tables where table_name in ('EMP', 'DEPT') ;
    'INSERTINTO'||TABLE_NAME||'ASSELECT*FROMUSER1.'||TABLE_NAME||';'
    insert into DEPT as select * from user1.DEPT ;
    insert into EMP as select * from user1.EMP ;
    2 rows selected.
    SQL>You could spool the output of the query above to a .SQL script file and then just run it within the same script using @@script_name.SQL.

  • How to put grouped results all on one line.

    I amt trying to get Principal, Interest, Principal YTD, Interest YTD from a transaction table to get them all on one line, but I can't seem to get it. I have a script here that can run without modification to see what I have here. The very last query is
    incorrect, as it puts each value on a separate line, but it demonstrates what I am getting so far. What I want is one account number with 4 columns, as above mentioned. Keep in mind, in this illustration, YTD is last year and forward:
    CREATE TABLE #a
    PMT_ID INT IDENTITY(1,1),ACCT_NO INT, PMT_TYPE CHAR(1), PMT_AMT MONEY, PMT_DATE DATE)
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'P', 450, '2012-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'I', 100, '2012-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'P', 450, '2012-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'I', 100, '2012-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'P', 450, '2012-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'I', 100, '2012-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'P', 351, '2012-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'I', 102, '2012-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'P', 352, '2012-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'I', 102, '2012-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'P', 353, '2012-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'I', 102, '2012-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'P', 850, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'I', 200, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'P', 880, '2013-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'I', 201, '2013-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'P', 855, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'I', 203, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'P', 451, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'I', 99, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'P', 451, '2013-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'I', 99, '2013-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'P', 451, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 1, 'I', 99, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'P', 352, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'I', 101, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'P', 353, '2013-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'I', 103, '2013-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'P', 354, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 2, 'I', 103, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'P', 851, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'I', 199, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'P', 881, '2013-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'I', 201, '2013-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'P', 854, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES ( 3, 'I', 205, '2013-12-01')
    SELECT PMT_ID, ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE
    FROM #a
    SELECT ACCT_NO, SUM(PMT_AMT) TOT_PRINCIPAL_PAID
    FROM #a
    WHERE PMT_TYPE = 'P'
    GROUP BY ACCT_NO
    SELECT ACCT_NO, SUM(PMT_AMT) TOTAL_INTEREST_PAID
    FROM #a
    WHERE PMT_TYPE = 'I'
    GROUP BY ACCT_NO
    SELECT ACCT_NO, SUM(PMT_AMT) TOTAL_PRINCIPAL_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'P'
    AND DATEPART(year,[PMT_DATE])=DATEPART(year,DATEADD(year,-1,GETDATE()))
    GROUP BY ACCT_NO
    SELECT ACCT_NO, SUM(PMT_AMT) TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'I'
    AND DATEPART(year,[PMT_DATE])=DATEPART(year,DATEADD(year,-1,GETDATE()))
    GROUP BY ACCT_NO
    SELECT ACCT_NO
    ,SUM(PMT_AMT) AS TOTAL_PRINCIPAL_PAID
    ,NULL AS TOTAL_INTEREST_PAID
    ,NULL AS TOTAL_PRINCIPAL_PAID_YTD
    ,NULL AS TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'P'
    GROUP BY ACCT_NO
    UNION
    SELECT ACCT_NO
    ,NULL AS TOTAL_PRINCIPAL_PAID
    ,SUM(PMT_AMT) AS TOTAL_INTEREST_PAID
    ,NULL AS TOTAL_PRINCIPAL_PAID_YTD
    ,NULL AS TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'I'
    GROUP BY ACCT_NO
    UNION
    SELECT ACCT_NO
    ,NULL AS TOTAL_PRINCIPAL_PAID
    ,NULL AS TOTAL_INTEREST_PAID
    ,SUM(PMT_AMT) AS TOTAL_PRINCIPAL_PAID_YTD
    ,NULL AS TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'P'
    AND DATEPART(year,[PMT_DATE])=DATEPART(year,DATEADD(year,-1,GETDATE()))
    GROUP BY ACCT_NO
    UNION
    SELECT ACCT_NO
    ,NULL AS TOTAL_PRINCIPAL_PAID
    ,NULL AS TOTAL_INTEREST_PAID
    ,NULL AS TOTAL_PRINCIPAL_PAID_YTD
    ,SUM(PMT_AMT) AS TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'I'
    AND DATEPART(year,[PMT_DATE])=DATEPART(year,DATEADD(year,-1,GETDATE()))
    GROUP BY ACCT_NO
    -- Query to put this all these 4 columns on the same line, ending up with 3 lines.
    DROP TABLE #a

    Try the below query
    CREATE TABLE #a
     PMT_ID INT IDENTITY(1,1),ACCT_NO INT, PMT_TYPE CHAR(1), PMT_AMT MONEY, PMT_DATE DATE)
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'P', 450, '2012-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'I', 100, '2012-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'P', 450, '2012-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'I', 100, '2012-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'P', 450, '2012-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'I', 100, '2012-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'P', 351, '2012-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'I', 102, '2012-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'P', 352, '2012-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'I', 102, '2012-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'P', 353, '2012-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'I', 102, '2012-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'P', 850, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'I', 200, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'P', 880, '2013-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'I', 201, '2013-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'P', 855, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'I', 203, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'P', 451, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'I', 99, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'P', 451, '2013-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'I', 99, '2013-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'P', 451, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 1, 'I', 99, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'P', 352, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'I', 101, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'P', 353, '2013-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'I', 103, '2013-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'P', 354, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 2, 'I', 103, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'P', 851, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'I', 199, '2013-09-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'P', 881, '2013-10-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'I', 201, '2013-11-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'P', 854, '2013-12-01')
    INSERT INTO #a ( ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE ) VALUES  ( 3, 'I', 205, '2013-12-01')
    SELECT PMT_ID, ACCT_NO, PMT_TYPE, PMT_AMT, PMT_DATE 
    FROM #a
    SELECT ACCT_NO, SUM(PMT_AMT) TOT_PRINCIPAL_PAID
    FROM #a
    WHERE PMT_TYPE = 'P'
    GROUP BY ACCT_NO
    SELECT ACCT_NO, SUM(PMT_AMT) TOTAL_INTEREST_PAID
    FROM #a
    WHERE PMT_TYPE = 'I'
    GROUP BY ACCT_NO
    SELECT ACCT_NO, SUM(PMT_AMT) TOTAL_PRINCIPAL_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'P'
    AND DATEPART(year,[PMT_DATE])=DATEPART(year,DATEADD(year,-1,GETDATE()))
    GROUP BY ACCT_NO
    SELECT ACCT_NO, SUM(PMT_AMT) TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'I' 
    AND DATEPART(year,[PMT_DATE])=DATEPART(year,DATEADD(year,-1,GETDATE()))
    GROUP BY ACCT_NO
    select 
    T123.ANO,
    SUM(TOTAL_PRINCIPAL_PAID) TOTAL_PRINCIPAL_PAID,
    SUM(TOTAL_INTEREST_PAID) TOTAL_INTEREST_PAID ,
    SUM(TOTAL_PRINCIPAL_PAID_YTD) TOTAL_PRINCIPAL_PAID_YTD,
    SUM(TOTAL_INTEREST_PAID_YTD) TOTAL_INTEREST_PAID_YTD
    from
    SELECT ACCT_NO ANO
    ,SUM(PMT_AMT) AS TOTAL_PRINCIPAL_PAID
    ,NULL AS TOTAL_INTEREST_PAID
    ,NULL AS TOTAL_PRINCIPAL_PAID_YTD
    ,NULL AS TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'P'
    GROUP BY ACCT_NO
    UNION
    SELECT ACCT_NO
    ,NULL AS TOTAL_PRINCIPAL_PAID
    ,SUM(PMT_AMT) AS TOTAL_INTEREST_PAID
    ,NULL AS TOTAL_PRINCIPAL_PAID_YTD
    ,NULL AS TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'I'
    GROUP BY ACCT_NO
    UNION
    SELECT ACCT_NO
    ,NULL         AS TOTAL_PRINCIPAL_PAID
    ,NULL         AS TOTAL_INTEREST_PAID
    ,SUM(PMT_AMT) AS TOTAL_PRINCIPAL_PAID_YTD
    ,NULL         AS TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'P'
    AND DATEPART(year,[PMT_DATE])=DATEPART(year,DATEADD(year,-1,GETDATE()))
    GROUP BY ACCT_NO
    UNION
    SELECT ACCT_NO
    ,NULL         AS TOTAL_PRINCIPAL_PAID
    ,NULL         AS TOTAL_INTEREST_PAID
    ,NULL         AS TOTAL_PRINCIPAL_PAID_YTD
    ,SUM(PMT_AMT) AS TOTAL_INTEREST_PAID_YTD
    FROM #a
    WHERE PMT_TYPE = 'I'
    AND DATEPART(year,[PMT_DATE])=DATEPART(year,DATEADD(year,-1,GETDATE()))
    GROUP BY ACCT_NO)T123
    Group by T123.ANO 
    DROP TABLE #a

  • HTML code displays on one line in browser view source

    Hi,
    In Dreamweaver, my HTML code displays returns, spaces, etc. However, in the view source option in a browser (Firefox in particular), all the code is displayed on one single line. I only found about this because I was having problems with my Google Ads not displaying. (A Google customer service person helped me to find a workaround for this since I still haven't figured how to get my code to display correctly.) So I have gone to Preferences in DW and changed my Code Format Line Break type. The result is the same with each of the three options: the code is all on one line when you check it under view source in a browser. (The server is Linux.)
    Does anyone know how to fix this? Also, I think I know how this happened in the first place. I copied my code to TextEdit for a quick backup the other day, and then I pasted it back to DW. Bad idea? Is the only way to get the code back to normal to re-write it in a new HTML file in DW?

    Pssh. Problem solved, but I'm not quite sure how. I did go back and try to clean up some redundant CSS and other things, but the HTML/CSS validator still shows that I have this one invalid <header> tag (www.nextmontenegro.com), but since that was written as part of the DW template, I just left it. Weird. Anyway, the code flows down the page now.
    Thanks for the quick replies and helpful hints:-)

  • Change in one line item should Populate for all line items

    Hi ,
    We have added one custom field Prefereed Vendor at line item level.
    We have requirement that if Prefereed Vendor at one line item level is changed,
    then it should populate for all the line items.
    Can any one tell me how it can be implemented?
    Thanks in Advance.
    Snehal

    Hello,
    I assume you are referring to SC. In standard SRM Preferred Vendor is a partner to an Item. But based on your post, have you added the Preferred vendor as a CUF field?
    Anyway we can achive your requirement in DOC_CHANGE_BADI. This BADI has importing parameter IT_ITEM and exporting as ET_ITEM.
    1. Get the SC from PD buffer using BBP_PD_SC_GETdETAIL into LT_ITEM
    2. Compare the preferred vendor for every item in IT_ITEM with corresponding item in PD buffer
    3. If for some item, the preferred vendor for IT_ITEM is diferrent from that of LT_ITEM --> means we found the item for which preferred vendor was chaged
    4. Now populate ET_ITEM based on IT_ITEM along with copying the preferred vendor from changed item to all items.
    Rgds,
    Prasanna

Maybe you are looking for