SESSION METHOD( WRONG VALUE OF THE parameter file type)

Hi here iam sending the whole code once to you. just chk it once and same error(WRONG VALUE OF THE parameter file type) is coming after the changes.
if i use asc it is giving that no file exists.
Table Declaration
tables :rf02k, "Maintain vendor master record screen and work fields
lfa1, "Vendor Master(general)
lfbk, "Vendor Master (Bank Details)
lfb1, "Vendor Master (Company Code)
lfm1, "Vendor master record purchasing organization data
lfb5. "Vendor master (dunning data)
Data Declaration
data : begin of it_UPLOAD occurs 0,
LIFNR like rf02k-lifnr, "vendor no
BUKRS like rf02k-bukrs, "company code
EKorg like rf02k-ekorg, "purchasing org
KTOKK like rf02k-ktokk, "account group
anred like lfa1-anred, "initial
name1 like lfa1-name1, "name of vendor
sortl like lfa1-sortl, "search term
land1 like lfa1-land1, "country
akont like lfb1-akont, "reconcillation a/c.
fdgrv like lfb1-fdgrv, "planning group
zterm like lfb1-zterm, "terms of payment key
mahna like LFB5-MAHNA, "dunning procedure
waers like lfm1-waers, "Purchase order currency
END OF IT_UPLOAD.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
include bdcrecx1.
start-of-selection.
UPLOADING THE DATA TO IT_UPLOAD
call function 'GUI_UPLOAD'
exporting
filename = 'C:\DASRR\VENDOR1.TXT'
filetype = 'DAT'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = IT_UPLOAD
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
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 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:/VENDOR1.TXT'
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_UPLOAD.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'SRR'
USER = SY-UNAME.
POPULATE INTERNAL TABL
LOOP AT IT_UPLOAD.
CLEAR IT_BDCDATA.
REFRESH IT_BDCDATA.
PERFORM POPULATE_DATA.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'XK01'
TABLES
DYNPROTAB = IT_BDCDATA.
ENDLOOP.
*& Form POPULATE_DATA
text
--> p1 text
<-- p2 text
FORM POPULATE_DATA .
PERFORM GETDATA USING 'X' 'SAPMF02K' '0100'.
perform getdata using ' ' RF02K-LIFNR 'IT_UPLOAD-LIFNR'.
perform getdata using ' ' RF02K-bukrs 'IT_UPLOAD-bukrs'.
perform getdata using ' ' RF02K-EKORG 'IT_UPLOAD-EKORG'.
perform getdata using ' ' RF02K-KTOKK 'IT_UPLOAD-KTOKK'.
PERFORM GETDATA USING 'X' 'SAPMF02K' '0110'.
perform getdata using ' ' LFA1-ANRED 'IT_UPLOAD-ANRED'.
perform getdata using ' ' LFA1-NAME1 'IT_UPLOAD-NAME1'.
perform getdata using ' ' LFA1-SORTL 'IT_UPLOAD-SORTL'.
perform getdata using ' ' LFA1-LAND1 'IT_UPLOAD-LAND1'.
PERFORM GETDATA USING 'X' 'SAPMF02K' '0210'.
perform getdata using ' ' LFB1-AKONT 'IT_UPLOAD-AKONT'.
perform getdata using ' ' LFB1-FDGRV 'IT_UPLOAD-FDGRV'.
PERFORM GETDATA USING 'X' 'SAPMF02K' '0215'.
perform getdata using ' ' LFB1-ZTERM 'IT_UPLOAD-ZTERM'.
PERFORM GETDATA USING 'X' 'SAPMF02K' '0220'.
perform getdata using ' ' LFB5-MAHNA 'IT_UPLOAD-MAHNA'.
PERFORM GETDATA USING 'X' 'SAPMF02K' '0310'.
perform getdata using ' ' LFM1-WAERS 'IT_UPLOAD-WAERS'.
ENDFORM. " POPULATE_DATA
*& Form GETDATA
text
-->P_0213 text
-->P_0214 text
-->P_0215 text
FORM GETDATA USING VALUE(P_0213)
VALUE(P_0214)
VALUE(P_0215).
IF P_0213 = 'X'.
IT_BDCDATA-PROGRAM = P_0213.
IT_BDCDATA-DYNPRO = P_0214.
IT_BDCDATA-DYNBEGIN = P_0215.
ELSE.
IT_BDCDATA-FNAM = P_0214.
IT_BDCDATA-FVAL = P_0215.
ENDIF.

When u use GUI_UPLOAD, U can not assign file type as 'dat'. This must be either ASC or BIN.
Make sure  ur flat file path should correct..
This well help u...

Similar Messages

  • WRONG VALUE OF THE parameter file type(bdc-session method)

    Hi experts,
    when iam uploading vendor details,,,
    it is giving above error.
    chk the code once.....
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      = 'C:/VENDOR1.TXT'
       FILETYPE                      = 'DAT'
      TABLES
        DATA_TAB                      = IT_UPLOAD.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
       GROUP                     = 'SRR'
       USER                      = SY-UNAME.

    Hi here  iam sending the whole code once to you. just chk it once and same error(WRONG VALUE OF THE parameter file type) is coming after the changes.
    if i use asc it is giving that no file exists.
    Table Declaration
    tables :rf02k,    "Maintain vendor master record screen and work fields
            lfa1,     "Vendor Master(general)
            lfbk,     "Vendor Master (Bank Details)
            lfb1,     "Vendor Master (Company Code)
            lfm1,     "Vendor master record purchasing organization data
            lfb5.     "Vendor master (dunning data)
    Data Declaration
    data : begin of it_UPLOAD occurs 0,
           LIFNR like rf02k-lifnr,     "vendor no
           BUKRS like rf02k-bukrs,     "company code
           EKorg like rf02k-ekorg,     "purchasing org
           KTOKK like rf02k-ktokk,     "account group
           anred like lfa1-anred,     "initial
           name1 like lfa1-name1,     "name of vendor
           sortl like lfa1-sortl,     "search term
           land1 like lfa1-land1,     "country
           akont like lfb1-akont,     "reconcillation a/c.
           fdgrv like lfb1-fdgrv,     "planning group
           zterm like lfb1-zterm,     "terms of payment key
           mahna like LFB5-MAHNA,     "dunning procedure
           waers like lfm1-waers,     "Purchase order currency
           END OF IT_UPLOAD.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    include bdcrecx1.
    start-of-selection.
    UPLOADING THE DATA TO IT_UPLOAD
    call function 'GUI_UPLOAD'
    exporting
    filename = 'C:\DASRR\VENDOR1.TXT'
    filetype = 'DAT'
    has_field_separator = 'X'
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    CHECK_BOM = ' '
    IMPORTING
    FILELENGTH =
    HEADER =
    tables
    data_tab = IT_UPLOAD
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    NO_AUTHORITY = 6
    UNKNOWN_ERROR = 7
    BAD_DATA_FORMAT = 8
    HEADER_NOT_ALLOWED = 9
    SEPARATOR_NOT_ALLOWED = 10
    HEADER_TOO_LONG = 11
    UNKNOWN_DP_ERROR = 12
    ACCESS_DENIED = 13
    DP_OUT_OF_MEMORY = 14
    DISK_FULL = 15
    DP_TIMEOUT = 16
    OTHERS = 17
    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 'GUI_UPLOAD'
    EXPORTING
      FILENAME                      = 'C:/VENDOR1.TXT'
      FILETYPE                      = 'DAT'
    TABLES
       DATA_TAB                      = IT_UPLOAD.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
       GROUP                     = 'SRR'
       USER                      = SY-UNAME.
      POPULATE INTERNAL TABL
    LOOP AT IT_UPLOAD.
    CLEAR IT_BDCDATA.
    REFRESH IT_BDCDATA.
    PERFORM POPULATE_DATA.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
        TCODE                  = 'XK01'
       TABLES
        DYNPROTAB              = IT_BDCDATA.
    ENDLOOP.
    *&      Form  POPULATE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_DATA .
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0100'.
    perform getdata using ' ' RF02K-LIFNR 'IT_UPLOAD-LIFNR'.
    perform getdata using ' ' RF02K-bukrs 'IT_UPLOAD-bukrs'.
    perform getdata using ' ' RF02K-EKORG 'IT_UPLOAD-EKORG'.
    perform getdata using ' ' RF02K-KTOKK 'IT_UPLOAD-KTOKK'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0110'.
    perform getdata using ' ' LFA1-ANRED 'IT_UPLOAD-ANRED'.
    perform getdata using ' ' LFA1-NAME1 'IT_UPLOAD-NAME1'.
    perform getdata using ' ' LFA1-SORTL 'IT_UPLOAD-SORTL'.
    perform getdata using ' ' LFA1-LAND1 'IT_UPLOAD-LAND1'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0210'.
    perform getdata using ' ' LFB1-AKONT 'IT_UPLOAD-AKONT'.
    perform getdata using ' ' LFB1-FDGRV 'IT_UPLOAD-FDGRV'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0215'.
    perform getdata using ' ' LFB1-ZTERM 'IT_UPLOAD-ZTERM'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0220'.
    perform getdata using ' ' LFB5-MAHNA 'IT_UPLOAD-MAHNA'.
    PERFORM GETDATA USING 'X' 'SAPMF02K' '0310'.
    perform getdata using ' ' LFM1-WAERS 'IT_UPLOAD-WAERS'.
    ENDFORM.                    " POPULATE_DATA
    *&      Form  GETDATA
          text
         -->P_0213   text
         -->P_0214   text
         -->P_0215   text
    FORM GETDATA  USING    VALUE(P_0213)
                           VALUE(P_0214)
                           VALUE(P_0215).
                        IF P_0213  = 'X'.
                        IT_BDCDATA-PROGRAM = P_0213.
                        IT_BDCDATA-DYNPRO = P_0214.
                        IT_BDCDATA-DYNBEGIN = P_0215.
                        ELSE.
                        IT_BDCDATA-FNAM = P_0214.
                        IT_BDCDATA-FVAL = P_0215.
                        ENDIF.
    ****************any error in coding just chk it*****************

  • How can I display the correct enum ring value from a parameter file?

    A user will make selections based on the menu ring (there are several of these) and then the values are saved for later use as a parameter (text) file. I have several menu rings which I write out to a parameter (text) file.
    How can I take these text values back into the appropriate location in the menu ring. For example, if I have menuring_value at index 0, menuring_value at index 1, etc. how do I make sure that, when the par (text) file is loaded, the saved values are the ones displayed without erasing the displayed menu ring value and inputting the saved one (from the parameter file). I would like the text value to search the appropriate menu ring, make a match and then display that menu ring value when the parameter file is loaded.

    If I understand your question, attached VI should have solved your doubt
    In this example, Configuration File VIs are used to save & retrieve MenuRings' statuses.
    As this VI is improvised, please further modify it to suit your needs.
    Cheers!
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    GUI_Menu Ring Status Save & Retrieve.vi ‏69 KB

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • How can i pass the Input value to the sql file in the korn shell ??

    Hi,
    How can i pass the Input value to the sql file in the korn shell ??
    I have to pass the 4 different values to the sql file and each time i pass the value it has to generate the txt file for that value like wise it has to generate the 4 files at each run.
    can any one help me out.
    Raja

    Can you please more elaberate., perhaps you should more elaberate.
    sqlplus is a program. you start it from the korn shell. when it's finished, processing control returns to the korn shell. the korn shell and sqlplus do not communicate back and forth.
    so "spool the output from .sql file to some txt file from k shell, while passing the input parameters to the sql file from korn shell" makes no sense.

  • Displaying different sheets at run time based on value of the parameter

    Hi,
    I've a query regarding displaying two different sheets at run time in Oracle discoverer based on the value of the parameter that i give.
    I've a parameter Summary_flag.
    If the value of the parameter is 'Y',then it should display a sheet,say for example it should display Sheet1.
    If the value is 'N',then it should display another sheet, say for example it should display Sheet2.
    Is there any way in which i can accomplish this?
    I went through the Format and Tools menus but couldnt find anything regarding this aspect.
    Can you help me out?
    Thanks,

    Having a Disco parameter dictate which worksheet is displayed is not an option that is available. There are a few workarounds, though:
    1. Have a portlet (or some other web interface) accept your parameters, and then call the appropriate worksheet.
    2. Have 2 worksheets, and have it devolve into a training issue (for a summary run this, for all the details run this).
    3. Create calculations that will show or hide column data depending on the parameter selected - the columns will still be there, and you can fill them in with blanks, or a message like "N/A for Summary".
    4. Create a report that will allow the users to drill between the summary and detail data - I'm not sure whether you could use a parameter to then say whether the report should open up summarized or expanded.

  • Problems saving values in the configuration file

    Hello,
    I'm upgrading one of my projects from VS2005 (with .NET 2.0) to VS2013 (with .NET 4.5). I have a setup project in my solution, but this is no longer supported and I have to change to InstallShield
    deployment project. With the old setup project my app runs fine, but now with InstallShield I have a problem. I install the application in this folder: C:\Program Files (x86)\CompanyName\AppName. I use .config file to read and write some parameters.
    Reading parameters goes well, but when I write new values in the .config file a get one error. When I used the old setup project, at writing time the system created new .config file in C:\Users\me\AppData\Local\VirtualStore\Program Files (x86)\CompanyName\AppName
    (this is named isolated storage, isn't it? :S).
    These are all changes I made in the solution:
    When I opened the solution with VS 2013 the migration process went well (some warnings and messages) except setup project (of course).
    I upgrade all projects to .NET Framework 4.5 (Project properties -> Application -> Target framework).
    I have intalled InstallShielld Limited Edition and added and configured the new deployment project.
    I think that these are all changes. And this is the source code where I get the exception:
    public void SetXParamValue(string value)
    try
    Configuration conf = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
    conf.AppSettings.Settings["XParam"].Value = value;
    conf.Save();
    catch (Exception e)
    MessageBox.Show("Error setting X param.");
    And this is the exception:
    Exception messsage:
    An error occurred loading a configuration file: Access to the path 'C:\Program Files (x86)\CompanyName\AppName\oy25i1se.tmp' is denied. (C:\Program Files (x86)\CompanyName\AppName\ExeFile 1.0.192b.exe.config)
    Stack trace:
    at System.Configuration.MgmtConfigurationRecord.SaveAs(String filename, ConfigurationSaveMode saveMode, Boolean forceUpdateAll)
    at System.Configuration.Configuration.SaveAsImpl(String filename, ConfigurationSaveMode saveMode, Boolean forceSaveAll)
    at System.Configuration.Configuration.Save()
    at VisualizadorCabecera.FormPrincipal.EstablecerIdioma(CultureInfo idioma)
    Inner exception messsage:
    Access to the path 'C:\Program Files (x86)\CompanyName\AppName\oy25i1se.tmp' is denied.
    Stack trace:
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean
    checkHost)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
    at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()
    at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)
    at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension)
    at System.Configuration.Internal.WriteFileContext..ctor(String filename, String templateFilename)
    at System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForWrite(String streamName, String templateStreamName, Object& writeContext, Boolean assertPermissions)
    at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForWrite(String streamName, String templateStreamName, Object& writeContext, Boolean assertPermissions)
    at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForWrite(String streamName, String templateStreamName, Object& writeContext)
    at System.Configuration.ClientConfigurationHost.OpenStreamForWrite(String streamName, String templateStreamName, Object& writeContext)
    at System.Configuration.UpdateConfigHost.OpenStreamForWrite(String streamName, String templateStreamName, Object& writeContext)
    at System.Configuration.MgmtConfigurationRecord.SaveAs(String filename, ConfigurationSaveMode saveMode, Boolean forceUpdateAll)
    Any suggestions? I have to configure something else?
    Thank you,
    Jon.

    > "With the old setup project my app runs fine"
    Actually, I disagree.  Your configuration file is sitting alongside your application, in a directory that
    should be protected from changes by "regular" users and it's
    only running because Windows is intercepting your attempt to write under C:\Program Files* and rerouting those attempts to a "Virtual Store" location.  By the sounds of it, something your new installer is doing is [quite rightly]
    stopping this from happening (IIRC, virtualisation can be turned off for a program and, IMHO,
    should be).  
    You need to move the configuration file to a location that the user can write to (somewhere under C:\Users\username), even if you have to copy it the very first time it's needed. 
    Regards, Phill W.

  • How do I overide the values in the text file

    I am reading a text file using loadvars, to get some values
    such as
    &yourid=123456 from the text file.
    How do I overide the values in the text file
    <PARAM NAME=movie VALUE="jamietrailer.swf?yourid=65432
    <---- this doesn't seem to work
    So I can change the values from the html file?

    I want to do this:
    # It should look like this:
    <PARAM NAME=movie VALUE= "movie.swf?text=hello">
    # Find the EMBED tag. Look for this:
    <EMBED src="/support/flash/ts/documents/movie.swf"
    # Again, replace the filename "movie.swf" with
    "movie.swf?text=hello".
    It should look like this:
    <EMBED
    src="/support/flash/ts/documents/movie.swf?text=hello"
    Is this supposed to overide the value I am reading using
    loadvars?
    or do I have to not read the value from the file if I am
    going to give it a value in html?

  • How to map AM method return values in the bean

    Hello -
    I have this requirement to map AM method return values in the bean as explained below. Please suggest a solution.
    Scenario: I am calling an AM method, which returns a String object on page load.
    AMImpl Method-
    public String getProfileName (){
    return "Profile";
    I wish to catch this retun value in the Bean Variable on page Load. I have created a methodAction biding on page and invokeAction to call this method on Page Load, but I don't know how to catch this value in the bean. Please suggest how to achieve this. Also, I need to achieve this in jsp page. I can't use TaskFlow for this.
    I am using ADF 11g.
    Regards -
    Rohit
    Edited by: Rohit Makkad on Apr 21, 2010 12:23 AM

    Hi, I think there are two ways, from the data control drag n drop the methods return value to the page. This way a binding for that will be created at the page definition eg retVal.
    and in the backing bean you can access it by calling resolveExpression("#{bindings.retVal.inputValue}")
    You can also call your method directly from the backbean
    ((YourAppModuleImpl) getBindings().getDataControl().getApplicationModule()).yourMethod();
    public DCBindingContainer getBindings() {
    return (DCBindingContainer) resolveExpression("#{bindings}");
    I dont know if the second method suits you
    Tilemahos

  • Inter company Billing is taking a wrong value of the Bill

    Inter company Billing is taking a wrong value of the Bill

    Hi,
    Can you give more information about this.
    Paul

  • How to Parse and Tally the Accept/Reject values in the XML file?

    I need to tally the comments & annotations in a document that's under review. What's the Accept/Reject values in the XML file?

    SQL> SELECT EXTRACTVALUE (COLUMN_VALUE, '//name') NAME,
           EXTRACTVALUE (COLUMN_VALUE, '//age') age
      FROM TABLE
              (XMLSEQUENCE
                  (EXTRACT
                      (XMLTYPE
                          ('<Root>
                              <Record>
                                <name>RAM</name>
                                <age>23</age>
                              </Record>
                              <Record>
                                <name>SAM</name>
                                <age>23</age>
                              </Record>
                            </Root>'
                       '/Root/Record'
    NAME       AGE      
    RAM        23       
    SAM        23       
    2 rows selected.

  • Need to take a value from the csv file and query in a OAF page.

    Hello,
    I have a requirement to take the list of employee numbers in a csv file and display its corresponding job on the page.
    I have created a item 'MessageFileupload' where the user will upload the csv file containing the employee number and a Button 'Display Jobs' which will display the corresponding jobs on the page.
    Any idea how to take the values from the csv file and query it?
    Regards,
    den123.

    Hi ,
    Check
    http://oraclearea51.com/contribute/post-a-blog-article/csv-file-upload-for-oa-framework.html
    http://www.roseindia.net/jsp/upload-insert-csv.shtml
    Below code works from above blogs.
    package xx.oracle.apps.pa.Lab.webui;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    // import java.io.*;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.server.OAViewObjectImpl;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.jbo.domain.BlobDomain;
    import oracle.cabo.ui.data.DataObject;
    import oracle.jbo.Row;
    * Controller for ...
    public class deptCsvUploadCO extends OAControllerImpl
      public static final String RCS_ID="$Header$";
      public static final boolean RCS_ID_RECORDED =
            VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
       * Layout and page setup logic for a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processRequest(pageContext, webBean);
       * Procedure to handle form submissions for form elements in
       * a region.
       * @param pageContext the current OA page context
       * @param webBean the web bean corresponding to the region
      public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
        super.processFormRequest(pageContext, webBean);
        // Code Addition Started for CSV upload
        OAApplicationModule am = (OAApplicationModule) pageContext.getApplicationModule(webBean);
        OAViewObjectImpl vo = (OAViewObjectImpl) am.findViewObject("deptCsvVO1");
          //if ("GoBtn".equals(pageContext.getParameter(EVENT_PARAM)))
           if (pageContext.getParameter("GoBtn") != null)
          System.out.println("Button Pressed");
              DataObject fileUploadData =(DataObject)pageContext.getNamedDataObject("FileUploadItem");
              String fileName = null;
              String contentType = null;
              Long fileSize = null;
              Integer fileType = new Integer(6);
              BlobDomain uploadedByteStream = null;
              BufferedReader in = null;
                      try
                      fileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
                      contentType =(String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
                      uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, fileName);
                      in = new BufferedReader(new InputStreamReader(uploadedByteStream.getBinaryStream()));
                      fileSize = new Long(uploadedByteStream.getLength());
                      System.out.println("fileSize"+fileSize);
                      catch(NullPointerException ex)
                      throw new OAException("Please Select a File to Upload", OAException.ERROR);
                      try{ 
                      //Open the CSV file for reading 
                      String lineReader=""; 
                      long t =0;
                      String[] linetext; 
                      while (((lineReader = in.readLine()) !=null) )
                      //Split the deliminated data and
                      if (lineReader.trim().length()>0)
                      System.out.println("lineReader"+lineReader.length());
                      linetext = lineReader.split(","); 
                      t++;
                      //Print the current line being
                      if (!vo.isPreparedForExecution())
                              vo.setMaxFetchSize(0);
                              vo.executeQuery();
                        System.out.println("Trimmed "+  linetext[1].replace("\"", ""));
                      Row row = vo.createRow();
                      row.setAttribute("Deptno", linetext[0].trim());
                      row.setAttribute("Dname",linetext[1].trim().replace("\"", ""));
                      row.setAttribute("Loc",linetext[2].trim().replace("\"", ""));
                      //row.setAttribute("Column4", linetext[3].trim());
                      vo.last();
                      vo.next();
                      vo.insertRow(row);
                      catch (IOException e)
                            throw new OAException(e.getMessage(),OAException.ERROR);
              //else if (pageContext.getParameter("Upload") != null)
              am.getTransaction().commit();
              throw new OAException("Uploaded SuccessFully",OAException.CONFIRMATION);     
    }Thanks,
    Jit

  • Multiple values for the Parameter

    1. Had any tried the selecting MULTIPLE values for the parameter in Oracle Discoverer Plus Releae 4.1 Version 4.1.37.00.0. If so can please let me know how to implement it.
    2. In a Page-Detail Cross Tab workbook, I have to show the weighted average instead of the avg or sum. Any inputs please.
    3. I have to compare two periods (TOP) of datapoints. Any inputs please.

    If you wanted to eliminate the need for users to type in the parameter values, you could create a LOV on the desired column. This will produce a distinct list of all valid values where the user would simply select as the wish. Of course you still need to check the "let user enter multiple values" checkbox if you want them to select more than one.
    -DG

  • Overwritting the values in the property files

    Hi All
    I am new to reading property file in java. I am able to read the property files but it is overwritting my key/value pair.
    The main thing when I am comparing the adminname which is present in the property file with the username which I am getting in the servlet request.
    Its only comparing the last key/value pair ie.., adminname=ghj.
    Can anyone help me regarding this...please..
    i need to check whether userName(Servlet request) matches with any one of the values(abc,cde ,fgh,ghj) present in the property file.
    But in my case it is only comparing the last value only.
    for Eg:
    admin.properties
    one key and number of values. Can I do this?
    adminname=abc
    adminname=cde
    adminname=fgh
    adminname=ghj
    // if they want to add or remove the admin people they are going to do it from property file which is the text file.
    import java.io.*;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.http.*;
    public class ExampleFilter implements Filter {
         private FilterConfig filterConfig=null;
         public void init(FilterConfig config) throws ServletException {
              this.filterConfig = config;
         public void destroy() {
              filterConfig = null;
         public void doFilter(ServletRequest request, ServletResponse response,
                   FilterChain chain) throws IOException, ServletException {
              RequestDispatcher rd = null;
              String userInfo = "";
              String userName="";
              if (request instanceof HttpServletRequest) {
                   userInfo = ((HttpServletRequest) request).getUserPrincipal()
                                      .getName();
                             String[] pieces = userInfo.split("\\\\"); // Firefox sends DOMAIN\USERNAME as UserPrincipal
                                  userName = pieces[pieces.length -1]; // getting the username for which I need to perform check
           try
                Properties propertiesFile = new Properties();
                FileInputStream file =
                    new FileInputStream("C:\\webapp\\WebContent\\WEB-INF\\lib\\admin.properties");
              if (file == null)
                       throw new NullPointerException("Properties file 'admin.properties' is missing in classpath.");
                   propertiesFile.load(file);
                              propertiesFile.list(System.out);
                           val=propertiesFile.getProperty(adminname);       
                                                 //here watever the last key/value is present in the admin.properties, I am getting it.
                             //In the above property files i will get "ghj"
                                                 System.out.println("adminName In Property file:" +val);
          if(userName.equals("val"))
                                      // I NEED TO COMPARE THE USERNAME WITH THE adminname IN THE PROERTY FILE (admin.properties)
                                       // IF userName=anyone value in the property files.......... I AM FORWARDING IT TO REGULAR PAGE
                                          chain.doFilter(request, response); // if username is present in proeprty file, I need to navigate to normal pages.
                      else{
                             //IF adminname is not present i m forwarding to ERROR PAGE
                              rd = request.getRequestDispatcher("/admin/error.html");
                                           rd.forward(request, response);
               catch(Exception e)
                      e.printStackTrace();
    }

    Read the java.util.Properties API. You can't have multiple same keys. Use one key or a key with some suffix, e.g. adminname.1 and so on or so.
    This has nothing to do with servlets. You've a problem with classes of java.util package, not of javax.servlet package. Use the 'New to Java' forum.

  • Screen shots  - how do I change the default file type

    Screen shots using command, shift, 4: I used to get pdf files from the screen shot command, now I get PNG files. How do I change the default file type from PNG to PDF? PNGs are a pain.

    Also, there are utilities like OnyX that will change the screenshot settings.
    But this AppleScript is my favorite.
    Screenshot Settings 1.1 <http://scriptbuilders.net/files/screenshotsettings1.1.html>
    About:
    This application is a GUI method for changing the screenshot (screen capture) settings in Mac OS X v10.4 (Tiger).
    Note that you can also drag-n-drop a folder onto this application to change the default location.
    Tom

Maybe you are looking for

  • Is it possible to have clock in and clock out in weekly view

    Hi, We have Daily View and Weekly View in Record Working Time iview in ESS.We can set the Clock in and Clock out times in Daily view if we check the With Clock Times checkbox in Data Entry Profile.But we want to have same Clock in and Clock out in We

  • How do i add a Full Screen Button?

    Hi guys, I have used Quicklime X - File > Save for Web option to upload a video to my web site. This gave me a Java Script player and code to embed into my site, i have all the files running local on my server and the videos works well. My problem is

  • DLL's

    Can I import and use my own DLL's in AS3/Flex?

  • ComboBox question

    Does anyone have a resource for learning how to add XML data to populate the current ComboBox in Flash? I simply need the actionScript that can give the ComboBox labels and data. ANy URL's to tutorials or simple explainations would be appreciated tha

  • Error During Install using Oracle DB

    Hi All, I'm trying to use an Oracle database with IDM. Our DBA used the provided script (create_waveset_tables.oracle) to set up the database, we're using the login/password that the DBA set up, I've copied the oraclejdbc.jar file to the /WEB-INF/lib