Regarding the file name checking

Hi ,
     I m using the below program which will upload the XL sheet , here i want to validate the file name which i m selecting from the destop. the file name should be named as "Suresh.XLS", where and how i can do validation for checking the file name..
I gave the code for the refernce...
  please let me know the solution ASAP..
REPORT  ZSURESH13062007                         .
types: begin of ttab ,
      fld1(30) type c,
      fld2(30) type c,
      fld3(30) type c,
      fld4(30) type c,
      fld5(30) type c,
      end of ttab.
data: itab type table of ttab with header line.
selection-screen skip 1.
parameters: p_file type localfile         .
selection-screen skip 1.
at selection-screen on value-request for p_file.
  call function 'KD_GET_FILENAME_ON_F4'
       exporting
            static    = 'X'
       changing
            file_name = p_file.
  start-of-SELECTION.
   IF  p_file IS INITIAL.
MESSAGE S398(00) WITH 'No input file specified.'.
  ELSE.
clear itab.
    refresh itab.
    PERFORM upload_data.
loop at itab.
    write:/ itab-fld1, itab-fld2, itab-fld3, itab-fld4, itab-fld5.
  endloop.
  endif.
form upload_data.
  data: file type  rlgrap-filename.
  data: xcel type table of alsmex_tabline with header line.
  file = p_file.
  call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
       exporting
            filename                = file
            i_begin_col             = '1'
            i_begin_row             = '1'
            i_end_col               = '200'
            i_end_row               = '5000'
       tables
            intern                  = xcel
       exceptions
            inconsistent_parameters = 1
            upload_ole              = 2
            others                  = 3.
   loop at xcel.
    case xcel-col.
      when '0001'.
        itab-fld1 = xcel-value.
      when '0002'.
        itab-fld2 = xcel-value.
      when '0003'.
        itab-fld3 = xcel-value.
      when '0004'.
        itab-fld4 = xcel-value.
      when '0005'.
        itab-fld5 = xcel-value.
    endcase.
    at end of row.
      append itab.
      clear itab.
    endat.
  endloop.
ENDFORM.
Thanks,
Suresh...

Hi Suresh,
Check the Function Modules,
PC_CHECK_FILENAME_WITH_EXT,
PC_CHECK_FILENAME.
Thanks,
Reward If Helpful.

Similar Messages

  • Check if file exists without knowing the file name

    I'm new to Java and am working on a program that needs to check a folder every couple of min to see if a file has been placed there, then open the file, read it and then change the name.
    The file name will be similar to 20020905 (the current date, but I don't know if the time will be appended to the name or not), but will not have a file extention.
    If anyone could point me in the right direction, I'd appreciate it.

    why go about it using the file name? Why not use the lastModifiedDate, which will be less then the last time you checked, e.g.:
    Date lastCheck = new Date();
    while(true) {
      try {
         Thread.sleep(yourDelay);
      catch(Excepiton e) { }
      File [] files = yourDirectory.listFiles();
      for (int i = 0; i < files.length; i++) {
        if (files.isDirectory()) {
    //skip directories
    continue;
    Date modified = new Date(files[i].lastModified());
    if (lastCheck.before(modified)) {
    System.out.println(files[i].getName() + " is new");
    //update time of last check
    lastCheck = new Date();
    That code isn't real exact, but it gives you an idea. I think using the lastModified date is a little more elegant then keying off file name conventions, but use what ever works best. If you use code like I suggested, depending upon how often files are added you might have to account for a possiblity where a file is created while you are iterating through that 'for' loop, meaning its file creation date qualifies it for your condition, but it will be less then the newly updated lastCheck value.

  • Consolidate Problem. Copying files failed. The File name was invalid.

    Hi to everyone,
    My system is 10.5.8, iTunes 9.2.1 (4)
    I tried to consolidate my iTunes library to an external HD. After about 100GB of copied music, I got the message : Copying files failed. The File name was invalid.
    Now everytime I try again to consolidate, I get immediately this message. I am looking everywhere for a solution, and I only find the same problem for Windows iTunes users.
    Actually I found very useful this thread:
    http://discussions.apple.com/thread.jspa?threadID=1708372,
    which talks about with which order iTunes consolidates the media, so by digging a little in the folders to find which track has the problem and make the fix. It says that consolidate start copy the files by the date added order. So I can go in my new iTunes media folder and find the latest added track, then go back in iTunes, sort by date added the songs and locate the next song, to make the fix. However in my case, all previous and next songs (by date added), have been copied in the new locations.
    I am stuck. I have a remaining 300GB of music to consolidate and dont know how to proceed.
    Any help would be much appreciated..

    Finaly, I managed to solve it by myself...,
    following the help I found from the post of the thread I mentioned on my question...
    What was the problem that made things more difficult in my case, is that a big amount of songs have been added at the same time, with just a few seconds time distance. So it was tougher to locate what was the last imported song, and where iTunes consolidation had stopped. Actually I had groups of about 100 songs with the same timestamp of date added and the consolidation was following the rule of the "date added" but not exactly with the order the songs was showing in the iTuned library. So I started checking all the songs very close to the last added in the media folder one by one with the "show in finder" command, and then I managed to found what was the one with the problem.
    Regarding the problematic file, that was a midi file that had been imported in my iTunes.
    I hope this will help anyone else that might have the same problem as me in the future.

  • Flat file connection: The file name "\server\share\path\file.txt" specified in the connection was not valid

    I'm trying to execute a SSIS package via SQL agent with a flat file source - however it fails with Code: 0xC001401E The file name "\server\share\path\file.txt" specified in the connection was not valid.
    It appears that the problem is with the rights of the user that's running the package (it's a proxy account). If I use a higher-privelege account (domain admin) to run the package it completes successfully. But this is not a long-term solution, and I can't
    see a reason why the user doesn't have rights to the file. The effective permissions of the file and parent folder both give the user full control. The user has full control over the share as well. The user can access the file (copy, etc) outside the SSIS
    package.
    Running the package manually via DTExec gives me the same error - I've tried 32 and 64bit versions with the same result. But running as a domain admin works correctly every time.
    I feel like I've been beating my head against a brick wall on this one... Is there some sort of magic permissions, file or otherwise, that are required to use a flat file target in an SSIS package?

    Hi Rossco150,
    I have tried to reproduce the issue in my test environment (Windows Server 2012 R2 + SQL Server 2008 R2), however, everything goes well with the permission settings as you mentioned. In my test, the permissions of the folders are set as follows:
    \\ServerName\Temp  --- Read
    \\ServerName\Temp\Source  --- No access
    \\ServerName\Temp\Source\Flat Files --- Full control
    I suspect that your permission settings on the folders are not absolutely as you said above. Could you double check the permission settings on each level of the folder hierarchy? In addition, check the “Execute as user” information from job history to make
    sure the job was running in the proxy security context indeed. Which version of SSIS are you using? If possible, I suggest that you install the latest Service Pack for you SQL Server or even install the latest CU patch. 
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • How to put the file name in notepad file

    dear frank,
    how to put the file name in notepad file via power shell. I mean i want to put the file name in that notepad file
    for example,
    my file name is ABL and in this file data is
    02/06/2015,180.00,182.00,176.01,180.50,1575500
    02/06/2015,4.20,4.20,4.20,4.20,500
    02/06/2015,113.50,113.70,112.91,113.09,157800
    02/06/2015,682.01,695.90,682.00,683.19,4250
    02/06/2015,213.98,215.00,213.00,214.87,326200
    02/06/2015,21.52,21.65,21.52,21.60,4000
    02/06/2015,111.00,111.25,108.25,108.91,17100
    02/06/2015,52.00,52.00,52.00,52.00,500
    and i want to data in this form
    ABL,02/06/2015,180.00,182.00,176.01,180.50,1575500
    ABL,02/06/2015,4.20,4.20,4.20,4.20,500
    ABL,02/06/2015,113.50,113.70,112.91,113.09,157800
    ABL,02/06/2015,682.01,695.90,682.00,683.19,4250
    ABL,02/06/2015,213.98,215.00,213.00,214.87,326200
    ABL,02/06/2015,21.52,21.65,21.52,21.60,4000
    ABL,02/06/2015,111.00,111.25,108.25,108.91,17100
    ABL,02/06/2015,52.00,52.00,52.00,52.00,500
    There are many file like this that i want to be edit
    plese tell me how can i do it, i think it is possible via windows power shell.
    thanks in advance.

    Hi
    Just for completeness, what version of VB.NET are you using?
    Here is a complete project to copy all the files with the added "ABL," at the start of each line.  You need to start a new Project with a BLANK default Form1, and replace all of Form1 code with the code below. When you run this project, you
    need to use the 2 buttons to set up the ORIGINAL file folder and a folder to place the copies. You need to check if the file EXTENSION is correct (I assumed txt), and check the text to add to each line is correct.  Once all is set up you should have a
    big red button to start the operation.
    NOTE: it is important that you try this out on a copy of some of the files to verify accuracy BEFORE trying on original files. Make sure you have a good back up of the original files before doing anything else.
    ' new project with default BLANK Form1
    ' replace all Form1 code with this code
    ' WARNING: make sure you have a backup of
    ' any files you use this application to
    ' operate on.
    Option Strict On
    Option Infer Off
    Option Explicit On
    Public Class Form1
    Dim OrigFileFolderPath As String = Nothing
    Dim CopyToFolderPath As String = Nothing
    Dim lab1, lab2, lab3 As New Label
    Dim tb1, tb2, tb3 As New TextBox
    Dim b1, b2, b3, b4 As New Button
    Dim fb As New FolderBrowserDialog
    Dim bgw As New System.ComponentModel.BackgroundWorker
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
    Me.Size = New Size(731, 300)
    With lab1
    .Text = "Original Files Folder Path"
    .Location = New Point(15, 5)
    End With
    With tb1
    .Width = 560
    .Location = New Point(10, 30)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
    End With
    With lab2
    .Text = "Copy Files to Folder Path"
    .Location = New Point(15, 125)
    End With
    With tb2
    .Width = 665
    .Location = New Point(10, 150)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
    End With
    With lab3
    .Text = "File Ext"
    .Location = New Point(600, 5)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    End With
    With tb3
    .Text = ".txt"
    .Width = 80
    .Location = New Point(590, 30)
    .BackColor = Color.Khaki
    .ForeColor = Color.Maroon
    .TextAlign = HorizontalAlignment.Center
    .Font = New Font(Me.Font.FontFamily, 12)
    .BorderStyle = BorderStyle.FixedSingle
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    End With
    With b1
    .Text = "Choose Original Files Folder Path"
    .AutoSize = True
    .Location = New Point(10, 65)
    End With
    With b2
    .Text = "Choose Copy Files to Folder Path"
    .AutoSize = True
    .Location = New Point(10, 185)
    End With
    With b3
    .Text = "DO THE COPY"
    .AutoSize = False
    .Size = New Size(240, 50)
    .BackColor = Color.Red
    .ForeColor = Color.White
    .Font = New Font(Me.Font.FontFamily, 20, FontStyle.Bold)
    .Location = New Point(420, 80)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    .Visible = False
    End With
    With b4
    .Text = "CANCEL JOB"
    .AutoSize = False
    .Size = New Size(240, 50)
    .BackColor = Color.Red
    .ForeColor = Color.White
    .Font = New Font(Me.Font.FontFamily, 20, FontStyle.Bold)
    .Location = New Point(420, 80)
    .Anchor = AnchorStyles.Top Or AnchorStyles.Right
    .Visible = False
    End With
    Me.Controls.AddRange({lab1, lab2, lab3, tb1, tb2, tb3, b1, b2, b3, b4})
    With bgw
    .WorkerReportsProgress = True
    .WorkerSupportsCancellation = True
    End With
    AddHandler bgw.DoWork, AddressOf bgw_DoWork
    AddHandler bgw.RunWorkerCompleted, AddressOf bgw_Completed
    AddHandler b1.Click, AddressOf b1_Click
    AddHandler b2.Click, AddressOf b2_Click
    AddHandler b3.Click, AddressOf b3_Click
    AddHandler b4.Click, AddressOf b4_Click
    End Sub
    Private Sub b1_Click(sender As Object, e As EventArgs)
    fb.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    fb.ShowNewFolderButton = False
    Dim r As DialogResult = fb.ShowDialog
    If r = Windows.Forms.DialogResult.OK Then
    tb1.Text = fb.SelectedPath
    If IO.Directory.Exists(tb1.Text) AndAlso IO.Directory.Exists(tb2.Text) AndAlso Not (tb1.Text = tb2.Text) Then
    If tb3.Text = Nothing Then
    redo: tb3.Text = InputBox("Enter the file extension that you want to copy/change", "FILE EXTENSION")
    If tb3.Text = Nothing Then GoTo redo
    End If
    b3.Visible = True
    Else
    b3.Visible = False
    End If
    End If
    End Sub
    Private Sub b2_Click(sender As Object, e As EventArgs)
    fb.SelectedPath = My.Computer.FileSystem.SpecialDirectories.MyDocuments
    fb.ShowNewFolderButton = True
    Dim r As DialogResult = fb.ShowDialog
    If r = Windows.Forms.DialogResult.OK Then
    tb2.Text = fb.SelectedPath
    If IO.Directory.Exists(tb1.Text) AndAlso IO.Directory.Exists(tb2.Text) AndAlso Not (tb1.Text = tb2.Text) Then
    If tb3.Text = Nothing Then
    redo: tb3.Text = InputBox("Enter the file extension that you want to copy/change", "FILE EXTENSION")
    If tb3.Text = Nothing Then GoTo redo
    End If
    b3.Visible = True
    Else
    b3.Visible = False
    End If
    End If
    End Sub
    Private Sub b3_Click(sender As Object, e As EventArgs)
    b3.Visible = False
    b4.Visible = True
    If Not tb3.Text.StartsWith(".") Then tb3.Text = "." & tb3.Text
    bgw.RunWorkerAsync()
    End Sub
    Private Sub b4_Click(sender As Object, e As EventArgs)
    bgw.CancelAsync()
    End Sub
    Private Sub ReadPWFile(fn As String)
    Dim filename As String = My.Computer.FileSystem.GetName(fn)
    Dim barename As String = IO.Path.GetFileNameWithoutExtension(fn)
    Dim copyto As String = tb2.Text & "\" & filename
    Dim line As String = Nothing
    Dim lines As New List(Of String)
    Using sr As IO.StreamReader = New IO.StreamReader(fn)
    Do
    line = sr.ReadLine()
    If Not line = Nothing Then
    lines.Add(barename & "," & line)
    End If
    Loop Until line = Nothing
    End Using
    Using sw As IO.StreamWriter = New IO.StreamWriter(copyto)
    For Each s As String In lines
    sw.WriteLine(s)
    Next
    End Using
    End Sub
    Private Sub bgw_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs)
    Dim ftc As Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(tb1.Text)
    For Each f As String In ftc
    If bgw.CancellationPending Then
    e.Cancel = True
    Exit For
    End If
    Dim ex As String = My.Computer.FileSystem.GetFileInfo(f).Extension.ToLower
    If My.Computer.FileSystem.GetFileInfo(f).Extension.ToLower = tb3.Text.ToLower Then
    ReadPWFile(f)
    End If
    Next
    End Sub
    Public Sub bgw_Completed(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs)
    tb1.Text = Nothing
    tb2.Text = Nothing
    b3.Visible = False
    b4.Visible = False
    MessageBox.Show("Finished copying files", "Job Completed")
    End Sub
    End Class
    Regards Les, Livingston, Scotland

  • How to get the file name in one of the Xml node field?

    Hi Experts,
    i have one requirement with file name in xml file.
    i need to get <b>the file name of file</b> in one of the node in xml content of that file.
    how can i achieve that req?
    treat this as Very Urgent.

    Hi Bheem,
    Explain your scenario in detail..
    >>i need to get the file name of file in one of the node in xml content of that file.
    1. Create an node <b>Filename</b> in the target datatype.
    2. Check the Option Filename in the Adapter Specific Message Attributes in the sender file CC.
    3. Use the following UDF and map it to the Filename field in the target message type.
    public String getFileName(Container container)
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String ourSourceFileName = conf.get(key);
    return  ourSourceFileName; 
    Regards
    San

  • Changing the file name dynamicallly in file Adapter

    Hi i want to change the file name directly from Java Mapping in the file adapter
    for this i have written this code
    DynamicConfiguration dynamicConfiguration = (DynamicConfiguration)map.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                   DynamicConfigurationKey keyFile = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
                   DynamicConfigurationKey keyDir = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
                   dynamicConfiguration.put(keyFile,fileName);
                   dynamicConfiguration.put(keyDir,outputpath);
    but it gives a null pointer exception at dynamicConfiguration.put(keyFile,fileName);
    please suggest.
    regards
    Nilesh Taunk.

    Hi Nilesh,
    If your requirement is to create , the file name dynamically for your receiver file adapter, you can do so using your <b>FILE ADAPTER CONFIGURATION</b> itself, and need not go for any JAVA Mappping / Java Code at all.
    The dynamic filename generation concept is as follows.
    In your filename field in the receiver file adapter, just give a variable with <b>%</b> symbols. (eg: %file% ).
    Now, under the option <b>Variable Name Substitution</b>, you can give how the value has to be created.
    <b>It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.</b>
    For the former, your give
    <b>message:interface_name</b> ,etc
    and for the payload part you give,
    <b>Payload: "your element root which u wanna acecss"</b>
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    Also, in your FILE Adapter under the option FILE CREATION MODE, you have options like,
    1.Add Counter,
    2. Append
    3. Create
    4. Add Time Stamp
    If you have any clarifications on this approach, do get back.
    Regards,
    Bhavesh

  • Should the web page address be included in the file name in the meta data dialog box?

    In the page properties > meta data > below is a field with the label file name: (the the area to type in the field), after the field, it is labeled .html.
    I have 2 questions here.
    1. If I type in http//:www (my page url), do I include .html at the end? I didn't know if this is automatically added because it is off to the side of the field?
    2. If I type in the entire URL address: http//:www (etc, etc).html,    after closing the page properties dialog box, I make it a habit to double check my work. What happens is the http//:www.xxx changes to (htttpwww.xxx). It drops the //: on the URL.
    So would it be better to just type in www.xxx (without the http//:www.xxx)
    and do you type in the .html at the end?
    I am assuming this will help with SEO page ranking or at least makes it easier for the search engines to crawl your site??
    I hope this makes sense.
    Advise would be very helpful.
    Ben

    You are absolutely correct with the URL Ben. Taking your above example, you just need to type in "Services" in the file name and the webpage will be exported as services.html and the URl will be  www.xyz.com/services.html.
    All the webpages (be it parent page or child page) gets physically saved at the root directory of your website on the server (where your website resides).
    This name is just the name of the file using which it is physically stored and called from the server. It does not help search Engines to crawl deeper inside the website.
    As I explained, "name which you wants the .html file to be stored with" here means the name of the physical file which is getting saved on the server.
    Most users leave the file name same as Page name. If you have it different from page name then this will be the workflow :
    Page Name : About
    File Name : test
    domain : www.mysite.com
    Now if you are  using a Menu Widget, it will list "About" in the Menu. And when end user will click on "About" then it will call the file named "test.html" from the server location (where all the files of your website are stored).
    And it will open a page with address "www.mysite.com/test.html"
    Hope I am able to explain the concept of File Name here. Please let us know if you have further queries on this.
    Regards,
    Sachin

  • The file name is invalid.

    when I start iCal I get the message "The file name is invalid" I had the calanders syncing through dropbox so that my G5 and macbook air would be the same. and the iPhone just synced with the laptop... I wanted to sync with iCloud so I deleted the drop box folder they were loking for. The G5 finally restarted with a blank calander, no big deal. The Air just keeps thowing up the same message. I check the iCloud box for it but it will not stay checked. I have restarted a few times. I need to have the clander sart so I can add the iCloud account I think but i cannot get at the preferences.

    Hi PG,
    My Node has the following attributes:
    Node
    |_ FILENAME type string  --> Binded to Filename Property
    |_ CONTENT  type rcf_attachment_content --> Data Property of the Upload UI Element.
    Please check the below code, as the same is working for me with this logic.
    IF lvfname IS NOT INITIAL.
    *determine file name without path
        CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
          EXPORTING
            full_name     = lvfname
          IMPORTING
            stripped_name = lv_stripped_name
            file_path     = lv_file_path
          EXCEPTIONS
            x_error       = 1
            OTHERS        = 2.
        IF sy-subrc = 0.
          IF NOT lv_stripped_name IS INITIAL.
            lvfname = lv_stripped_name.
          ENDIF.
        ELSE.
    * Throw error
          lo_api_controller ?= wd_this->wd_get_api( ).
          CALL METHOD lo_api_controller->get_message_manager
            RECEIVING
              message_manager = lo_message_manager.
    *     report message
          lo_msg = 'Please select proper file'.
          CALL METHOD lo_message_manager->report_t100_message
            EXPORTING
              msgid = '38'
              msgno = '000'
              msgty = 'E'
              p1    = lo_msg.
          EXIT.
        ENDIF.
    At the same time, I've made use of the class cl_hrrcf_attachment_bl to maintain the attachments in my requirement.
    Regards,
    -Syed.

  • My file names have disappeared in grid view. Thery have been replaced with a dark bar along the bottom of the previews. If I toggle using the command u it hide the bar but I still can't see the file name. In list view all the file names are OK.

    My file names have disappeared in grid view. Thery have been replaced with a dark bar along the bottom of the previews. If I toggle using the command u it hide the bar but I still can't see the file name. In list view all the file names are OK.

    The dark bar is caused by the option "Show metadata below image".
    Check the settings for the metadata overlays in Grid view (basic and expanded) by clicking the little "badge" icon below the Browser and selecting "Edit". Is the filename still enabled in the list? And in a high enough position to have precedence for other metadata tags, if the space does not suffice to show all selected tags?
    Regards
    Léonie

  • Need to validate file Name,split the file name and store the splited values into Variables

    Dear All,
    Below is the my requirement.
    I have a folder, in that folder I have bunch of text files. The file name is below format
    ACA_122_pay_20140430_001
    Initially the file name start with ACA code,groupid,group name and date time stamp. This is the standard structure of file name.
    I want to check each and every file in the folder with this structure. The structure should be standard for all the files. If the structure same for all files I need to get codes form file name. For example
    If you see the below file name, I need to get ACA and put into variable,I need to get 122 and put into variable. For group name and date time needs to put in variable.
    If the file format is not valid state then I need to log exception.
    Let me know if I am not clear.
    Kindly provide the C# code for achieving the above requirement.
    As I am new to .net programming. kindly help me.
    Thanks in Advance,
    Regards,
    Madhava Ganji
    Madhava Ganji

    Hi MadhavaGanji,
    I have post how to validate the file name, header row against definition table which stored the file name and column definition. 
    Take a look and see if this is helpful.
    http://sqlage.blogspot.com/2013/11/ssis-validate-file-header-against.html
    http://sqlage.blogspot.com/

  • Writing file content on to mobile phone (need to specify the file name req)

    Hi,
    I have a jsp page which i am trying to execute on a mobile phone. In this page i am trying to open a ServletOutputStream and using this i am trying to write some content on to the phone. But by default the file name is beeing given as the name of the jsp page, so is there any that we can we specify the name of the file explicitly using the program itself (i mean other than the jsp file name). Can some one give me an idea to implement this.
    Here is the code snippet used......
    ServletOutputStream outstr = response.getOutputStream();
    String itemPath = "http://172.10.100.25/file_dwn/funny_pic.gif";
    java.net.URL url = new java.net.URL(itemPath);
    javax.activation.URLDataSource source = new javax.activation.URLDataSource(url);
    javax.activation.DataHandler dataHand = new javax.activation.DataHandler(source);
    String file = itemPath.substring(itemPath.lastIndexOf("/")+1);
    response.setHeader("Content-Type","application/vnd.oma.drm.message;boundary=foo");     
    outstr.println();
    outstr.println("--foo");
    outstr.println("Content-Type: " + dataHand.getContentType()+";Name=\""+file+"\"");
    outstr.println("");
    dataHand.writeTo(outstr);
    outstr.println();
    outstr.println("--foo--");
    outstr.println();
    outstr.flush();
    outstr.close();

    Hi,
    You can Include a Knowledge Management Folder as a Web Folder, this way you can copy and paste files from KM to  file system very easily.
    Check this
    http://help.sap.com/saphelp_nw70/helpdata/EN/30/75b62c659d724fb908c74ade23af51/frameset.htm
    Regards,
    Praveen Gudapati

  • How to include the file name as an XML field

    Hi,
    I'm using a file adapter for process a flat file and convert it into an XML. Does anybody knows how to include the file name into an XML field.
    Ex.
    I process the file named <b>XXIMN21022007.txt</b> and I need an XML like:
    <MT_FILE>
    <field1></field1>
    <field2></field2>
    <field3></field3>
    <filename><b>XXIMN21022007.txt</b></filename>
    </MT_FILE>
    Regards
    Gonzalo

    Just go for dynamic configuration.
    Check the sender file adapter to write the filename in the header (as explained in Michal's blog) and then read that header in some mapping.
    U can use that even in simple message mappings.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
    Your code for the filename tag would be something like:
    <i>DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        “http://sap.com/xi/XI/System/File”,
        “FileName”);
    return conf.get(key);</i>
    Regards,
    Henrique.

  • Problems getting just the file name using an upload component

    Hi everyone, I'm using an upload component on my page and I need to get just the name of the image/file in order to store it in a database, I used the code of the tutorial and It works fine on mozilla but the problem comes when I use Internet Explorer because I get the whole path of the image/file and not just the name of it. I believe the browser is the cause of the problem, I already checked the http://jakarta.apache.org/commons/fileupload/, but I don't understand how to use anything, and not even the code of the tutorial works eventhough it is specified in comments:
    // some browsers return complete path name, some don't
       // make sure we only have the file name
       String justFileName = uploadedFileName.substring
          ( uploadedFileName.lastIndexOf(File.separatorChar) + 1 );If anybody could helpme solve this problem I'd appreciate it so much
    Regards
    Yes
    Message was edited by:
    Yesenia

    Let's walk through the code...
    File.separatorChar is the system-dependent default hame-separator charac tor. This field is initialized to contain the first character of the system property file.separator. On UNIX systems, the value of this field is '/'; on Microsoft Windows systems it is '\\'.
    String justFileName =
    // get the substring of uploadedFileName
    // that starts after the last separator (\ or /)
    uploadedFileName.substring
    uploadedFileName.lastIndexOf(File.separatorChar) + 1
    You say that this statement is returning the complete path name, for example:
    C:\Documents and Settings\All
    Users\Documentos\Mis im��genes\Im��genes de
    muestra\Puesta de sol.jpgSo, we can make an assumption that the File.separatorChar must not be \, or else the statement would return Puesta de sol.jpg.
    We know that it works for you on Solaris/Mozilla.
    We also know that Misha has tested the statement in IE and it works for him.
    (And I know that this tutorial was tested by a software engineer and a quality engineer, and it worked for both of them, as well as the tutorial author and a peer).
    So, what is different here??????
    Can you print out File.separatorChar and see if it is '\\' (I think the first \ is an escape char, that is \\ (escape-escape) is the equivalent of \ (backslash)) or '\'?
    When you run it on another machine, how are you deploying it on the other machine? Is it deployed to Solaris and running on Windows?
    Have you tested to see if it works on a Windows machine using Mozilla?
    Thanks in advance for any light you can shed on the problem.

  • Duplicate File name check

    Hi, 
           I need to check whether the incoming file is already processed or not. The files are been placed on XI server. If the file with same file name comes then i dont want to process it. I am polling for files on xi server using file adapter.
    regards,
    Miten

    Hi,
    You can check the file name using the lookup. Maintain the table at R3 end, Send the file name at the R3 end and for the first time u update the entry of file name in R3 table.
    Now when second time ur scenario runs then send the file name to R3, in the FM check the file name with the file name which is maintained in the table if its not the same then update the table with the new file name and if it is same then pass the false value to XI and it will suppress the root node in message mapping.
    If file name is different then pass true value to XI and generate the Root node.
    Lookup:
    Lookup method from GUI mapping can be called using any of the following ways.
    •     RFC lookup using JCO (without communication channel)
          /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    •     RFC lookup with communication channel.
                     /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    The steps are as follows:
    •     Develop and test ABAP function module.
    •     Develop and test Java method within Integration Repository/message mapping tool.
    Thnx
    Chirag

Maybe you are looking for

  • Error While Starting the Weblogic Managed server- BEA-160001

    Hi, While starting the managed server (10.3.4) below exception occurs. Help me on why the error occurs. <Error> <J2EE> <BEA-160001> <Error deploying Internal Application: weblogic.application.ModuleException: [HTTP:101216]Servlet: "CoordinatorPortTyp

  • I reset my ipad to factory specs and now it is asking for a puk code.

    I need help locating a puk code to get back into my ipad. I reset it due to it glitching on me and not opening up any apps. Can anyone help?

  • Nvidia - nouveau error

    Hi. I have installed archlinux and after some update I have nouveau error (X server is working fine anyway). that's the error: [ 7.014559] fb: conflicting fb hw usage nouveaufb vs VESA VGA - removing generic driver [ 7.014709] nouveau 0000:02:00.0: s

  • Crop Tool Malfunctioning! How do I fix it?

    My crop tool no longer works. I can choose an area I want to crop, then when I go to "Image/Crop" it only crops a single pixel. I have been having to select the area with the rectangular marquee tool, copy & paste it into another layer, delete the ba

  • ITunes Store download problems

    Hi, for the last few months if I purchase something on the iTunes store (Apps, Music, TV Shows, Movies) regardless of what it is the purchase is made and it downloads fine. However, if I close iTunes before the download is completed, whatever was in