Get filenames from SAP App. Server

Hi,
Need info on the following.
Need to fetch all filenames OR filenames using a mask from the SAP Application server directory into internal table.
Not able to find appropriate Function Module.
I have used the following function modules for the purpose but to no help.
EPS_GET_DIRECTORY_LISTING
RZL_READ_DIR_LOCAL
Looking forward to your suggestions.
Thanks.

Hi Mohammed,
you can read the files with the following command:
CONCATENATE 'ls ' p_path INTO ux_com SEPARATED BY space.
CALL 'SYSTEM' ID 'COMMAND' FIELD ux_com
ID 'TAB' FIELD i_files-sys.
p_path contains your Unix filepath.
i_files is just an internal table with one field for the filename.
Use SE11 and search a rollname like path, file.
Take a field that has length 128 (usually is long enough, if not take one with 256 ) and is type char.
Then you code:
data: begin of i_files occurs 0,
filename type <the_fieldname_you_found_char_128>.
data: end of i_files.
p_path is your pathname usually 128 is also long enough.
parameters:p_path(128) deault '/your_paht/'.
This should work, the -sys is just for the called C-routine relevant.
Use it the way i suggested.
Kind regards
Henner
<b>Reward if helpful</b>

Similar Messages

  • SAP App Server 7 does not recognize DOM mechanism of XML security provider

    Hi all,
    I am trying to do XML signature by Java servlet, and am using Sun WSDP 2.0 (WebServices Developers Pack) for this purpose.
    SAP Netweaver 7.0 (which implements Servlet API version 2.3) on Windows2003
    JRE 1.4.2
    SAP Developers Studio
    SWSDP 2.0
    Code snippet:
    import javax.xml.crypto.dsig.XMLSignatureFactory;
    XMLSignatureFactory sigFactory =
    XMLSignatureFactory.getInstance("DOM", new org.jcp.xml.dsig.internal.dom.XMLDSigRI());
    This gives an exception:
    javax.xml.crypto.NoSuchMechanismException: Cannot find DOM mechanism type
    This means that the SAP app server cannot get DOM mechanism from the provider (org.jcp.xml.dsig.internal.dom.XMLDSigRI).
    I tried the same code in a stand-alone Java program, and it worked perfectly. Again, the same program when loaded on tomcat also worked. I tried with JWSDP 1.5 and the results were same (ie. worked on tomcat, worked in a stand-alone java program, but failed in SAP app server).
    Does anyone know or have any idea of this issue? Why is the SAP app server rejecting the DOM mechanism of other provider? Is this a bug?
    To recreate this issue, just download the xmldsig.jar for the package JWSDP2.0 (or 1.5) and write the above 2 lines in the servlet.
    Thanks in advance.

    This problem is solved. I am putting the reply here so that others who stumble upon this error can benefit.
    Add the following line to explicitly include the provider before the getInstance
    Security.addProvider(new org.jcp.xml.dsig.internal.dom.XMLDSigRI());
    XMLSignatureFactory sigFactory =
    XMLSignatureFactory.getInstance("DOM", new org.jcp.xml.dsig.internal.dom.XMLDSigRI());

  • CL_GUI_PDFVIEWER and files from the App server

    Hi,
    I would liek to use the class CL_GUI_PDFVIEWER  to read files from the app server (transaction AL11) and then to present them.
    it is easy to use the local machine files.
    how can I use the method open_document with a file from there?
    Thanks,
    Itay

    Thanks for the help.
    I tried what you suggested but I get a dump for some reason.
    Can you help?
    This is the dump:
    Exception condition "SYSTEM_FAILURE" raised.
         Program                                      SAPLOLEA                    
         Include                                      LOLEAU10                    
         Row                                          358                         
         Module type                                  (FUNCTION)                  
         Module Name                                  AC_FLUSH_CALL_INTERNAL      
    This is the program:
    REPORT zpdftest .
    DATA: g_html_viewer     TYPE REF TO cl_gui_html_viewer,
          my_main_container TYPE REF TO cl_gui_custom_container,
          entry1(100) TYPE c,
          entry2(100) TYPE c.
    DATA: okcode TYPE sy-ucomm,
          gt_pdf TYPE STANDARD TABLE OF string,
          wa_pdf TYPE string,
          g_url(2048)  TYPE c
    START-OF-SELECTION.
      SET SCREEN 100.
    *&      Module  pbo_0100  OUTPUT
    MODULE pbo_0100 OUTPUT.
      SET PF-STATUS 'STATUS100'.
      SET TITLEBAR  'TITLE100'.
      IF my_main_container IS INITIAL.
        CREATE OBJECT my_main_container
          EXPORTING
            container_name = 'CUSTOM_CNTL'
          EXCEPTIONS
            cntl_error     = 1
            OTHERS         = 2.
        CHECK sy-subrc IS INITIAL.
        CREATE OBJECT g_html_viewer
          EXPORTING
            parent             = my_main_container
          EXCEPTIONS
            cntl_error         = 1
            cntl_install_error = 2
            dp_install_error   = 3
            dp_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.
        DATA: lv_filename TYPE rlgrap-filename.
        lv_filename = '/PBMGUS/UXA/ABAP/TEST.PDF'.
        OPEN DATASET lv_filename FOR INPUT
                     IN BINARY MODE
        WHILE sy-subrc IS INITIAL.
          READ DATASET  lv_filename  INTO wa_pdf.
          IF NOT sy-subrc IS INITIAL.
            EXIT.
          ENDIF.
          APPEND wa_pdf TO gt_pdf.
        ENDWHILE.
        CLOSE DATASET lv_filename.
        CALL METHOD g_html_viewer->load_data
          EXPORTING
            type                 = 'application'
            subtype              = 'pdf'
          IMPORTING
            assigned_url         = g_url
          CHANGING
            data_table           = gt_pdf
          EXCEPTIONS
            dp_invalid_parameter = 1
            dp_error_general     = 2
            cntl_error           = 3
            OTHERS               = 4
        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 METHOD g_html_viewer->show_url
          EXPORTING
            url                    = g_url
          EXCEPTIONS
            cntl_error             = 1
            cnht_error_not_allowed = 2
            cnht_error_parameter   = 3
            dp_error_general       = 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.
      ENDIF.
    ENDMODULE.                 " pbo_0100  OUTPUT
    *&      Module  pai_0100  INPUT
    MODULE pai_0100 INPUT.
      CASE okcode.
        WHEN 'BACK'.
          LEAVE to screen 0.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
      CLEAR okcode.
    ENDMODULE.                 " pai_0100  INPUT

  • Trying to use FTP to get data from a different server

    Hi Friends,
        I have to use FTP to get data from a different server and upload it on SAP server. Now my problem is when I m trying to do ftp through command line it brings the file but with no data.
       Through ABAP program nothing is happening.
    Here's my code--
      V_PASSWORD = 'test@123'.
      V_PWD_LEN = STRLEN( V_PASSWORD ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = V_PASSWORD
          SOURCELEN   = V_PWD_LEN
          KEY         = CS_KEY_500098
        IMPORTING
          DESTINATION = V_PASSWORD.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          USER            = 'test'
          PASSWORD        = V_PASSWORD
          HOST            = '176.0.1.6'
          RFC_DESTINATION = 'SAPFTPA'
        IMPORTING
          HANDLE          = MI_HANDLE
        EXCEPTIONS
          NOT_CONNECTED   = 1
          OTHERS          = 2.
      CHECK SY-SUBRC = 0.
      cmd = 'lcd d:\ftp'. .
      PERFORM FTP_COMMAND USING CMD.
      CMD = 'asc'.
      PERFORM FTP_COMMAND USING CMD.
      CONCATENATE 'dir' 'ftpt*' INTO CMD SEPARATED BY SPACE.
      PERFORM FTP_COMMAND USING CMD.
      cmd = 'ls'.
    concatenate 'ls' INTO CMD SEPARATED BY SPACE.
      PERFORM FTP_COMMAND USING CMD.
      cmd = 'mget trial.txt'.
    CONCATENATE 'mget' 'trial.txt' INTO CMD SEPARATED BY SPACE.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          HANDLE        = MI_HANDLE
          COMMAND       = CMD
        TABLES
          DATA          = MTAB_DATA1
        EXCEPTIONS
          TCPIP_ERROR   = 1
          COMMAND_ERROR = 2
          DATA_ERROR    = 3
          OTHERS        = 4.
      IF SY-SUBRC = 0.
        LOOP AT MTAB_DATA1.
          WRITE: / MTAB_DATA1.
        ENDLOOP.
      ELSE.
        CONCATENATE 'Error in FTP Command while executing' CMD INTO ERROR SEPARATED BY SPACE.
        WRITE: / ERROR.
      ENDIF.

    Hi
    try this.....in one of my reqt, i done this successfully....
    FORM FTPCON.
    FTP-------------------------------------------------------*
      CLEAR DSTLEN.
      SET EXTENDED CHECK OFF.
      DSTLEN = STRLEN( S_PWD ).     -
    >  (S_PWD (password) is a selection screen field )                  
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = S_PWD
          SOURCELEN   = DSTLEN
          KEY         = KEY
        IMPORTING
          DESTINATION = S_PWD.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          USER            = P_USER                   -
    > Username
          PASSWORD        = S_PWD             -
    > password
          HOST            = P_HOST                  -
    > Host
          RFC_DESTINATION = P_DEST         -
    > Destination
        IMPORTING
          HANDLE          = HDL
        EXCEPTIONS
          NOT_CONNECTED   = 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 'FTP_COMMAND'
        EXPORTING
          HANDLE        = HDL
          COMMAND       = 'set passive on'
        TABLES
          DATA          = RESULT
        EXCEPTIONS
          TCPIP_ERROR   = 1
          COMMAND_ERROR = 2
          DATA_ERROR    = 3.
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          HANDLE         = HDL
          FNAME          = G_FCNAME
          CHARACTER_MODE = 'X'
        TABLES
          TEXT           = T_FILE1
        EXCEPTIONS
          TCPIP_ERROR    = 1
          COMMAND_ERROR  = 2
          DATA_ERROR     = 3
          OTHERS         = 4.
      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 'FTP_R3_TO_SERVER'
        EXPORTING
          HANDLE         = HDL
          FNAME          = G_FCNAME1
          CHARACTER_MODE = 'X'
        TABLES
          TEXT           = T_FILE2
        EXCEPTIONS
          TCPIP_ERROR    = 1
          COMMAND_ERROR  = 2
          DATA_ERROR     = 3
          OTHERS         = 4.
      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 'FTP_DISCONNECT'
        EXPORTING
          HANDLE = HDL.
      CALL FUNCTION 'RFC_CONNECTION_CLOSE'
          EXPORTING
            DESTINATION          = P_DEST
          EXCEPTIONS
            DESTINATION_NOT_OPEN = 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.
    ENDFORM.                    " FTPCON
    Hope it helps.....

  • How BW get data from MS SQL server DB?

    I got infomation about this from help.com, http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm.
    this web told me, when BW application server must be Win NT.BW can get data from MS SQL server DB.
    but our BW application server was AIX.
    Did you know other solution to this?

    Hi,
    you need to use the DBConnect or in BI7.0 the UDConnect features.
    regards
    Siggi
    See also: http://help.sap.com/saphelp_nw70/helpdata/EN/a1/89786c3df35c4ea930a994e884bb4c/frameset.htm
    or
    http://help.sap.com/saphelp_nw70/helpdata/EN/44/bcdce1dcaf56a3e10000000a1553f6/frameset.htm
    Edited by: Siegfried Szameitat on Aug 13, 2008 9:16 AM

  • Standalone webcache or Web cache from Oracle Apps Server 10.1.2.0.2?

    Hi
    I am installing web cache on two servers in web tier and J2EE server (with OHS) on another two servers in apps tier. Should I use standalone webcache or install from Oracle Apps Server package? If I choose Oracle Apps Server package, I have to disable Home, HTTP components. But it is DCM managed. Any suggestions?
    And should I deploy my OHS servers on web cache servers in the web tier? In future we want to expand J2EE installation, we will deploy Portal with SSO, OID etc.
    Regards
    Shen Jie

    Shen Jie,
    Please review the Enterprise Deployment to see what are the best architectures.
    Hope this helps.
    Deepak

  • How to get FILENAME from FILE PATH

    does anyone know how to get filename from a file path for example
    FILE PATH: C:\Project\uploadbean\web\uploads\Button.txt
    returns
    FILENAME: Button.txt

    @BalusC
    ust for a reference cause i'm new in JSP This has nothing to do with JSP, but with basic knowledge of an essential API. I have given you the link to the File API. Are you saying that you refused to read the API documentation, which clearly explains you how to use the File and shows which methods are all available to you undereach the straightforward getName() method, and expecting that the others may chew the answers for you? Loser.

  • API to retrieve data from SAP content server

    Is there an API available to retrieve data from SAP content server?

    Hi
    you could check out function groups starting with OPT.
    F.eks. OPTB, OPTC, OPTD
    Also check function group ARCHIVOBJECT.
    best regards
    Thomas Madsen Nielsen

  • How to Access data from SAP Content Server through SAP Portal

    Hi Experts,
    I want to aceess the data from SAP Content server through portal. Currently I am working on LSO business package. The SAP content server should work like Webdav as we uses KM as webdav.
    I am trying to use this URL into the CMS address but it is not working
    http://XXX-XXX-XXXX:1090/ConTentServer/ContentServer.dll?adminContRep&operation=docIdList&contRep=ZADGAS_LSO
    Is there any other procedure for acceesing the DATA  from SAP content server. ?
    Thanks,
    Ahmad

    If your Content Server is being used by DMS, then you can use the DMS Connector for KM.  This connector allows all documents stored in DMS to be accessed in Portal as if they are stored in KM.  For more info see this:
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/42/d289b446076bb2e10000000a1553f6/frameset.htm
    Andrew

  • Outbound mails from SAP CRM server

    Hi,
    Is there any way by which Outbound mails from SAP CRM server can be routed to more than one mail servers?
    Any suggestions or work arounds will be appreciated.
    Thanks and regards,
    Asheesh

    Hello Asheesh,
    it is possible to create more than one Mail Node in Transaction SCOT. The mail can then be routed depending on the Domain Name.
    Regards
    Gregor

  • SMS Provider for sending SMS from SAP BI server

    Hello,
    I need to send sms from sap bi server.
    Which service provider is preferable to use for sending sms?
    Any suggestions?

    You can opt for IDEA...............

  • C# retrieve report from SAP Crystal Server

    I have installed SAP Crystal Server on a Windows 2012 Server machine. The installation looks fine. I can run the Central Management Console and everything appears to be up and running.
    I have a Windows application running on my local machine and all I want to do is run a report.
    myRCDoc = new ReportClientDocument();
    myRCDoc.ReportAppServer = _server;
    object path = reportName;
    myRCDoc.Open(ref path, 0);
    I get the following error:
    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Billings.exe
    Additional information: Failed to connect to server "ENTBSQ01".
    How do I make the server reachable from my windows code?

    Thanks Dell!
    I'm currently not logging into the CMS.
    I'm not clear when you ask "working with reports from CRS"? 
    The *.rpt files are indeed stored on the server.  My windows app simply calls ReportClientDocument.Open to get the report.  I'm assuming that means I am indeed working with reports from CRS.
    I'll try to logging in part first and then move to checking the SDK.
    Thanks again!
    -Terry

  • Error Missing parameter values - I get this in 11g app server only

    Hi.. I had an application in JSP-Struts, previously on 10g app server.  I now migrated the code into 11g. 
    I get the error on CrystalViewer.jsp 
    Error
    Missing parameter values
    Steps that lead up to the error:
    The very first time anyone enters the application and clicks a submit button on the jsp, after entering data and/or picking from drop menus, the error shows up on a separate page (thrown by crystalViewer.jsp)
    When I get this error, and click the browsers back button, and simply click the submit button on the jsp screen again, the reports work fine (like they do in 10g).
    Tried the following:
    I used log4j and followed the data as it made its way from Struts to Crystal Factory.  But once it gets out of Struts, and forwards to Crystal, I receive the error from the CrystalViewer.jsp
    Next, I removed code in struts-action, that used crystal factory to 'set parameter', and didnt send any parameters, letting my crystal report bring back some random records.. And this works even the first submit!  So the problem is only when I have to send parameters to crystsl
    Additional info:
    I do not send any null values across, since I read on these forums that folks were having issues with setting nulls etc... I check for null and then force 'All' in the parameter if the user does not enter data or pick from the drop-down.
    I need help resolving this . Thanks and have a great day.
    (Are there any changes to be made to the Struts config, or any additions to Web.xml? Should Crystal reports be changed in anyway so they can function like they did in 10g?)

    The Crystal SDK doesn't know or care that you're using Struts. 
    The exception is stating you're not setting parameters. 
    So wherever you're trying to set parameters, whatever's reaching the viewer don't have them set.
    Why not trace the workflow to see what's where?
    Sincerely,
    Ted Ueda

  • How to get filename from mail attachment

    Hi all,
    I have a XI scenario Mail->XI->RFC. I have created my own adapter module which handle all attachments from incoming mail.
    Everything work fine, but in my module I try to get information about filename of mail attachment. I use getContentType() metod to get the filename but this method return only the mimetype of the document. The getDescription() method return olny string "mail attachment". I need to get the original filename of the attachment or at least the file extension. 
    Is it possible to get the whole filename from mail attachment?
    Thanks
    Peter

    Hi,
    You can tryout with adapter modules . You can make use of following Adapter attributes also -
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/bf93409c663228e10000000a1550b0/content.htm
    Similar discussion-
    Email attachment file names
    PayloadSwapBean-
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Regards,
    Moorthy

  • FileName from the Content Server

    Hi All ,
    I need to show the FileName of a File uploaded into SAP Content Server .
    Example if I upload fiel ABC.pdf I should be able to get the name "ABC.pdf" form content server
    is there any FM available ?
    Note : While storing the file into content server it is creating the unique ID(system generated GUID) for each uploaded File.
               Using this ID I am able to show the contents of file using FileDownload but the label I need to show as the FileName and
              not the ID.
    Regards,
    Ravi

    I am having this problem as well, with IE5.0 as well as IE5.5 on Windows 2000. I have tried the above suggestion and that doesnt seem to work. I have also tried to use a
    Content-Disposition of "inline" to just view
    the document and that seems to work incorrectly too; an IE dialog comes up
    asking to open/save the download JSP.
    I have tried loads of variations and based
    my code on Marks stuff posted in this group
    e.g. renderContent.
    Any more suggestions/work arounds?
    Darren.
    null

Maybe you are looking for

  • How do I copy and paste a picture from my Photobucket account to an email

    The only reason I use Internet Explorer is because I copy and paste pictures to make emails for friends but don't know how to do it here

  • Problem with Replying, Relaying or Forwarding E-mails with Attachments

    This just started happening recently. I don't recall exactly when. Best guess is within the last week or so. When I try to reply to, relay or forward an e-mail (in Mail.app) that has an attachment, only the attachment shows up in the new e-mail edit

  • How to load lots of images synchronously

    HI all, I want to cache lots of images locally with URLLoader and need to know those fails. I can add listener to event IOErrorEvent.IO_ERROR. A variable can be used to save the file name I want to load last time. Then in the error handler I can know

  • Java -jar -myApp.jar works but ....

    Hi there, I have a problem : using ant, I have exported my application into an executable jar file. When in the console, I type "java -jar myApp.jar" . Everything works well. But if, I do double click on the jar file, nothing happens. In fact, I can

  • Songs gone from library, how do i get back?

    ok i wanted to add 22 new songs to the library so i could then add them to my ipod. i wanted to copy my current library and then delete it and add the 22 songs to it so i could easy add them to my ipod without searchin for them song by song, and then