Recipe Upload using MRTRS300 MASTER RECIPE WRITE

Hi SAP gurus,
Has anyone used  the MRTRS300_MASTER_RECIPE_WRITE FM to upload the Master Recipe
As i have many scenario in it like material assignment at header level at BOM component level, production version assignment.
Has somebody work on this area please help as there is no documentation also available for this FM.
Thanks

Hi,
Can anyone help
Thanks

Similar Messages

  • Problem in Customer Master Upload using LSMW

    Hi,
    I am using LSMW direct input method to upload customer master. I have used ZSOURCE structure as parent structure and for multilple entries like Bank details and contact details i have used other child structure like ZBANK and ZCONTACT. I am using separate flat file for Bank and contact details.
    I have used one common field 'ID' as the first field both on ZSOURCE, ZBANK and ZCONTACT structure to link-up. Thus, i am able to load multiple records for Bank data. But i am unable to get contact details.
    Also, value for Reconciliation account(KNB1-AKONT) and sales group(KNVV-VKGRP) is not passed to screen.
    I have checked 'Generate Read Program','Read Data', 'Generate Conversion Program' and 'Convert Data' step again and again. Upto step 'Display Converted Data', data is converted successfully, but the same field values are not passed to screen.
    Can you pls help me to get the value..

    Hi,
    LSMW will have a Indicator for headr and itam, i do not remember the correct field, but it will have an indicator, check the fields, there will be a single charecter lenght field, that should be the indicator, and using that we can write the logic.
    check that single charecter field, if that is X that means the header record is processed, and do the items.
    and, this is another way, try this out also
    YOu can do this in "Define Source Structures" step,
    the HEADER is defined first,
    then the DETAIL below the HEADER.
    add the fields to the structures.
    Both should have some common key field
    Please take care that the name of the common field is the same.
    Once you do this it is linked. The you have a header and item corresponding to that header. then run the LSMW as you would.
    Re: Table control in LSMW

  • I am unable to upload the customer master data using BAPI.?

    Hi Guru's,
    i am unable to upload the customer master data using BAPI.(BAPI_CUSTOMER_CREATEFROMDATA1)
    Please guide me how upload the data...
    Thanks in iadvance
    Srinivas...

    Hello Srinivas
    This BAPI does not allow to create a new customer from scratch but only to copy an existing customer to a new one and change its address data.
    The reference customer has to be provided using IMPORTING parameter PI_COPYREFERENCE. See also the BAPI documentation for more details.
    The BAPI does the same like transaction XD01 with Reference.
    Regards
      Uwe

  • What is the standard program for Material Master upload using LSMW

    Dear All
    I am trying to use the MM upload using DATMIG_INF4. I want to know what are the different standard projects that are used for Material master upload.

    Hi Amol,
    You can load the material master using direct input method  in LSMW ,details of which are as follows:
    Object               0020   Material master
    Method               0000                 
    Program name         RMDATIND             
    Program type         D   Direct input    
    Please revert back in case of any doubt.
    Cheers
    VJ

  • Upload FS Items master using flexible upload-SEM-BCS

    I want to upload FS Items master using flexible upload in SEM BCS.  I was wondering if i could have a sample upload format of the file.  Kindly help.
    Ramanathan
    [email protected]

    Hi Ramanathan and welcome to SDN!
    Everything depends on your settings in a flexible upload method.
    You may use a comment character (like an asterisk) to show fields names and choose a fields delimiter (say, ';').
    In this case you may have a file for upload something like the following.
    These are fields in a header
    Field1 Field2 Field3 Field4 etc.
    Field1Val;Field2Val;Field3Val;Field4Val
    These are fields in rows
    Field5 Field6 Field7 Field8 etc.
    Field8Val;Field8Val;Field8Val;Field8Val
    Field8Val;Field8Val;Field8Val;Field8Val
    Field8Val;Field8Val;Field8Val;Field8Val
    Best regards,
    Eugene

  • Upload GL accont master data from legasy to SAP R/3

    Hello Gurus,
                        I have a requirement to write a BDC program for uploading GL account master data from legacy system to SAP R/3 database using FS00 transaction.Please can you help me with this?
    Regards,
    Kalpana.

    Hello,
    Goto Transaction SHDB, then create one new recording then do the simple recording and save that recording in one program and use as per your requirement.
    you can also use existing program suggested by Rob.
    Regards,
    Sujeet

  • Email upload in vendor master change

    Hi all,
    I have to do emails upload in vendor master change but when i do through shdb recording i am not able to see the communication screen to enter the values. Can any one of you please guide me step by step.
    Thanks & regards,
    Kumar

    Hi,
    you have to use table BAPICOMREM. Just go to one testing customer and add email address with note to this customer. Then go to SE37 and call BAPI BAPI_ADDRESSORG_GETDETAIL. This BAPI has same structure as BAPI_ADDRESSORG_CHANGE. Hence you will see how you have to fill all structures to change email address and also note.
    Cheers

  • FB01 upload using LSMW

    Hi
    Iam uploading FB01 data using LSMW.
    I maintained two files, one for Header Data and one for Item Data
    but only header data was written after reading
    can any one give me the steps regarding this
    Thanka in advance
    venkat

    Hi,
    LSMW will have a Indocator for headr and itam, i do not remember the correct field, but it will have an indicator, check the fields, there will be a single charecter lenght field, that should be the indicator, and using that we can write the logic.
    check that single charecter field, it that is X that means the header record is processed, and do the items.
    and, this is another way, try this out also
    YOu can do this in "Define Source Structures" step,
    the HEADER is defined first,
    then the DETAIL below the HEADER.
    add the fields to the structures.
    Both should have some common key field
    Please take care that the name of the common field is the same.
    Once you do this it is linked. The you have a header and item corresponding to that header. then run the LSMW as you would.
    Regards
    Sudheer

  • Need to upload using lsmw

    hi,
    LSMW it's only navigation part for direct/batch input method. So why do abapers do the LSMW to upload?
    regards
    raghu

    Hi raghu,
    good question...
    If you are using LSMW to upload inventory, you need to understand that there must be an inventory tcode that must first be chekced to ensure all the fields are well captured. For example, if you are uploading Vendor Master record, you need check FK01 with the data given to you by the functional team and advise them if the data does not conform with what you have in the transaction fields.
    Most times, the functional team are so oblivious of what exact data should be supplied. Please do not hesitate to ask questions. If you need further help on how to upload using LSWM, do not hesitate to let me know
    thanks
    karthik

  • Material Classification Upload using LSMW

    Hi SAP Experts,
    We are thinking of using LSMW as a means to upload our material master data for the classification view. How is this done?
    Can we use LSMW to upload materials with many class assignments with multiple characteristics?
    Ex. Material A is assigned to class X and class Y. Class X has characteristics 1, 2, and 3. Class Y has characteristics 4, 5, and 6.
    Would appreciate a swift response.
    Thanks in advance!

    Hi All,
        If it is the existing material you need to modify the Classification type. It can be done by BDC. If you instruct the ABAP team they will make it & give. I am not sure about modifying classification type using LSMW. If you need to create a new material master data with classification using LSMW i will give the steps.
    Check out this link for LSMW Steps:
    www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc
    Reward if useful.
    pherasath

  • HR data upload using LSMW

    Hi All
    I am using LSMW to upload the HR master data. The infotype data that is loaded include the basic infotypes like 0000, 0001, 0002, 0007, 0014 and 0019 (monitoring of tasks). I am using recording method. I can record all infotypes till 0014 in single shot and the recording gets saved at the end of 0014 and gets back to LSMW step. I need 0019 infotype recording also. For this what should I do? How should I record it? Can I record this individually and attach to the above recording? Please help.
    Thanks
    Shakir

    Hi,
    What we do during data convertion is creating each recording separately. I don't think the customer will provide you one data file with all ITs information. Providing he/she has to extract data from his/her system it is likely that you get separeted files. Pelase ensure it won't be this way.
    Moreover this approach is less error-prone. Image that you are missing some configuration for one of the infotype, which is in the middle (lets say 4th in the row out of 10). Everything would load correctly till it reaches this "unlucky" infotype. Then the record has status of not loaded. The rest would be skipped and you have missing data. Now you need to start reloading from this wrong infotype to the end. But how about these already loaded? Would you delete the records to avoid duplicating?
    That's why I am really encouraging you to take each IT separately approach. It is better to spend some time preparing data files then loosing your nerves when investingating what's in and what's not yet in the system, in case an error occurs.
    Regards
    Marcin

  • Ns0 prefix not attached in the xml structure generated using Content Master

    Hello Everyone,
    I am parsing a tabdelimited file using the Content Master Studio.
    I am providing the message type xsd as the schema file.
    After writing all the parsing logic the xml file which is getting generated is in the below mentioned format
    <?xml version="1.0" encoding="UTF-8"?>
    <ReadExcel xmlns="urn:readexcel.com">
    <ROW>
    <NAME>Rahul</NAME>
    <AGE>24</AGE>
    <Location>Mumbai</Location>
    </ROW>
    <ROW>
    <NAME>Vinit</NAME>
    <AGE>25</AGE>
    <Location>Mumbai</Location>
    </ROW>
    </ReadExcel>
    but since the ns0 prefix is not getting attached the mapping program is failing in XI.
    <ns0:ReadExcel xmlns:ns0="urn:readexcel.com">
    I guess the people who have used Content master studio might have also faced the similar problem.
    Please suggest me some solution
    Thanks and Regards
    Rahul Nawale

    Hi Rahul,
    the namespace prefic ns0 is only a placeholder for the namespace urn:readexcel.com. This namespace can also be represented by another prefix or even by the empty prefix.
    E.g. the document you have pasted is totally equivalent to the document
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ReadExcel xmlns:ns0="urn:readexcel.com">
    <ns0:ROW>
    <ns0:NAME>Rahul</ns0:NAME>
    <ns0:AGE>24</ns0:AGE>
    <ns0:Location>Mumbai</ns0:Location>
    </ns0:ROW>
    <ns0:ROW>
    <ns0:NAME>Vinit</ns0:NAME>
    <ns0:AGE>25</ns0:AGE>
    <ns0:Location>Mumbai</ns0:Location>
    </ns0:ROW>
    </ns0:ReadExcel>
    However, it is not possible to model this document via a Message type in the Integration Repository. The XML instance from a Message type will look like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:ReadExcel xmlns:ns0="urn:readexcel.com">
    <ROW>
    <NAME>Rahul</NAME>
    <AGE>24</AGE>
    <Location>Mumbai</Location>
    </ROW>
    <ROW>
    <NAME>Vinit</NAME>
    <AGE>25</AGE>
    <Location>Mumbai</Location>
    </ROW>
    </ns0:ReadExcel>
    Indeed, in the root tag all documents are equivalent (it has name ReadExcel and namespace urn:readexcel.com). But for the subelements (ROW, NAME,...) there is a fundemental difference. In your example (and my first example) these elements have namespace urn:readexcel.com, too. In my second example those elements have empty namespace. Indeed, all XML documents modelled as Message types have an empty namespace for all non-root elements.
    Message types are simply not suitable to model a document as you have posted. However, there is simple help. Just download the schema for the Message type to your local file system. Add attribute elementFormDefault="qualified" to the root tag of that schema. Upload that schema as External Definition. This External Definition will have one External Message. Define your mapping using that schema.
    For more background on that topic I recommend reading the specifications on XML namespaces and XML schema.
    Greetings
    Stephan

  • 'Create' Push button is not working in BDC and LSMW while uploading G/L master data

    Hello Experts:
    I am facing the following problem:
    While uploading G/L master data with the BDC program, 'create' push button is not working  even after executing following lines.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=ACC_CRE'.
    Create G/L account  screen is not coming in BDC. Please suggest me what to do.
    Thanks !!

    Re: 'Create' Push button is not working in BDC and LSMW while uploading G/L master data
    Re: 'Create' Push button is not working in BDC and LSMW while uploading G/L master data
    Hi Glen Anthony
    Thank you for the reply Glen Anthony please take a look at the following code.
    REPORT  ZFI_BDC_FS00
            NO STANDARD PAGE HEADING LINE-SIZE 255.
    *INCLUDE BDCRECX1.
    TYPES : BEGIN OF STR,
       BUKRS TYPE GLACCOUNT_SCREEN_KEY-BUKRS,        "Company Code
       SAKNR TYPE GLACCOUNT_SCREEN_KEY-SAKNR,        "G/L Account Number
       KTOKS TYPE GLACCOUNT_SCREEN_COA-KTOKS,        "G/L Account Group
       XPLACCT TYPE GLACCOUNT_SCREEN_COA-XPLACCT,    "P&L statement account
       XBILK TYPE GLACCOUNT_SCREEN_COA-XBILK,        "Indicator: Account is a balance sheet account?
       TXT20_ML TYPE GLACCOUNT_SCREEN_COA-TXT20_ML,  "G/L account short text
       TXT50_ML TYPE GLACCOUNT_SCREEN_COA-TXT50_ML,  "G/L account short text
       WAERS TYPE GLACCOUNT_SCREEN_CCODE-WAERS,      "Account currency
       XSALH TYPE GLACCOUNT_SCREEN_CCODE-XSALH,      "Indicator: Only Manage Balances in Local Currency
       MWSKZ TYPE GLACCOUNT_SCREEN_CCODE-MWSKZ,      "Tax Category in Account Master Record
       XMWNO TYPE GLACCOUNT_SCREEN_CCODE-XMWNO,      "Indicator: Tax code is not a required field
       MITKZ TYPE GLACCOUNT_SCREEN_CCODE-MITKZ,      "Account is reconciliation account
       XOPVW TYPE GLACCOUNT_SCREEN_CCODE-XOPVW,      "Indicator: Open item management?
       XKRES TYPE GLACCOUNT_SCREEN_CCODE-XKRES,      "Indicator: Can Line Items Be Displayed by Account?
       ZUAWA TYPE GLACCOUNT_SCREEN_CCODE-ZUAWA,      "Key for sorting according to assignment numbers
       FSTAG TYPE GLACCOUNT_SCREEN_CCODE-FSTAG,      "Field status group
       XINTB TYPE GLACCOUNT_SCREEN_CCODE-XINTB,      "Indicator: Is account only posted to automatically?
       END OF STR.
    DATA : ITAB TYPE TABLE OF STR WITH HEADER LINE,
            IT_BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE,
            TXT(4096) TYPE C OCCURS 0,
            MSG TYPE STRING,
            COUNT(5) TYPE N.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
       PARAMETERS : MY_FILE TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR MY_FILE.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
      IMPORTING
        FILE_NAME           = MY_FILE
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       EXPORTING
    *   I_FIELD_SEPERATOR          =
    *   I_LINE_HEADER              =
         I_TAB_RAW_DATA             = TXT
         I_FILENAME                 = MY_FILE
       TABLES
         I_TAB_CONVERTED_DATA       = ITAB[]
      EXCEPTIONS
        CONVERSION_FAILED          = 1
        OTHERS                     = 2
    IF SY-SUBRC <> 0.
    * IMPLEMENT SUITABLE ERROR HANDLING HERE
    ENDIF.
    START-OF-SELECTION.
    COUNT = 0.
    LOOP AT ITAB.
    *PERFORM OPEN_GROUP.
    REFRESH  IT_BDCDATA.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_KEY-BUKRS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=ACC_CRE'.
    *PERFORM BDC_FIELD       USING 'BDC_CURSOR'
    *                              'GLACCOUNT_SCREEN_KEY-BUKRS'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                   ITAB-SAKNR. "'5'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_KEY-BUKRS'
                                   ITAB-BUKRS. "'TATA'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=2102_GROUP'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-KTOKS'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                   ITAB-XPLACCT. "'X'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=2102_BS_PL'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-XBILK'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                   ITAB-XPLACCT. "''.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                   ITAB-XBILK. "'X'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=TAB02'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                   ITAB-XBILK. "'X'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-TXT50_ML'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                   ITAB-TXT20_ML. "'G/L ACCOUNT'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                   ITAB-TXT50_ML. "'G/L ACCOUNT'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=TAB03'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                   ITAB-WAERS. "'INR'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XSALH'
                                   ITAB-XSALH. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                   ITAB-MWSKZ. "'*'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XMWNO'
                                   ITAB-XMWNO. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                   ITAB-MITKZ. "''.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                   ITAB-XOPVW. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                   ITAB-XKRES. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                   ITAB-ZUAWA. "'1'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=SAVE'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_CCODE-XINTB'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                   ITAB-FSTAG. "'G019'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XINTB'
                                   ITAB-XINTB. "'X'.
    *PERFORM BDC_TRANSACTION USING 'FS00'.
    CALL TRANSACTION 'FS00' USING IT_BDCDATA MODE 'E' UPDATE 'S'.
    COUNT = COUNT + 1.
    *PERFORM CLOSE_GROUP.
    ENDLOOP.
    CONCATENATE COUNT ' RECORDS UPDATED SUCCESSFULLY' INTO MSG.
    MESSAGE MSG TYPE 'I'.
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
       CLEAR IT_BDCDATA.
       IT_BDCDATA-PROGRAM  = PROGRAM.
       IT_BDCDATA-DYNPRO   = DYNPRO.
       IT_BDCDATA-DYNBEGIN = 'X'.
       APPEND IT_BDCDATA.
    ENDFORM.
    *        INSERT FIELD                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
    *  IF FVAL <> NODATA.
         CLEAR IT_BDCDATA.
         IT_BDCDATA-FNAM = FNAM.
         IT_BDCDATA-FVAL = FVAL.
         APPEND IT_BDCDATA.
    *  ENDIF.
    ENDFORM.

  • File upload problem. Can't write to server

    Hi guys,
    I am currently trying to upload some images to the server I am using but I can't succeed.
    I am using a form consisting of 3 text fields 1 textarea and an upload form.
    The whole thing is working fine on my localhost . All the items are being inserted to the database and the files saved to the path.
    But when I try to upload to the commercial server even though the text field are being read and inserted to database the files just can't!!
    my tree structure is
    /home/domain/www-domain/webapps
    and that's what I am getting when using
    getServletContext().getRealPaththe full line for getting the real path is
    FileWriter fw2 = new FileWriter(getServletContext().getRealPath("//upload"+fileName+".jsp")); I am using tomcat 4.0 and all the other servlets are working just fine
    as this one apart from the FileWriting thing?
    am I doing something wrong with the getServletContext thing?
    And if so, why is it working just fine on my pc?
    I am only suspecting that I am not getting the path correctly
    I want to store the images under
    webapps/upload/images
    but it doesn't work even when I am trying to store under webapps (root directory)
    Is there any way that I am not getting permission to write to the server??
    Any help is highly appreciated!!
    cheers

    the thing is that I am not getting any exception back to my browser> some of the values are inserted into the database (the ones that are not referring to any uploded items). i guess i have to do a print.stacktrace but I am not sure at which point...
    ok I am posting the full code to give you an idea. Your interest is much appreciated , thank you
    import java.sql.*;
    import java.text.ParsePosition;
    import java.text.SimpleDateFormat;
    import java.util.*;
    import java.util.Date;
    import gr.cretasport.util.*;
    import org.apache.commons.fileupload.*;
    import java.awt.Image;
    import java.io.*;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest ;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    * @author myron.veligradis
    * 17/09/2005
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class InsertArticle extends HttpServlet{
      * global variables
    String fieldName;
    Image imageIn;
    Resize rsImg = new Resize();
    Mirror mrImg = new Mirror();
    //ImageProcess ImPr = new ImageProcess();
    Date curDate;
    String datecur;
    String inputtext;
    BufferedWriter bw;
    String aRString ;
    String photoPath;
    File savedFile;
    String txtPath;
    String txtPathFullText;
    String author;
    String eidos;
    String kathgoriaID;
    String title;
    String rating;
    String kathgoria;
    String keimeno;
    String keimenoRest;
    String fullKeimeno;
    String hmeromhniaD;
    final String jspPrefix="<%@ page contentType=\"text/html; charset=iso-8859-7\" language=\"java\"  errorPage=\"\" %>";
    Connection con=null;
    Statement statement = null;
    ResultSet rs, rs1 = null;
    int kathgoriaIDInt;
    int ratingInt;
    public void init(ServletConfig conf) throws ServletException  {
      super.init(conf);
    public void doPost (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException, UnsupportedEncodingException {
    //  try {
    //   req.setCharacterEncoding("iso-8859-7");
    //   catch (UnsupportedEncodingException uee)
      boolean isMultipart = FileUpload.isMultipartContent(req);
      HttpSession session = req.getSession();
      ServletContext sc = getServletContext();
       * GET THE FILE NAME
      curDate=new Date();
      datecur = curDate.toString ();
        String fileName = datecur.replaceAll("\\W","_");
        String strDate = curDate.toString();
        SimpleDateFormat formatter= new SimpleDateFormat ("EEE MMM dd hh:mm:ss zzz yyyy");
      Date date = formatter.parse(strDate,new ParsePosition(0));
      hmeromhniaD = new SimpleDateFormat("yyyy-MM-dd").format(date);
       *  GET THE PARAMETERS
       *  FILE UPLOAD *******************************************************
      System.out.println(isMultipart);
      DiskFileUpload upload = new DiskFileUpload();
      try {
       req.setCharacterEncoding("iso-8859-7");
       List items = upload.parseRequest(req);
       Iterator itr = items.iterator();
       while(itr.hasNext()) {
        FileItem item = (FileItem) itr.next();
    //    String articleTitle = new String(req.getParameter("articleTitle").getBytes("iso-8859-1"),"iso-8859-7");
       // check if the current item is a form field or an uploaded file
         if(item.isFormField()) {
         // get the name of the field
         // if it is name, we can set it in request to thank the user
         if (item.getFieldName().equals("author")) {
                author = new String(item.getString().getBytes("iso-8859-1"),"iso-8859-7");
         if (item.getFieldName().equals("eidos")) {
                eidos = new String( item.getString().getBytes("iso-8859-1"),"iso-8859-7");
         if (item.getFieldName().equals("keimeno")) {
                keimeno =item.getString();
                FileWriter fw1 = new FileWriter(getServletContext().getRealPath("webapps//upload"+"pro_"+fileName +".jsp"));
           fw1.write(jspPrefix+"<html><body>"+keimeno+"</body></html>");
           fw1.close();
           txtPath = ("upload/text/"+"pro_"+fileName+".jsp");
         if (item.getFieldName().equals("keimenorest")) {
                keimenoRest =item.getString();
                FileWriter fw2 = new FileWriter(getServletContext().getRealPath("//upload"+fileName+".jsp"));
           fw2.write(jspPrefix+"<html><body>"+keimeno+" "+keimenoRest+"</body></html>");
           fw2.close();
           txtPathFullText = ("upload/text/fulltext/"+fileName+".jsp");
         if (item.getFieldName().equals("title")) {
               // title = new String(item.getString().getBytes("iso-8859-1"),"iso-8859-7");
                System.out.println ("titlos "+title);
                title=getServletContext().getRealPath("webapps//upload");
         if (item.getFieldName().equals("rating")) {
                rating = item.getString();
         if (item.getFieldName().equals("kathgoriaID")) {
                kathgoriaID = item.getString();
       else {
        // the item must be an uploaded file save it to disk. Note that there
        // seems to be a bug in item.getName() as it returns the full path on
        // the client's machine for the uploaded file name, instead of the file
        // name only. To overcome that, I have used a workaround using
        // fullFile.getName().
        File fullFile  = new File(item.getName()); 
        //check if input file is actually an image
        if ( item.getName().toLowerCase().endsWith(".jpg") ||
        item.getName().toLowerCase().endsWith(".gif") ||
        item.getName().toLowerCase().endsWith(".bmp"))
         File temp = new File(getServletContext().getRealPath("webapps//upload")," temp.jpg");
         item.write(temp);
         //to class Resize pernei 2 inputs, to file kai to path string
         rsImg.resizeImage(temp,getServletContext().getRealPath("webapps//upload"+fileName+".jpg"));
         //to class Mirror pernei kai ayto 2 inputs, to file poy exei dhmiourgithei apo panw
         //pou to kanei overwrite epeidh pernoun to idio onoma me to time stamp
         Mirror.mirrorImage(new File(getServletContext().getRealPath("webapps"+fileName+".jpg")),
           getServletContext().getRealPath("webapps//upload"+fileName+".jpg"));
         System.out.println("upload/images/"+fileName+".jpg");
      kathgoriaIDInt= new Integer(kathgoriaID).intValue();
      ratingInt   = new Integer(rating).intValue();
       * HTML UPLOAD
      catch (Exception fe) {
      //get the string names to insert to database
      photoPath="upload/images/"+fileName+".jpg";
       * INSERT THE DATA INTO THE DATABASE
      InsertToDatabase();
      String url="/insertarticle.jsp";
      RequestDispatcher rd = sc.getRequestDispatcher(url);
      rd.forward(req,res);
    //res.sendRedirect( res.encodeRedirectURL( "indextest.jsp "));
    public void InsertToDatabase() {
      try {
       con=null;
       statement = con.createStatement();
       String insertprefix = "insert into articles(eidos,photopath,textpath,textpathfull,title,author,dateen,rating, kathgoriaID) VALUES"
         + "('" + eidos.trim() +"','" + photoPath.trim()  + "','"   +
         txtPath + "','" + txtPathFullText + "','" +title + "','"+ author + "','"+ hmeromhniaD + "','"+ ratingInt+ "','"
         +kathgoriaIDInt + "')";
       statement.execute(insertprefix);
       statement.close();
       con.close();
       catch (Exception e)
    }

  • Uploading HR mini master

    Hello,
    I would like to know what the best way is to upload HR mini master records. We are doing a CATS project and I need employee numbers with infotypes: 0000, 0001, 0007, 0105, 0315. Can anyone provide me information on what BAPI's or other to use.
    Preferably using it in LSMW.
    Do I for instance need to split the upload in PA40 upload and then an update upload with PA30?
    Thanks in advance,
    Kind regards,
    Mirko Polisini

    Hello Screenivas,
    Thanks for the SPRO link. However, from that documentation it seems that you need to code your own program to do the uploading based on a report as model.
    I came across Business Object HRMASTER with method SAVEREPLICAMULTIPLE. Do you have any idea if that would work better, in the sence that own creation of reports is reduced? In the mapping I see a lot of infotypes (not infotype 007, ok batch input). But looks further ok? What do you think? In the SPRO link no mention of this HRMASTER business object is done.
    Thanks in advance,
    Kind regards,
    Mirko

Maybe you are looking for

  • How do I convert my purchaced iTunes TV shows to MP4?

    I purchased a series on iTunes. I Want to put them on my external hard drive which only supports mp4. How can I convet them on my PC?

  • Msi tv@anywhere help !!!

    I bought your new tv card I downloaded the new drivers and patches And I did really got high quality tv picture and did some MPEG4 Real-time encoding of TV programs. Nice. But I can not do anything else. And I mean nothing. No other program I tried c

  • Web dynpro java application throws ArrayIndexBoundException

    Hi Experts, We had a java web dynpro application in production server and was running well. There were some changes made in the RFC and reimported the web dynpro model. After we pushed the new ear in production, it throws an ArrayIndexBoundException.

  • Ora-02331 error - while trying to force logging

    Hi friends, i am trying to configure the physical standby database and i am following this documentation http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm. when i am trying to do the force logging i am getting the following

  • Very Basic Question - Resizing Image

    Cannot believe I am having to ask such a basic question, but in order to scan and send documents to a particular database, there are two requirements: 1) 200 dpi, and 2) Greyscale The greyscale I found quickly enough by going to image adjustments ---