How do I use FILE_GET_NAME and make my resulting dataset name unique?

Okay, here's a case where I have a bunch of pieces to the puzzle -- a little knowledge here, a little knowledge there -- but I'm having trouble putting them together.
I am working on an RFC that is called by XI as part of an interface.  This interface will execute every 15 minutes.  As part of the RFC's execution (which is very simple and straight-forward) I would like to write out a dataset of the processing results.  I have already learned how to use the OPEN DATASET, TRANSFER, and CLOSE DATASET commands, so I'm good to go there.
Here's what I'd like to do:  Because this can run every 15 minutes, I don't want to keep overwriting my dataset file with the latest version.  I'd like to keep the dataset name unique so it doesn't happen.  Obviously, the first thought that comes to mind is adding a date/time stamp to the file name, but I'm not sure how -- or the best way -- to do this.
Also, I was told I should put the file -- for now -- into the DIR_DATA directory.  I had no idea what this meant until I was told about t-code "FILE" and that this was the logical file name.  Someone in-house thought I'd need to use a function called FILE_GET_NAME to make things easier.
Okay, so I need to use FILE_GET_NAME apparently, somehow plugging in DIR_DATA as the directory I need, and I want the resulting file name to have the date/time added at run time.  I'm thinking when it comes to batch processing and writing out datasets, this has to be something that someone's already "paved the road" doing.  Has anyone done this?  Do you have a little slice of code doing just this that you could post?  This would go a long way toward helping me understand how this "fits" together, and I would greatly appreciate any help you can provide.
As always, points awarded to all helpful answers.  Thank you so much!

hey,
here is the brief description of logical & physical path.
in the physical path, we will give total path of the file,where the file is located actually in the server.
for example : /INT/D01/IN/MYFILE.
this is the physical path in my client for a particular file.
some times this have problems like D01 above in the path,
is development system. if we move to quality, it will be Q01 etc..
to make every file independent of the server location, we use logical path concept, which is nothing but, instead of giving the total physical path like above,we will give this logical path & file name. before that we will create a logical path in sap & assign some physical path to it.
the below function module is used to get the actual physical path by giving the logical path name & file name
*&      Form  GET_PHYSICAL_PATH
      text This form used to get the Physical Filepath by giving the Logical path & the File name.
FORM GET_PHYSICAL_PATH.
  DATA : LV_FILE(132) TYPE C,
         V_LENGTH TYPE I   ,
         LV_LOGNAME LIKE FILEPATH-PATHINTERN.
  LV_LOGNAME = P_LPATH.
*--this P_LPATH is a parameter in the selection screen
*--this P_FNAME is the actual file name as below
*--PARAMETERS : P_LPATH TYPE RLGRAP-FILENAME,
                P_fname TYPE RLGRAP-FILENAME.
  CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
       EXPORTING
            CLIENT                     = SY-MANDT
            LOGICAL_PATH               = LV_LOGNAME
            OPERATING_SYSTEM           = SY-OPSYS
            FILE_NAME                  = p_fname
       IMPORTING
            FILE_NAME_WITH_PATH        = LV_FILE
       EXCEPTIONS
            PATH_NOT_FOUND             = 1
            MISSING_PARAMETER          = 2
            OPERATING_SYSTEM_NOT_FOUND = 3
            FILE_SYSTEM_NOT_FOUND      = 4
            OTHERS                     = 5.
  IF SY-SUBRC <> 0.
    MESSAGE E000 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ELSE.
*--ur total physical(absolute) path will be in LV_FILE.
    V_FILEPATH = LV_FILE.
  ENDIF.
ENDFORM.                    " GET_PHYSICAL_PATH
unique naming for ur file names;
after getting the physical path from the above function module, append date& time stamp to the file as below.
CONCATENATE V_FILEPATH
            SY-DATUM
            SY-UZEIT
            INTO V_FILEPATH.
This way you can make your file name unique always
regards
srikanth
Message was edited by: Srikanth Kidambi

Similar Messages

  • How do I use CreateBookmarksFromGroupTree and NOT guid in the name for my top level?

    Post Author: Barbdcg
    CA Forum: Deployment
    I have a report that I have created that uses uses groups and I wanted export a PDF using the CreateBookmarksFromGroupTree option. While that works, I get an ugly top level bookmark name that starts with the name of my report, then followed by a GUID;
    Report {49E72CC5-7FFD-44F8-831B-EA8F543F7D82}.rpt
    So, how do I Put in a name of my own choosing as the top-level bookmark or at least get rid of the guid?
    Any help or suggestions would be appricated.
    Thanks,
    Barb

    Post Author: Barbdcg
    CA Forum: Deployment
    Still no answer??? I can not figure this one out!!  HELP!!!

  • How do I rearrange apps and make folders using a Focus 40 braille display

    I am using a Focus 40 braille display with an iPad2. What are the commands/how do I rearrange apps and make folders when accessing in this manner? Thanks in advance.

    Assuming you sync with iTunes then there will be a backup maintained by iTunes. Just sync the iPhone with iTunes to transfer everything from the backup to the phone.
    Also see iPhone- Transferring information from your current iPhone to a new iPhone

  • How do I use Qt and OpenGL with Visual Studio

    Hi! I mainly want to program in C++ and I want to use Qt and OpenGL with Visual Studio.
    I am currently revising C++ and later on i am going to start reading Qt and OpenGL. I have a background of
    Embedded firmware design(C and Assembly).
    The Visual Studio Version I have is 2013 ultimate. How do I use Qt and OpenGL with Visual Studio?
    Thanks
    Alexandros

    Hi ClassicalGuitar,
    The forum supports VS setup and installation. And your issue is not about the forum. I will move the thread to off-topic forum. Thanks for your understanding.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • HT2534 how do i use itunes and the app store without any credit card or gift card?

    i just got my iphone and i used to use itunes all the time before when downloading all songs were completly free, how do i use itunes and the app store to find free stuff to download without having to add a credit card or gift card with my account?

    Create a NEW account/ID for her using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before. Make sure you specify a birthdate that results in being at least 13 years old
      Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    More details of how:
      http://ipadhelp.com/ipad-help-tips-tricks/how-to-get-free-apps-from-the-app-stor e-without-a-credit-card/

  • How do you import jpegs and make a flip book with CC Id?

    How do you import jpegs and make a flip book with CC Id?

    You actually don't need to make a flipbook yourself. There are paid and free, ready-to-use flipbooks in Flash or HTML5 available which you just need to configure and then put all images into a specific folder and the flipbook runs them.

  • How can I use OmniPortlet and Web Clipping Portlet?

    How can I use OmniPortlet and Web Clipping Portlet?

    You find information on OmniPortlet and Web Clipping in the Portal Developer's Guide.
    o Building Portlets with OmniPortlet
    o Building Content-Based Portlets with Web Clipping
    Peter

  • When I try to restore my iPod, it stops restoring at the same place and doesn't work. How do I fix this and make it completely restore itself?

    When I try to restore my iPod, it stops restoring at the same place and doesn't work. How do I fix this and make it completely restore itself?

    Did you make sure that your security software allows iTunes to contact Apple during the restore process? http://support.apple.com/kb/TS3125

  • How can I use excel and word on the IPAD2

    How can I use excel and word documents on my Ipad 2

    There are apps such as Documents To Go which support reading/editting/creating those sorts of documents :
    standard version  -  http://itunes.apple.com/us/app/documents-to-go-office-suite/id317117961?mt=8
    premium version  -  http://itunes.apple.com/us/app/documents-to-go-premium-office/id317107309?mt=8

  • How can I use undo and redo with run time menu?

    Hi..I try to built my own menu for graphic programming. How can I use undo and redo in labview with run time menu?

    filozof-
    During runtime, by default, LabVIEW has undo/redo data changes under the edit menu. This will undo/redo changes made to controls during runtime. If you want a more extensive undo/redo (custom for your application), you are going to have to do quite a few things
    1) Create a custom runtime menu (Edit>>RunTime Menu) and place your own undo/redo controls on it
    2) Keep an action history in your program
    3) Catch the Shortcut menu event for your custom undo/redo controls
    4) Reverse the last action in your histroy when you catch the event
    This method would allow you undo entire operations (like resize, move, or whatever kind of functionality you are building into your application) unstead of just undoing data changes.
    Xaq

  • How do I remove background and make it transparent?

    How do I remove background and make it transparent?

    The tutorial below shows you how to remove the background around a figure.
    For more simple images, you might try this tutorial, instead:
    I hope these help, and please let us know if you have any trouble with the steps!

  • I use a Flexislider for my website [url removed] I want to use flash and make my website attracti

    I use a Flexislider for my website [url removed] I want to use flash and make my website attractive. Any suggestions?

    Will people be able to login to the FTP server from my website and do everything through their browser?
    Users could use web based ftp client or a 3rd party ftp client.
    Have look at the sytem the following school uses.
    http://www.glenbard.net/Glenbard_DistrictHQ/Media/MOVs/Web-BasedFTPClient.html
    Although I have not setup this type of thing up myself googling around shows a few tutorials using PHP or Java based ftp clients.
    have a look at this article..

  • The new firefox opens my homepage IN ADDITION to the firefox startup page EVERY TIME I open firefox. How can I stop this and make it so ONLY my homepage shows?

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/893967]]</blockquote>
    The new firefox opens my homepage IN ADDITION to the firefox startup page EVERY TIME I open firefox. How can I stop this and make it so ONLY my homepage shows?

    See these articles for some suggestions:
    * https://support.mozilla.com/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    * https://support.mozilla.com/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    * http://kb.mozillazine.org/Preferences_not_saved

  • Why and how do we use CHAIN and ENDCHAIN

    Why and how do we use CHAIN and ENDCHAIN

    Hi,
    To ensure that one or more PAI modules are only called when several screen fields meet a particular condition, you must combine the calls in the flow logic to form a processing chain. You define processing chains as follows:
    CHAIN.
    ENDCHAIN.
    All flow logic statements between CHAIN and ENDCHAIN belong to a processing chain. The fields in the various FIELD statements are combined, and can be used in shared conditions.
    CHAIN.
      FIELD: <f1>, <f 2>,...
      MODULE <mod1> ON CHAIN-INPUT|CHAIN-REQUEST.
      FIELD: <g1>, <g 2>,...
      MODULE <mod2> ON CHAIN-INPUT|CHAIN-REQUEST.
    ENDCHAIN.
    The additions ON CHAIN-INPUT and ON CHAIN-REQUEST work like the additions ON INPUT and ON REQUEST that you use for individual fields. The exception is that the module is called whenever at least one of the fields listed in a preceding FIELD statement within the chain meets the condition. So <mod1> is called when one of the fields <fi> meets the condition. <mod2> is called when one of the fields <f i> or <g i> meets the condition.
    Within a processing chain, you can combine individual FIELD statements with a MODULE statement to set a condition for a single field within the chain:
    CHAIN.
      FIELD: <f1>, <f 2>,...
      FIELD  <f> MODULE <mod1> ON  INPUT|REQUEST|*-INPUT
                                  |CHAIN-INPUT|CHAIN-REQUEST.
      MODULE <mod2> ON CHAIN-INPUT|CHAIN-REQUEST.
    ENDCHAIN.
    The module <mod1> is called when screen field <f> meets the specified condition for individual fields. <mod2> is called when one of the fields <fi> or <f> meets the condition. If you use the addition ON CHAIN-INPUT or ON CHAIN-REQUEST with FIELD <f>, the condition also applies to the entire chain and module <mod1> and <mod2> are both called.
    In cases where you apply conditions to various combinations of screen fields, it is worth setting up a separate processing chain for each combination and calling different modules from within it.
    Regards,
    Ferry Lianto

  • HeNew Ipone, my icloud id doesn´t work. How can I delete it and make a new one? The email address wrong so I can´t varifie it.

    Hey,
    Got a new Iphone, my icloud doesn´t work. How can I delete it and make a new one? The email address is wrong so I can´t varify it.
    Can´t download apps, because it´s wrong. What can I do? Please help!

    Welcome to the Apple Community.
    You can delete your account at settings > iCloud, scroll down and tap delete account. You can then enter details of any new account you create.
    Note. The purchase of apps are done through an iTunes store account not your iCloud account. If you are having issues downloading apps, it isn't related to your iCloud account.

Maybe you are looking for

  • No video on streaming videos

    Does anyone know how to fix this it happens every few months or so, ive stopped getting video when i watch them on the internet i only get audio. I've tried the web plug in method thats on here but its not there anymore from the last time it broke an

  • Automatically connect to airport/WiFi at startup

    I have updated the firmware on mt Airport extreme and my new MacBook Pro now no longer connect to the airport automatically on startup, as it used to - i have to manulayy select the network each time. Is ther a way of getting it to do this automatica

  • WCF Data Service from Entity Framework 5 in SharePoint 2013

    not sure which forum is best, so im going to throw it in here. I am working on a proof of concept. I want to create a WCF Data Service within sharepoint 2013. not only do i want to do that, i want to use the Entity Framework 5 to expose the data via

  • Passing multiple dynamic params to JS function

    Hi, I have a problem that I have been grappling with for some time now. My JSP shows the user a list of textboxes dynamically, depending on a value from the DB. So, if the field value is 10, the user will see 10 textbixes and they will sequentially b

  • Cannot install all apps in nokia 920

    <p>Hi all,</p> <p> </p> <p>I cannot install all apps I would like on my lumia 920.</p> <p> </p> <p>There is no button at all when I look at app info from the store.</p> <p> </p> <p> </p> <p> </p> <p>Is there a way to baypas this issue?</p>