Ldif2db command fails to import data and deletes the root node

ldif2db command fails to import data into LDAP.
The command used was
ldif2db -n userRoot -s "dc=example,dc=com" -i test.ldif
The test.ldif conains the nodes under dc=example,dc-com
eg: ou=test,dc=example,dc=com
But on executing the command the root node "dc=example,dc=com" itself got deleted. The console output was like "Skipping entry uid=test001,ou=test,dc=example,dc=com" for all the entries present in ldif.
What might be the reason for this ? Any clues ?
The reason y i am trying to do this ldif2db is to preserve the createtimestamp and modifytimestamp while migrating data from one Directory Server to another. Any other ways of doing it ?

ldif2db is the right command to migrate data and preserve those attributes like createtimestamp and modifytimestamp.
However, when this command is used, it will first remove everthing before it load whatever you want. So you need to be very careful. I got this terrible problem as well.
In my experience, if you use this command, don't use "-s". You can just use:
ldif2db -n suffixName -i test.ldif
If you only have one suffix (database), then you can use "-n userRoot".
Also, if you migrate your data from server A to server B, you'd better dump the data using db2ldif -n userRoot -a test.ldif from server A. Then load it into server B using ldif2db -n userRoot -i test.ldif.

Similar Messages

  • Transferring data and deleting the old

    I want to get a new 5th gen. Ipod and I was wondering if your able to transfer data to the newer ipod? And if your able to delete the old ipod from the itunes account.

    In one catalog, select File->Import from Catalog and point it to a different catalog. Repeat until all catalogs are imported into the first catalog.
    After you check the contents of the master catalog, and are sure they have everything you want, you could delete the old ones. I'd still makes backups of every catalog just in case.

  • Command or script to identify and delete the bitlocker partition

    I am looking for some command or script to identify the bitlocker partition and delete it. Please let me know if anybody has any suggestions.

    Hi,
    I just want to know why you want to delete the BitLocker partition? If you mean the system reserved partition, it is not recommended to do like this, this partition contains not only the BitLocker component, but also the boot files. Deleting it would lead
    into system startup failure.
    Alex Zhao
    TechNet Community Support

  • Crystal Reports 2008 failed to retrive data, and instead deleted it.

    I have been using crystal reports 2008 for the past year or so with our billing software through an OBDC data source. I was using xp pro sp3. However I recently upgraded to a new computer running xp pro sp3 as well, and now I am having some serious issues.
    When I try to connect to a data source in the database expert, it shows all the tables, and then the field explorer shows the fields, but when I actually try to brows the data, view a preview, verify the database, or refresh an old report it gives me an error and DELETES the .dat file that the field was located in. I am so glad I have regular backups to restore too, because pulling a report nuked 5 .dat files.
    The errors I am getting are as follows:
    "Failed to retrieve data from database."
    Clicked ok
    "Failed to retrieve data from database."
    Clicked ok
    "Database Connector Error: 'HY000:[Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager]The file cannot be created with Variable-trail Allocation Tables (VATs)(Btrieve Error 105)'"
    Clicked ok
    "Failed to retrieve  data from database.
    Details:HY000:[Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface]Unable to open table: <nameoftable>"
    Click ok
    and Crystal stays open but has just deleted the .dat file that the table was located in. It will still show the fields but  no data. Trying to open the other software leads to an error "missing <name of table>.dat" It then has to be restored from a backup.
    I have tried updating crystal as well as fully uninstalling it and reinstalling it, we have created a new ODBC connection, and cloned the database for testing purposes. The same thing occurs with the new database and ODBC data source.
    We have no other computers, except my old one that has crystal reports on it. I have tried the old computer again and it is working fine.
    Does anyone have an suggestions? This is pretty critical. Thanks in advance.
    Edited by: Russellk on Jan 13, 2010 8:27 PM

    Hello, you could try turning on ODBC tracing to see if it logs anything. It's a pain to get going but here's how.
    Go to ODBC Admin, Click on the Tracing tab and create a log file and save. Don't start tracing yet. Close the ODBC admin and then re-open it and then turn tracing on. You may have to do this a few times to get it working.
    Once it's tracing then open CR and try the demo data. Then close the report, log off, log onto the real data and do the same with a new report. You'll see a bunch of ODBC API's but there may be one or 2 that don't look right or errors may be logged compared to the DEMODATA.
    Another suggestion is it may not be your PC doing the deleting. Maybe the Server thinks you have infected the data files and it's deleting them. Have a look in anti-virus quarantine logs on the server to see if it's doing the nasty....
    Check the trust between your PC and the server.
    I've also seen this type of odd behaviour with corrupted Profiles. Check with your IT guys on creating a new one for you, it's apain because you loose everything on your work station.
    What happens if you log on from another PC using your account? Does that also delete the files? Or get someone else who it does work for log into your PC, does that work? If so it may be your Profile is either not trusted or it's been corrupted.
    Good luck
    Don

  • I have a password problem. After importing data and settings from one MacBook Pro to a new one, I have to put my iCloud password in when re-starting, but the password from the old computer in when waking the computer from sleep.

    I have a password problem. After importing data and settings from one MacBook Pro to a new one, I have to put my iCloud password in when re-starting the new computer, but the password from the old computer in when waking the computer from sleep. I want to use my iCloud password on both computers consistently. How can I fix this?

    The only other place to change a password for the computer login is in Users & Groups preferences. But I don't really know enough here to fix your problem. You can try fixing the keychain:
    iCloud- Frequently asked questions about iCloud Keychain
    Tutorial: Resolving Keychain Issues
    If you can't access your keychain, or forget your password If you can't get into your keychain file because you've forgotten your password or the keychain file appears to be corrupt, there are a couple of options.
    First, if you've forgotten your password, you can use the "Keychain First Aid" utility to make the keychain password the same as the login password. This can be accomplished via the following process:
      1. Open Keychain Access (located in Applications/Utilities)
      2. Go to the "Keychain Access" menu and select "Preferences"
      3. Click the "First Aid" tab
      4. Make sure the "Synchronize login keychain password" box is checked
      5. Close the Preferences window
      6. Go to the "Keychain Access" menu and select "Keychain First Aid"
      7. Enter your username and password
      8. Click the "Repair" button
    The second option is to completely delete your keychain then recreate it. This routine is useful if your keychain appears to be corrupt or otherwise inaccessible. This can be accomplished as follows:
      1. Launch Keychain Access (located in Applications/Utilities)
      2. Click "Show Keychains" in the lower-left corner of the window.
      3. Select the problematic keychain from the left-hand pane.
      4. Navigate to the "File" menu and select "Delete Keychain '(name of keychain)'"
      5. Check all options for deletion and press "OK"
      6. Create a new keychain by going to the "File" menu, then "New" and selecting
          "New Keychain"
      7. You can now make this keychain your default if you desire by selecting it, then
          going to the "File" menu and selecting "Make '(name of keychain)' Default"
    Login as root and perform repair In some cases, problems with keychains can only be resolved when logged in as the root user.
    First, you want to enable the root user:
      1. OS X Mountain Lion: Enable and disable the root user
      2. OS X Lion: Enable and disable the root user
      3. Mac OS X 10.6: Enabling the root user
      4. Enabling and using the "root" user in Mac OS X
    After enabling the root user, and logging in under this account, again open Keychain Access. First attempt repairs using Keychain First Aid, and failing that, delete then recreate the keychain as described above while logged in as root.
    Persistently asked for stored passwords If you are persistently asked for passwords in various applications that you have specified should be remembered in a keychain, your "login" keychain may not be active for one reason or another.
    Navigate to ~/Library/Keychains/ (this is the Library folder inside your user's home folder). Find the file named "login.keychain" and double-click it.
    Failing that, select the "login" keychain within the Keychain Access application and make sure it is the default keychain by going to the "File" menu and selecting "Make 'Login' Default"
    Turn off Keychain synchronization in applications having problems If specific applications are experiencing issues when accessing password-protected material, the Keychain may be to blame.
    The above comes from an article published on MacFixit.com.

  • OFI_AP_4  Delete all data and REINIT the load to FIAP ODS and Cube

    Hi bw GURUS I need a quick help, I have requirement to Delete all data and REINIT the load to FIAP ODS and Cube  i have data source ofi_ap_4, please tell me what should i do as i know LO extraction but whats is the transaction code to run the set job for FIAP like for Purchasing I have OLI3BW now tell me what will be the steps to reinit the load to fiap ods and cube.
    i know this much as below
    Delete the data from cube and ODS
    Delete the Init in Cube AND ods NOW reinit i mean load the init, but now problem is before doing that i need to run the set up job or tell me what are the steps please
    its very important since i am doing in production
    thanks
    Soniya

    You are right by your approach to update from PSA to ODS as u have wrritten before. Just got to PSA tree select the PSA request and choose update Immediatly or scedule for update.
    (and if u have 0FI_GL_4 but u r not using it ..it is fine. I  was telling that in case u have that and you are trying to use somethin with 0FI_AP_4)

  • Conversion failed when converting date and/or time from character string

    Hi experts,
    I'm trying running a query in Microsoft Query but it gives the following error message:
    "conversion failed when converting date and/or time from character string"
    when asks me the data I'm inserting 31-01-2014
    i've copy the query form the forum:
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number',
         CASE  WHEN T0.TransType=13 THEN 'Invoice'
              WHEN T0.TransType=14 THEN 'Credit Note'
              WHEN T0.TransType=30 THEN 'Journal'
              WHEN T0.TransType=24 THEN 'Receipt'
              END AS 'Document Type',
         T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')<=-1),0) 'Future'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
    WHERE (T0.MthDate IS NULL OR T0.MthDate > ?) AND T0.RefDate <= ? AND T1.CardType = 'C'
    ORDER BY T1.CardCode, T0.DueDate, T0.Ref1

    Hi,
    The above error appears due to date format is differnt from SAP query generator and SQL server.
    So you need convert all date in above query to SQL server required format.
    Try to convert..let me know if not possible.
    Thanks & Regards,
    Nagarajan

  • Error "Conversion failed when converting date and/or time from character string" to execute one query in sql 2008 r2, run ok in 2005.

    I have  a table-valued function that run in sql 2005 and when try to execute in sql 2008 r2, return the next "Conversion failed when converting date and/or time from character string".
    USE [Runtime]
    GO
    /****** Object:  UserDefinedFunction [dbo].[f_Pinto_Graf_P_Opt]    Script Date: 06/11/2013 08:47:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE   FUNCTION [dbo].[f_Pinto_Graf_P_Opt] (@fechaInicio datetime, @fechaFin datetime)  
    -- Declaramos la tabla "@Produc_Opt" que será devuelta por la funcion
    RETURNS @Produc_Opt table ( Hora datetime,NSACOS int, NSACOS_opt int)
    AS  
    BEGIN 
    -- Crea el Cursor
    DECLARE cursorHora CURSOR
    READ_ONLY
    FOR SELECT DateTime, Value FROM f_PP_Graficas ('Pinto_CON_SACOS',@fechaInicio, @fechaFin,'Pinto_PRODUCTO')
    -- Declaracion de variables locales
    DECLARE @produc_opt_hora int
    DECLARE @produc_opt_parc int
    DECLARE @nsacos int
    DECLARE @time_parc datetime
    -- Inicializamos VARIABLES
    SET @produc_opt_hora = (SELECT * FROM f_Valor (@fechaFin,'Pinto_PRODUC_OPT'))
    -- Abre y se crea el conjunto del cursor
    OPEN cursorHora
    -- Comenzamos los calculos 
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    /************  BUCLE WHILE QUE SE VA A MOVER A TRAVES DEL CURSOR  ************/
    WHILE (@@fetch_status <> -1)
    BEGIN
    IF (@@fetch_status = -2)
    BEGIN
    -- Terminamos la ejecucion 
    BREAK
    END
    -- REALIZAMOS CÁLCULOS
    SET @produc_opt_parc = (SELECT dbo.f_P_Opt_Parc (@fechaInicio,@time_parc,@produc_opt_hora))
    -- INSERTAMOS VALORES EN LA TABLA
    INSERT @Produc_Opt VALUES (@time_parc,@nsacos, @produc_opt_parc)
    -- Avanzamos el cursor
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    END
    /************  FIN DEL BUCLE QUE SE MUEVE A TRAVES DEL CURSOR  ***************/
    -- Cerramos el cursor
    CLOSE cursorHora
    -- Liberamos  los cursores
    DEALLOCATE cursorHora
    RETURN 
    END

    You can search the forums for that error message and find previous discussions - they all boil down to the same problem.  Somewhere in your query that calls this function, the code invoked implicitly converts from string to date/datetime.  In general,
    this works in any version of sql server if the runtime settings are correct for the format of the string data.  The fact that it works in one server and not in another server suggests that the query executes with different settings - and I'll assume for
    the moment that the format of the data involved in this conversion is consistent within the database/resultset and consistent between the 2 servers. 
    I suggest you read Tibor's guide to the datetime datatype (via the link to his site below) first - then go find the actual code that performs this conversion.  It may not be in the function you posted, since that function also executes other functions. 
    You also did not post the query that calls this function, so this function may not, in fact, be the source of the problem at all. 
    Tibor's site

  • SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)

    SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)
    SELECT    
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO AS T0 LEFT OUTER JOIN
                          VPM2 AS T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
         OVPM AS T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1 AS T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate>='[%0]' and T0.DocDate<='[%1]'

    Hi,
    Try this:
    SELECT   
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO  T0 LEFT OUTER JOIN
                          VPM2  T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry
    LEFT OUTER JOIN
         OVPM  T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1  T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate >= '[%0]' and T0.DocDate <='[%1]'
    group by T0.DocStatus,T0.DocDate ,
    T0.DocNum ,
    T0.NumAtCard,
    T0.TransId ,
    T0.Comments ,
    T0.CardCode,
    T0.CardName ,
    T0.WTSum ,
    T3.DueDate ,
    T3.CheckSum
    Thanks & Regards,
    Nagarajan

  • Why is the folder strukture based on the import date, and not on the Creation date? How can i setting this?

    Why is the folder strukture based on the import date, and not on the Creation date? How can i setting this?

    What folder structure?
    If you're referring to how Aperture stores the originals in a managed library then the answer is you can't change it.
    If having the originals stored in a specific file structure is important to you you will need to switch to a referenced original setup.

  • I downloaded pics from my camera to iphoto, forgot to click 'import all' and closed iphoto and deleted the pics from the camera. is there any way to retireve these pics?

    I downloaded pics from my camera to iphoto on my macbook pro and forgot to click 'import all. Then i closed iphoto and deleted the pics from the camera. i know I'm screwed, but i'll give this a try, is there any way to retireve these pics?

    Use an app like MediaRecover to get the pics back from the card.

  • HT201302 I imported the photos from my camera rool to my computer and deleted the majority of them from my iPhone 5, however it still is telling me i have a large amount on the camera roll.  Why isn't the size reduced?

    I imported photos from my camera roll to my computer and deleted the majority of them from my iPhone5, however the size of my camera rooll did not change.  Why?? 

    If you have photo stream set up, that can take up a large amount of room, so check that too. And videos take up much more space than photos.

  • I have two iphone wich are protected by two different password ! but when i woke up today ! i'v found that my two iphone ( iphone 5 et iphone 4 ) refuse my passwords of 4 numbers i have important data and i dont want to lose please help me ! thank you !

    i have two iphone wich are protected by two different password ! but when i woke up today ! i'v found that my two iphone ( iphone 5 et iphone 4 ) refuse my passwords of 4 numbers i have important data and i dont want to lose please help me ! thank you !

    If you forgot (or don't know) your passcode, restore the device from backup on the last computer it was synced with when the passcode was turned on... this will remove the passcode. If you do not have access to the last computer it was synced with, or you don't have a backup, you will have to force it into recovery mode & restore as a new device.
    See this for more info... http://support.apple.com/kb/HT1212

  • Comparing two internal tables and deleting the record not present in second

    Hi All,
    I have a internal table itaba with PERNR as primary key and various other columns (1000 records) and table B with PERNR as primary key and 800 records.
    Now what is the best way to compare these two and delete the record from table A when its corresponding record is not present in table B?
    Thanks and Regards,
    Mohan

    HI SIR
    u trained us in accenture
    Hi all
    when ever m running this session in SM35 , M getting error as :
    "LEAVE TO TRANSACTION" MARA-BISMT is not allow
    in batch input
    REPORT YASEC_BDC_NIK_SESSION
    no standard page heading
    message-id zmm
    line-count 65
    line-size 150.
    tables : mara.
    *Top includr program
    INCLUDE YNEW_MAIN_TOP.
    *include yasec_bdc_nik_session_top.
    ***********selection screen *******************
    selection-screen begin of block b1 with frame title text-001.
    selection-screen skip.
    PARAMETERS: p_ifile(128) TYPE c .
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: rad1 TYPE c RADIOBUTTON GROUP 1 USER-COMMAND gr1,
    rad2 TYPE c RADIOBUTTON GROUP 1 .
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_sess TYPE c.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK b1.
    Subroutine call***************************
    INCLUDE YNEW_MAIN_F01.
    *include yasec_bdc_nik_session_f01.
    *********At selection event triggered *************
    at selection-screen on value-request for p_ifile.
    To get F4 help for the input file path
    PERFORM f_f4_input_file.
    AT SELECTION-SCREEN ON p_ifile.
    To validate and upload the input file
    PERFORM f_load_file.
    AT SELECTION-SCREEN ON p_sess.
    To validate the Number of Sessions field
    IF rad2 IS NOT INITIAL AND sy-ucomm EQ c_onli.
    PERFORM f_check_sessions.
    ENDIF.
    ***********Start of selection *******************
    start-of-selection.
    *To process BDC
    PERFORM f_process_bdc.
    TOP OF PAGE
    TOP-OF-PAGE.
    Writes the report heading and for displaying line number.
    PERFORM f_report_header.
    TYPES : BEGIN OF t_final,
    matnr(50) TYPE c,
    bismt(18) type c,
    end of t_final.
    TYPES: BEGIN OF t_fdata,
    data(256) TYPE c,
    END OF t_fdata.
    TYPES: BEGIN OF t_error,
    message(100) TYPE c,
    END OF t_error.
    *Internal table declarations
    *Internal table to load the data from the file that is changed throgh BDC
    DATA : i_final TYPE STANDARD TABLE OF t_final,
    wa_final TYPE t_final.
    *Internal table to store the error messages
    DATA : i_error TYPE STANDARD TABLE OF t_error,
    wa_error TYPE t_error.
    *Internal table to load the raw data
    DATA : i_fdata TYPE STANDARD TABLE OF t_fdata,
    wa_fdata TYPE t_fdata.
    *Internal table to store records of BDC
    DATA : i_bdcdata TYPE STANDARD TABLE OF bdcdata INITIAL SIZE 0,
    wa_bdcdata TYPE bdcdata.
    Internal table to store BDC messages
    DATA: i_bdcmsgcoll TYPE STANDARD TABLE OF bdcmsgcoll INITIAL SIZE 0,
    wa_bdcmsgcoll TYPE bdcmsgcoll.
    VARIABLE DECLARATIONS
    DATA: v_ifile TYPE string,
    v_input TYPE i,
    c_delimiter TYPE c VALUE 'X',
    v_mode TYPE c VALUE 'A',
    v_sessions TYPE i.
    CONSTANTS
    CONSTANTS : c_flagx TYPE c VALUE 'X',
    c_slash TYPE c VALUE '/',
    c_onli(4) TYPE c VALUE 'ONLI',
    c_vl02(4) TYPE c VALUE 'VL02',
    c_s TYPE c VALUE 'A'.
    FORM f_f4_input_file .
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    IMPORTING
    file_name = p_ifile.
    ENDFORM. " f_f4_input_file
    *& Form f_load_file
    FORM f_load_file .
    v_ifile = p_ifile.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = v_ifile
    filetype = 'ASC'
    has_field_separator = 'X'
    TABLES
    data_tab = i_fdata
    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.
    *Text-103-Input file does not exist.
    MESSAGE e000 WITH text-103 .
    ELSEIF NOT i_fdata IS INITIAL.
    DELETE i_fdata WHERE data = space.
    DESCRIBE TABLE i_fdata LINES v_input.
    ENDIF.
    IF v_input EQ 0.
    Text-104 - Input file is empty.
    MESSAGE e000 WITH text-104 .
    ENDIF.
    ENDFORM. " f_load_file
    *& Form f_check_sessions
    FORM f_check_sessions .
    IF p_sess IS INITIAL.
    MESSAGE e000 WITH text-106.
    ELSE.
    v_sessions = v_input DIV p_sess.
    ENDIF.
    ENDFORM. " f_check_sessions
    *& Form f_process_bdc
    text
    FORM f_process_bdc.
    LOOP AT i_fdata INTO wa_fdata.
    SPLIT wa_fdata AT cl_abap_char_utilities=>horizontal_tab
    INTO wa_final-matnr
    wa_final-bismt.
    APPEND wa_final TO i_final.
    CLEAR wa_fdata.
    ENDLOOP.
    IF rad1 = c_flagx.
    PERFORM f_passbdc_vl02.
    ELSEIF rad2 = c_flagx.
    PERFORM f_sessions_vl02.
    ENDIF.
    ENDFORM. "f_process_bdc
    To populate the Screen information
    p_program Program Name
    p_dynpro Screen Number
    FORM bdc_dynpro USING p_program TYPE any
    p_dynpro TYPE any.
    CLEAR wa_bdcdata.
    Populate the BDC structure with the Screen Information.
    Move the Program name PROGRAM
    wa_bdcdata-program = p_program.
    Move the Screen Number DYNPRO
    wa_bdcdata-dynpro = p_dynpro.
    Indicate the beginning of a new screen
    wa_bdcdata-dynbegin = c_flagx.
    APPEND wa_bdcdata TO i_bdcdata.
    ENDFORM. "f_bdc_dynpro
    *& Form f_passbdc_vl02
    text
    FORM f_passbdc_vl02.
    DATA: l_lines_im TYPE i.
    SORT i_final BY matnr ASCENDING.
    CLEAR wa_final.
    LOOP AT i_final INTO wa_final.
    CLEAR: i_bdcmsgcoll[],
    wa_bdcmsgcoll,
    wa_bdcdata.
    CLEAR: i_bdcdata[].
    perform bdc_dynpro using 'SAPLMGMM' '0060'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RMMG1-MATNR'
    wa_final-matnr.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
    'X'.
    perform bdc_dynpro using 'SAPLMGMM' '4004'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'BDC_CURSOR'
    'MARA-BISMT'.
    perform bdc_field using 'MARA-BISMT'
    wa_final-bismt.
    perform bdc_dynpro using 'SAPLSPO1' '0300'.
    perform bdc_field using 'BDC_OKCODE'
    '=YES'.
    perform bdc_transaction using 'MM02'.
    perform bdc_dynpro using 'SAPLMGMM' '0060'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPLMGMM' '4004'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_dynpro using 'SAPLSPO1' '0300'.
    perform bdc_field using 'BDC_OKCODE'
    '=YES'.
    perform bdc_transaction using 'MM03'.
    CALL TRANSACTION 'MM02' USING i_bdcdata
    MODE v_mode
    UPDATE c_s
    MESSAGES INTO i_bdcmsgcoll.
    If error occurred in call transaction 'VA02' then stores all
    information of failed records into internal table i_error_im.
    IF sy-subrc NE 0.
    DESCRIBE TABLE i_bdcmsgcoll LINES l_lines_im.
    CLEAR wa_bdcmsgcoll.
    READ TABLE i_bdcmsgcoll INTO wa_bdcmsgcoll INDEX l_lines_im.
    To capture success and error messages in BDC.
    CALL FUNCTION 'FORMAT_MESSAGE' "#EC *
    EXPORTING
    id = wa_bdcmsgcoll-msgid
    lang = wa_bdcmsgcoll-msgspra
    no = wa_bdcmsgcoll-msgnr
    v1 = wa_bdcmsgcoll-msgv1
    v2 = wa_bdcmsgcoll-msgv2
    v3 = wa_bdcmsgcoll-msgv3
    v4 = wa_bdcmsgcoll-msgv4
    IMPORTING
    msg = wa_error-message
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    ENDIF.
    ELSE.
    WRITE: text-111 COLOR 7.
    ENDIF.
    CLEAR: wa_final.
    REFRESH i_bdcdata.
    ENDLOOP.
    ENDFORM. "f_passbdc_va02
    *& Form bdc_field
    text
    -->P_FNAM text
    -->P_FVAL text
    FORM bdc_field USING p_fnam TYPE any
    p_fval TYPE any.
    CLEAR wa_bdcdata.
    Populate the Field Name
    wa_bdcdata-fnam = p_fnam.
    Populate the field value
    wa_bdcdata-fval = p_fval.
    APPEND wa_bdcdata TO i_bdcdata.
    ENDFORM. "f_bdc_field
    *& Form f_sessions_vl02
    text
    FORM f_sessions_vl02 .
    DATA: l_sindex TYPE sy-tabix VALUE 1,
    l_eindex TYPE sy-tabix,
    l_flag TYPE c VALUE space.
    l_eindex = v_input.
    SORT i_final BY matnr ASCENDING.
    DO p_sess TIMES.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    client = sy-mandt
    group = 'Y_VL02_NIK'
    user = sy-uname
    keep = c_flagx
    EXCEPTIONS
    client_invalid = 1
    destination_invalid = 2
    group_invalid = 3
    group_is_locked = 4
    holddate_invalid = 5
    internal_error = 6
    queue_error = 7
    running = 8
    system_lock_error = 9
    user_invalid = 10
    OTHERS = 11.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CLEAR wa_final.
    CLEAR: i_bdcdata[].
    LOOP AT i_final INTO wa_final FROM l_sindex TO l_eindex .
    IF l_flag = v_sessions.
    CLEAR l_flag.
    EXIT.
    ENDIF.
    l_flag = l_flag + 1.
    CLEAR: i_bdcdata[].
    perform bdc_dynpro using 'SAPLMGMM' '0060'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RMMG1-MATNR'
    wa_final-matnr.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
    'X'.
    perform bdc_dynpro using 'SAPLMGMM' '4004'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'BDC_CURSOR'
    'MARA-BISMT'.
    perform bdc_field using 'MARA-BISMT'
    wa_final-bismt.
    perform bdc_dynpro using 'SAPLSPO1' '0300'.
    perform bdc_field using 'BDC_OKCODE'
    '=YES'.
    perform bdc_transaction using 'MM02'.
    perform bdc_dynpro using 'SAPLMGMM' '0060'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_dynpro using 'SAPLMGMM' '4004'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_dynpro using 'SAPLSPO1' '0300'.
    perform bdc_field using 'BDC_OKCODE'
    '=YES'.
    perform bdc_transaction using 'MM03'.
    l_sindex = l_sindex + 1.
    ENDLOOP.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    not_open = 1
    queue_error = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDDO.
    ENDFORM. " f_sessions_vl02
    *& Form f_report_header
    FORM f_report_header .
    FORMAT COLOR COL_HEADING INTENSIFIED ON.
    ULINE.
    text-201 - Company: Carrier
    text-102- Batch Data Communication.
    text-202 - System: SAP
    WRITE: /1 sy-vline,
    3 text-201,
    50 text-102,
    100 text-202,
    AT sy-linsz sy-vline.
    text-203 - Program:
    text-204 - Date/Time:
    WRITE: /1 sy-vline,
    3 text-203, sy-repid ,
    100 text-204,sy-datum ,c_slash, sy-uzeit,
    AT sy-linsz sy-vline.
    text-205 - User ID:
    text-206 - Page:
    WRITE: /1 sy-vline,
    3 text-205, sy-uname,
    100 text-206, sy-pagno,
    AT sy-linsz sy-vline.
    FORMAT COLOR OFF.
    ULINE.
    ENDFORM. " f_report_header
    FORM bdc_transaction USING tcode.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    tcode = tcode
    TABLES
    dynprotab = i_bdcdata
    EXCEPTIONS
    internal_error = 1
    not_open = 2
    queue_error = 3
    tcode_invalid = 4
    printing_invalid = 5
    posting_invalid = 6
    OTHERS = 7.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    WRITE: / text-109 ,wa_final-matnr,
    text-110 .
    ENDIF.
    ENDFORM. "bdc_transaction

  • Search file for text and delete the found text.  How?

    I need to know how to search a file for text and delete the found text. I think grep will let you do this but not sure of the syntax.

    Hi Dmcrory,
       In addition to what Camelot and nobody loopback point out, one must also consider the fact that UNIX text tools are largely line based. You also fail to tell us for what kind of text you are searching. If you are looking for multiple words, there's a very good chance of finding the expression wrapped onto different lines. With hyphenation, even single words can wrap to multiple lines. Tools that search line-by-line will miss these unless you use multiline techniques.
       Multiline substitutions require that you write "read-ahead" code for the command line tool that you're using and that you take that into account in the substitution. Given how you want the results to be printed out, you may also want to preserve any newlines found in the match, which is even more difficult. That could bring up the subject of line endings but that's a completely different topic.
       I apologize if this sounds discouraging. Multiline searches aren't needed that often and in most of those cases, exceptions can be dealt with by hand. I just didn't want you to get surprised by it. To give you an idea of how easy basic substitution is, have a look at Tom Christiansen's Cultured Perl: One-liners 102 and One-liners 101. Both have some "in-place" substitution examples.
    Gary
    ~~~~
       MIT:
          The Georgia Tech of the North

Maybe you are looking for

  • IPhone 4 GSM overheating and battery draining fast.

    I recently updated to 6.1.3 and eevr since my phone have been ovrheating and the battery has been draining REALLY fast. I have tried basic trouble shooting that includes mail, wifi, 3g, and even a factory restore to "new phone". The problem persists.

  • Call Function Destination in a background job

    I am having a problem using:   CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC'          DESTINATION p_dest in a background job. I am working on a program that would compare the same table in 2 different systems and write the differences.  It works when I r

  • Why does synch of my iPod touch takes far longer than before iOS 5?

    Synching of iPod before introduction of iCloud never took more than a few minutes and during the process iTunes reported how many photos or songs were being added or deleted based on what had changed on the iPhoto and iTunes libraries since the last

  • Status 56 -  IDOC with errors added

    Hi everyone,         I was configuring File to IDOC Scenario, in the receiving R/3 system, i am getting error as Status 56 -  IDOC with errors added "<b>EDI: Partner Profile not available</b>".         but i had already created Partner profile in WE2

  • Report Designer Control - Redistribution Issue

    Hi: I use Report Designer Control(RDC) in my program to allow user to modify reports.  I made a build and installed the build but when I try to access report designer from program I am getting the error about license.  "This system does not have a va