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.......

Similar Messages

  • How to create a directory in application server

    Hi all,
    How to create a directory in application server through Progaram??
    eg:\tmp - is already existing
    I want to create \tmp\fi 
    Within \tmp\fi - i should able to store my file,,,
    Kindly help me urgent...

    Hello San,
    Either contact Basis guys at ur end for the same or u can do it dynamically via a piece of ABAP code, i hope it wll help u.
    call function 'GUI_CREATE_DIRECTORY'
         exporting
    dirname = '//<ip_address>/qfilesvr400/<host>/usr/sap/TST/SYS/Folder1'
         exceptions
              failed  = 1
              others  = 2.
    Reward If Helpful.
    Regards
    Sasidhar Reddy Matli.

  • How to create clustering on oracle application server on windows

    hi,
    i want to know how can i create clustering on oracle application server on windows machine.
    regards

    I think that you need to configure Web cache for this as a frontend, and two or more servers behind it.
    Try to read :
    Metalink DOC ID 312834.1
    http://www.oracle.com/technetwork/developer-tools/forms/documentation/advancedformsconf-128186.pdf
    Edited by: Marcos_Pawloski on 15/12/2010 00:02

  • How to create URL in Oracle Application Server ?

    Hello,
    I would like to know how to create a URL in Oracle Application server (LINUX) so that our application can be invoked from each and every machine in our
    local hosting.I expect a quick reply.

    You question is not so clear. Basically, after installing infrastructure and middle-tier instances, you can simple run http://localhost:port/appication from any web browser.
    If not, what is your requirements?
    Jaffar

  • Can any one tell me how to write open hubs to application server?

    Hello Everone,
    I created open hubs and my requirement is to write the file to application server. So, I created logical file name and logical paths as specified in below link.
    http://help.sap.com/SAPHELP_NW04S/helpdata/EN/8d/3e4ec2462a11d189000000e8323d3a/frameset.htm
    That is created 'logical file path defination' in 'FILE' transaction. Used the physical path as - 'bw/FTPOUT/BPR/GM/<FILENAME>' as given in above link..
    In logical file name I used the above logical file path.
    When I run the open hub, I'm getting the ABAP dump  "UNCAUGHT_EXCEPTION
    CX_RSB_WRITE_ERROR
    12/18/2008 09:00:40"
    Can any one tell me how to write open hubs to application server?

    Hi David,
    Goto transaction code - FILE
    1) Create a Logical File Path definition, enter the technical name and description by clicking new entries and save it.(z_ftp)
    2) create a Logical file name definition using cross client,
        enter the logical file name = z_ftp , name = ftp , physical file = ftp_test.txt,
    dataformat = ASC, Appln area = BW and Logical path = z_ftp(created from step 1).
    click SAVE button.
    3) Assignment of physical paths to logical paths, choose your logical path here.
    enter the syntax group = UNIX
    Physical path = /bwftp/....
    Save it .
    In the openhub,
    choose definition type = file
    Check the applicaion sever.
    servername = dev
    type of file name = Logical file
    Applin server file name = z_ftp
    separator = |
    Hope this helps and solve your problem.
    Thanks
    Sat

  • How to create SAP System

    Hi all,
    Is this possible to assign the role, based on the organization structure?
    In which SAP system stores organization structure in it.
    How to create the SAP system to store my organization structure through EP.
    Helpful answers will appreciate.
    Thanks.
    Regards,
    Kathiresan R

    Hii
    How to create sap system:
    Steps:
    Go to System Administration
    2) Go to System Configuration
    3) Go to Portal Content (Right Side Panel), open that folder.
    4) Right Click on Portal Content, a Panel is displayed select "System (from Template)".
    5) That will display a new view on right side, now select "SAP system using dedicated application server" from
    the existing templates. (Other templates are possible - for example, load balanced or through a SAProuter connection string).
    For this exercise, we'll use the simplest type.
    6) Choose next
    7) Give the System Name and System Id (which are mandatory fields) incase you want to give any brief notes
    about the system then give them in the "Description" field.
    8) Open the Newly Created System.
    9) Now when you want to create a New System, you have to fill four Properties they are:
    "Connector" - contains basic connectivty details
    "Internet transaction Server (ITS) - if you wish to use SAPGUI for HTML and/or IACs",
    "Web Application Server" - if you wish to access BSPs and/or Web Dynpro for ABAP and
    "User Management".
    You also need at least one "System Alias" has to be defined from the Display drop down menu.
    Make sure you have set end user access in the Permissions drop down menu to all users who need to access the system
    10) Select "Connector" property, now fill the required fields such as:
    a) Application Host (should be fully qualified hostname) - Give the R/3 "Application Name",
    which can be obtained from the SAP Logon Pad (check what R/3 system you are using, right click on it , go to the properties,
    it will open a window which has the Application Server Name.
    b) Logical System Name - Give the logical name as defined in the backend system
    c) SAP Client - Check the Client in the backend system and give the appropriate number (3 digits)
    d) SAP System ID(SID)* - Check the R/3 properties and give the check for System ID
    e) System Type* - Since we are connecting to R/3, select SAP_R3 system.
    f) System Number - This is a two digit number that you can find in the SAP Logon Pad
    11) Select "Internet transaction Server (ITS)" property, now fill the required fields like
    a) ITS Description à Give some Description
    b) ITS Host Name - Same as "Application Host" of R/3 (when integrated ITS) and should be attached with the
    port number of ITS Server (to get port number detailed description is given below). ex: hostname : port number
    c) ITS Path - To get the path along with the port number you have to Log on to R/3 system. Use the
    Transaction Code "SICF", it opens a new window go to:
    default_host -> sap -> bc -> gui -> sap -> its -> webgui -> SAP GUI for HTML -> right click on
    that and click "Test Service'. This will open a new window, on the address bar you will find the "port number", and
    the path something like (/sap/bc/gui/sap/its/webgui). Use the path after the port number.
    d) ITS Protocol - There are two protocols "http" & "https", select the appropriate protocol which is
    visible when you opened "Test Service" window.
    12) Select "Web Application Server" property , now fill the required fields like
    a) Web AS Description -> Give some Description
    b) Web AS Host Name - same as ITS Host Name
    c) Web AS Path - usually /sap/bc/bsp/sapd)*
    Web AS Protocol - should be same as the ITS Protocol.
    13) Select "User Management" property, now fill the required fields like
    a) Authentication Ticket Type - Since we are not using SSO leave the field
    empty i.e. put in select mode. (Please note that longer term you will probably want to use SSO)
    b) Logon Method - Select UIDPW.
    c) User Mapping Type - In case you have administration rights then you choose "admin" or in case you
    just have user rights then choose "user", better go for "admin/user".
    14) Since all the required fields are filled appropriately now create a System Alias name, this can be done by following steps:
    a) go to Display -> Select "System Aliases" give some Alias Name, let's call it "SAP_R/3"
    15) Now that System is created we have to create a iView which will display the given Transaction Code.
    16) Go To "Content Administration".
    17) Go To "Portal Content".
    18) Go to Portal Content (Right Side Panel), open that folder
    19) Right Click on Portal Content, a Panel is displayed select "New" -> iView
    20) Select iView template, click next
    21) Select "SAP Transaction iView" from the list of templates available. Click next.
    22) Give the iView name and iView ID. Incase you want to give any brief notes about the iView then give it in "Description" field. Click next
    23) Select "SAP GUI for HTML" radio button. Click next
    24) Now select the system which you have create "SAP_R/3", give some Transaction Code, say SE12 (Dictionary Display). Click next and Finish.
    25) Now Preview the iView
    26) You will see a new Window where in SE12 Dictionary Display window is displayed.
    Thanks :
    Dont forget to give rewards if usefull.

  • How to zip the folder in application server?

    how to zip the folder in application server?

    You can use
    open dataset with filter
    link:[http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_OS_ADDITION.htm#!ABAP_ADDITION_2@2@]

  • Picking a IDOC Flat File stored in SAP R/3 Application Server by SAP PI

    Hi,
    Can SAP PI pickup a IDOC Flat File stored in SAP R/3 Application Server Directory and send it back as an Inbound IDOC.
    Scenario:
    We have a data in the EXCEL Sheet, which will be used to a fill an IDOC and the IDOC will be just save in the SAP R/3 Application Server Directory, but can not be triggered due to its peculiar behavior. Afterwards, SAP PI should pole the SAP R/3 and pick up that IDOC Flat File from the R/3 Application Server and send it back to the SAP R/3 as an Inbound IDOC.
    For Ref: IDOC does not have a Outbound Process Code, thus can not be triggered and send to SAP PI. It is always used as a Inbound IDOC in SAP R/3 system.
    Regards,
    Saurabh

    SAP PI should pole the SAP R/3 and pick up that IDOC Flat File from the R/3 Application Server
    If SAP PI = 7.11 --> /people/william.li/blog/2009/04/01/how-to-use-user-module-for-conversion-of-idoc-messages-between-flat-and-xml-formats
    send it back to the SAP R/3 as an Inbound IDOC
    why to send  some information again into R3 which it already has? cant some internal code in R3 read the info from excel and then update the IDOC directly?

  • How to create a file in the server?

    Hi,
    I'm making a webservice that has to generate a XML file, sign it using another webservice and return this XML. The problem is that i don't know how to create the file in the server throught webservice.
    I use this code in the webservice to generate the XML and after I return the XML to client in a byte[]
         static void outputDocumentToFile(Document myDocument, String path) {
            //setup this like outputDocument
              try {
                   // XMLOutputter outputter = new XMLOutputter("  ", true);
                   XMLOutputter outputter = new XMLOutputter();
                   //output to a file
                   FileWriter writer = new FileWriter(path);
                   outputter.output(myDocument, writer);
                   writer.close();
              } catch(java.io.IOException e) {
                   e.printStackTrace();
        }But the file is generated in the client-side, how can I generate the file in the server-side?
    Thanks very much.

    Well the File object doesn't create a file it's simply an abstract representation of file and directory pathnames.
    You can try something like this:
    <%
    try
    // get the path to the web server root
    // I read somewhere not to use 'getRealPath' for some reason which I
    // can't seem to remember :S Hopefull someone can enlighten us :)
    String path = application.getRealPath("/project/jsp/demo.txt");
    File file = new File(path);
    PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(file)));
    writer.println("Hello World!");
    writer.close();
    catch (Exception e)
    System.err.println(e.getMessage());
    %>
    Hope this helps :)

  • How to upload XML file from Application server.

    Hi,
    How to upload XML file from Application server.Please tell me as early as possible.
    Regards,
    Sagar.

    Hi,
    parameters : p_file type ibipparms-path obligatory.
    ***DOWNLOAD---->SAP INTO EXCEL
    filename1 = p_file.
    call function 'GUI_DOWNLOAD'
      exporting
      BIN_FILESIZE                    =
        filename                        = filename1
        filetype                        = 'ASC'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      tables
        data_tab                        = it_stock
      FIELDNAMES                      =
    exceptions
       file_write_error                = 1
       no_batch                        = 2
       gui_refuse_filetransfer         = 3
       invalid_type                    = 4
       no_authority                    = 5
       unknown_error                   = 6
       header_not_allowed              = 7
       separator_not_allowed           = 8
       filesize_not_allowed            = 9
       header_too_long                 = 10
       dp_error_create                 = 11
       dp_error_send                   = 12
       dp_error_write                  = 13
       unknown_dp_error                = 14
       access_denied                   = 15
       dp_out_of_memory                = 16
       disk_full                       = 17
       dp_timeout                      = 18
       file_not_found                  = 19
       dataprovider_exception          = 20
       control_flush_error             = 21
       others                          = 22
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Regards,
    Deepthi.

  • How to save CSV file in application server while making infospoke

    How to save CSV file in application server to be used as destination while making infospoke.
    Please give the steps.........

    Hi
    If you want to load your flatfile from Application server,then you need to trasfer your file from your desktop(Computer) to Application server by using FTP.
    Try using ARCHIVFILE_CLIENT_TO_SERVER Function module.
    You Just need to give thesource path and the target path
    goto SE37 t-code , which is Function module screen, give the function name ARCHIVFILE_CLIENT_TO_SERVER, on click F8 Execute button.
    for path variable give the file path where it resides like C:\users\xxx\desktop\test.csv
    for target path give the directory path on Application server: /data/bi_data
    remember the directory in Server starts with /.
    U have to where to place the file.
    Otherwise use 3rd party tools to connect to ur appl server like : Core FTP and Absolute FTP in google.
    Otherwise...
    Goto the T.code AL11. From there, you can find the directories available in the Application Server.
    For example, if you wanna save the file in the directory "DIR_HOME", then you can find the path of the directories in the nearby column. With the help of this, you can specify the target path. Specify the target path with directory name followed by the filename with .CSV extension.
    Hope this helps
    regards
    gaurav

  • How to create restore point in windows server 2008 service pack1

    hi i am bhaskar ... how to create restore point in windows server 2008 service pack1 and how to restore system from a restore point in windows server 2008 service pack1.. is this option available or not ? what is the difference between shadow copies and
    restore point ? instead of restore point we have this shadow copies option in windows server 2008 ?Bhaskar

    AFIK, Restore Points doesn’t exist in Windows 2008.
    Volume Shadow Copy option can be used to achieve:
    Creating consistent backups of open files and applications
    Creating shadow copies for shared folders
    Creating transportable shadow copies using a hardware provider — for backup, testing and data mining scenarios
    Quickly recovering and restoring files and data
    It is more like a file, data, application backup. 
    Santhosh Sivarajan | MCTS, MCSE (W2K3/W2K/NT4), MCSA (W2K3/W2K/MSG), CCNA, Network+ Houston, TX
    Blogs - http://blogs.sivarajan.com/
    Articles - http://www.sivarajan.com/publications.html
    Twitter: @santhosh_sivara - http://twitter.com/santhosh_sivara
    This posting is provided AS IS with no warranties, and confers no rights.

  • Topic: How to obtain entity manager in application server?

    Hey,
    How to obtain Entity manger in application server ?
    The class is a simple class (no Ejb), and i can call to this class from Ejb or from inner schdeuler process (not container management)
    I want that if i call to this calss from Ejb , that the entity manager transaction will join to the global transaction.
    Thank you

    Hi,
    entity managers outside EJBs can be created using a javax.persistence.EntityManagerFactory.
    Regards

  • Create Excel file in application server but the field value is incorrect

    Hi Experts,
    i am facing a problem when create excel file in application server using OPEN DATASET command.
    the internal table have 4 field and one of those field contains 19 digit number --> ICCID.
    the code running well, successfully create EXCELfile in application server but the problem is SAP only copy exactly first 15 digit numeric only and the rest became zero 0
    Example :
    the field value in internal table is 8962118800000447654 but when i opened in the excel file the value became 8962118800000440000.
    and if i add alphabet like a8962118800000447654 then it is correct.
    is there is anything wrong with my code?
    here is my code
    CONSTANTS: c_tab TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab. "Tab Char
    Data : begin of lt_zdsdmmdt00005 occurs 0,
             SERNR (18) type c,
             MSISDNl(20) type c,
             BOX1 (20) type c,
             ICCID(30) type c,
           end of lt_zdsdmmdt00005.
    data : ld_temp(100) type c.
    i_file = '/usr/sap/DM/test_excel.xls'.
    open dataset i_file for output in legacy text mode.
      loop at lt_zdsdmmdt00005.
        move lt_zdsdmmdt00005-ICCID to ld_iccid .
        concatenate lt_zdsdmmdt00005-sernr  lt_zdsdmmdt00005-MSISDN  lt_zdsdmmdt00005-BOX1 ld_iccid
        into ld_temp separated by c_tab.
        transfer ld_temp to i_file.
      endloop.
      close dataset i_file.
    Best Regard,
    Akbar.

    Hi Naveen,
    thanks for your reply,
    i already tried and the result still the same. any idea?
    Best Regard,
    Akbar.

  • OPEN DATASET create .txt file in application server

    Hi,
    I'm trying to create a .txt into application server. Code as follows:-
    OPEN DATASET gv_filestatus FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc <> 0.
        WRITE: 'File cannot be opened.'.
      ENDIF.
      LOOP AT gt_pdfstatus INTO gw_pdfstatus.
        TRANSFER gw_pdfstatus TO gv_filestatus.
      ENDLOOP.
      CLEAR gw_pdfstatus.
    CLOSE DATASET gv_filestatus.
    But I got the error "GW_PDFSTATUS" cannot be a table, a reference, a string, or contain any of these objects. GW_PDFSTATUS is a work area with 5 fields of different type. I know that I can transfer table type of TLINE but I'm not sure how to convert my internal table gt_pdfstatus as TLINE.
    Please advise. Thanks.

    When transfering data to a file, you should convert the data to type char and then transfer it to the file.
    So, you would need to declare a structure with 5 fields of type c with the corresponding length of the original structure.
    Then move the corresponding fields of work are gw_pdfstatus to the character type structure. And then transfer the new structure to the file (gv_filestatus in your case).
    "for example if all the fields in the gw_pdfstatus  are of lenght 10, then declare a structure as follows
    data : begin of file_wa,
    f1(10) type c,
    f2(10)  type c,
    f3(10) type c,
    f4(10) type c,
    f5(10) type c,
    end of file_wa.
    OPEN DATASET gv_filestatus FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc  0.
        WRITE: 'File cannot be opened.'.
      ENDIF.
      LOOP AT gt_pdfstatus INTO gw_pdfstatus.
        move-corresponding gw_pdfstatus to file_wa.  " Add this
        TRANSFER file_wa TO gv_filestatus.   " Change this line
      ENDLOOP.
      CLEAR gw_pdfstatus.
    CLOSE DATASET gv_filestatus.
    Hope this helps.
    KR,
    Advait

Maybe you are looking for