Logic in Transformations to delete record

Hi,
How to write(syntax) a routine in Start routine of transformation
I am extraction data from ECC to DSO in BW
My requirment is in Transformations start routine i need to check each record if source package on 2 fields XYZ and PQR....need to update the record only if both the fields are NOT BLANK
How to achieve this
Thanks

Hi
There is a small correction in your syntax
DELETE DATA_PACKAGE WHERE XYX IS INTIIAL
                                            OR PQR IS INITIAL.
This will delete the records if any one of the field is blank
There is one more option that you can handle in the field routine for skipping the record
Just take the first field routine in your transformation, it may be any field say FCG
Make the two fields XXX and PQR as the source by inserting them
First map the source anf destination fiel d of the field in which the routine is created
RESULT = SOURCE_FIELDS-FCG
IF soure_fields-XXX IS INITIAL
OR source_fields-PQR IS INITIAL.
RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD
ENDIF.
By doing this the record will be skipped and it will not be updated to the target DSO.
Prathish

Similar Messages

  • How to delete records from standard maintenance view

    Dear Sir/Madam,
            i want to delete records from standard view " v_mmim_rep_cust "
    This is a standard maintenance view , used in MBLB report.
    here i found the records with different report name but same fields as shown below...
    REPORT             TABLE NAME     FIELD NAME 
    RM07DOCS         MKPF                 BKTXT
    RM07DOCS         MKPF                 BLDAT
    RM07DOCS         MKPF                 BUDAT
    RM07DOCS         MSEG                 ANLN1
    RM07DOCS         MSEG                 ANLN2
    RM07DOCS         MSEG                 APLZL
    YRM07DOCS         MKPF                 BKTXT
    YRM07DOCS         MKPF                 BLDAT
    YRM07DOCS         MKPF                 BUDAT
    YRM07DOCS         MSEG                 ANLN1
    YRM07DOCS         MSEG                 ANLN2
    YRM07DOCS         MSEG                 APLZL
    I WANT TO DELETE THE RECORDS FROM THE VIEW WITH REPORT = YRM07DOCS.
    PLEASE HELP ME.
    Thanks in Advance,
    Dastagiri.

    Dear Sir,
          when i did so , it displays a message that  " entry mseg zeile  must not be deleted ".
    hense i went through writing a program to delete the records from table mmim_rep_cust
    but it says that record not found.
    program logic : 
    delete from mmim_rep_cust
        where report in report
          and TABNAME in TABNAME.
    if sy-subrc = 0.
    write ' RECORDS DELETED SUCCESSFULLY'.
    else.
    write ' RECORD NOT FOUND'.
    endif.
    please guide me to delete the records from the view.
    Thanks in advance,
    Dastagiri.

  • What is the best approach to track deleted records

    Dear all,
    We have build a CMS platform which is based on SQL server 2012 tables structure hosted in Azure.
    We have build on top of this some REST API method in order to access data from any type of client application.
    The issues we need to solved now is what his the best way to track deleted records in order that client application gets informed through web service about deleted data from our CMS.
    We were thinking of 2 path actually :
    - having a kind of Ghost table for each of our real table where deleted records will be inserted into ( physical delete ). This would mean adding as many Ghost tables as we have production tables
    - Adding a IsDeleted flag to each of our table which will be set to true when a record is deleted from our CMS ( logical delete ). This would means adding an IsDelete field to each of our tables, create and update all our store procedure and web services
    in order to taken in account that new filter criteria to fetch our records. Quite huge job
    Will there be any other approach ?
    We are looking the best solution with minimum impact on our current solution
    reagards
    Your knowledge is enhanced by that of others.

    Hello,
    @Tom, based on your question
    "The question would be what do you need to do with the deleted records and how long do you need to keep them?"
    When records is deleted, then I simply want to delete them and informed any client application about deleted items in order to get data in Sync. I will not have any reporting on deleted data !
    The only reason of tracking delete tables items, is simply to informed client application through web service sync about the data to be ignored. Client application have a caching database records for performance reason and is is require to not used data
    from that local storage which has been reported as deleted by the SQL server on Aure.
    Does this make sense ?
    regards
    Your knowledge is enhanced by that of others.

  • How to deal with delete record in generic delta of generic datasource

    Hi,
       Anyone can give me suggestion about the delete record in generic delta  of generic data. I need extract data with a generic datasource and hope deleted record in datasource also can be "delete" in next delta extraction. I do a test with generic delta. It seem that the delete record can not be updated in ODS. but updated record can be updated in next delta extraction.
    How dose BW generic delta deal with the deleted record with generic delta mechanisim? Or how can I use generic delta mechanisim to realize that BW "delete" the deleted record of source system in ODS with delta extraction?
    Thanks in advance!
    Billy

    Delete is not supported in delta mechanism of generic delta extractor. You will need to add a workaround for that.
    - Capture the deleted records somewhere (maybe enhance the txn deleting the record so the key is written to a Z table). Take these records to BW and manipulate the recordmode to affect deletion of corresponding record from ODS.
    - If your generic delta is based on FM, and if the 'delete' is captured in change document tables, add the logic to check change document tables whether any records are deleted, and if yes, send those to BW with appropriate recordmode to achieve deletion.

  • Delete records from multiple table

    Hi,
    I need to delete records from multiple tables using a single delete statement. Is it possible ? If so please let me know the procedure.
    Kindly Help.
    Thanks,
    Alexander.

    Hi Tim,
    Syntax of DELETE statement does not allow for multiple tables to be specified in this way. Infact, none of the DMLs allow you to specify table names like this.
    Technically, there are other ways of deleting from multiple tables with one statement.
    1. "Use a trigger":
    What was probably meant by this is that you have a driving-table on which you create a on-delete trigger. In this trigger, you write the logic for deleting from other tables that you want to delete from.
    This does mean a one-time effort of writing the trigger. But the actual DML operation of deleting from all the tables would be simply triggered by a delete on driving-table.
    2. Dynamic SQL:
    Write a PL/SQL code to open a cursor with table-names from which you want the data to be deleted from. In the cursor-for loop, write a dynamic SQL using the table-name to delete from that table.
    3. Using Foreign-Key constraint with Cascade-Delete:
    This I feel is a more 'cleaner' way of doing this.
    Having to delete data from multiple tables means that there is some kind of parent-child relationship between your tables. These relationships can be implemented in database using foreign-key constraints. While creating foreign-key constraint give the 'on delete cascade' clause to ensure that whenever data is deleted from parent-table, its dependent data is deleted from child-table.
    Using foreign-key constraint you can create a heirarchy of parent-child relationships and still your DELETE would be simple as you would only have to delete from parent-table.
    IMPORTANT: Implementing foreign-key constraints would also impact other DML operations that you should keep in mind.

  • Displaying ALV agan with deleted record not shown....

    Hello Gurus,
    I am working on ALV. The ALV deipalys data froma custom table. Now I have created a Button in application toollbar saying 'Delete'. I have wrirren logic  in 'ALV_UC (i_callback_user_command) so that when user pushes 'Delete' button, the data record gets deleted from custom table.
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = lv_progname
                i_callback_pf_status_set = 'ALV_STAT'
                i_callback_user_command  = 'ALV_UC'
    *            i_callback_top_of_page   = 'TOP_OF_PAGE'
                is_layout                = is_layout
                it_fieldcat              = field_lst
    *            is_variant               = g_variant
                it_event_exit            = gt_event_exit
                i_save                   = 'A'
                it_sort                  = it_sort
                i_screen_start_column    = i_start_col
                i_screen_start_line      = i_start_ln
                i_screen_end_column      = i_end_col
                i_screen_end_line        = i_end_ln
           tables
                t_outtab                 = p_outtab
           exceptions
                program_error            = 1
                others                   = 2.
    Now, I want the ALV to be dsiplayed with that deleted record not shown. How can I do this ? Is there a Refresh function or something  ?
    Thanks.
    Regards,
    Rajesh.

    Hello Rajesh
    A quick view into the documentation of IMPORTING parameter I_CALLBACK_USER_COMMAND would have answered your question:
    Within the USER_COMMAND callback routine set
    REFRESH = 'X'.  " That's all
    EXIT routine for command handling
       Description
         Passing an EXIT routine indicates to the ALV that the application wants
         to respond to certain function codes.
         Generally, these are function codes that are unknown to the ALV (that
         is, are not standard ALV functions) and that were defined and set by a
         user status.
         See also the documentation on parameter  I_CALLBACK_PF_STATUS_SET.
         The interface of the form routine specified must be defined as follows:
                 FORM user_command  USING r_ucomm LIKE sy-ucomm
                                          rs_selfield TYPE slis_selfield.
         Parameter R_UCOMM contains the function code triggered.
         Structure RS_SELFIELD contains the following information:
         o   tabname  : Name of the internal output table
         o   tabindex : Index of the internal output table
         o   fieldname: Field name
         o   endsum   : Cursor is located on the totals line
         o   sumindex : If >0, the cursor is located on a subtotals line
         o   value    : Value of the field on the list
         o   refresh  : (Exporting) List should be set up again
         o   col_stable:(Exporting) Keep column position when list is set up
             again
         o   row_stable:(Exporting) Keep row position when list is set up again
         o   exit      :(Exporting) Exit list (and ALV)
         o   before_action: Call before standard action execution
         o   after_action : Call after standard action execution, before list
             setup
         o   ignore_multi : Internal use
         o   sel_tab_field: Internal use
         The EXIT routine is called whenever a function unknown to the ALV is
         triggered or if the routine call before/after the execution of a
         standard function code has been defined by interface parameter
         IT_EVENT_EXIT.
         See also the documentation on parameter IT_EVENT_EXIT.
         The function code and the current cursor position are then passed on to
         the calling program through the EXIT routine.
         If the user has selected multiple rows by selecting checkboxes, the
         output table field designated as the checkbox contains the current state
         of the checkbox in the list.
    Regards
      Uwe

  • Can we have the RKF logic in transformation?

    Hello all,
    we have a lot of RKF created in our queries. I was wondering if we can write the same kind of logic in transformation itself like by writing some kind of code.
    The RKF we have is we are restricting the key figure by some characteristic. Example we are restricting the key figure with depending on the characteristics "Status" and its values. Like RKF Approved has the key figure and value of "Status" as approved. Pending RKF as Pending Value of "Status"
    Can we right some kind of like this logic in the transformation and include those many key figure in our cube so these RKF/key figures will be stored in cube rather than being calculated on the fly and the performance will be good?
    Thanks all in advance.

    Hi Kris,
    You can implement some ABAP logic in the update routines/transformations.
    You have to assign/map the original key figure from the info source to the key figure in the cube(RKF).
    In the mapping of the key figure use update type addition and update method as Routine.
    In the routine, you can check for the characterisitic value of the characteristic Status in the incoming record and assign the key figure value in the infosource to the key figure in the target (RKF).
    For each restrcted key figure you will have the corresponding key figure in the cube model and map it to the key figure(which was used in RKF definition) from the infosource.
    If you are using transformation, use routine as the rule type and implement the logic in the routine.
    PN - You are right the advantage of having key figures in the model would reduce the query response time, however it increases the loading time.
    Hope it helps,
    Regards,
    Sunmit.

  • DTP Indicator Only Get Delta Once: How to handle deleted records in source

    Hi colleagues,
    I have checked some messages and blogs, but could not find any solution for deleted records in source system.
    My source system is not able to delivere delta for my table of interest. So I checked "Only Get Delta Once" in my DTP and made some tests.
    It works very well for changes of existing records of the source table.
    But, SAP help on this features wirtes:
    ...If this is not logically possible because, for example, data is deleted in the source without delivering reverse records, you can set this indicator and perform ...
    I checked this feature by selecting less data from source at the second load from the same table. But recordmode does not get an deletion flag for the now missing records. So, the indicator "Only Get Delta Once" does not work like BI standard delta mechanism?
    What is wrong?
    Thanks and regards,
    Wolfgang

    Hi,
    If you select the option 'Only get delta once', then every request in the PSA will only be loaded into the Data target once. For example. If you load a full request into the PSA through an InfoPackage and then load it to the Cube. In a snapshot scenario, when the new full load comes to the PSA you will need to delete the previous request from the cube before loading the new request.
    But if you delete the previous request from the cube, and not from the PSA - and if you haven't checked the 'Only get delta once' flag, when you execute the DTP, it will load both previous and the new requests from the PSA to the cube. In order to avoid this you have 2 options:
    1. You can delete a request from the PSA after every successful load into the Cube OR
    2. You can check the 'Only get delta once' flag in the DTP so that it won't load any request it has loaded into the cubes previously even if it was deleted from the cube.
    Using the second option de-couples the PSA maintenance from your regular data loading and also saves you an additional step of deleting the PSA request in your process chain.

  • DTP can't be deleted, if transformation was deleted before it

    DTP can't be deleted, if transformation was deleted before it
    How I can delete that DTP?

    Hi,
    if you want delete the Delta DTP or Full DTP use program deleting DTP's.
    enter the T-CODE-  SE38 -> run the program -> give the DTP technical name -> execute.
    it will go permanently.
    Thanks,
    Phani.

  • Delete record from the form and from the database

    hi,
    i want delete record from the form and the database ,but the record is only delete from the from !!!
    this is my code :
    if //condition then
    delete_record;
    commit;
    end if ;
    Any solutions ??
    thnx

    You have unique key field(s) on the table you are trying to insert which actually restricts you from inserting the same value again.
    When you are deleting the record and issue commit there is a record to be inserted in the table which is a duplicate that's why you are getting this unique error.
    As oracle is not able to insert your commit fails and stops your deletion of record from table

  • Delete records from tableA which are not in tableB

    Table A contains milions of records which is the best way to delete records from tableA which are not in tableB
    delete from tableA where empno not in (select empno from tableb)
    or
    delete from tableA where empno not exists (select empno from tableb
    where b.empno=a.empno)
    any help

    Hi
    If you can do this, do with this:
    create table tableC
    as select a.*
    from tableA a,
    (select empno from tableA
    minus
    select empno from tableB) b
    where a.empno = b.empno;
    drop table tableA;
    rename table tableC to tableA;
    Ott Karesz
    http://www.trendo-kft.hu

  • Delete recording from VSMS server

    In VSMS server, how can delete recording from storage? and can delete some of recording, like 1 hour from all recording or 1 day?

    Hello mshah,
    This is not recommended at all to delete recording files manually or for certain durations since every files has reference id created which are being associated to cameras.Deleting files in such can cause issue to the server.
    What is the reason behind deleting those files from server?
    Regards
    Nadeem Ahmed

  • How to delete record from table control in BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    Hi,
    While doing recording check for Filter button available for the table control, if it available then do the recording for the same.
    Once it is done while passing the data from internal table put the value into Filter field.
    Hope it resolves your issue.
    Thanks & Regards.
    Nagaraj Kalbavi

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

  • How to Restore deleted records in other table in oracle database 10g...

    Hi All,
    i want to restore deleted records of a particular table in other table
    suppose:
    i perform a query
    delete from emp
    where deptno =30;
    now i wont to restore deptno=30 records in other table, let say in emp1 table
    can any one let me know how to do it?
    Thanks..

    This is what flashback query is for:
    orclz> conn scott/tiger
    Connected.
    orclz> select count(*) from emp;
      COUNT(*)
            14
    orclz> delete from emp where deptno=30;
    6 rows deleted.
    orclz> commit;
    Commit complete.
    orclz> create table deleted30 as select * from emp as of timestamp(systimestamp - 5/1440) where deptno=30;
    Table created.
    orclz> select count(*) from deleted30;
      COUNT(*)
             6
    orclz>

Maybe you are looking for

  • UKM_BP additional information not getting saved.

    Hello Experts, We are implmenting FSCM Credit Management, wherein I need to enter information like collateral, guarantees etc in business partner. But when I try to save it in additional information in credit profile tab, it doesn't get saved once sa

  • Get week number for day from a list of days within a year..

    I am beginning in ORACLE / SQL and wondering how I can use this query to work with a column of Dates that span over a number of years? Ideally, I would like to use this script to add a number for the week of the year based on this. Then when a new ye

  • Third-party plugins and color cast

    Hello, When using DE:Noise or Magic Bullet Denoiser 2, I get a color cast on the whole image when it is applied simultaneously with a color correction via a Lumetri effect. I have tried everything inside Premiere regarding effect order, nesting, and

  • Install Adobe reader on a chromebook

    do you have a install program or a plug in for the chromebook

  • Display Each Section as Separate Sheet in EXCEL

    Hi, I have section report in WebI. My requirement is user want to see Each section in a separate sheet in excel .. How to acheive this? For Example: I am using REGION as a section. I need a excel output like Quote: REGION1 in Sheet1 REGION2 in Sheet2