How to capture the excel file name

Hi friends,
when i execute my program one excel sheet is getting generated.for this i have used a fm 'SAP_CONVERT_TO_XLS_FORMAT'.i want to capture that excel file name and i want to pass it to next function module as input.bcz i should not do any hard coding like passing the filename directly into the function module.
anybody have any suggestion for this.

Hi,
Here is the piece of code ....
I hope this will add some help to u...
FORM convert_xls_itab.
  break devuser.
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_field_seperator    = 'X'
      i_line_header        = 'X'
      i_tab_raw_data       = wa_tab
      i_filename           = p_file
    TABLES
      i_tab_converted_data = it_data
    EXCEPTIONS
      conversion_failed    = 1
      OTHERS               = 2.
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
TABLES
INTERN = IT_INTERN.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
**--- Perform to move the data into an internal data
ENDFORM. " CONVERT_XLS_ITAB
Thanks & Regards
Ashu Singh

Similar Messages

  • How to change the excel file name which is in Application server...

    hi friends,
    my requirement is getting failed, when i'm trying to change the file name which is in Application server using the FM: SXPG_COMMAND_EXECUTE.
    when i execute above FM, i can see all my required details in SM69 like:
    COMMAND NAME: ZSPOOL_TEST1      
    OS: Windows NT
    TYPE: Customer 
    OS COMMAND: cmd rename Y:\OBRZ.PDF OBRZ38582.PDF
    once the above FM is executed, i'm getting SY-SUBRC = 2 (exception: COMMAND_NOT_FOUND).
    so, can any one guide me how to resolve this issue or is there any other way to rename the file which is in AS?
    thanks in advance...

    Hi ,
    First you can tranfer the AS server file to a new application server file.
    Then you delete the original file .
    To do that you can write code as follows --
    DATA : w_file(8) TYPE c VALUE 'FILE_NAM', " your present AS file name
           w_new(8) TYPE c VALUE 'NEW_FILE',
           fs_itab(255) TYPE c,
           t_itab LIKE TABLE OF fs_itab.
    OPEN DATASET w_file FOR OUTPUT IN BINARY MODE.
    DO.
      READ DATASET w_file INTO fs_itab. " Reading value from the AS file to field string
      IF sy-subrc NE 0.
        EXIT.
      ELSE.
        APPEND fs_itab TO t_itab. " Populating internal table form the file value
      ENDIF.
    ENDDO.
    OPEN DATASET w_new FOR INPUT IN BINARY MODE. " creating a new file if that does not exist
    LOOP AT t_itab INTO fs_itab.
      TRANSFER fs_itab TO  w_new. " Transfering to file
    ENDLOOP.
    CLOSE DATASET w_file..
    DELETE DATASET w_file. " Dleting the old file
    CLOSE DATASET w_new.  " Closing the final file
    Regards
    Pinaki

  • How to change the excel file name which already exists

    Hi,
        I want to rename the already existing excel file, is there any way to do it in Lab View. Please help me in this regards.
    Regards
    Shiva Kumar Singh

    Use the "move" tool with the current path and new path as inputs. It's in the File I/O...advanced palette.
    LabVIEW Champion . Do more with less code and in less time .

  • How to get the incoming file name using JMS adapter and SOAP adapter

    Hi Everybody,
       In one of my interface i need to get the file name of incoming flat file using JMS adapter at sender side. and then i am using xslt to convert it to IDOC and then posting to  SAP IDOC.
    my incoming filname are in this form price<DateTimestamp>.txt. when i do the tranformation this incoming file name should be part of one element in the IDOC which i am posting.
    EX:
    <IDOC
    <REF>price<DateTimestamp>.txt</REF>
    </IDOC>
    Hope it is clear to everybody. I need your suggestion how i can capture this incoming file name and send it as part of IDOC.
    Thanks
    raj

    If they are passing it in message id or correlation id,
    you can access it using
    <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/JMS', 'DCJMSMessageID/ DCJMSCorrelationID')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
    Check this:
    http://help.sap.com/saphelp_nw70/helpdata/en/f4/2d6189f0e27a4894ad517961762db7/content.htm
    Thanks,
    Beena.

  • How to print the report file name and path and the last mod date

    Good morning,
    I am trying to print on the footer of the report the report file name and path as well as the report last modification date.
    Anyone would know how I can do that? I have checked the doc but found nothing.
    Thks. Philippe.

    Did you ever determine how to print report name and report last mod date?
    Thanks

  • How to Edit the Title (file name) on forms 10g Screen.

    Hi ,
    How can one edit the Title ,and <(file name)> on forms 10g Screen ....
    I tried editing through the forms module preperty palette , but could n't change the Title, or file name on forms menu screen ...
    I guess , the entries are made through some other means...
    Please let me know on how to do this .
    Need a quicker reply ..
    Thanks in Advance
    Sanu

    using the below code too not getting me the new names entered by me ... still the old title names are comingWhat do you mean by new nemes? It will return you the actual file name which is saved in phycical location and form name will return you the module name which displays when you open forms in builder.
    Or you mean something else then its better to provide any example..like what is happening actually with you.
    -Ammad

  • How to chante the PDF File Name in Broadcasting

    Hi Team,
         Could you help me?, I am in a project where the customer need  the Following requirement with the PDF File Name in the Broadcasting:
    I am configuring one distribution Job in Broadcasting configuration Tab this Job need send a report via E-Mail in  PDF Format, but the customer requirement is that the file name is sent with the description name and not with the technical name from report.
    Then, some of you know "How change the name to the PDF File that is sent in the Distribution Jobs, I need the Description name, because actually the E-mail send the PDF File with the Technical Name, and the user does not want in that way".
    Thank you very much.
    Leslie Denise.

    Hi,
        Thank you for your answer, but that parameter i added in the content of the email. But I need change the name from the file not to add the description in the subject or in the content.
    And if there are somebody to know if is possible to change the name from the PDF File I will apreciate your comments and answers.
    But Thank you so much for your answer voodi.
    Regards
    Leslie Denise.

  • How to change the RPD file name without deploying on EM

    Is there a way to change the RPD file name so it doesn't have BI0002 or BI0003 on the end of it? I can delete my BI0002 file and point the NQSConfig.ini file to my new FileName.rpd but when the BI services restart the BI0002 file reappears in the repository directory and the NQSConfig file changes to reflect this. It's like the only way you can change this is in the Enterprise Manager, but that always adds the suffix to the file.
    Any suggestions?
    Here's what the docs say:
    When you upload a repository, it is copied to the local repository directory for each Oracle BI Server component, located at:
    ORACLE_INSTANCE\bifoundation\OracleBIServerComponent\coreapplication_obisn\repository
    If you have published the repository in shared mode, then the repository is also copied to the shared network location.
    After the repository is uploaded, it is given a version number suffix (for example, SampleApp_bi001.rpd). This version number is incremented each time that the repository is uploaded. To revert to a previous version, you must re-upload the specific version of the repository to use.
    Note that you can delete older versions from the repository directory or shared network directory to reclaim disk space.
    What does that mean? I have to use an old rpd file in order to get rid of the suffix?

    Hi,
    It can be changed, although I do not no exactly how. You have to take a look at the MBeans which are used to deploy a new repository. The suffixed is used to insure you do not overwrite an existing RPD
    Cheers,
    Daan Bakboord
    http://obibb.wordpress.com

  • How to set the default file name for upload

    Hi All,
    I have the following BSP app for a file upload of a csv file. I want the page when displayed show the default file name to be loaded as c:\db1\currentPM.csv
    What changes do I need to make to get the default file name in the BSP app.
    Thanks
    Karen
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content id               = "content"
                   design           = "classicdesign2002design2003"
                   controlRendering = "sap"
                   rtlAutoSwitch    = "true" >
      <htmlb:page title="File Upload " >
        <htmlb:form method       = "post"
                    encodingType = "multipart/form-data">
              <htmlb:textView text   = "File:"
                              design = "STANDARD" />
              <htmlb:fileUpload id          = "uploadID"
                                onUpload    = "UploadFile"
                                upload_text ="Upload"/>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    On Input Processing
    event handler for checking and processing user input and
    for defining navigation
    DATA: EVENT TYPE REF TO IF_HTMLB_DATA,
          DATA TYPE REF TO CL_HTMLB_FILEUPLOAD,
          LV_OUTPUT_LENGTH TYPE I,
          LV_TEXT_BUFFER TYPE STRING,
          FILE_NAME TYPE STRING,
          FILE_PATH TYPE STRING ,
          INTERN TYPE TABLE OF  ZALSMEX_TABLINE.
    DATA: LT_BINARY_TAB TYPE TABLE OF SDOKCNTBIN .
    TYPES: BEGIN OF TY_TAB,
           FIELD1(2) TYPE C,
           FIELD2(2) TYPE C,
           FIELD3(2) TYPE C,
           FIELD4(2) TYPE C,
           FIELD5(2) TYPE C,
           END OF TY_TAB.
    DATA:  WA_TAB TYPE TY_TAB,
           IT_TAB TYPE TABLE OF TY_TAB.
    TYPES: BEGIN OF TY_LINE,
              LINE(255) TYPE C,
           END OF TY_LINE.
    DATA:  WA_LINE TYPE TY_LINE,
           IT_LINE TYPE TABLE OF TY_LINE.
    EVENT = CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ).
    IF EVENT IS NOT INITIAL AND EVENT->EVENT_NAME = HTMLB_EVENTS=>FILEUPLOAD.
      DATA ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = RUNTIME->SERVER->REQUEST NAME = 'fileUpload' ID = 'uploadID' ).
      FILE_NAME = DATA->FILE_NAME.
      FILE_PATH = FILE_NAME.
      IF DATA IS NOT INITIAL.
        CALL FUNCTION'SCMS_XSTRING_TO_BINARY'
         EXPORTING BUFFER = DATA->FILE_CONTENT
         IMPORTING OUTPUT_LENGTH = LV_OUTPUT_LENGTH
         TABLES BINARY_TAB = LT_BINARY_TAB .
        CALL FUNCTION'SCMS_BINARY_TO_STRING'
        EXPORTING INPUT_LENGTH = LV_OUTPUT_LENGTH
         IMPORTING TEXT_BUFFER = LV_TEXT_BUFFER
         TABLES
         BINARY_TAB = LT_BINARY_TAB.
        IF SY-SUBRC = 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        SPLIT LV_TEXT_BUFFER AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE IT_LINE.
        IF SY-SUBRC = 0.
          LOOP AT IT_LINE INTO WA_LINE.
           SPLIT WA_LINE AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
            split wa_line at ','
            INTO WA_TAB-FIELD1 WA_TAB-FIELD2 WA_TAB-FIELD3 WA_TAB-FIELD4 WA_TAB-FIELD5.
            append wa_tab to it_tab.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDIF.

    Also, I missed another point.
    In the folder c:\dbdata I have a number of CSV files on the user frontend. I would like the BSP application to get the list of files in the folder and process them one after the other. How can I get the list of files on the folder in the user PC and how to process them one after the other.
    I want the form to display only the default folder and once I press on upload it must process all files and display the status of processing on the same page.
    Please kindly share ideas how I can implement this app.
    Thanks
    Karen

  • How to specify the download file name??

    Hi guys~~~
    I have servlet which can generate a *.pdf file,I found if I didn't setContentType="application/pdf",I can download it!!But the download file name is my servlet file name.If I want to change the download file name,How do I do????
    thanx a lot!!!Best regard!

    Thanx for ur help...But I encounter a new charllenge now...
    I use a javascript(window.open("/myservlet")) to open the download file servlet.
    Everything is okay.But when I finish downloading the file which window I opened cant close itself automatically.
    I am really not understand the header parameter of the HTML header,could someone give me something about this??
    Thanx again!!!!

  • Mail to File - how to read the attachment file name from the subject.

    I need to use the SHeaderSUBJECT's value in the receiver file adapter's variable substitution.
    This is a Mail to File scenario without design part where the attachment file name comes in the subject of the mail.
    I see the below in the dynamicconfiguration section. How can i retrive the value from dynamicconfiguration section to the filename.
    <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
    <SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="SHeaderSUBJECT">PlainAttachment.txt</SAP:Record>
    </SAP:DynamicConfiguration>
    Points will be rewarded.

    Try to use sthg like this in a UDF :
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().getStreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(“http://sap.com/xi/XI/System/Mail”,“SHeaderSUBJECT”);
    String value = conf.get(key);
    or in a JAVA mapping :
    DynamicConfiguration dynConf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey dynKey = DynamicConfigurationKey.create((“http://sap.com/xi/XI/System/Mail”,“SHeaderSUBJECT”);
    String keyValue = dynConf.get(dynKey);
    param is the map object from the execute() method of your mapping ...
    Hope this helps
    Chris
    Edited by: Christophe PFERTZEL on Apr 23, 2008 11:34 AM

  • InfoPath 2013: How to find the current file name?

    Hello,
    Is there any way to find the file name in the rule formulas when an existing xml file in a sharepoint form library is being edited in InfoPath? I am looking for a function that returns the current file name that is being edited.
    Thank you,

    Hi,
    According to your post, my understanding is that you want to get the current file name in the InfoPath form.
    Here is a similar thread for you to take a look at:
    http://social.technet.microsoft.com/Forums/en-US/a24f01d5-744c-4b75-b30d-3295311ab054/how-do-i-find-the-file-name-of-the-currently-open-infopath-form?forum=sharepointcustomizationlegacy
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to get the EXCEL file from web site (b2b) into SAP system?

    Hi Guys,
    I have a requirement of saving the excel file that has been send to SAP system from a B2B site.
    Currently there is a call to the SAP system from the B2B site via an RFC function ,this RFC functions gets the excel file as an input to the SAP system,i need to store this Excel file in the SAP  (as an excel file itself).
    How can i acheive this?
    Please suggest.
    Thanks ,
    Swati

    You can extract a date portion and  assign to the variable and then compare with GETDATE()
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to extract the excel file using web dynapro

    Hi Expert,
       I want to know how to generate an excel file to extract the internal  data. Please give me your help.
      Thanks in advance.

    I think you you can use File download UI element. Refer following link for more info:
    [FileDownload|http://help.sap.com/saphelp_tm60/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    Regards,
    Saket

  • How to see the whole file names in finder column view?

    Hi guys,
    I like to use finder in column view. However, most of the times, the file names get trunked and I have to redim the column to see the whole names. Other day, without wanting to, I must have pressed some key combination, and the column got redim automatically, so I could read the whole file names. So, my question is if does anybody know how to achieve this?

    I don't know what "redim" means, but if you double-click the column separator, it becomes wide enough for the longest name. If you Option-double-click it, all columns become wide enough for the longest name in each column.

Maybe you are looking for