Getting filename using file technology

Hi,
i am not able to understand below code,
select     C1     C1_C1
from      TABLE
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=FileNameSNP$CRLOAD_FILE=#Default_location\<%=odiRef.getContext("CTX_NAME")%>\cm_mstr.txtSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=C1SNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CR$$SNPS_END_KEY*/
can u please help me immediately
Thanks,
sh

Hi
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=FileNameSNP$CRLOAD_FILE=#Default_location\<%=odiRef.getContext("CTX_NAME")%>\cm_mstr.txtSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x0009SNP$
CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$
aboce code is generated by odi during loading step in an interface.
Suppose you want select * from emp
Now odi replace this emp table by the code.The above code seems like a table which in turn refer to the file.
CRFILE_FIRST_ROW= *0*
See the bold part. Here zero refers to the 1st line of file.Then it is incremented up to the last line to fecth line by line.For more details on it refer
http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-2-%E2%80%93-getting-all-lines-once-at-time
In case of any issue let us know.
Thanks

Similar Messages

  • How to get FILENAME from FILE PATH

    does anyone know how to get filename from a file path for example
    FILE PATH: C:\Project\uploadbean\web\uploads\Button.txt
    returns
    FILENAME: Button.txt

    @BalusC
    ust for a reference cause i'm new in JSP This has nothing to do with JSP, but with basic knowledge of an essential API. I have given you the link to the File API. Are you saying that you refused to read the API documentation, which clearly explains you how to use the File and shows which methods are all available to you undereach the straightforward getName() method, and expecting that the others may chew the answers for you? Loser.

  • Get filename from file sender adapter

    Hi Experts,
    I have a question regarding the file/ftp adapter (sender).
    I have a directory with xml and pdf files. for every xml file there is a pdf file with the same filename. for example:
    file1.xml
    file1.pdf
    file2.xml
    file2.pdf
    file3.xml
    file3.pdf
    Now I want to read the xml file with the file sender adapter. afterwards I want to read the related pdf file. for example: If I read the file file1.xml afterwards I want to read the pdf file file1.pdf with the file sender adapter. For this it is nessessary to get the filename from the xml file so that I can read afterwards the pdf file. How can I realise it?
    Thanks and best regards
    Christopher

    Hi srinivas,
    thanks for your quick answer.
    That the file adapter is not able to read pdf files is clear to me. In this case I only want to transport the pdf. that works fine. I tested it.
    the problem is the following:
    I have a xml file with the name "file1.xml". I read the xml file with the sender file/ftp adapter configured with filename "*.xml". Then I want to import the pdf file with the name "file1.pdf". Therefor I need the filename from the xml file.do you know what I mean? So XI has to know the filename of the xml to import the pdf with the same name ...
    regards

  • File not getting deleted using File.delete()

    Hi guys,
    I have a code like this:
    File tempdir = new File("tempdir");
    tempdir.mkdir();
    File temporaryFile = new File("tempdir\tempfile.txt");
    FileWriter writer = new FileWriter(temporaryFile);
    // write data into file
    writer.flush();
    writer.close();
    try {
        // Do something
    catch (Exception e) {
        // Do something
    temporaryFile.delete();
    tempdir.delete();The program runs successfully. The directory and the file is created and data is written successfully into it. However, the file as well as directory is not getting deleted at the end of the program. I tried temporaryFile.deleteOnExit(), but this also didn't help.
    Can anyone provide some input as to what can be the possible reasons for the file not getting deleted?
    Thanks..

    I want the file to be created inside the directory I specified. Hence, I put the "\". Please let me know if there is some other way to achieve this. This way I am getting the file created at the location I want.
    One more interesting thing which I noticed. Actually this code is part of a JUnit test. In the same JUnit, I am creating new files in atleast 2-3 test methods. But the deletion of files is really random. Sometimes, 2 out of 3 get deleted, sometimes only 1 gets deleted. However, I didn't come through a single instance wherein all the 3 files got deleted. :-(
    Also, the directory is never deleted. However, I got the reason behind this. As per the File API, the directory will not be deleted if it is not empty.

  • Get/put dynamic file name using FTP

    Hi Friends,
      I am currently using FTP_Connect, FTP_command and FTP_disconnect to get/put a file from a remote server.
    But the file name was changed to add a date/time stamp.
    So the filename became dynamic (example from 'test.txt' to 'test_200512160800.txt').
    I tried using get test. but my FTP command failed. Do you know anyway of doing this?
    Thanks.

    Hi Lego,
    here's another sample for the fm:
    REPORT ztest_epsf.
    PARAMETERS: date LIKE sy-datum,
                dir  TYPE epsf-epsdirnam,
                pattern TYPE epsf-epsfilnam,
                zid   LIKE vers_dest-rfcdest.
    DATA dir_list LIKE epsfili OCCURS 0 WITH HEADER LINE.
    DATA cnt_file TYPE epsf-epsfilsiz.
    DATA err_file TYPE epsf-epsfilsiz.
    START-OF-SELECTION.
      IF date IS INITIAL.
        date = sy-datum.
      ENDIF.
    *build pattern with input-pattern and date
      CONCATENATE pattern date '*' INTO pattern.
    *search for files in foreign system
      CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
           DESTINATION                   zid
           EXPORTING
                dir_name               = dir
                file_mask              = pattern
           IMPORTING
                file_counter           = cnt_file
                error_counter          = err_file
           TABLES
                dir_list               = dir_list
           EXCEPTIONS
                invalid_eps_subdir     = 1
                sapgparam_failed       = 2
                build_directory_failed = 3
                no_authorization       = 4
                read_directory_failed  = 5
                too_many_read_errors   = 6
                empty_directory_list   = 7
                OTHERS                 = 8.
      WRITE: / pattern.
      ULINE.
      LOOP AT dir_list.
        WRITE: / dir_list-name.
      ENDLOOP.
      ULINE.
      WRITE: / cnt_file.
      WRITE: / err_file.
    pls reward points for useful hints.
    thanks and
    regards Andreas

  • Get filename from uploaded file then place in input tags

    i have an upload feature with the use of upBean and i can get the filname thru filename=file.getFileName
    when i place in the input tags it takes an error what i suppose to do
    <input type="hidden" name="getfilename" value="<%=filename%>">
    if (MultipartFormDataRequest.isMultipartFormData(request)) {
                            // Uses MultipartFormDataRequest to parse the HTTP request.
                            MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
                            String todo = null;
                            String filename=null;
                            String description=request.getParameter("txtDesc");
                            String checkfilename=mrequest.getParameter("uploadfile");
                            if (mrequest != null) todo = mrequest.getParameter("todo");
                            if ( (todo != null) && (todo.equalsIgnoreCase("upload")) ) {
                                Hashtable files = mrequest.getFiles();
                                if ( (files != null) && (!files.isEmpty()) && (description!=null)) {
                                    UploadFile file = (UploadFile) files.get("uploadfile");
                                    if (file != null){
                                        filename=file.getFileName();                                    if(checkfilename==null){
                                            filename="";
                                  upBean.store(mrequest, "uploadfile");  // Uses the bean now to store specified by jsp:setProperty at the top.
                                             else out.println("<BR> todo="+todo);
                    %>
                    Message was edited by:
    BlingBling15

    Thanks for reply.
    I replaced messageFileUpload (binded to blob table column) with messageStyledText (binded to filename attribute). Above the table placed single messageFileUpload and submitButton nearby. After user select file on submit I do:
    *if (pageContext.getParameter("DoUploadButton") != null) {*
    .. DataObject fileUploadData = pageContext.getNamedDataObject("FileData");
    .. *if (fileUploadData != null) {*
    .... String fileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
    .... String contentType = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
    .... BlobDomain fileContent = (BlobDomain)fileUploadData.selectValue(null, fileName);
    .... String seqNumber = pageContext.getParameter("seqNumber");
    .... am.insertInstanceAttachRowBlob(seqNumber, fileName, fileContent, contentType);
    .... pageContext.removeNamedDataObject("FileData");
    .. return;
    Edited by: user12086842 on 02.01.2013 2:41

  • Getting empty csv file using servlet

    Hi
    i am working on reports for my web application and i used struts frame work.
    for my reports i want csv export, so for that i written servlet, once if i click generate button i am able to open popup window to save the generated csv file at my local system, but i am getting emplty csv file..
    nothing si ther ein that file forget abt data atleast my header fields.
    here is my servlet file..plz let me know where i am doing wrong..
    public class ReportServlet extends HttpServlet{
         public void doPost(HttpServletRequest req,HttpServletResponse res)
    throws ServletException,IOException
    PrintWriter out = res.getWriter();
    res.setContentType("text/csv");
    res.setHeader("Content-Disposition","attachment; filename=\"export.csv\"");
    out = res.getWriter();
    AdvDetailReportBean reportBean = null;
    ArrayList list =(ArrayList)req.getSession().getAttribute("advreportlist");
    System.out.println(" servlet report list size is"+list.size());
    String branchcode=(String)req.getSession().getAttribute("branchcode");
              String bName=(String)req.getSession().getAttribute("branchname");
              System.out.println(" servlet branch name"+bName);
              System.out.println(" servlet branch code"+branchcode);
    StringBuffer fw = new StringBuffer();
              fw.append("Branch Code");
              fw.append(',');
              fw.append("Branch Name");
              fw.append('\n');
              fw.append(branchcode);
              fw.append(',');
              fw.append(bName);
              fw.append('\n');                              
              fw.append('\n');
              fw.append("Customer Name");
         fw.append(',');
         fw.append("Constitution Code");
         fw.append(',');
         fw.append("Customer Status");
         fw.append(',');
         fw.append("Restructure Date");
         fw.append(',');
         fw.append("Total Provision");
         fw.append(',');
         fw.append("Limit Sanctioned");
         fw.append(',');
         fw.append("Principal");
         fw.append(',');
         fw.append("Balance");
         fw.append(',');
         fw.append("AccountID");
         fw.append(',');
         fw.append("Collateral SL No");
         fw.append(',');
         fw.append("Issue Date Of Collateral");
         fw.append(',');
         fw.append("MaturityDate Of Collateral");
         fw.append(',');
         fw.append("Subsidy");
         fw.append(',');
         fw.append("Guarantor SL No");
         fw.append(',');
         fw.append("Guarantor Rating Agency ");
         fw.append(',');
         fw.append("External Rating of Guarantor");
         fw.append(',');
         fw.append("Rating Expiry Date");
         fw.append(',');
         fw.append("Guarantee Amount");
         fw.append(',');
         fw.append('\n');
         for (Iterator it = list.iterator(); it.hasNext(); )
              reportBean = new AdvDetailReportBean();
              reportBean = (AdvDetailReportBean)it.next();
              fw.append(reportBean.getCustomername());
              fw.append(',');
              fw.append(reportBean.getConstitutionCode());
              fw.append(',');
              fw.append(reportBean.getCustomerStatus());
              fw.append(',');
              fw.append(reportBean.getRestructureDate());
         fw.append(',');
         fw.append(reportBean.getTotalProvision());
         fw.append(',');
         fw.append(reportBean.getLimitSanctioned());
         fw.append(',');
         fw.append(reportBean.getPrincipal());
         fw.append(',');
         fw.append(reportBean.getBalance());
         fw.append(',');
         fw.append(reportBean.getCurrentValue());
         fw.append(',');
         fw.append(reportBean.getAccountNumber());
         fw.append(',');
         fw.append(reportBean.getColCRMSecId());
         fw.append(',');
         fw.append(reportBean.getIssueDt());
         fw.append(',');
         fw.append(reportBean.getMarturityDt());
         fw.append(',');
         fw.append(reportBean.getUnAdjSubSidy());
         fw.append(',');
         fw.append(reportBean.getGuarantorFacilityId());
         fw.append(',');
         fw.append(reportBean.getRatingAgency());
         fw.append(',');
         fw.append(reportBean.getExternalRating());
         fw.append(',');
         fw.append(reportBean.getExpDtOfRating());
         fw.append(',');
         fw.append(reportBean.getGuaranteeAmt());
         fw.append(',');
         fw.append('\n');
    }

    You don't seem to be writing anything to the response at all. Yes, you create a StringBuffer and write lots of stuff to the StringBuffer but then you do nothing else with that buffer.

  • Using "File" as the technology in ODI Designer to populate dimensions

    Hello John (John Goodwin)
    I am currently following your blog on "ODI series 4 - Enter the Designer" and so far I have been successful with the following:
    1) Connecting to the planning application
    2) Performing Reverse operation
    However, when I create a new model by selecting "File" as the technology, even after selecting "Standard" under the "Reverse" tab and selecting proper context (as created earlier), I am not able to see the "Files" tab as shown in the blog.
    I am not able to get to the following "Insert a new DataStore and give it a name and if you click browse for file button it should open up in the correct directory and you can select the csv file." Where do I insert a new Datastore?
    Without this option I am not able to move forward. I would appreciate any help with this.
    Thanks,
    Datta

    Hi,
    First of all have you set up the physical schema for the File technology in the topology manager, adding the context and logical schema name.
    Next in the designer you will need to Insert Model using the file technology and the logical schema that was created in the topology manager.
    Now you can right click the Model and insert Datastore, you should be able to click the Resource Name, select the file and carry on from there.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Get File name using File Adapter

    Does anyone know how to get the file name that has been picked up so it can be past to a variable so it can be used in the BPEL process.
    cheers
    James

    Hi James,
    Here the STEPS,
    Create File Adapter.
    Add File Adapter Service to Receive Activity.
    Click Receive Activity and goto Adapters Tab.
    Click "Tourch" to get variable names.
    Select Variable -> Process -> Variables and Click on "Create New Variable" icon and give name.
    Select "Message Type" and click "Tourch" icon.
    Now you select "Partner Links" -> FileAdapter WSDL -> Imported WSDL -> Message Type -> InboundHeader_msg and select OK.
    It's done.
    now you can use this Global Variable to get Filename and Directory name.
    Regards,
    Bhavesh Thaker.

  • How to get the file using file adapter.

    Hi All,
    We have a requirement, IDoc -> PI -> JMS Adapter. Here the IDoc is in Flat file format. How can i consume Flat file version of IDoc into PI using Sender File Adapter for further processing..
    The Flat file version is been created within the SAP Application server "/usr/sap/SID/SYS/global"
    Do I need to specific Source Directory as "/usr/sap/SID/SYS/global" in Sender comm channel? How about the remaining parameters like authentication details?
    plz guide me..
    Thnx

    Check the below link:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0901cba-f49e-2910-748c-d7ce4c0c4c1c?quicklink=index&overridelayout=true
    go to transaction AL11 and there you can find DIR_HOME with a path.
    D:usrsapPID..
    Double click on the filename, you would be able to view the file content.
    That path is ur Application Server path, there you can save your file. Then in the External Data tab in Scheduling screen select Application server and on the file name press F4 so u can get the AL11 files select that then double click DIR_HOME, select your file.
    It will ask for display contents or copy name. Give COPY NAME the file name with path will be copied.
    If we are using Sender File Adapter to consume the file then what should be the source directory (i.e., /usr/SAP/PID/Global/..)
    If you are on the same network then use File Aapter(NFS).
    Now, the path should be usrSAPPIDGlobal

  • How to use Min function to get FileName into a Variable

    I was wondering how to use MIN function in Evaluate variable in package to get the first file name from the list(Datastore)
    With reference to Merging Flat Files into a single file Post number-4
    Thanx

    Hi Diwakar,
    That List data store should be table, than only it will gives the min of the filename string,
    If it is a file datastore, Min function does not works properly it will returns a first name in the file data store.
    so please, use an interface to upload the List filedatastore into some other temp table. From that table you can use variable to get Min value of file name.
    Thanks
    Madha

  • PSE9: Using File/Move; what happens with duplicate filenames

    I have PSE9 on Win7.
    I'd like to use File/Move to move a large number of images from one set of folders to a another location.
    The new location would be a single folder.
    I'm pretty confident that I have duplicate filenames. So the same filename exists in more than one
    of my 'source' folders.
    Using File/Move what is going to happen when I encounter these duplicates?
    Thanks for any help or advice.

    So I used a belt and supenders method of organization. Tags and folders.
    Oh, how I hate that phrase. This has sent many people down the road of organizing two different ways, with a cost. You did twice as much work. And in my opinion, using two different ways to organize was totally unnecessary, and waste of effort.
    But in all honesty I don't use a lot of the advanced features of PSE. So from time to time
    Neither do I. But that is irrelevant to how your set things up so you can find your photos when you want them.
    For my new downloads, I believe I will just put them all into a single 'My Pictures' folder.
    Unless your version of PSE has more features than mine does, putting them into a single folder (without subfolders by capture date) is more work than using the default folder naming scheme, which is capture date! And it buys you nothing! There is absolutely no harm in using the default of putting photos in folders by capture date. Don't make extra work for yourself! Now if your version lets you put all your new photos into a single large folder ...
    I read some web articles that gave me the impression that there might be another way to migrate rather
    than Backup/Restore.
    Not sure what you read. You could manually transfer all your photos AND catalog file from one computer to another, and if you get all the details right, everything still works! But the onus is on you to get all the details right.
    It sounded like after writing all the metadata those images could be File/Get Photos... intoPSE. But I also saw there may be a need to use the Keyword Tags/+/Save Keyword Tags to File function as well.
    Writing metadata to files does not let you rebuild your catalog completely. There is information in your catalog that will never be written to the files themselves. In fact, writing metadata to the photo files was NEVER intended to be a backup method; it was intended to be a method to allow PSE to communicate SOME information with other applications (like Flickr). So, should you want to make a backup, metadata is not the way to go. If you want multiple backup approaches, use the PSE method, and also make copies of your catalog file and photos using some other automated method.
    I used the File/ 'Write Keywords and Properties... ' function to write all the metadata back into all of my files.That seems like a good idea because I use multiple file backup approaches. Is there a way to get
    PSE to always write that info into a file anytime it changes? Like when I'm adding a tag?
    There is no way to automate this.

  • I can no longer import pictures to my ibook (OSX version 10.6.8) using iphoto 09 version 8.1.2 and now get message that file is in an unrecognizable format.  What is wrong?  Same camera as before.

    I can no longer import pictures to my ibook (OSX version 10.6.8) using iphoto 09 version 8.1.2 and now get message that file is in an unrecognizable format.  What is wrong?  Same camera as before.

    Julesvernet
    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • HT1766 I have an iphone 4.I upgraded it to 5.0.1 and so I have lost all the data from my iPhone,but i have a backup in my computer.How do I use the backup file ? i.e How will i get that backup file in my iPhone ?

    I have an iphone 4.I upgraded it to 5.0.1 and so I have lost all the data from my iPhone,but i have a backup in my computer.How do I use the backup file ? i.e How will i get that backup file in my iPhone ?

    Connect phone to computer.
    Select Restore.
    Tell iTunes which of the available backup files to use, let iTunes restore it.
    Also, try reading the User's Guide as it answers questions like this.

  • Using sharepoint designer 2013 - connected to sharepoint online - but getting " data source file cannot be saved" after making a new linked datasource

    using sharepoint designer 2013 - connected to sharepoint online - but getting " data source file cannot be saved" after making a new linked datasource

    Hi,
    Based on your description, I have done a test and I can’t reproduce your issue.
    I have used SharePoint Designer 2013 to open a SharePoint Online site and there are no issues.
    I’d like to clarify whether you encounter any issues when accessing SharePoint Online sites. If there are no issues during the accessing procedure, SharePoint Online service should be working fine at your side. The issue may be caused by specific SharePoint
    Designer client or network. I suggest you refer to the following steps to troubleshoot the issue.
    1. Use SharePoint Designer to open another site and check whether it is successful.
    2. When you are prompted to enter Office 365 account and password, try other users’ accounts and select the remembering the credential.
    3. Perform the connection procedure under another environment and verify whether the issue is resolved.
    If the issue persists, can you provide related screenshots for further troubleshooting?
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

Maybe you are looking for