Need sample pgm to delete entries

Hi experts ,
iam some prblm with transaction data .. so i want to delete these entries fro the table . what my question is ??
A  program should take input from flat file consisting of same structure as of table XYZ  table . NOW IT HAS TO DELETE ALL THE FLAT FILE ENTRIES FROM THE XYZ TABLE USING gUI_UPLOAD fUNCTION Module ??
Regs ,
Narayana Murthy

Hi
Do u want to delete all the data  after uploading???. If u want to upload u can tryu this way
you can use this FM
ALSM_EXCEL_TO_INTERNAL_TABLE
to upload data
TYPE-POOLS: truxs.
DATA: i_text_data       TYPE truxs_t_text_data,
      v_filename_string TYPE string.
DATA: BEGIN OF itab OCCURS 0,
        Name(30),
        Phone(15),
        Fax(500).
DATA: END OF itab.
PARAMETERS: p_file LIKE rlgrap-filename.
START-OF-SELECTION.
  v_filename_string = p_file.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                      = v_filename_string
      filetype                      = 'ASC'
      has_field_separator           = 'X'
*     HEADER_LENGTH                 = 0
*     READ_BY_LINE                  = 'X'
      dat_mode                      = ''
*   IMPORTING
*     FILELENGTH                    =
*     HEADER                        =
    TABLES
      data_tab                      = i_text_data
    EXCEPTIONS
      file_open_error               = 1
      file_read_error               = 2
      no_batch                      = 3
      gui_refuse_filetransfer       = 4
      invalid_type                  = 5
      no_authority                  = 6
      unknown_error                 = 7
      bad_data_format               = 8
      header_not_allowed            = 9
      separator_not_allowed         = 10
      header_too_long               = 11
      unknown_dp_error              = 12
      access_denied                 = 13
      dp_out_of_memory              = 14
      disk_full                     = 15
      dp_timeout                    = 16
      OTHERS                        = 17.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_field_seperator          = 'X'
*     I_LINE_HEADER              =
      i_tab_raw_data             = i_text_data
      i_filename                 = p_file
    TABLES
      i_tab_converted_data       = itab
    EXCEPTIONS
      conversion_failed          = 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.
reward all helpfull answers
Regards
Pavan

Similar Messages

  • Delete entries from the table

    Hi folks,
    I have delete program to delete entries from a custom table and has only one feld in it.
    tables: ZABC
    selection-screen begin of block B1 with frame title text-110.
    select-options: P_KOSTL for ZABC-KOSTL.
    selection-screen end of block B1.
    delete from ZABC where KOSTL in P_KOSTL.
    Upon executing I am entering certain cost center ids on the selection screen to delete them from the table.It did not work.
    what is it I am missing?
    Thanks,
    SK

    Hi,
    Try this sample code..Replace ZABC with your table..
    TABLES: ZABC.
    selection-screen begin of block B1 with frame title text-110.
    select-options: P_KOSTL for ZABC-KOSTL.
    selection-screen end of block B1.
    START-OF-SELECTION.
    * Delete the records from the table.
    DELETE FROM ZABC where KOSTL IN P_KOSTL[ ].  " [] for the select-options.
    IF sy-subrc <> 0.
      ROLLBACK WORK.
    ELSE.
      COMMIT WORK.
    ENDIF.
    Thanks,
    Naren

  • Is there any BAPI or function module  to delete entries from a table (VBAK)

    Hi Everybody,
    this is my first thread in SDN...
    my problem follows...
    A report is be created that selects all sales orders created by e-Sales that are more than 20 minutes old and still have a delivery block:
    tables:
    VBAK     sales document: header data
    selection fields:
    VBAK-LIFSK      &#8800;     <BLANK>
    VBAK-ERNAM     =     userID used by e-Sales / IVE
              (EP-BATCH / EAI-BATCH)
    VBAK-ERDAT      <=     Current system Date
    VBAK-ERZET     <=     Current system Time - 20 minutes
    These orders should be deleted from SAP system.
    This report should be scheduled to run regularly every 10 minutes.
    my doubt : is ther any BAPI or Function module to delete entries from a standard table...if no what is the way to delete the enteries from a std table...
    best replies will be rewarded....
    regards
    Reddy

    Hi Vasanth ,
    thanks for your reply.
    i tried in the same manner what u mentioned.
    but how to pass only one parameter to the functionmodule..
    here in this case we have to pass only update flag as 'D'..
    i did the same it giving dump..
    An exception occurred that is explained in detail below.                          
    The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was      
      not caught and                                                                   
    therefore caused a runtime error.                                                 
    The reason for the exception is:                                                  
    The call to the function module "BAPI_SALESORDER_CHANGE" is incorrect:                                                                               
    In the function module interface, you can specify only                            
    fields of a specific type and length under "ORDER_HEADER_INX".                    
    Although the currently specified field                                            
    "INT_ORDER_HEADER_INX" is the correct type, its length is incorrect.              
    my pgm :
    *& Report  YNEW_ORDER_DELETION
    REPORT  ynew_order_deletion.
    TABLES:vbak.
    PARAMETERS:
         p_lifsk LIKE vbak-lifsk DEFAULT '02'.
    SELECT-OPTIONS:
       s_lifsk FOR vbak-lifsk DEFAULT '10',
        s_ernam FOR vbak-ernam,
        s_erdat FOR vbak-erdat,"DEFAULT sy-datum.
        s_erzet FOR sy-uzeit.
    *PARAMETERS:
    p_erzet LIKE sy-uzeit.
       s_erdat like vbak-erdat,
       s_erzet like vbak-erzet.
    DATA:
       BEGIN OF int_final OCCURS 0,
            w_vbeln TYPE vbak-vbeln,
       END OF int_final.
    DATA:
      int_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    DATA: int_order_header_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE.
    DATA:
      wf_time TYPE sy-uzeit.
    INITIALIZATION.
      s_ernam-low = 'KULKARMA'.
      s_ernam-sign = 'I'.
      s_ernam-option = 'EQ'.
      APPEND s_ernam.
    s_ernam-low = 'EAI-BATCH'.
    s_ernam-sign = 'I'.
    s_ernam-option = 'EQ'.
    APPEND s_ernam.
    wf_time = sy-uzeit - 1200.
    p_erzet = sy-uzeit - 1200.
    p_erzet-low = wf_time.
    APPEND s_erzet.
      int_order_header_inx-updateflag = 'D'.
      APPEND int_order_header_inx.
    START-OF-SELECTION.
      SELECT vbeln FROM vbak
                       INTO TABLE int_final
                       WHERE lifsk EQ p_lifsk
                         AND ernam IN s_ernam
                         AND erdat IN s_erdat
                         AND erzet IN s_erzet.
      IF sy-subrc = 0.
        LOOP AT int_final.
          CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
            EXPORTING
              salesdocument         = int_final-w_vbeln
      ORDER_HEADER_IN             =
        order_header_inx            = int_order_header_inx
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
      LOGIC_SWITCH                =
      NO_STATUS_BUF_INIT          = ' '
            TABLES
              return                      = int_return
      ORDER_ITEM_IN               =
      ORDER_ITEM_INX              =
      PARTNERS                    =
      PARTNERCHANGES              =
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
      SCHEDULE_LINES              =
      SCHEDULE_LINESX             =
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      CONDITIONS_IN               =
      CONDITIONS_INX              =
      EXTENSIONIN                 =
        ENDLOOP.
        LOOP AT int_return.
          WRITE:/ int_return-type,
                  int_return-id,
                  int_return-number,
                  int_return-message.
        ENDLOOP.
      ENDIF.
    please help me ..its a very urgent issue to be solved...
    am waiting for ur reply...
    regards
    gangareddy

  • How to delete entries in the T030 table with LSMW?

    Hi all,
    I need to delete 600 entries from T030 table (Fix account table), Tcode OBYG, and I want to use a legacy for this,
    but I don´t know how or if is possible delete entries from a table with a legacy.
    Thanks in advance!

    You Can Use SCAT instead.

  • Delete entries in "Installed Updates" log

    Is there anyway to delete entries in the "Installed software updates" log?
    I want to reinstall a firmware patch but although the patch downloads and says it has installed successfully it doesn't actually update anything... However, it shows up in the "installed updates" log.
    Any one any ideas how to delete entries in the "Installed software updates" log?

    Why do you want to delete an entry from the log?
    What do you think that will achieve?
    How do you know it doesn't actually update anything?
    Why do you think you need to reinstall the patch?
    If you reinstall the patch but it doesn't need to be reinstalled
    then I would not expect anything to change.
    Dave

  • How to delete entries in COSP table?

    Dear experts
    How to delete the transactions posted in COSP table from my testing client.
    The reason is user has created wrong cost element and posted the transactions. But they don't want this as cost element.
    I have deleted entries in COEP table by running the program RKACOR20.
    After that I tried to delete the cost element. Now it is showing that  "Deletion is not possible (dependent records exist in table COSP)"
    Now  the question is how to delete these transaction posted to COSP table.
    Regards
    Kiran

    Hi Experts,
    I'm facing exactely the same issue on a customer system
    COEP line deleted via RKACOR20
    COSP total amount stil exist, need to be cleaned.
    Does it exist a program that read COEP to update COSP ?
    Any update ?
    Thanks a lot for your help.
    Best regards,
    Jean

  • Delete entries over 1 month old in parent  and child tables

    Hi guys,
    Im new to oracle (2days old) and im struggling to find out how to delete all entries over 1 month old in a database but also delete entries from the child table. I have read about delete cascading etc but im really strugging at the moment. Any tip or ideas? thank you

    You just need to delete data in parent table using the right WHERE clause that requires some timestamp column that stores data age. If the foreign key constraint is created with ON DELETE CASCADE child rows are automatically deleted.
    Assuming P is the parent table and C the child table and the timestamp column is stored in the parent table here is an example.
    SQL> create table p(px int primary key, d date);
    Table created.
    SQL> create table  c(cx int, cy int references p on delete cascade);
    Table created.
    SQL>
    SQL> insert into p values(1, '01/01/2011');
    1 row created.
    SQL> insert into p values(2, '15/01/2011');
    1 row created.
    SQL> insert into p values(3, '31/01/2011');
    1 row created.
    SQL> insert into c values(10,1);
    1 row created.
    SQL> insert into c values(20,2);
    1 row created.
    SQL> insert into c values(30,3);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> delete p where months_between(sysdate, d) >= 1;
    2 rows deleted.
    SQL>
    SQL> select * from p;
            PX D
             3 31-01-2011
    SQL> select * from c;
            CX         CY
            30          3
    SQL>Edited by: P. Forstmann on 15 févr. 2011 13:45

  • Need sample program OO abap alv using  hotspot( interactive report)

    need sample program on Object Oriented program using alv interactive report.

    *& Report Z8VM_N_PO_PRICING_CONDITION *
    REPORT Z8VM_N_PO_PRICING_CONDITION NO STANDARD PAGE HEADING
    MESSAGE-ID Z8VM.
    vivekanand meghmala
    trial assignment
    po with pricing condition interactive report with checkbox
    data declaration
    TYPES : BEGIN OF STRUCT_EKKO, "po header
    BUKRS LIKE T001-BUKRS,
    EBELN LIKE EKKO-EBELN,
    BSART LIKE EKKO-BSART,
    BEDAT LIKE EKKO-BEDAT,
    EKORG LIKE EKKO-EKORG,
    WAERS LIKE EKKO-WAERS,
    LIFNR LIKE EKKO-LIFNR,
    KNUMV LIKE EKKO-KNUMV,
    END OF STRUCT_EKKO.
    TYPES : BEGIN OF STRUCT_EKPO, "po details
    EBELN LIKE EKPO-EBELN,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    END OF STRUCT_EKPO.
    TYPES : BEGIN OF STRUCT_KONV,
    KNUMV LIKE KONV-KNUMV,
    KPOSN LIKE KONV-KPOSN,
    KSCHL LIKE KONV-KSCHL,
    KAWRT LIKE KONV-KAWRT,
    KBETR LIKE KONV-KBETR,
    END OF STRUCT_KONV.
    DATA : IT_EKKO TYPE STANDARD TABLE OF STRUCT_EKKO WITH HEADER LINE.
    DATA : IT_EKPO TYPE STANDARD TABLE OF STRUCT_EKPO WITH HEADER LINE.
    DATA : IT_KONV TYPE STANDARD TABLE OF STRUCT_KONV WITH HEADER LINE.
    PARAMETERS : T_BUKRS LIKE EKKO-BUKRS .
    SELECT-OPTIONS : S_BEDAT FOR IT_EKKO-BEDAT.
    SELECT-OPTIONS : S_EKORG FOR IT_EKKO-EKORG.
    validations
    AT SELECTION-SCREEN.
    IF T_BUKRS = ' '.
    MESSAGE E009.
    ENDIF.
    SELECT BUKRS FROM T001
    INTO CORRESPONDING FIELDS OF IT_EKKO
    WHERE BUKRS = T_BUKRS.
    EXIT.
    ENDSELECT.
    IF SY-SUBRC 0.
    MESSAGE E001.
    ENDIF.
    logic
    START-OF-SELECTION.
    SELECT BUKRS
    EBELN
    BSART
    BEDAT
    EKORG
    WAERS
    LIFNR
    KNUMV FROM EKKO INTO CORRESPONDING FIELDS OF TABLE IT_EKKO
    WHERE BUKRS = T_BUKRS
    AND BEDAT IN S_BEDAT
    AND EKORG IN S_EKORG.
    SELECT EBELN
    EBELP
    MATNR FROM EKPO INTO CORRESPONDING FIELDS OF IT_EKPO
    FOR ALL ENTRIES IN IT_EKKO WHERE EBELN = IT_EKKO-EBELN.
    APPEND IT_EKPO.
    ENDSELECT.
    LOOP AT IT_EKPO.
    SELECT KNUMV
    KPOSN
    KSCHL
    KAWRT
    KBETR FROM KONV INTO CORRESPONDING FIELDS OF IT_KONV
    WHERE KPOSN = IT_EKPO-EBELP.
    APPEND IT_KONV.
    ENDSELECT.
    ENDLOOP.
    *data printing
    LOOP AT IT_EKKO.
    WRITE :/ IT_EKKO-BUKRS,IT_EKKO-EBELN,IT_EKKO-BSART,IT_EKKO-BEDAT,
    IT_EKKO-EKORG,IT_EKKO-WAERS,IT_EKKO-LIFNR,IT_EKKO-KNUMV.
    LOOP AT IT_EKPO WHERE EBELN = IT_EKKO-EBELN.
    WRITE :/ IT_EKPO-EBELP,IT_EKPO-MATNR.
    LOOP AT IT_KONV.
    WHERE KPOSN = IT_EKPO-EBELN.
    WRITE :/ IT_KONV-KNUMV COLOR 3,IT_KONV-KPOSN COLOR 3,IT_KONV-KSCHL COLOR 3,IT_KONV-KAWRT COLOR 3,IT_KONV-KBETR COLOR 3.
    ENDLOOP.
    ENDLOOP.
    ENDLOOP.[/code]
    thanks
    reward if helpful

  • Sun directory db files continue to grow after deleting entries

    Hello,
    Sun-Java(tm)-System-Directory/6.3.1
    with
    * Messaging Server (64bit) 7u3 (7.3-11.01)
    * Comms DSsetup 6.4 (6.4-5.05)
    * Convergence 1u3 (1.0-10.01)
    I have to load a large quantity of entries ~59000 into the directory on a regualar basis for an AddressBook.
    This requires deleting the entire content using ldapdelete and then reloading.....
    I have noticed that the directory is getting bigger all the time... so I did "dsadm export" and I see the deleted entries still there....
    This is causing us a problem , since administrative commands e.g. "msuserpurge" timeout, since they are working on the same suffix ... (I just load the AddressBook into the suffix so that it appears in Convergence)... Every time I delete and reload the data I have to increase "dsconf set-server-prop look-through-limit:" up another 59000 or so...
    Any pointers would be welcomed, especially on how to completely remove the entries to keep the database small.....
    Cheers,
    Paul

    You can try the DB Compaction tool, though I'm not sure if 6.3.1 has it or you'd need to upgrade.
    Really, your Address Book should be in its own backend. Most Messaging deployments eventually put the address book on its own Directory servers. Access patterns and data characteristics for address book are totally different from the Message Store or MTA. It just doesn't scale the same way. You will not be able to tune a single directory instance to support all of these components optimally.
    Completely deleting and readding the same DNs is a terribly inefficient way to update your address book. If you have the PiServerDB in its own backend (which is, I believe, the way dssetup does things), you can simply reimport the DB. Otherwise you ought to be generating a diff file and applying that, rather than deleting and readding the bulk of the database. We had a thread {thread:id=2156737} about how to do this a while ago.

  • Calender automatically deletes entries even when set to "keep forever"

    Help!! I'm a new blackberry curve owner, and I am very dependant on my calender. It's just started deleting past entries (anything over 24 hours) even though my settings are to "keep forever". I have contacted my service provider and they said it's because I've run out of memory and calender entries and text messages are low priority. Is there anyway to ensure they don't get deleted? Is there anything I can do (other then set the texts to keep for only 15 days - already done) to ensure I always have enough memory? Is there anyway to recover my deleted entries? I don't have it synched to my computer or outlook. Much thanks!

    Deleted messages that are not synced are gone. I am sorry. Please go to options > status > and post your file free. It is VERY likely this is your issue.
    To free up memory make sure that your pictures are on a media card, that you remove any messages/MMS you dont need, delete unused applications, etc.
    If you are the original poster (OP) and your issue is solved, please remember to click the "Accept as Solution" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the Star on the left of their post.

  • Recover deleted entries from ztable

    Hi
    is there any best method to recover the deleted entries from ztable?

    Hi Vahi,
    1. Find out the exact time when the data has been deleted.        
    2. Restore THE WHOLE DATABASE on any other server with MSSQL server
    running on that. You should not restore the database completely,  
    rather using "Point-in-time" recovery method. Appoint the time from
    the p.1 minus 5 minutes as the end point of the database recovery.
    Please refer to the note 193816 for more information.             
    3. Now the old content of the table ZRATE is there. You can       
    export the data and then import them into the produtive system.   
    Afterwards you can delete the restored database, it is not needed 
    anymore.                                                                               
    Thanks!
    Anusha

  • Unable to delete entries from queue (SMQ2)

    Hi
    I am unable to delete entries from inbound queue due to number of entries are too high (Approximately 160,000). Deletion in dialog mode producing timeout error...Is there any way to delete these entris in background mode or any other idea about this situation..
    Your valuable time & annswer appreciated.
    Thanks
    Rakesh

    Hi Rakesh,
       Check these threads on SMQ2. It may give some help to you:
       Queue issue
       deleting the inbound queue tc smq2
       Also check this file:
      http://help.sap.com/saphelp_nw04s/helpdata/en/d9/b9f2407b937e7fe10000000a1550b0/frameset.htm
    Regards,
    Subhasha Ranjan

  • I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. don't need the caps/lock or ctrl key and due to an injury my daughter can only use her left hand to type. She is using a text to speech app to verbaliz

    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini. I don't need the caps/lock or ctrl key. Due to a brain injury my daughter can only use her left hand to type. She also uses a text to speech app to verbalize all of her needs since her speech isn't intelligible any longer either. And her vision was significantly affected also, so the keyboard has to be mounted about 6 inches from her face. So to reach across the keyboard with her left hand to the right side delete and enter button is physically difficult and causes typing errors, which cause people to not understand what shes trying to say.
    The best keyboard so far is the Zagg folio mini. I just had to make stickers to enlarge the letters on the key buttons.
    Does anyone know how I can reprogram these two keys? Or where I can buy a wireless mini keyboard for Ipad made for lefthanders with these two functions on the left side. I have searched for days and days. It's sooooo important to me that she be able to contribute her voice again. Imagine if you got in a car accident and couldn't speak clearly any longer, but understood everything still. Thanks for any help and suggestions you all take the time to share with me. I really appreciate the kindness of strangers to help me help my daughter.
    Sami's mom

    Sami\'s mom wrote:
    I need to reprogram the delete and enter key to the left side of a external keyboard for the ipad mini.
    You cannot.

  • I have brought a iphone 4 and the person i brought it from has not deleted her icloud account i need her pasword to delete it but hse wont give it to me what can i do how can i add my icloud account can you give me a reasonable answer please. thank you

    i have brought a iphone 4 and the person i brought it from has not deleted her icloud account i need her pasword to delete it but hse wont give it to me what can i do how can i add my icloud account can you give me a reasonable answer please. thank you.

    The seller needs to follow this procedure:
    http://support.apple.com/kb/TS4515
    If she refuses, then as Tim suggested the iPhone is probably stolen. You'll need to contact your local police department and ask how to proceed.
    Regards.

  • I need the code to delete record in the database not in the form???

    I need the code to delete record in the database not in the form...
    because when i execute a form always insert the datas in the data base but i want insert value on a text file and delete in the data base the record whith this value of text file.
    i'm spanish an my english is bad sorry.
    thank, javier

    Well, I fail to understand why you want to complicate easy things, but anyway you can do that by using TEXT_IO within Forms to create text file (see Forms builder help), and UTL_FILE package to read it within Pl/Sql : you could create a stored procedure, and call it from Forms passing the file name as parameter. See UTL_FILE documentation

Maybe you are looking for

  • New Feature to Me:  Ability to Enlarge Album Art on Screen

    I own the ORIGINAL iPod. I bought the Nano and have noticed something that is NEW to me, but you may all know about. I noticed how small the Nano screen is. Album Art is really small. I was listening to a Inside Mac Radio Podcast. Many podcasts now h

  • [Locked: repeating post bug] Can't save jpg due to program error

    Saw some answers in a post I now can't locate... I can save a psd to tiff, but can save nothing to jpg, which gives the message above. It's very annoying. I run Cocktail and Diskwarrior fairly regularly, which usually sorts things like this out, but

  • Vendors Dunning - Due Items

    Hi Experts, Can any suggest me how the vendor Invoice Open items and Credit memo items are selected for Dunning. I have the below scenario. There is a invoice and a credit memo posted to a venodr account which are overdue and the overal balance is De

  • Windows 7 will not recognize the dvd drive in my dv9925nr

    Windows will not recognize my dvd drive in Windows 7. It shows up under device manager under cd drives, but will not list in in my computer and will not recognize it as a drive in burning applications.

  • LR no longer reading raw files

    Had the operating system of my Macbook cleared, then reinstalled my copy of LR3. After first import from Nikon 7000, received message that raw files of this camera are not compatible with my LR. Puzzling, for I have loaded on this computer with this