Generating File name as versions

Hi,
I have a scenario where in my output file should be generated in versions or sequence.
order_00.xml and nest file as order01.xml so on for every file posted ..
My receiver is a 3rd party system and we are using FTP not NFS..
Any help in achieving this would be appreciated.

Hi,
Instead of going with the sequence number, it would be better to go with the IDOC number.
Here is the code:
public String putDynamicConfiguration(String docnum, Container container) throws StreamTransformationException{
try
     DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
     DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
     String filename = "Prefix_" + docnum + ".txt";
     conf.put(key, filename);
     return docnum;
catch (Exception e)
     return docnum;
you can add a counter function to thiis code to achieve the requirement.
Thanks,

Similar Messages

  • Filespaces in generated file names - unfortunate

    I'm trying to upload all the files generated by an export to directory. Many of the auto-generated file names use the name of a page (which is displayed in the navigation - so i don't want to remove the spaces).
    This creates files with blanks in the name, and most FTP implementations will choke on this.
    #1 - this should be fixed
    #2 - does anyone have a workaround for managing this?

    Spaces are not valid in web pages. If used, they have to be escaped with %20
    If you want to change the names of files before trying to use them with some web publishing program, this shell script might be of use. It changes spaces to _ makes upper case letters lower case, etc.
    #!/bin/bash
    # Pete keeps giving me photos with bad file names
    for i in *
    do
    OLDNAME="$i"
    NEWNAME=`echo "$i" | tr ' ' '_' | tr A-Z a-z | sed s/-/-/g`
    if [ "$NEWNAME" != "$OLDNAME" ]
    then
    TMPNAME="$i"_TMP
    echo ""
    mv -v -- "$OLDNAME" "$TMPNAME"
    mv -v -- "$TMPNAME" "$NEWNAME"
    fi
    done

  • Generate file names randomly

    are there anyways to generate file names randomly? if there are, are there any reference codes i could refer to? thanks.
    heard that using random characters from ascii code (generating random numbers and translating them into chars) could do the job but i am rather new to it. can anybody advise me on how to go about it? thanks.

    There is a method called createTempFile in the java.io.File class for this purpose. I suggest you use that one.

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • How to generate file name dynamically in receiver FIle adapter? Please help

    Dear Experts,
       I have a scenario where I need to generate output file with the name dynamically pulled from the XI payload.
       In receiver File communication channel I don't see any option where we can specify the XML path for the file name.
       For example:
       If my inbound XML structure (inbound interface) is like below:
       <filename>file123.txt</filename>
       <RootNode>
             <Element1>Product123</Element1>
       <RootNode>
      From this I need to pick the filename value and generate the output file with the same value.
      How can I achieve this? Please help!
    Thanks & Regards
    Gopal
    Edited by: gopalkrishna baliga on May 3, 2011 1:10 PM

    Gopal,
    You can use DynamicConfiguration class for this.
    You need to write UDF for this and with input of filename you want to set and map this UDF to the top level node.
    Refer the below famous blog from Micheal:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    You can also use Variable substitution to get value from payload, search SDN on this.
    --Divyesh Vasani

  • File name and Version name corruption

    In a section of my library, if I click on a thumbnail, it opens with a different photo than the thumbnail and the thumbnail then changes to this other photo. The Metadata indicates that the file name is referencing the surprise photo and the version is referencing the original photo. Since all my files are referenced, if I Show in the Finder, the reference is to the surprise photo. This appears to be just in my 2006 year folder of photos (3500) but seems to have occurred randomly throughout that year. It is really a mess.
    fyi, my photos are organized with folders for each year and then projects and subfolders for the various events. Total library is about 65,000 photos. All are referenced.
    Any clue as to what is happening and how to correct it would be appreciated.
    thanks, gib

    My masters are on a Drobo drive that is only 1/2 full. I talked with Apple today but the support person was not able to determine the issue. He thought the Drobo could be an issue, although his experience was more with slower response time. (I am very pleased with the Drobo.) He suggested that I trash the offending projects, setup new ones and re-import the masters. Ok but lose metadata and adjustments but may be the next step to take.

  • Dynamically generating file names for 2 File ( 1: 2 mapping transformation)

    Hi ,
    I have a scenario Proxy to File(FCC) with 1:2 transformation in message mapping ie 1 sender and 2 receiver interface ....
    1 Message mapping
    1 Operation mapping
    1 RD , 1 ID and 2 file receiver channels  and 2 receiver agreements.
    I need to dynamically generate the filename say abc.(first 9 characters of mesg id) and xyz.(first 9 characters of mesg id)
    I used dynamic configurations with ASMA settings, created 2 UDF assigned each of these to header node of r receiver message types.
    Here, I guess the second dynamic configuration is over writing the first dynamic configuration and hence creating only one file with xyz.(first 9 characters of mesg id)
    name .
    Need your valuable inputs
    Thanks and regards,
    Pavithra

    As dynamic configuration doesnot work in case of 1:n mapping what  you need to do is
    Create a field Filename in your source data structure
    Create a1:1 mapping between your source structure and source structure
    In that 1:1 mapping on the target structure assign UDF for file name
    Now this target structure will be used as a source structure in your next 1:2 mapping
    Under operation mapping add first the 1:1 mapping for source and then the multimapping
    regards
    Ninad

  • Generating file name with date

    Hello,
    I try to create via ABAP a file name with date in it. Normaly my script must run but the script won't run. Please help. Thanks.
    data = sy-datum.  " = data set to sys date
    data+6(2) = '01'. " = first day of month
    data = data - 1.  " = last day of last month
    file name creation
    p_filename+0(21) = '/sapio/flatfiles/xxx/'. " = first part of file name
    p_filename21(6) = data0(6). " = second part of file name
    p_filename+27(15) = '_XXXX_XXXXX.csv'. " = last part of file name
    p_subrc = 0.
    Regards, Thomas

    Hi again!
    Now I try it with your hints but now I got a save error.
    program conversion_routine.
    * Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rsldpsel.
    * Global code used by conversion rules
    *$*$ begin of global - insert your declaration only below this line  *-*
    * TABLES: ...
    * DATA:   ...
    data: data like sy-datum.
    *$*$ end of global - insert your declaration only before this line   *-*
    form compute_flat_file_filename
         using p_infopackage type rslogdpid
      changing p_filename    like rsldpsel-filename
               p_subrc       like sy-subrc.
    *       Insert source code to current selection field
    *$*$ begin of routine - insert your code only below this line        *-*
    * Datum wird gebaut
    data = sy-datum.  " = data set to actual date
    data+6(2) = '01'. " = first day of month
    data = data - 1.  " = last day of month before
    v_date = data+0(6).
    * Dateiname wird gebaut
    p_filename = '/sapio/flatfiles/XXX/'v_date'_XXXX_XXXX.csv'.
    p_subrc = 0.
    *$*$ end of routine - insert your code only before this line         *-*
    endform.

  • Why is the Master File names as Version?

    When I import a file into a new project and apply an adjustment a new 'version 2' is automatically generated. This is correct. But why does the system name the original Master (which remains unchanged) as 'Version 2' and shows the adjusted file as the master?

    See the thread
    http://discussions.apple.com/thread.jspa?threadID=2330768

  • Mailing the Report Output-Does not generating file name

    Dear Gurus,
           The below program fulfils the "mailing the report" requirement .it sends the out put as an attachment in XLS format.But one problem exists i.e.,it does not generate  filename.It gives the filename as ".XLS"(DOT XLS).
    What should be done that system generates a filename?
    *& Report  ZTESTMAIL                                                   *
    REPORT  ZTESTMAIL                               .
    tables: ekko.
    parameters: p_email type somlreci1-receiver.
    types: begin of t_ekpo,
    ebeln type ekpo-ebeln,
    ebelp type ekpo-ebelp,
    aedat type ekpo-aedat,
    matnr type ekpo-matnr,
    end of t_ekpo.
    data: it_ekpo type standard table of t_ekpo initial size 0,
    wa_ekpo type t_ekpo.
    types: begin of t_charekpo,
    ebeln(10) type c,
    ebelp(5) type c,
    aedat(8) type c,
    matnr(18) type c,
    end of t_charekpo.
    data: wa_charekpo type t_charekpo.
    data: it_message type standard table of solisti1 initial size 0
    with header line.
    data: it_attach type standard table of solisti1 initial size 0
    with header line.
    data: t_packing_list like sopcklsti1 occurs 0 with header line,
    t_contents like solisti1 occurs 0 with header line,
    t_receivers like somlreci1 occurs 0 with header line,
    t_attachment like solisti1 occurs 0 with header line,
    t_object_header like solisti1 occurs 0 with header line,
    w_cnt type i,
    w_sent_all(1) type c,
    w_doc_data like sodocchgi1,
    gd_error type sy-subrc,
    gd_reciever type sy-subrc.
    t_object_header = 'Text.xls'. append t_object_header.
    *START_OF_SELECTION
    start-of-selection.
    Retrieve sample data from table ekpo
    perform data_retrieval.
    Populate table with detaisl to be entered into .xls file
    perform build_xls_data_table.
    *END-OF-SELECTION
    end-of-selection.
    Populate message body text
    perform populate_email_message_body.
    Send file by email as .xls speadsheet
    perform send_file_as_email_attachment
    tables it_message
    it_attach
    using p_email
    'Example .xls documnet attachment'
    'XLS'
    'PO'
    changing gd_error
    gd_reciever.
    Instructs mail send program for SAPCONNECT to send email(rsconn01)
    perform initiate_mail_execute_program.
    *& Form DATA_RETRIEVAL
    Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp aedat matnr
    up to 10 rows
    from ekpo
    into table it_ekpo.
    endform. " DATA_RETRIEVAL
    *& Form BUILD_XLS_DATA_TABLE
    Build data table for .xls document
    form build_xls_data_table.
    *CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
    *con_tab TYPE x VALUE '09'. "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    constants:
    con_tab type c value cl_abap_char_utilities=>horizontal_tab,
    con_cret type c value cl_abap_char_utilities=>cr_lf.
    concatenate 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
    into it_attach separated by con_tab.
    concatenate con_cret it_attach into it_attach.
    append it_attach.
    loop at it_ekpo into wa_charekpo.
    concatenate wa_charekpo-ebeln wa_charekpo-ebelp
    wa_charekpo-aedat wa_charekpo-matnr
    into it_attach separated by con_tab.
    concatenate con_cret it_attach into it_attach.
    append it_attach.
    endloop.
    endform. " BUILD_XLS_DATA_TABLE
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    form send_file_as_email_attachment tables pit_message
    pit_attach
    using p_email
    p_mtitle
    p_format
    p_filename
    p_attdescription
    p_sender_address
    p_sender_addres_type
    changing p_error
    p_reciever.
    data: ld_error type sy-subrc,
    ld_reciever type sy-subrc,
    ld_mtitle like sodocchgi1-obj_descr,
    ld_email like somlreci1-receiver,
    ld_format type so_obj_tp ,
    ld_attdescription type so_obj_nam ,
    ld_attfilename type so_obj_des ,
    ld_sender_address like soextreci1-receiver,
    ld_sender_address_type like soextreci1-adr_typ,
    ld_receiver like sy-subrc.
    ld_email = p_email.
    ld_mtitle = p_mtitle.
    ld_format = p_format.
    ld_attdescription = p_attdescription.
    ld_attfilename = p_filename.
    ld_sender_address = p_sender_address.
    ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
    w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
    w_doc_data-obj_langu = sy-langu.
    w_doc_data-obj_name = 'SAPRPT'.
    w_doc_data-obj_descr = ld_mtitle .
    w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
    clear w_doc_data.
    read table it_attach index w_cnt.
    w_doc_data-doc_size =
    ( w_cnt - 1 ) * 255 + strlen( it_attach ).
    w_doc_data-obj_langu = sy-langu.
    w_doc_data-obj_name = 'SAPRPT'.
    w_doc_data-obj_descr = ld_mtitle.
    w_doc_data-sensitivty = 'F'.
    clear t_attachment.
    refresh t_attachment.
    t_attachment[] = pit_attach[].
    Describe the body of the message
    clear t_packing_list.
    refresh t_packing_list.
    t_packing_list-transf_bin = space.
    t_packing_list-head_start = 1.
    t_packing_list-head_num = 0.
    t_packing_list-body_start = 1.
    describe table it_message lines t_packing_list-body_num.
    t_packing_list-doc_type = 'RAW'.
    append t_packing_list.
    Create attachment notification
    t_packing_list-transf_bin = 'X'.
    t_packing_list-head_start = 1.
    t_packing_list-head_num = 1.
    t_packing_list-body_start = 1.
    describe table t_attachment lines t_packing_list-body_num.
    t_packing_list-doc_type = ld_format.
    t_packing_list-obj_descr = ld_attdescription.
    t_packing_list-obj_name = ld_attfilename.
    t_packing_list-doc_size = t_packing_list-body_num * 255.
    append t_packing_list.
    Add the recipients email address
    clear t_receivers.
    refresh t_receivers.
    t_receivers-receiver = ld_email.
    t_receivers-rec_type = 'U'.
    t_receivers-com_type = 'INT'.
    t_receivers-notif_del = 'X'.
    t_receivers-notif_ndel = 'X'.
    append t_receivers.
    call function 'SO_DOCUMENT_SEND_API1'
    exporting
    document_data = w_doc_data
    put_in_outbox = 'X'
    sender_address = ld_sender_address
    sender_address_type = ld_sender_address_type
    commit_work = 'X'
    importing
    sent_to_all = w_sent_all
    tables
    object_header = t_object_header
    packing_list = t_packing_list
    contents_bin = t_attachment
    contents_txt = it_message
    receivers = t_receivers
    exceptions
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    others = 8.
    Populate zerror return code
    ld_error = sy-subrc.
    Populate zreceiver return code
    loop at t_receivers.
    ld_receiver = t_receivers-retrn_code.
    endloop.
    endform.
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    Instructs mail send program for SAPCONNECT to send email.
    form initiate_mail_execute_program.
    wait up to 2 seconds.
    submit rsconn01 with mode = 'INT'
    with output = 'X'
    and return.
    endform. " INITIATE_MAIL_EXECUTE_PROGRAM
    *& Form POPULATE_EMAIL_MESSAGE_BODY
    Populate message body text
    form populate_email_message_body.
    refresh it_message.
    it_message = 'Please find attached a list test ekpo records'.
    append it_message.
    endform. " POPULATE_EMAIL_MESSAGE_BODY
    Your suggestions will be appreciated and rewarded.
    Thanks in advance
    Murali

    Hi
    Your pgm is not passing anything in obj_descr in packing list for excel file. If you pass a name your excel file will have that.
    Regards
    Sathar
    perform send_file_as_email_attachment
    tables it_message
    it_attach
    using p_email
    'Example .xls documnet attachment'
    'XLS'
    'PO'
    ' '  *------> no value*
    changing gd_error
    gd_reciever.
    form send_file_as_email_attachment tables pit_message
    pit_attach
    using p_email
    p_mtitle
    p_format
    p_filename
    p_attdescription *----> no value*
    p_sender_address
    p_sender_addres_type
    changing p_error
    p_reciever.
    t_packing_list-obj_descr = ld_attdescription.

  • How to Change the defalut file name of PDF out of report (Version 6i)

    Dear All
    I have a report which opens from forms(Version 6i); the output of the report is in PDF. The generated file name is the same name as the report. Is there any way to give parameter name of the report as the name of the PDF out put of the report?
    For example I have a parameter called PATIENT_ID and my value is 25613 now I need the PDF out put name also 25613.
    Thanks and regards
    Sijo

    Use DESNAME to specify the output filename:
    set_report_object_property(repid, REPORT_DESNAME, :patient_id);

  • Reg : I need to generate a file name sequence number.

    Dear All,
    I need to generate file name in sequence number. Now i have generated file in specific folder. In that folder file i am reading one by one and generating. Problem is folder file some names having special characte those names are not generating while reading 'Cat' Caommand in shell script. Instad of that i want to generate files in 1.ldt,2.ldt to etc..
    Please guide me how to generate in specific folder.
    Thanks in advance.
    Best Regards,
    Velu.

    First, LabVIEW 7 allows you to pass string and path data types directly into the Matlab script node. Otherwise, in LV <= 6.1 you can do the following:
    In LabVIEW, convert the string to an array of U8s using the String to Byte Array function. Then pass the U8 array into the Matlab script node as a Real Vector type. Finally, in Matlab, convert the Real Vector to a string using the char() function. For example:
    stringAsString = char(stringAsRealVector)
    Attached is an image that shows how to do this.
    Good luck,
    -Jim
    Attachments:
    Matlab_Script_Node_String_Input.GIF ‏6 KB

  • How to know file names & version on EBS 12.1.1

    Hi guys
    Please help I work with EBS 12..1.1 on HP-UX
    When apply patch no. 8429053 to support financial consultant ,I read the patch read me and as required I must know the file name and version as following .
    *3. Fixed File Names and versions*
    *$xla/patch/115/sql/xlaaptrn.pkb 120.63.12010000.14*
    and i found wrote *"cd $XLA"* then I didn't find it how to know this info
    Thanks

    Hi,
    It's not uncommon for the documentation to omit '_TOP' from the environment variable names, unfortunately. Try 'cd $XLA_TOP' instead.
    You can refer to Note 121916.1: How To Get Version of Programs, Files, and Objects Necessary for Oracle Applications? to find out how to get the version of the file you need.
    (Edit: Whoops, look like I left my browser tab open too long, and Srini already answered your question. :) )
    Regards,
    John P.
    http://only4left.jpiwowar.com
    Edited by: jpiwowar on Apr 24, 2010 8:17 AM

  • Can I change the File Names the Iphone generates for my photos so I don't have to go and "rename" each photo?

    When I take a photo the phone stores it with a self generated file name, however since I have multiple Iphones taking photos, I would like to change the method of this generated filing system.
    As an example, photos being taken with Iphone #1 would have Phone1Image1... or some smaller if necessary and then phone 2 would be Phone2Image1...
    Then when I go into the cloud I could sort them according to source rather than a random date selection or some other way of filing.
    Thanks

    Just have each song as a separate playlist.
    You can use the SpotLight search on the iPod to find songs as well as other things.
    You can also change what the search shows to only include music. Go to Settings>General>Spotlight search

  • Any way to keep original file name as image name for web gallery?

    Hi,
    I wonder if there is any way to keep the original file name as image name for a web gallery (instead of "picture-1.jpg)
    People often send us the thumbnails or the image from the web and we have to search forever to find the image in AP - if we could keep our original filename then this would be a second away.
    Hope somebody has an idea
    thanks

    Hi William,
    I finally had time to play - unfortunately it does
    not work the way you described above.
    I´m just exporting a set of images using the "Stock
    Black" Theme - marked name only - batched the
    filename to masterfile - but the actual picture names
    are still "picture-1.jpg" - "picture-2.jpg".
    did I miss anything? thanks
    I see what you want, you don't care about the screen name so much but want the generated file names to be the same as the version names. From earlier messages though I am not quite sure why this is a problem, since you said other people were picking the images they wanted - say Image1 and 23 and 8. That to me says those people are going through the directory using Finder or Explorer, not using the HTML.
    Is it the case you are giving people web galleries on CD? If so, then perhaps also export a "browse" directory with exported images using the version names, so that people can use the right name.
    Or perhaps it's the case that people are downloading the images from the web, and then using the downloaded file names to send you requests. I'm not sure how to fix this yet and do not know if 1.1 offers something for this.

Maybe you are looking for

  • BDC for FB50L...URGENT

    Hi, I am doing the BDC for FB50L but the code doesn't seem to execute...it is giving errors... I am attaching the code...Please review it and help me....its really urgent... Your help will be really appreciated... REPORT  ZTEST_BDC_PARK_ACC_GL. DATA:

  • Splitting Purchase Order Idoc based on qty

    Hi All, I am having a requirement wherein i have to insert multiple line items in purchase order idoc  based on quatity .Eg if the line item qty is 3 then the same line item has to be repated for 3 times and purchase order idoc has to created with 3

  • How to create barcode form in Acrobat Pro XI

    i have checked a few video's regarding creating bar code eForm in Acrobat Pro X. However, i am finding difficulities to adding a bar code (No such field is available) in Acrobat Pro XI FormsCentral, is there any plug-in/update required?

  • RFC Call from ABAP (R3) to Webdynpro EP

    Hi experts, I have a requirement to initiate a call from an ABAP program on R3 to a standard Portal (Webdynpro) API. Does anyone have any experience with this? I understand that normally Portal (Webdynpro) applications will make the RFC call to ABAP

  • Rhino calling overloaded Java methods with Array parameters

    Has anyone had any problems writing JavaScript code that calls overloaded Java methods? I have two Java defined methods that differ in the arguments, one takes a string the other takes an array of strings. The problem is calling Java methods within t