Selection of Folder/File name using the same Fun.Module

Please let me know if there is a function module which can fetch folder name/File name  from the directory path when f4 option of selection screen field is selected. Currently I am able to get the file name using FM F4_DXFILENAME_4_DYNP but the requirment is like I have to select either folder name or the file name depending on user selection.
Note: Please let me know if there is a single Function module which can get folder name or the file name based on the user selection.i.e, if the user want to select a folder he can select or he can select files in the folder for processing

Hi sridhar
try this:
PARAMETER : TXT_FILE(100).
AT SELECTION-SCREEN ON VALUE-REQUEST FOR TXT_FILE.
PERFORM GETFILE.
start-of-selection.
PERFORM GETDATA.
FORM GETDATA.
  DATA : FILENAME TYPE STRING.
  FILENAME = TXT_FILE.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      FILENAME                      = FILENAME
     FILETYPE                       =  'ASC'
     HAS_FIELD_SEPARATOR           = 'X'
    HEADER_LENGTH                 = 0
    READ_BY_LINE                  = 'X'
    DAT_MODE                      = ' '
    CODEPAGE                      = ' '
    IGNORE_CERR                   = ABAP_TRUE
    REPLACEMENT                   = '#'
    CHECK_BOM                     = ' '
  IMPORTING
    FILELENGTH                    =
    HEADER                        =
    TABLES
      DATA_TAB                      = IT_UPLOAD
  EXCEPTIONS
    FILE_OPEN_ERROR               = 1
    FILE_READ_ERROR               = 2
    NO_BATCH                      = 3
    GUI_REFUSE_FILETRANSFER       = 4
    INVALID_TYPE                  = 5
    NO_AUTHORITY                  = 6
    UNKNOWN_ERROR                 = 7
    BAD_DATA_FORMAT               = 8
    HEADER_NOT_ALLOWED            = 9
    SEPARATOR_NOT_ALLOWED         = 10
    HEADER_TOO_LONG               = 11
    UNKNOWN_DP_ERROR              = 12
    ACCESS_DENIED                 = 13
    DP_OUT_OF_MEMORY              = 14
    DISK_FULL                     = 15
    DP_TIMEOUT                    = 16
    OTHERS                        = 17
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.
FORM GETFILE.
  CALL FUNCTION 'WS_FILENAME_GET'
   EXPORTING
    DEF_FILENAME           = ' '
     DEF_PATH               = '.'
    MASK                   = ' '
    MODE                   = ' '
    TITLE                  = ' '
   IMPORTING
     FILENAME               = TXT_FILE
    RC                     =
  EXCEPTIONS
    INV_WINSYS             = 1
    NO_BATCH               = 2
    SELECTION_CANCEL       = 3
    SELECTION_ERROR        = 4
    OTHERS                 = 5
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.
<b>This is a part of my BDC program its working for me u try n reply if it works for u.</b>
regards
vijay

Similar Messages

  • How to get Bursting file to use the same template as selected by user

    I have created an XML publisher bursting control file for a standard Oracle report Direct Debit letter.
    The user wants to be able to select from a number of different letter templates which is ok except that the bursting control file is fixed to use one template.
    How can I get the bursting control file to use the same letter template as selected by the user when running the report ?
    I am using XML Publisher 5.6.3 with bursting patch.

    Try these following, which come to my mind now as of now.
    In the bursting file, you can do the filtering and apply different template..
    <xapi:template type="rtf" location="/usr/template1" filter=".//DIRECT_DEBIT[./parameter_or_element='first_template']"></xapi:template>
    <xapi:template type="rtf" location="/usr/template2" filter=".//DIRECT_DEBIT[./parameter_or_element='second_template']"></xapi:template>
    second option..
    you can replace the element from the xml in the bursting control file.
    ${ELEMENT_NAME}
    can be used in the template name i guess..
    <xapi:template type="rtf" locale=""
    location="xdo://AR.${SHORT_NAME}.en.US/?getSource=true" translation="" filter="">
    </xapi:template>
    But in this short name has to be in XML file...
    I haven;t tried it...wil try it wheni get time..

  • How to find the File name using the FTP Adapter

    hi all,
    how to find the File name using the FTP Adapter with BPEL.
    Regards

    Found the solution for this.
    First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
    In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
    Thanks for the posts

  • Use the same code module for several steps in the sequence

    Hello All,
      I have been trying to set up a sequence that uses the same code module for all of the steps in the sequence, but am having trouble referring back to it when I need to send it commands.  I have gotten as far as calling the VI in a new thread so that it can be run asynchronously.  I can run the simple sequence and it will indeed open the VI, and move on to the next step.  When I close the VI manually from the front panel, the sequence in TestStand completes, as expected.  So it appears that I have that much working. 
      My question is how to call the separate thread from the main sequence or other sub sequences when I need to edit the parameters.  If I insert an Action step, I am required to select a VI file, but from what I can tell, it opens a different instance of the file, and does not provide an interface with the other instance running asycronously.  My next guess was to use a Statement step, but I was not able to figure out how to configure the lookup string to call the VI parameters.  Beyond that, I'm not sure how to proceed.  Please advise.   
      My intention is to start the code module VI (asynchronously), run several different subsequences within the main sequence that call that same VI and edit it's parameters, close everything and report on the results.  If I am misunderstanding how TestStand is supposed to work, please let me know. 
    Thanks,
    GSinMN    
    Solved!
    Go to Solution.

    What I do is use a Queue to send data to the asynchronous VI.  So it can run and do whatever, but also recieve the commands from the queue.  I use an Action Engine that holds the queue reference and sends the commands.  So you really just have to call the Action Engine from your sequences.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Selecting two different Names using the same table with same field

    Hello,
    I am trying to display several fields from different tables. Here are some of the fields that I need: The instructor needs to go after the social.
    WESL | ENGR-1101-SW1 | Hinojosa | Ashley | Social | Instructor |
    I am using a table where they have the social and I need to get both the student and the instructor. How do I select the instructor when the instructor's id is on a different table. example
    CLASS PERSON CLASS_ASSIGN
    student_id student_id: name facutly_id
    Here is the code that I have so far and it works.
    rem ----------------
    rem Filename: cer.sql
    rem Purpose: to get data from banner and put into flat file
    rem Date: August 17, 2006 4:51 P.M.
    rem Author: Robert Hernandez
    rem ---------------
    rem Notes: Need to add the Instructor - having problems
    rem using the same spriden_id.
    rem Also need to have admissions enter the grad date for
    rem several students: Procedure is working as is.
    declare
    l_output utl_file.file_type;
    grad_month varchar2(2);
    buffer varchar2(1000);
    cursor cursor1 is
    select ssrmeet_bldg_code,
    ssbsect_subj_code,
    ssbsect_crse_numb,
    ssbsect_seq_numb,
    spriden_last_name,
    spriden_first_name,
    spriden_id,
    scbcrse_title,
    ssbsect_term_code,
    sfrstcr_grde_code,
    sorhsch_graduation_date,
    decode(substr(sorhsch_graduation_date,4,3),'JAN','01',
    'FEB','02',
    'MAR','03',
    'APR','04',
    'MAY','05',
    'JUN','06',
    'JUL','07',
    'AUG','08',
    'SEP','09',
    'OCT','10',
    'NOV','11',
    'DEC','12') as grad_month,
    sorhsch_sbgi_code
    from ssbsect,ssrmeet,sfrstcr,spriden,scbcrse,sorhsch
    where rownum < 200
    and ssbsect_seq_numb like 'S%'
    and (ssrmeet_term_code = ssbsect_term_code
    and ssrmeet_crn = ssbsect_crn)
    and (ssbsect_crn = sfrstcr_crn
    and sfrstcr_pidm = spriden_pidm
    and length(spriden_id) = 9
    and substr(spriden_id,1,1) <> 'A')
    and (ssbsect_crse_numb = scbcrse_crse_numb
    and ssbsect_subj_code = scbcrse_subj_code)
    and spriden_pidm = sorhsch_pidm
    and sorhsch_graduation_date is null
    order by ssbsect_crse_numb;
    begin
    l_output := utl_file.fopen('CER','rbfpce.txt','W');
    for cur1_rec in cursor1 loop
    buffer:= cur1_rec.ssrmeet_bldg_code||'|'||
    cur1_rec.ssbsect_subj_code||'-'||
    cur1_rec.ssbsect_crse_numb||'-'||
    cur1_rec.ssbsect_seq_numb||'|'||
    cur1_rec.spriden_last_name||'|'||
    cur1_rec.spriden_first_name||'|'||
    substr(cur1_rec.spriden_id,1,3)||'-'||
    substr(cur1_rec.spriden_id,4,2)||'-'||
    substr(cur1_rec.spriden_id,6,4)||'|'||
    cur1_rec.scbcrse_title||'|'||
    cur1_rec.ssbsect_term_code||'|'||
    cur1_rec.sfrstcr_grde_code||'|'||
    '20'||SUBSTR(cur1_rec.sorhsch_graduation_date,8,2)||
    cur1_rec.grad_month||'|'||
    cur1_rec.sorhsch_sbgi_code;
    utl_file.put_line(l_output,buffer,false);
    end loop;
    utl_file.fclose(l_output);
    exception
    when no_data_found then
    utl_file.fclose(l_output);
    end;
    /

    Can you be more precise , please :
    - which table stores the people identities ? (I call this one Identity)
    - which table gives the class where the student works in (I cal l this one Claa_attendees)
    - which table gives the instructor of a class (I call this one Class)
    If your issue is that you have one table which stores Itendities , and you need to display Student identity and Instructor Identity, you have to call this table twice in your query , using table aliases . I mean :
    Select Stud_iden.name, Instr_iden.name
    From Identity Stud_iden, Identity Instr_iden, Class_attendees, Class
    Where Class.clas_id = class_attendees.class_id
    and class.instructor_id = Instr_iden.people_id
    and class_attendees.student_id = Stud_iden.people_id
    Is this what you need to do ?

  • How to print .sql file name in the same file using sqlplus

    Oracle 10g on Linux platform.
    I am trying to print the name of .sql script file in that file but could not. Following is the file:
    test.sql
    select '&0' from dual;But instead of printing, it is asking for input:
    SQL> @test.sql
    Enter value for 0: Can any body give me a hint as how can i print the file name.

    Use this
    SELECT FNAME_KRBMSFT AS name FROM X$KRBMSFT
    and see
    SQL> create or replace procedure get_dir_list
    2 (p_directory varchar2)
    3 is
    4 l_null varchar2(100);
    5 l_directory varchar2(100);
    6 BEGIN
    7 l_directory := p_directory;
    8 sys.dbms_backup_restore.searchfiles(l_directory, l_null);
    9 FOR x IN (select fname_krbmsft fname from x$krbmsft) LOOP
    10 dbms_output.put_line(x.fname);
    11 END LOOP;
    12
    13 END;
    14 /
    Edited by: HuaMin Chen on Jun 26, 2012 12:26 PM

  • How to print text rertrived by using the READ_TEXT fun module in smartform

    Please tell me how to print the text which is rertrived by using the READ_TEXT function module in smartform.
    I have coded all things in the program lines and in that i am retriveing the long texts.
    I am getting the text lines in my internal table clearly, the thing is that I am not able to pass these lines to the text module.
    its urgent. Points will be rewarded for any type of clue. whether it will work or not.

    loop the table into which u have retrieved the text .
    in the form interface of the smartform ... in importing parameter give the that table name .
    and in smartform whereever u want to print there insert the data into work area and pass to fields for dispaly .
    decalre ur work area in global defintions
    thnaks .

  • Multiple files with the same file name within the same folder

    It looks like a finder bug. To replicate, I surf to any website, I right-click on a jpg image, select "Save Image As" and in the window that pops up I type in the filename "000.jpg", I select the folder Pictures, and click on Save.
    BTW, I don't know why, but the file was saved only as "000" without the file extension ".jpg". Does anybody know why?
    Then I surf to another image, and again I save it as "000.jpg" and now it asks me if I want to replace the existing filename, although the existing one is "000" and I try to save as "000.jpg", so I say yes, and then magically the file is saved with the full filename including the extension "000.jpg"
    When I did it a couple of times, always saving image as "000.jpg" from various sources, I ended up with two distinct files named "000" and both in the same folder Pictures.
    Please advise.

    Misio wrote:
    It looks like a finder bug. To replicate, I surf to any website, I right-click on a jpg image, select "Save Image As" and in the window that pops up I type in the filename "000.jpg", I select the folder Pictures, and click on Save.
    BTW, I don't know why, but the file was saved only as "000" without the file extension ".jpg". Does anybody know why?
    the extension is simply hidden. go to the get info panel for the file and uncheck the option to hide the extension.
    Then I surf to another image, and again I save it as "000.jpg" and now it asks me if I want to replace the existing filename, although the existing one is "000" and I try to save as "000.jpg", so I say yes, and then magically the file is saved with the full filename including the extension "000.jpg"
    When I did it a couple of times, always saving image as "000.jpg" from various sources, I ended up with two distinct files named "000" and both in the same folder Pictures.
    Please advise.
    it sounds to me like you saved one file as 000.jpg and the other and 000.jpg.jpg.
    check the info panels for the files for full names to verify if this is the case.

  • When I open iTunes on my new computer using the .itl file, and using the same external drive holding the songs, all of the songs I added to iTunes up to a certain date have broken links, while none of the songs have broken links on the old computer.

    I want to open the  iTunes library on my new laptop with all the playlists and stuff I built on the old computer. I have all my music on an external drive. I have copied the .itl file from the old computer and opened it on the laptop, and it has all the playlists, but all of the songs that were added to iTunes up to a certain date have broken links. What am I doing wrong?

    Moving library files around while leaving the data in the same place usually presents no problems. Moving the data around independently from the library usually breaks things. With Windows machines all you should need to do is make sure that the same drive letter is being used on the new system as with the old. If that is not possible you need to get your library into a portable layout before moving it between systems.
    Typical layout of iTunes folders:
    When the media folder is inside the main iTunes folder as shown above then the library is portable. Typically with a split library the iTunes Music or iTunes Media folder (everything inside the red outline) is moved to a different drive by choosing a new locaton for it and then consolidating.
    To make the library portable again you need to copy the library files and album artwork folder into the parent folder of the media folder so that the nested relationship is recreated. (BTW If your media isn't already inside your designated media folder then you will also need to consolidate the files that are outside of it, before you copy the library files.) You can then use the hold-down-shift-when-starting-iTunes method to open the library file in that parent folder. Once the library has been opened, tested and closed you are most of the way there.
    The iTunes window inherits its title from the folder holding the library files so, unless you created a folder called iTunes to hold the media folder, iTunes may now have an unexpected title when you run it. The parent folder can be renamed as iTunes, and the library opened again. Alternatively, if the parent folder is at the root of the drive, or has other data which you wish to leave in place, you can create a new top level folder called iTunes and move the library files, album artwork and media folders into it before opening and testing the library again.
    If the library doesn't work after any step simply reverse it by undoing a move or rename or opening the previous set iTunes Library.itl file.
    If all has gone well then the library is now portable. Once you've migrated the data to a new system you can copy the library files back to their usual internal location if you find that having them on the external drive affects performance...
    tt2

  • Dynamically changing the file name using the submit button

    I am currently using a submit button to send information to myself from the user of the form. Is there any way to change the name of the file that is emailed as a .pdf file according to some type of parameter or data set that is collected in the form?

    Not programmatically. The attachment wil take the same name as the opened PDF. If you change the name of the PDF then it will change your form name as well. That cannot be done programmatically.

  • Where (drive, folder, file name) are the database files that store catalog information such as tags and changed dates in Elements 13?

    I want to backup just the datebae file that holds catalog data.  I can't find it in Elements 13 but could in Elements 10.  Is it hidden in a secret file with a secret name?  Why?

    The catalog is a folder containing the main database (catalog.pse13db), the thumbnails cache (thumb.5.cache) and other files and subfolders. To save a catalog, you save the whole catalog with its subfolders. Note that if you don't save the thumbnail cache (which is the biggest item in the catalog), it will be rebuilt automatically.
    In all versions of Elements, Win or Mac, you find its location from the menu: Help/System information.
    By default it's in a hidden folder in Windows.
    Why? I don't know, but you can tell the Windows Explorer to show hidden files. That's up to you; I always do that.
    Should the catalog always be in the default location? Not at all. You can move it elsewhere. For instance you can hold your image library and your catalog to an external drive. Then, the catalog manager shows it as beeing in 'custom location'.
    The following is not in your question, but I assume you are asking that for backup purposes. If you have an external backup system, you should include the catalog folder. That is not enough if you want to restore to another computer or drive because the original is dead. The catalog stores the picture files location with reference to the path, but also to the internal serial number of the drive. Changing drive means that all files will be shown 'missing' or 'disconnected', and you'll have to run a 'reconnect' procedure. You don't need the reconnection if you use the internal backup/restore process in the Organizer.
    Use Backup, Restore to move catalog | Organizer | Elements 6 or later
    If you are not in the situation of a crash, but you simply want to update (includinge updating PSE version), the integrated system is ideal.
    Other backup systems have their advantages. I do use Windows SyncToy after each significant editing session, and the Organizer backup at regular intervals.

  • Want To Capture The File name Using the SQL Loader

    Hi,
    I Am loading The Data To Staging Table Using The SQL*developer, The File That need to be Loaded Will be One Of The Input To the SQL*Loader Concurrent Program.
    In One Of The Column Of My staging Table I want To Put The File name.
    Can We do the Same.
    thanks,
    Ankit

    Not unless you generate the loader controlfile dynamically.. try this.. pass file name as $1 first parameter. Use the below example and modify as per your requirement
    1) create table with following table structure
    create table temp_table (x varchar2(20),file_name varchar2(30));
    2) create data file - test.dat (contains only values for x)
    abc
    def
    geh
    ggg
    fff
    3) create a host file host file - test.sh with following content:
    echo "load data
    infile $1
    append
    into table temp_table
    fields terminated by ','
    (x,
    file_name constant "$1")" > test.ctl
    sqlldr <usr>/<pwd>control=test.ctl
    4) run the host file from unix prompt with data file name as parameter (ensure test.sh has execute permissions)
    test.sh test.dat
    Hope this helps
    Regards,
    Bhadri

  • Select a layer whose name is the same as another layer

    I have two layers with the same name. How can I select the one I want from an automation plugin?
    thanks
    Bill

    I wonder if this may help.
    The top left of the bounding box will be the layer bounds [0] (left) and [1] (top)
    #target photoshop
    app.documents.add();
    var FontName = "Arial";
    var FontSize = 14;
    var black = new SolidColor();
    black.rgb.hexValue = '000000';
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var newTextLayer = activeDocument.artLayers.add();
    newTextLayer.kind = LayerKind.TEXT;
    newTextLayer.textItem.kind = TextType.POINTTEXT
    newTextLayer.textItem.color = black;
    newTextLayer.textItem.font = FontName;
    newTextLayer.textItem.size = FontSize;
    newTextLayer.textItem.contents = "The quick brown fox jumps over the lazy dogs back 1234567890";
    newTextLayer.textItem.kind = TextType.PARAGRAPHTEXT;
    newTextLayer.textItem.height =300;
    newTextLayer.textItem.width = 100;
    newTextLayer.textItem.position = Array(10, 10);
    newTextLayer.textItem.justification=Justification.CENTERJUSTIFIED;
    var LB = newTextLayer.bounds;
    var doc = activeDocument;
    alert("Bnds height = " + (LB[3]-LB[1]) + " Bnds Width = " + (LB[2]-LB[0]));
    alert("BB Height = " + doc.activeLayer.textItem.height + " BB Width = " + doc.activeLayer.textItem.width);
    app.preferences.rulerUnits = startRulerUnits;

  • How to pick the sender files dynamically using the same File CC

    hi,
    My requirements is like , Same Sender File communication Channel has to pick up the different file which are having differnt file conventions and which are placed in different directories .. then it has to send to diffentn directories in the receiver side..
    how to do this?
    Regards,
    Balaji

    Hi Stefen,
    They have tried the Generic Sender File adapter concept to handle filenames with different names and from different directories instead creating many file channels. In my project many channels are configured as generic File sender channel.. And Eventhough the Generic file sender channels processing the filenames from different directories, all processed files are archieved in one common directories.. now they wanna generic solution to archieve the processed files in a particular folder based upon the directories they got processed from....
    and There are no such message mapping or Operation mapping since they used AAE concept. So do you  have any idea to make Generic File sender channels to archieve the files as per requirements i said before??
    Two doubts can we use like Module programming or can we do any OS level command acchieve this ? if yes please explain in detail .... Please help me out here
    please refer the following link .. exact way we used in our project
    http://wiki.sdn.sap.com/wiki/display/XI/SingleSenderFileCCForMultipleDirectories
    Regards,
    Balaji
    Edited by: Balaji Pichaimuthu on Feb 5, 2010 5:55 AM

  • How do i change multiple file names to the same name w/ a number value?

    I use Windows machines and Macs at my office.  In Windows I can take a group of files, let's say JPG's of a factory tour, and when I upload them into Windows, I can "select all", right click and chose "rename".  I rename the first file "102511 Widget Tour (1)" and press "enter" Windows automatically renames all the JPG's to "102511 Widget Tour" and progresses the number in the parentheses.  In OS X there is not even a "rename" function when multiple items are selected.  I've looked at using Automater, but it seems that I would have to construction a new action each time.  Any ideas?

    If you have Aperture it can do it for you.
    Alternative:
    I suggest a third part app: Renamer
    http://incrediblebee.com

Maybe you are looking for