Module Processor - FTP File Name

Hi,
I want to know the sender file and we are in SP11. I deployed the bean component to J2EE and also added the components in Adapter also.Could any one explain what to do next to get the file name.
GK

Hi,
Refer to this weblog on 'Copy a file with same filename using XI'
/people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi
also refer  SAP Note 819761 for another wa to access the file name.
Cheers,
Siva Maranani.

Similar Messages

  • Get FTP file name

    Hi,
       I have a question about how to get the file name from FTP.
       Use Function 'FTP_COMMAND'
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          HANDLE                = handle
          command               = 'ls'
        tables
          data                  =  data_list
       EXCEPTIONS
         TCPIP_ERROR           = 1
         COMMAND_ERROR         = 2
         DATA_ERROR            = 3
         OTHERS                = 4
    the return data_list data like this:
        -rw-rw-rw  1 user  group  1245  oct 8  08:18   1101_433.txt.
    The question is that  how can i get the file name?  At the example is '1101_433.txt.'.
    Which Function can process it ?

    Hi Zheng,
    FYI link which will guide you through FTP process
    http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPsolutiontoimplementFTP+transactions
    Cheers
    S.Janagar

  • Function Module for creating file name in Application Server

    Hi Guys,
    Can you suggest me a function module to generate a file name for a flat file to be save on application server using DATASET. 
    Required filename format : <table name >.<times tamp>.TXT
    Thanks in advance.

    Hi,
    Please try this ...
    DATA: BEGIN OF FILE1,
            CONST1(01) TYPE C VALUE '_',
            FIELD1     LIKE SY-DATUM,
            CONST2(01) TYPE C VALUE '_',
            FIELD2     LIKE SY-UZEIT,
          END OF FILE1.
    DATA: FILENAME LIKE EDI_PATH-PTHNAM.
    MOVE SY-DATUM  TO FILE1-FIELD1.
    MOVE SY-UZEIT  TO FILE1-FIELD2.
    CONCATENATE <table name> FILE1 INTO FILENAME.
    Regards,
    Ferry Lianto

  • FTP directory from part of PDF file name

    Hi,
    I have a requirement to FTP a pdf file to a server directory according to fist 10 char of the file name. I am able to get the file name using variable substitution method but how can i chop the 1st 10 char of file name as my directory? As the file is a .pdf i didn't do any data mapping.
    Thanks

    Hi,
       If you dont have any Mapping Objects,then writing adapter module to change file name is the right option
    or you can create dummy message mapping and add dynamic configuration UDF ,but in your case you trasfering PDF documents,this option is not feasible.
    or writing Java map is the other alternatine,but it is not recommanded to your requirement,because once again you need change the .add IR objects.
    Writen adapter module,
    add and chnage below code as per module and your requirement
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMdd");
    String timestamp = dateformat.format(new Date());
    String filename_new=fileNametimestamp".txt";
    conf.put(key, filename_new);
    return "";
    Regards,
    Raj

  • Getting the swf file name of the module

    i have a parent application and it loads a module xyz.swf.
    however, i don't know the name of the module the parent application is loading.
    is there a way i can get the module's swf file name in the module code without knowing it beforehand?
    thanks

    Hi All,
    Iam able to do this by checking the Option ASMA in only sender adapter itself
    Regards
    Bopanna

  • Class Cast Exception In Module Processor

    Hi,
      I'm trying implement "Step by step guide to develop a
    module for reading file name in a
    sender file adapter" by Krishnakumar Ramammoorthy. When I deploy the EAR in my server I'm getting following exception:
    #1.5#0003BA92DD90003B0000240000001D190003FCBEF3B117E6#1122321992587#/Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/File##com.sap.aii.adapter.file.File2XI.processFileList()#J2EE_GUEST#0##nd2xidb.svc.doi.test_XD2_3621750#Guest#46b9f3b0fd4611d9af850003ba92dd90#output##0#0#Error#1#com.sap.aii.adapter.file.File2XI#Plain###Channel CC_File_S_ABCMCodes: Sending file failed with java.lang.ClassCastException - continue processing#
    I'm running it on XI 3.0 SP 11.
    I'm trying to send a file and planning to modify the content in the module processor.
    Please let me know if anyone has a clue ?
    to get above mentioned document please search for "ramammoorthy", it's the first document.
    https://www.sdn.sap.com/sdn/search.sdn?contenttype=url&query=ramammoorthy&selected=0&content=/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fSDN!2fiViews!2fWCM!2fcom.sap.sdn..wcm.search.search_adv%3Fprttheme%3DCSIN%26QueryString=ramammoorthy%26SearchPluginName=sdn_all%26SelectedCustomProps=resourcetype(value=s*)
    thanks
    Sibo

    Hi All,
      The problam was in ejb-jar.xml. You should use the interfaces provided by module framework as home and remote interface.
    I made following changes in ejb-jar.xml and it worked..
    <session>
                <ejb-name>GetFileNameBean</ejb-name>
                <!local-home>gov.doi.fbms.moduleprocessor.GetFileNameLocalHome</local-home>
                <local-home>com.sap.aii.af.mp.module.ModuleLocalHome</local-home>
                <!local>gov.doi.fbms.moduleprocessor.GetFileNameLocal</local>
                <local>com.sap.aii.af.mp.module.ModuleLocal</local>
                <ejb-class>gov.doi.fbms.moduleprocessor.GetFileNameBean</ejb-class>
                <session-type>Stateless</session-type>
                <transaction-type>Container</transaction-type>
            </session>
    Please refer to document http://help.sap.com/saphelp_nw04/helpdata/en/32/43d84072378031e10000000a1550b0/content.htm
    Thanks a lot for your help..
    Sibo

  • File name FM

    Hi all,
    Is there any function module to retrive file name from file path.??
    for example,
    file path: C:\MYDIR\TEMP\TEST.XLS.
    I want to retrive only file name 'test'  from above string.
    thanks in advance

    Refer the following code:
    PARAMETERS: p_ofile TYPE   dxfile-filename LOWER CASE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ofile.
      PERFORM help_audit_file CHANGING p_ofile.
    FORM help_audit_file CHANGING p_audit_path TYPE any.
    DATA:  lt_file_table TYPE filetable,
             la_file_table LIKE LINE OF lt_file_table,
             l_rc TYPE i,
             l_pcdsn TYPE cffile-filename.
      REFRESH lt_file_table.
      CLEAR la_file_table.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        CHANGING
          file_table = lt_file_table
          rc         = l_rc.
      READ TABLE lt_file_table INTO la_file_table INDEX 1.
      l_pcdsn = la_file_table-filename.
      MOVE l_pcdsn TO p_audit_path.
    ENDFORM.                    " help_audit_file

  • Reading file name

    hello
    i used the step by step guide to develop a module for reading file name in a sender file adapter from Krishnakumar Ramamoorthy. (Thankyou very much for that guide)
    now when i use this module i get only one problem:
    the filename includes the source-dir as well.
    e.g.
    source-dir: /home/example
    filename: test.txt
    Filename in module: /home/example/test.txt
    why is the source-path included in the Filename?
    thanks alot for any help

    Hi Paul,
    you can always delete this inside your mapping:
    for instance trim the first 13 letters from /home/example
    then if your directory is always the same you'll have a filename only
    Regards,
    michal

  • Name of processed file in a module processor in XI 3.0

    Hello,
    I've got the scenario : Flat file -> XI -> IDOC.
    I have configured the parameter "source file name" with "*.xml" in the file adapter.
    Now i try to capture in a moule processor the name of the file which is processed (for exemple : 123456.xml) and for that i try to use the "LookupManager" class and the "InboudRuntimeLookup" class for having the current channel and after i use the method : String res = (String) MyChannel.getValueAsString("file.sourceFileName") and in the two cases the result is "*.xml" so the configuration parameter... I don't understand how to get the current name of the file !
    I have do that in xi2.0 with a dispatcher and i know that it's possible to use this dispatcher with XI3.0 but i don't want to do that because after XI 3.0 the usage of a dispatcher is not permitted !
    So if anybody has an idea for doing that in XI3.0...
    Regards
    Vincent

    Did you take a look at this article? :
    Migrating Dispatcher Classes of the J2SE Plain Adapter Engine
    http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm
    Regards,
    Michal Krawczyk

  • Add Counter to File name when using Tran Protocol as FTP

    Hi There,
    Was wondering if there was any way to achive the same "Add Counter"  functionality used for File names in Reciever file adapter when we are using FTP as the transport protocol, this option is only provided in NFS,
    My requirement is ..
    Write files using counter on to ftp..
    say if three files already exists on the ftp server with names ...fname001, fname002 and fname003
    then the next time a file is written it should have a file name fname004 else fname001 if no file exists.
    Any help would be greatly appreciated

    No such standard functionality is available in communication channel...
    But you can try customizing ur scenario in one of the following ways...
    Case 1: If a field in source data carries the information regarding the sequence.
    You can map this value ( Directly .. or using some transformation ) in some temporary field in the target and then use a Variable substitution at the receiver communication channel.
    Case 2. If the source file name carries the sequence information. then you can enable the Adapter specific settings in the Sender communication channel , and then get the information of the source file name using the Container object in the mapping. Then assign the sequence number to a field in the target , use a Variable substitution at the receiver communication channel.
    Case 3 : If Case 1 and Case 2 are not applicable ... then you have to use a Ztable to store the sequence number , a function module to fetch the number , and then use a UDF in which you will implement the RFC call logic.Then the same process .... assign the sequence number to a field in the target , use a Variable substitution at the receiver communication channel.
    BR,
    Sushil.

  • In FTP server same file name with multiple vesions

    Hi All,
    My source system is UNIX. in that FTP server they have multiple files with same name  example " abc.dat"; with different versions example"abc.dat;43" "abc.dat;44", "abc.dat;45". . so how to read latest version file like "abc.dat;45"   from sender communication channel with file adapter.
    suggestions please..Thanks in advance.
    Edited by: venkataraonandigam on Jul 15, 2011 3:12 PM

    Hi VenkatRao,
    Sender file adapter configuration has an option "Processing Sequence". In the that select by"Date" or Name .
    If you used placeholders when specifying the file name, define the processing sequence of the files:
    ○       By Name: Files are processed alphabetically by file name.
    ○       By Date: Files are processed according to their time stamp in the file system, starting with the oldest file.
    Otherwise you have to write shellscrit to move the latest version file to a different folder and pick it up from that folder.
    Or
    write adapter module.

  • How to set FTP parameters through Module Processor?

    Hi
    We read parameters set in the communication channel of an adapter through method getSupplementalData("module.parameters") of com.sap.aii.af.mp.module.ModuleData.
    I have following question regarding reading/writing configuration data, set in communication channel for a File adapter:
    1) How can I read the FTP Connection Parameters in a module of a module processor?
    2) Is it possible to update FTP parameters at Module Processor level for Receiver Adapter?
    3) If update of parameters through Module Processor is not possible, then is there some other way I can set the FTP parameters?
    Regards
    Vijendra

    HI Vijendra,
    Check out this -
    https://websmp202.sap-ag.de/~form/sapnet?_SHORTKEY=01200252310000071155&_SCENARIO=01100035870000000202
    https://media.sdn.sap.com/SDNTV/main.asp?mediaId=130
    <i>2) Is it possible to update FTP parameters at Module Processor level for Receiver Adapter?</i>
    You can not dynamically determine the FTP server etc. In the Receiver Adapter, Module is called first, then control is given XI Adapter to output the file into FileSystems. You can modify the Payload.
    For more~
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/frameset.htm
    Hope this helps,
    Regards,
    Morothy

  • File name structure for picking up X12/EDIFACT documents from an FTP Server

    According to some documents, and posts in this forum, the file name for a document retreived from an FTP server by B2B has to be in the following format: %TPName%_%X12 Doc Type%_%X12 Version_1_12345.dat
    Why is this format required? Is it possible to obtain all this information for the Header Envelopes of each X12 or even EDIFACT EDI Document?

    Thanks Ramesh.
    I did specify the propery oracle.tip.adapter.b2b.edi.identifyFromTP=Group, but I was still not getting the expected results. Now I played around for a while and now I identified the problem . When I specify the property oracle.tip.adapter.b2b.edi.identifyFromTP=Group, I should use the Group ID when I create the agreement so that the agreement would be identified by using group id. I think I got that working now.
    I have one question on the trading partner end point URL in FILE/FTP. When I specify the endpoint URL for a trading partner would that be used to pull the document from the trading partner or push the documents to trading partner?
    In my testing even though I specified the end point URL for the trading partner using FILE protocol, when I put the message in that URL ( folder), it did not pull the message from that URL ( this trading partner is the initiator for that EDI 204 message). But when I put the messages into the host partner's end point URL, it got pulled and processed successfully. I am little confused on the usage of trading partner end point URL for the FILE/FTP protocols . Could you explain me little bit or point me to a documnet where it is expalined in detail?
    Bala

  • Function Module that gives the names of the file in the Application Server.

    Hi Experts,
       Please give me a Function Module that gives the names of the file in the Application Server.
    Thanks,
    Debi.

    Hi,
    see these links
    http://help.sap.com/saphelp_nw04/helpdata/en/2a/fa02b7493111d182b70000e829fbfe/content.htm
    http://abaplovers.blogspot.com/2008/05/function-module-sap-logged-in-users-to.html
    http://www.saptechies.com/abap-function-modules/
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/function-module-to-get-data-and-time-of-file-576751
    thanks
    karthik

  • 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

Maybe you are looking for

  • Error When using web services on Oracle Application

    we are getting this error when we deployed code on Oracle Application, but same code working fine on Jdev. Exception java.rmi.RemoteException: ; nested exception is: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionEx

  • Context Menu is not working in flash player 10.1

    I write a flex application. I added some custom menu items in context menu. when I compiled this code using flashplayer 10.0, it works fine and my added context menu items are shown when I Right-Click. But when I compile same code for flashPlayer 10.

  • HT203167 RINGTONES PURCHASED

    I purchased more than 20 ringtones since 2008. I recently changed my pc to imac and I also purchase iphone 5 at the same time. Now on my itunes account I have a proof of payment for my ringtones but when I looked at my purchased items they are not th

  • JSC, mysql 4.0 data source and utf-8

    Hi all, I connected to mysql 4.0 database from JSC and bound some utf-8 encoded text data to a StaticText component in a JSP page. Data is shown improperly, as a bunch of wierd characters. MySQL 4.0 knows nothing about encodings other than iso8859-1,

  • Backup Restoration fails on MSSQL2005(SP2) on windows 2003 IA64 in ECC6.0

    Hi ,            Iam trying to resore backup of my MSSQL2005 server from a Ultrium 3 tape drive but it's getting failed. Iam able to take the backup sucessfully and Iam able to see the content on the tape0 from SQLStudio Manager. When I try to restore