Hi i want to exit the program if no file found by FM call file_get name

HI
I am calling a function module which is picking up a file from utility server
presently its giving error message that if no file found it propts for error msg no file found or file could not be opened i suppose  its coming by the FM only
now i want to write a code that if there is no file then the program should exit and not execute further but with no error mesage
pls suggest a code for this
regards
Arora

Hi Nishant,
Try to do as indicated in the following code below
FORM validate_app_file USING  fp_file  TYPE FILENAME-FILEINTERN.
  data : l_fname(60).
  CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      LOGICAL_FILENAME = P_FILE
      OPERATING_SYSTEM = SY-OPSYS
    IMPORTING
      FILE_NAME        = L_FNAME
    EXCEPTIONS
      FILE_NOT_FOUND   = 1
      OTHERS           = 2.
  IF SY-SUBRC = '0'.
    OPEN DATASET  L_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
      MESSAGE s007 DISPLAY LIKE c_e.
    ELSE.
      CLOSE DATASET l_fname.
    ENDIF.
  ENDIF.
Also find below the parameters for the function module and thier use
Interface of function module FILE_GET_NAME
IMPORT parameter
Function
CLIENT
Logical file names can be client-specific. Here you can specify the client to be used. The current client as stored in the system field SY-MANDT is used as default.
LOGICAL_FILENAME
Here you specify the logical filename. (Uppercase letters must be used!)
OPERATING_SYSTEM
Here you can specify the operating system for which to generate the appropriate file name. The application server's operating system as stored in the system field SY-OPSYS is used as default.
PARAMETER_1
PARAMETER_2
Here you can specify values that substitute the placeholders <PARAM_1> and <PARAM_2> in physical file names and paths.
USE_PRESENTATION
_SERVER
Specifies that the presentation server's operating system be used as the basis for generating a platform-specific file name.
WITH_FILE_EXTENSION
Specifies that the logical file name's data format be used as filename extension.
USE_BUFFER
Specifies that the customizing tables for converting platform-independent file names be buffered in main memory.
EXPORT parameter
Function
EMERGENCY_FLAG
If the returned value is not SPACE, then no physical path has been found for the logical filename under the current operating system. In this case the path specified in the profile parameter DIR_GLOBAL will be used as physical path.
FILE_FORMAT
Returns the data format defined for the logical file name. You can use this parameter to decide in which mode to open the file. It is also required as a parameter for DOWNLOAD of files to the presentation server.
FILE_NAME
Returns the fully instantiated platform-specific file name and path.
Exceptions
Function
FILE_NOT_FOUND
Raised if logical file name is not defined.
OTHERS
Raised if other errors occur.
Analyse your problem
If the function module cannot find a physical path for the current operating system (see parameter EMERGENCY_FLAG), this may have various causes:
the operating system is not defined in the customizing tables
the operating system is not assigned to a syntax group
no physical path is assigned to the logical path for the relevant syntax group
no logical path is assigned to the logical file name.
Please check and revert
Also Reward points for all helps.it encorages others to help u more
Regards
Byju
Edited by: Byju Edamana on Mar 20, 2008 11:06 AM

Similar Messages

  • After sorting photos into albums, the albums disappeared on me. I dragged and dropped the photos and went back to check that they were in place before exiting the program. When I went back, the folder was there but no albums. Help!

    Working on an IMac - with IPhoto v.9.6 
    This is my first experience with IPhoto... trying to move files from a PC over to a Mac.
    I don't have a ton of photos but I created about 6 albums - standard albums - and dragged and dropped individual photos into each of the albums. I named each of the albums as well so I would know what was in each. After i was finished, I created a folder called 2014 and moved each of the albums into that folder. Before moving ANY of the albums, I opened each of them up to make sure that all the photos I wanted in each were indeed there - and since there were some errors on my part, I deleted any duplicates first. SO, I KNOW the photos were actually in each of the albums BEFORE i moved them into the 2014 folder.
    My intention was to then delete the photo files in my document file but once I got there I thought I would go back and double check the IPhoto file just to make sure... and the pictures were NOT in the albums where I had placed them... is there a need to save this before you move on and if so, to where and how? I was under the impression that once files were moved to albums, they remain there.
    The photos are still in the photo library but unsorted now again... I cannot even open the 2014 folder at this point.
    Thanks for any help!!

    Was back on IPhoto this morning. The folder did not open at all so I deleted it. Beside Albums, nothing showed at all. It was like I had done no work at all except to import my photo folder. Nothing was in my trash bin either.
    I started again and created one album at a time. I dragged and dropped photos into the album and exited out of IPhoto, opened up other programs and then returned to IPhoto to see if the album was still there and it was this time. I created a second album and did the same thing. This time, for some reason, the albums seem to be staying in place. I am not doing anything differently than last time. After creating three albums, I created a folder called 2014 and dragged and dropped the three albums into the folder and exited IPhoto. They were still there when I returned - YEAH! It seems to be working - for now! I am keeping my fingers crossed that my photos are not going to disappear but I am not going to delete my photo folder from my files just in case!
    Thanks for the suggestions but this may just have been a funny glitch... not sure what happened. I didn't change anything or do anything differently this time except that I am doing it one album at a time and exiting the program between creating each of them and coming back to check... very strange.

  • Hi when i use treeMap class and if i exit the program

    hi
    hi when i use treeMap class and if i exit the program,
    what will happen? the information that i put in the treeMap will be disappear??
    if it is like that,,how am i able to retrieve my data...when i restart my program..
    once i put ID as key and put my customer information,
    in it, after exit my program,, and i can't find
    my customers by their ID,,,,,,,,,how can,,i solve it......

    what will happen? the information that i put in the
    treeMap will be disappear??Yes. Of course. If you want data to hang around you have to tell the computer. If you want anything to happen you have to tell the computer.
    if it is like that,,how am i able to retrieve my
    data...when i restart my program..Tada! Tell the computer. Your simplest option is to use Serialization.
    Before exiting your program, serialize your TreeMap to disk. After starting your program serialize your TreeMap from disk.
    First stop should be your text book to learn what Serialization is and how it works, then try to write some code, then ask us to help with any problems.
    Dave.

  • ITunes 9 Dumps music library when exiting the program

    I would sure appreciate any help that you all might be able to throw my way. Upgraded to iTunes 9 a couple of months ago. Basically from the time it was installed I have had the problem that I must Manually click FILE and Add Folder to Library. Upon exiting the program it will then basically dump the whole library and the next time I open iTunes I have to Add Folders to Library Again. After the upgrade to 9 I didn't even try syn'in my Nano because I was afraid I might loose music so I just left it alone and kept fiddling trying to figure out why the library would dissapear upon exiting the program.
    Just after Christmas I got a 16GB Touch so figured I really need to get the figured out..... and I'm still trying. Before connecting the Touch for the first time I COMPLETELY uninstalled iTunes, Quicktime, Apple Software UPdater, Apple Mobile Device Support, Bonjour,etc. After this, I found i still had an itunes folder in my Music folder so I deleted that (I pulled purchased music files into a seperate folder on my desktop just in case). I reinstalled itunes 9, went to File and then Add Folder to Library and imported everything. I wanted to get up and running with the Touch so I made a couple small playlists and called it a day. Exited the program, then re-opened it just to check if it was still there and it was! I was excited..... but not for long. Next day opened iTunes 9 and there was no music, the library was empty.
    I could go on and on... but won't. I've read posts about checking the XML file in wordpad, which I've done and seems like it's correct. even when I go to Preferences/Advanced, and look at where it's storing it seems correct.
    Can some one point me where to look?????
    Thx! Jeromy

    Thank you so much for your reply Katrina. Interesting stuff. Somehow in the mega searches I was doing for answers I didn't think to search using the Vaio angle. I will definitely go through those Vaio Files. This is my 4th Vaio and I NEVER seem to use any of the preloaded software, but to this point have not had problems until I installed iTunes 9.
    Last night I read another post that reminded me that the music files that show up in the iTunes/music folder are just "pointers" or say "shortcuts" (I can't remember the actual term used) to where the ACTUAL music files are located. When I used the Add Folders from the file menu I've always assumed that these "shortcuts" have been placed in the iTunes/Music folder properly. But just in case, I clicked on the Copy Files to iTunes Media folder in Advanced tab to be safe and then I did the Drag/Drop from my windows MY MUSIC folder (rather than using the Add Folders to Library in iTunes). I started by dragging and dropping like 5 albums. Then I'd close, open, close, open etc. to see if they would stay in my iTunes music library.... and they DID! So I left it overnight and then this morning I dragged a bunch more albums into my iTunes music library. Did another close, open, close, open on iTunes and so far everything is staying in place. My next test is going to be to completely shut down my Vaio and start it back up and see if it's all still there.
    Do you think any of this makes sense, or relates back to the Vaio software issues from the post you provided? I don't quite understand why it would work to drag/drop but not simply click Add Folders to Library???
    Thanks Again,
    Jeromy

  • I recently bought  Lightroom and installed on one of my computes. I wanted to instal the program on another computer I have, using the same serial number I already bought and I'm not alowed as it says that the SN is not valid. What shall I do?

    I recently bought  Lightroom and installed on one of my computes. I wanted to instal the program on another computer I have, using the same serial number I already bought and I'm not alowed as it says that the SN is not valid. What shall I do?

    It is possible that you downloaded the Creative Cloud trial of Lightroom. The perpetual license key will not work. Uninstall the version on the second computer, this will not interfere with your catalog, preferences and personal files.
    Download the appropriate version from the link below and install, your license key will be accepted and everything will be fine.
    Product updates

  • I just want to launch the program and retouch a photo.[was:lost]

    i just want to launch the program and retouch a photo. why am i so lost?

    Exactly my point. With all the "training" and "introduction" and promotional
    hoopla on the CC platform, I couldn't even find a way to LAUNCH photoshop.
    I eventually simply downloaded Photoshop Elements. Problem solved.
    Your Partner in Development
    Robert Ott PMP
    Earth Energy Exchange, Ltd.
    631-371-6842

  • Purchased aperture progam and downloaded onto desktop. recently purchased a macbook pro and want to transfer the program to new computer.  can it be done and how do I do it?

    I purchased the Aperture progam last year and downloaded to desk top Mac.  I now have a mac book pro and want to transfer the program.  Is it possible and How do I do it? 

    What is your Mac OS X version? And your Aperture Version?
    Did you buy from the App Store? When you downloaded Aperture from the App Store, you only need to sign into the App Store with the Apple ID you used to buy Aperture and to download it to your Mac Book Pro from the "Purchased" tab at the App Store. Your licence covers the installation on all your Macs for private purposes.
    If you bought a licence key from the Apple Store, not the App Store, copy the installer you downloaded to your Mac Book Pro and run it there. Then unlock Aperture with your licence key.
    Regards
    Léonie

  • My safari screen suddenly fills my entire screen, and there is no right hand corner button to push to manually shrink it. What to do? I can never even exit the program without quitting it.

    My screen when I am using Safari suddenly fills my entire screen, and there is no right hand corner button to push to manually shrink it. What to do? I can never even exit the program without quitting it.This has happened only within the last two days.

    Try changing the screen resolution.
    Go to Apple Menu / System Preferences / Displays.
    Change the resolution. Whatever numbers are shown, e.g. 1280 x 960, select a larger one. The larger the number, in the resolution the smaller the display on the screen. You can keep changing this till you find the resolution that suits you.

  • When I wanted to update the programs, it said that there was an error, and it still says so. I cant even see the different programs now

    When I wanted to update the programs, it said that there was an error, and it still says so. I cant even see the different programs now

    I have exactly the same problem here too. Followed all of the discussions and still unable to access programs

  • How do I know games and programs that become free? I want to know the programs and games that become free first first

    How do I know games and programs that become free?
    I want to know the programs and games that become free first first

    You are allowed to have two activated installations so there should not be a problem having working installations on the two machines.  If by chance you have somehow tied up two activations for the one machine you can have Adobe support help resolve that thru chat.
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • How to exit the program using AS3??

    Hi guys  , i'm trying to use a button to exit the program. anyone knows which code to use?

    What exactly do you mean by 'exit the program'? What program? Is your Flash Object in a browser, or is it an AIR app?
    If you're talking about an AIR app, have a look at:
    NativeWindow.close()

  • I've paid for photoshop online and want to download the program. Where do I do it?

    I've paid for photoshop online and want to download the program. Where do I do it?

    I'll give it a try.
    Thanks.
    Martin

  • I have installled PE12,I have registrated it (serie number) and I have made an Adobe- ID. (I can find there my registrated product). Still, when I want to start the program, there is a screen that indicates that i have "to registrate PE within 7 days" , W

    I have installled PE12,I have registrated it (serie number) and I have made an Adobe- ID. (I can find there my registrated product). Still, when I want to start the program, there is a screen that indicates that i have "to registrate PE within 7 days" , When iI continuer (next sceen) there is a message that the proces can not proceed for "I need  an internet commection" which I have!!!! When this problem does not disappear  I have to contact Adobe ??.......  So please can you help me. I am already many hours trying to get started :-(

    CS2 is very old and reached its "end of life" a while back.  So probably won't run on modern operating systems.  If you can still run it, you'll need to uninstall what you have and re-install with the download link below to activate it.
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    Nancy O.

  • My problem is:I want to download the program test premiere pro cc but do not let me in the crative cloud

    I want to download the program test premiere pro cc but do not let me in the crative cloud

    If it doesn't show up, then your system doesn't meet the requirements. It's as simple as that. Check the Tech Specs on the product page.
    Mylenium

  • Windows keeps asking if I want to allow the program to make a change even though cc 2014 is installed.

    Just installed CC 2014. It shows in my Start menu with the install shield.  Whenever I attempt to open CC 2014, I get a dialogue box asking if I want to allow the program to make changes to the computer.  I have uninstalled and reinstalled and can't get it to go away.

    This would only happen if you never installed it with sufficient administrative privileges and the user permissions are not set correctly. therefore reinstall it as admin.
    Mylenium

Maybe you are looking for

  • Site-to-ste VPN with overlapped subnet.

    Hi Friends I have to set up site to site VPN with overlapped network ASA 5540 and checkpoint   what is the best parctice to achive tis goal Thanks in advance

  • Texy edit - how to print page numbers only

    I wish the page numbers in TextEdit to be printed on my documents; in TextEdit preferences, when I select the option to number pages when printing, it also prints the date and document title. How can I have it only print the page numbers?

  • HP Laserjet CP1525nw and AirPrint

    I have a brand new CP1525nw which is on the list of supported printers. It has the most up to date firmware available. My iPad is running the most up to date version. I am unable to print to it with my iPad. A windows desktop can print to it wireless

  • I am not able to access the email, I do not know what the password is and cannot seem to get it reset.

    the image keeps telling me Login Failed Login to server mail.portnel.com failed. with options of Retry / Enter New Password / Cancel I really need this fixed as I am looking for work and this is my main email

  • Please post the password for the following HP Mini 110

      Customer brought in laptop and did remember the bios password. We tried the suggested download win32 to submit the halt code and it did not work on xp or win7 in compatibility mode.     Can someone please post the password for the following HP Mini