Create Directory via ABAP on Application Server

Hej folks,
does anybody know how to create a directory on the ApplServer via ABAP?
Thanks in advance!
boris

You can create an external command via SM69 which you can then invoke through function module SXPG_COMMAND_EXECUTE
For NT you'd need something like the following:
Operating system command                             
cmd                                                                               
Parameters for operating system command              
/c mkdir
$/SAPGLOBALHOST/\?   
Have fun,
Mark
Kudos to Pete Devereux and Pete White

Similar Messages

  • How to create the user on Internet Application Server(IAS) control console

    Hi All,
    My Client is asking me for How to create the user on Internet Application Server(IAS) control console 10.1.2( 10g release 2).
    If anyone have the document for How to Create the User on Internet Application Server (IAS) console 10g release 2 , then please send me the document and help me out from this Concern.
    Regards,
    Yadav@intelli.
    Edited by: 851080 on Apr 8, 2011 6:31 PM

    Are you using OID? Can you provide more details about your iAS environment?

  • To create a new file in application server and transfer data to ti

    i am doing the following where i have to create a new file in application server and transfer data to tht file from an internal table.but its saying file cant be opened.the path i am giving to parameter p_prefil is /tmp/prachi.txt.
    wats the prob..can anyone help.
    DATA:L_WA_FINAL TYPE TY_FINAL,
         l_wa_string type string.
    OPEN DATASET P_PREFIL FOR OUTPUT IN text mode encoding default.
    if sy-subrc <> 0.
    write: ' file cannot be opened'.
    stop.
    endif.
    LOOP AT P_I_FINAL INTO L_WA_FINAL.
    move l_wa_final to l_wa_string.
    TRANSFER l_wa_string TO P_PREFIL.
    if sy-subrc <> 0.
    write: 'file can not be written'.
    stop.
    endif.
    clear l_wa_final.
    ENDLOOP.
    CLOSE DATASET P_PREFIL.
    if sy-subrc <> 0.
    write: ' file cannot be closed'.
    stop.
    endif.

    DATA:L_WA_FINAL TYPE TY_FINAL,
    l_wa_string type string.
    OPEN DATASET P_PREFIL FOR OUTPUT IN text mode encoding default.
    if sy-subrc ne 0.
    write: ' file cannot be opened'.
    stop.
    endif.
    LOOP AT P_I_FINAL INTO L_WA_FINAL.
    move l_wa_final to l_wa_string.
    TRANSFER l_wa_string TO P_PREFIL.
    write: 'file can not be written'.
    clear l_wa_final.
    ENDLOOP.
    CLOSE DATASET P_PREFIL.
    if sy-subrc ne  0.
    write: ' file cannot be closed'.
    stop.
    endif.

  • Creating a directory statically in the Application Server

    Hi,
    I need to create a directory in the application server statically (not through code), in which I later have to store and read files. Most forums talk about doing this through AL11 --> Configure.
    While this does create an entry in the directory list in AL11, I doubt if the directory was actually created in the AS. Double clicking this directory name shows an error message in the status bar (Wrong order of calls <- CALL opendir: No such file or directory). So I believe the directory is not created at all.
    How do I set up a directory which I can browse and see, and use for creating / reading files?
    My AS is on AIX OS.
    Thanks,
    Z

    Hi,
    Yes, Could we not do it from SAP screens?
    Go to Al11 and in that you can see a tab Configure.
    There you can create the Directory and say Add button
    and then Save .
    and after that Using
    Open Data set ds1 for Output.
    will create the File if it is not there .
    you can specify the path in which you can create the files.
    check this thread as well:
    Creating a directory & subdirectory on Application Server
    Sachin
    Edited by: Sachin Dhingra on Jan 22, 2009 11:02 AM

  • Directory Existence Check on Application Server

    Is there any function module to check whether a given directory exists on Application Server or not.

    This works pretty good for me.
    REPORT ZRICH_0001 .
    type-pools: abap.
    data: path type string.
    data: result type abap_bool.
    path = '\<host>usrsapTSTSYS'.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST
      EXPORTING
        DIRECTORY            = path
      RECEIVING
        RESULT               = result
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        WRONG_PARAMETER      = 3
        NOT_SUPPORTED_BY_GUI = 4
        others               = 5.
    if result = 'X'.
      Write:/ 'Directory Exists'.
    else.
      Write:/ 'Directory not found'.
    endif.
    Regards,
    Rich Heilman

  • Create database on top of application server

    Hi, I have Oracle Application Server 10g installed, now can I create database directly on top of that? I tried to use the provided DBCA to create a 10g database. During the creation process, I got "ORA-01304: Oracle not available". Is there anybody know what is wrong with this? Or should I install 10g database independenttly?
    Any input will be appreciated.

    Hi,
    "can I create database directly on top of that" ...
    1. If you are installing in the same "ORACLE_HOME" directory no.
    2. If you are installing in a different directory, and have sufficient memory, cpu, diskspace (a significant issue)... then Yes
    "should I install 10g database independently"
    1. perhaps, see above, if Yes to (2) then is this a development platform for yourself or an organizational / company platform. It is common practice for the apps server and db to be installed on different servers for performance reasons.

  • Creating a new file in application server

    hai,
      please rectify this, how to create a file in application server ?
       can any one forward a sample code for creating a file in application server.
                           hazam

    Hi Hazam,
      Please check the below code.
    Data :   P_UFILE(60)                   " Unix File name
             TYPE C
             value '/emn_R3/hr/ben_age25_dep'.
        CLEAR GD_SUBRC.
        <b>OPEN DATASET</b> GD_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF SY-SUBRC <> 0.
          GD_SUBRC = SY-SUBRC.
          gs_error-pernr = gs_0021-pernr.
          gs_error-ename = gd_ename.
          gs_error-mess
               = 'Can not open File:'(017) + gd_file.
          append gs_error to gt_error.
          clear gs_error.
    *      CLEAR GD_MSG1.
    *      CONCATENATE 'Can not open File:'(017)
    *                   GD_FILE
    *        INTO GD_MSG1.
    *      WRITE : / GD_MSG1.
        ELSE.
          LOOP AT GT_BODY INTO GS_BODY.
            <b>TRANSFER</b> GS_BODY TO GD_FILE.
          ENDLOOP.
          <b>CLOSE DATASET</b> GD_FILE.
        ENDIF.
    Hope this will help you.
    Thanks&Regards,
    Siri.
    Message was edited by: Srilatha T

  • Creating connection pool on Sun Application Server 8.1

    Hi All,
    I am trying to create a connection pool for my MySql database on Sun Application Server(Version 8.1) using 'asadmin'. I am also able to create the connection pool successfully but when i am trying to ping the connection pool, it is giving me the java.net.UnknownHostException. The command I am using for creating the connection pool is as follows:
    create-jdbc-connection-pool user admin password adminadmin host localhost port 4849 datasourceclassname com.mysql.jdbc.jdbc2.optional.MySqlConnectionPoolDataSource restype javax.sql.XADatasource --property User=root:Password=admin:SelectMethod=Cursor:DatabaseName=testdb:serverName=\"localhost\":portNumber=3306 MyConnectionPool
    My database and the application server are running on the same machine.
    Has anyone come across such a problem? Any help would be highly appriciated.
    Thanks in Advance,
    Anurag.

    hi Anurag,
    Check the properties in the jdbc-connection-pool tag and make sure that the values are populated correctly. You can also try specifying the actual hostname or IP address of the machine instead of localhost and see if that works.
    Cheers,
    Vasanth

  • Creating an SMF service for application server

    Hi... I'm not sure this is the proper place to post this
    I installed application server 8.2 pe on Solaris 10 6/06 and I tried to create a service using asadmin create-service, but the option fo creating service does not seem to exist. Is it a matter of the version, type of app. server? any suggestions?
    Am I supposed to try this old style: http://docs.sun.com/app/docs/doc/819-4712/6n6rit5q5?a=view

    Hi Roman Dubov
    Here is the step-by-step guide of How to Create ICF Service from an Existing Service:
    Just have a look:
    http://help.sap.com/saphelp_bw30b/helpdata/en/78/9852aec06b11d4ad310000e83539c3/content.htm
    Cheers,
    Vijay Raheja

  • Creating directories for installing Oracle Application Server 10.1.2.0.2

    Hi,
    I have Red Hat Linux 4.0 and i am trying to install OAS 10.2.0 Enterprise Edition which includes web tier, app tier and database tier all in server machine because i do have about 100GB disk space, 12 GB memory and 9 GB swap space.
    Now, i read the OAS installation documents which i got from oracle.com
    as well as i read OAS installation chapters from the OAS books i purchased from oracle press.
    now each documentation guides us to create different folders with different names for installinmg the AS. these are the list of directories i got from both these documentations.
    for Inventory:
    /home/oracle/oraInventory
    /opt/oracle/oraInventory
    for Infrastructur instance:
    /opt/oracle/oraInfra
    /u01/oracle/infra1012
    for Database files:
    /u01/oracle/infra1012/datafiles
    /opt/oracle/oraInfra/datafiles
    for BI and Forms:
    /opt/oracle
    /u02/oracle
    and from above comparisons which one is oracle recommended default directory name that i should create for my installation.
    also what path should i give for ORACLE_HOME. is it
    /home/oracle/product or
    /opt/oracle
    Can someone please guide me with creating the correct recommended directories for installaing OAS10.1.2.
    Or can i go ahead and create my own directory names for the installation.
    Thanks,
    Philip.

    Basically it's up to you how to design the directory structure.
    What I normally do on my VMWare instances where I run RedHat is one directory in the home dir of the Oracle user.
    So I have:
    /home/oracle
    In there one directory for the software called products
    /home/oracle/products
    When I have several ORACLE_HOME's they get their own dir in the above directory, for example:
    /home/oracle/products/db102
    /home/oracle/products/as101202infra
    /home/oracle/products/as101202mid
    /home/oracle/products/as10131soa
    and so on.
    When dealing with installation at customers I adhere to their standard which is normally based on OFA. Search for OFA on the internet and you get the reason why you see so many differnet directories in the docs and books.
    cu
    Andreas

  • Create an XML File in Application server

    Hello,
    I have a requirement to create an XML File as Local File and as server File. For the local File it works fine and i got a Local XML File.
    My problem is for the Server File.I found a solution in internet to convert in binary.But i don't get in the server File created the XML structure.
    Here is My code for the unix server File
    DATA ex_tab TYPE TABLE OF x255.
      data: wa_tab type x255.
      data: lv_line(255) type c.
    **-- carica tabella gt_file
       PERFORM CARICA_TAB_FILE.
       LOOP AT GT_FILE.
         MOVE-CORRESPONDING GT_FILE TO WA_SOURCE.
         APPEND WA_SOURCE TO GT_SOURCE.
         CLEAR WA_SOURCE.
       ENDLOOP.
    * Perform the XSLT stylesheet
       TRY.
           CALL TRANSFORMATION ZMESMO052_XML
              SOURCE MATERIAL_DATA = GT_SOURCE[]
              RESULT XML XML_RESULT .
         CATCH CX_ROOT INTO GS_RIF_EX.
           GS_VAR_TEXT = GS_RIF_EX->GET_TEXT( ).
           MESSAGE GS_VAR_TEXT TYPE 'E'.
       ENDTRY.
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
         EXPORTING
             buffer     = XML_RESULT
           TABLES
             binary_tab = ex_tab.
       CONCATENATE P_FILE '.xml' INTO P_FILE.
       CONDENSE P_FILE.
       TRANSLATE P_FILE TO LOWER CASE.
       OPEN DATASET P_FILE FOR OUTPUT IN BINARY MODE.
       IF SY-SUBRC NE 0.
         MESSAGE E000(ZF) WITH ' Error opening File' P_FILE.
       ENDIF.
       loop at ex_tab  into wa_tab.
         move wa_tab to lv_line.
         transfer lv_line to p_file.
       endloop.
       close dataset p_file.
    And i Got a file like this
    Any solution please

    I Found the solution,
    DATA EX_TAB TYPE TABLE OF X255.
       DATA: WA_TAB TYPE X255.
       DATA: LV_LINE(255) TYPE C.
       DATA: L_CONVIN TYPE REF TO CL_ABAP_CONV_IN_CE.
       DATA: L_HTML TYPE STRING.
       DATA: L_VALUE TYPE STRING.
       DATA: L_MSGSTR TYPE STRING.
       DATA: FILENAME TYPE STRING.
    **-- carica tabella gt_file
       PERFORM CARICA_TAB_FILE.
       LOOP AT GT_FILE.
         MOVE-CORRESPONDING GT_FILE TO WA_SOURCE.
         APPEND WA_SOURCE TO GT_SOURCE.
         CLEAR WA_SOURCE.
       ENDLOOP.
    * Perform the XSLT stylesheet
       TRY.
           CALL TRANSFORMATION ZMESMO052_XML
              SOURCE MATERIAL_DATA = GT_SOURCE[]
              RESULT XML XML_RESULT .
         CATCH CX_ROOT INTO GS_RIF_EX.
           GS_VAR_TEXT = GS_RIF_EX->GET_TEXT( ).
           MESSAGE GS_VAR_TEXT TYPE 'E'.
       ENDTRY.
       TRY.
           CALL METHOD CL_ABAP_CONV_IN_CE=>CREATE
             EXPORTING
               ENCODING = 'UTF-8'
               INPUT    = XML_RESULT
             RECEIVING
               CONV     = L_CONVIN.
           CALL METHOD L_CONVIN->READ
             IMPORTING
               DATA = L_HTML.
         CATCH CX_ROOT.
           L_MSGSTR = 'Conversion error'.
       ENDTRY.
       SEARCH L_HTML FOR '><'.
       CLEAR L_VALUE.
       L_VALUE = CL_ABAP_CHAR_UTILITIES=>NEWLINE.
       CONCATENATE '>' L_VALUE '<' INTO L_VALUE.
       IF SY-SUBRC = 0.
         REPLACE ALL OCCURRENCES OF '><' IN L_HTML WITH L_VALUE IN
    CHARACTER MODE.
       ENDIF.
       CONCATENATE P_FILE '.xml' INTO P_FILE.
       CONDENSE P_FILE.
       TRANSLATE P_FILE TO LOWER CASE.
       FILENAME = P_FILE.
       OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE
    WITH UNIX LINEFEED.
       TRANSFER L_HTML TO FILENAME.
       CLOSE DATASET FILENAME.

  • Create tab seperated file on application server

    Hi all
    I need to create a file with Tab separation. I have a solution on a 4.7 system as shown below. But this does not work on a 4.6 system as the class does not exist.
    How can I do this on a 4.6 system?
    Thank you four your reply.
    Herbert
    CONSTANTS c_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
        LOOP AT t_material.
          CONCATENATE
            t_material-id
            t_material-brand
            t_material-desc
            t_material-level
            t_material-flag
         INTO w_line
            SEPARATED BY c_tab.
          TRANSFER w_line TO w_file2.
        ENDLOOP.

    do this way...
    Table to store final data
    CONSTANTS: cns_09(2) TYPE n VALUE 09,
               c_val1 TYPE c VALUE 'X'.
    DATA: g_deli(1) TYPE c.
    table to place delimiter
    DATA: BEGIN OF it_hex,
            tab TYPE x,
          END OF it_hex.
    ASSIGN g_deli TO <fs> TYPE c_val1.
    it_hex-tab = cns_09.
    <fs> = it_hex-tab.
    LOOP AT t_material.
    CONCATENATE
    t_material-id
    t_material-brand
    t_material-desc
    t_material-level
    t_material-flag
    INTO w_line
    SEPARATED BY g_deli.
    TRANSFER w_line TO w_file2.
    ENDLOOP.

  • How to create sap directories in application server by coding.

    Hi Experts,
    Please tell me how to create a sap directory via coding in application server.
    Please tell me step by step n send the code also.I have tried alot using FM  'SXPG_COMMAND_EXECUTE' but i dont know how to use it n wht are d parameters i need to pass.
    Also, i found that we need to create a external command in SM69 to pass in this FM...i dont know how to create this.
    Please help me out.

    Hi friend,
    1. Goto to Transaction SM69.
    2. Click on F5.
    3. Click on F6.
    4. Enter a name in Command Name box          ex: z_com
    5. Enter a os command in Operating system command box.     ex: mkdir (creating a directory)
    6. Give location in application server in Parameters for operating system command box   ex: /C dir
    7. Click Save.
    Goto SE 38 and develop a report using FM 'SXPG_COMMAND_EXECUTE' .
    Ex:
    REPORT  zawi_demodownload                       .
    data: g_out like BTCXPM occurs 0,
            z_com type SXPGCOLIST-NAME  value 'mkdir'.
    CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
      EXPORTING
        commandname                         = z_com
      TABLES
        exec_protocol                       = g_out
      EXCEPTIONS
       NO_PERMISSION                       = 1
       COMMAND_NOT_FOUND                   = 2
       PARAMETERS_TOO_LONG                 = 3
       SECURITY_RISK                       = 4
       WRONG_CHECK_CALL_INTERFACE          = 5
       PROGRAM_START_ERROR                 = 6
       PROGRAM_TERMINATION_ERROR           = 7
       X_ERROR                             = 8
       PARAMETER_EXPECTED                  = 9
       TOO_MANY_PARAMETERS                 = 10
       ILLEGAL_COMMAND                     = 11
       WRONG_ASYNCHRONOUS_PARAMETERS       = 12
       CANT_ENQ_TBTCO_ENTRY                = 13
       JOBCOUNT_GENERATION_ERROR           = 14
       OTHERS                              = 15.
    IF sy-subrc = 0.
    ENDIF.
    Thanks.......

  • How to run the report via application server

    Report not running?
    hi All,
    I am calling the report via forms, In application server i had recompiled the reports in two different format too.
    1. myreports.rep
    2. myreports.jsp
    I have called the report from the menu and i used code like below
    Declare
          V_id Varchar2(100);
    Begin
        V_id := Run_Report_Object('myreports');
    End;but i am getting following error.
    Frm-41219:Cannot find report:Invalid ID.and subsequently an another too.
    Frm-40738:Argument 1 to builtin RUN_REPORT_OBJECT cannot be null.please guide me
    kanish

    I using Forms 10g R2, i store the recompile version in Application server.
    Good, so you can refer to the metalink note I mentioned above, as per storing the reports in the application server, the default place for running reports is not a folder in the FORMS_PATH, the REPORTS_PATH is set in the $ORACLE_HOME/bin/reports.sh file, pointing by default to the sample folder - $ORACLE_HOME/reports/samples/demo, for testing purposes you can put your report there and try it again, or you can modify the REPORTS_PATH variable in the reports.sh file to point to the directory you were mentioning.
    Note: I am calling the report throug menu using the eariler posting code.
    I would recommend to create a Form to call the Report, I am not sure if there are restrictions about invoking a report directly from the menu.
    About the code, you are missing a lot there, refer to metalink note mentioned above, here is an excerpt from that document.
    PROCEDURE TEST_REPORT IS
      repid      REPORT_OBJECT; 
      v_rep      VARCHAR2(100); 
      rep_status VARCHAR2(50); 
    BEGIN 
      repid := find_report_object('report5');
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH); 
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'html');
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'repserver90');
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no pdeptno='||:dept.deptno);
      v_rep := RUN_REPORT_OBJECT(repid); 
      rep_status := REPORT_OBJECT_STATUS(v_rep); 
      WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
        LOOP
          rep_status := report_object_status(v_rep);
        END LOOP;
      IF rep_status = 'FINISHED' THEN
        /*Display report in the browser*/
        WEB.SHOW_DOCUMENT('http://<YourServerName:8888/reports/rwservlet/getjobid'||
       substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
      ELSE 
        message('Error when running report'); 
      END IF; 
    END;
    In my eariler version 6i (2 tier) when i call the report it invoke parameter form. will 10g also behave same like 6i?
    Yes, there is still a parameter Form which runs in an HTML page.
    *1. Should i want to create any Report_Path, Report_classpath ? if yes ,where should i ?* It will depend on your configuration, the easiest way is to setup the REPORTS_PATH in the $ORACLE_HOME/bin/reports.sh file, if you are configuring the reports server to use environment ids, that would not work and you would need to setup the REPORTS_PATH directly in the reports engine configuration file .. $ORACLE_HOME/reports/conf/rwserver.template.
    Edited by: Rodolfo Ferrari on Jun 3, 2009 3:19 PM

  • FTP without creating files on Application server

    hello everyone,
    in an internal table i have around 100 records each of length around 3500 chararters. i want to send this data to the client via ftp in the form of txt file. since the lenght of each record  exceeds 1000 bytes, i thought of sending the data directly to the ftp server without creating the file on the application server. is this feasible. please provide the necessary steps to achieve this.

    Hi,
    The FTP involves a lot of complexity but you can do the SCP(secure copy) instead. And what u can do is first create a file on application server and then u can delete it...
    the sample code is below..
    #!/bin/ksh
    scp <filename> <destination>
    rm -f <filename>

Maybe you are looking for

  • Does FCE work with a Sony PMW-EX1 ?

    Hi, Final Cut Pro does, but anybody know about FCE? And if so, what kind of machine power is necessary to have a descent performance? thanks,

  • Cursor to add data through a wizard

    Hi All, Thanks in advance for any help. I have several insert statements using cursors but am getting caught up on a few problems. For the first portion I was trying to insert the id and description of a variable at the same time with no luck. Below

  • No printing in bridge mode

    Setting up an AEBS for use with an IMac. Using cable modem so I had to set the AEBS to bridge mode to be able to access the internet. Have an HP photoprinter/scanner hooked up that will work with a USB connection to the IMac but not when plugged into

  • New MBP 13" 7.1 nvidia 320M issues ?!

    Hi, It looks that i have some issues with my new MBP13". I switched from the midd 2009 13" MBP 2.53 with the 9400M to the new one. Load all data to it as i do it all the time with all my Mac´s. After it was done i tried the more powerfull grafic card

  • OIM 10g Connector

    Hi, I have OIM 10g installed in my home PC. I want to do a hands-on with any one of the available OOTB connector. Please suggest any connector where i can deploy the target also in my PC. For example, if i am going to use AD connector , will i be abl