FileUpload element is not working.

Hi, experts,
There is WD-application with FileUpload element that is not working so that the rar file isn't uploaded into MIME Repository.
Action:
1. Create content attribute that type is xstring in the view context.
2.  Create MIMETYPE,  FILENAME attribute that type is string in the view context.
3.  Bind the content attribute  to the data property of the fileupload element in the layout.
4.  Bind the filename to the filename property of the fileupload element in the layout.
5.  Bind the mimetype to the mime type property of the fileupload element in the layout.
The following is code for the upload button in the view:
method ONACTIONFILEUPLOAD .
data:   content  type xstring.
DATA lo_nd_mimes           TYPE REF TO            if_wd_context_node.
DATA lo_el_mimes           TYPE REF TO            if_wd_context_element.
DATA ls_mimes              TYPE                   wd_this->element_mimes.
DATA lv_mimetype          LIKE ls_mimes-mimetype.
get the context
wd_context->get_attribute( exporting name = 'FILECONTENT' importing value = content ).
lo_nd_mimes = wd_context->get_child_node( name = wd_this->wdctx_mimes ).
lo_el_mimes = lo_nd_mimes->get_element(  ).
set single attribute
  lo_el_mimes->set_attribute(
    EXPORTING
      name =  `MIMETYPE`
      value = 'APPLICATION/octet-stream;charset=utf-16le' ).
  lo_el_mimes->set_attribute(
    EXPORTING
      name =  `FILENAME`
      value = 'test.rar' ).
put the rar file to  the repository .
data:
mime_repository        type ref to           if_mr_api,
mime_type                type                  string,
url                            type                  string value '/sap/bc/webdynpro/sap/zz_00_test_019' ,             
mime_repository = cl_mime_repository_api=>IF_MR_API~GET_API( ).
mime_repository->put(
          EXPORTING
            i_url                         = url
            i_content                     = content
            i_suppress_package_dialog     = 'X'
          EXCEPTIONS
            parameter_missing             = 1
            error_occured                 = 2
            cancelled                     = 3
            permission_failure            = 4
            data_inconsistency            = 5
            new_loio_already_exists       = 6
            is_folder                     = 7
            OTHERS                        = 8 ).
break-point.
endmethod.
So the questions are:
I don't find the rar file in the mime repository after I run the Webdynpro for ABAP application.
I am sure that the field where is put the rar file is right.
Do you give me some hint?
Thanks!
Best regards,
tao
Edited by: wang tao on Feb 13, 2009 8:12 AM

Hi Wang,
Regarding your file uploading problem, please check this code.
On a button action call this code to upload the file.
Please take care of the URL you going to pass.
The URL should be like this. i.e. You have to specific the dummy file name in the url as here in this example I am passing the Code.txt.
  url TYPE string VALUE '/SAP/BC/WebDynpro/SAP/WDR_TEST_ADOBE_PDF_ONLY/CODE.TXT' .
METHOD onactiononclick .
  DATA lo_nd_node TYPE REF TO if_wd_context_node.
  DATA lo_el_node TYPE REF TO if_wd_context_element.
  DATA ls_node TYPE wd_this->element_node.
  navigate from <CONTEXT> to <NODE> via lead selection
  lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
  get element via lead selection
  lo_el_node = lo_nd_node->get_element(  ).
  get all declared attributes
  lo_el_node->get_static_attributes(
    IMPORTING
      static_attributes = ls_node ).
  lo_el_node->set_static_attributes(
  EXPORTING
    static_attributes = ls_node ).
  DATA:
  mime_repository TYPE REF TO if_mr_api,
  mime_type TYPE string,
  url TYPE string VALUE '/SAP/BC/WebDynpro/SAP/WDR_TEST_ADOBE_PDF_ONLY/CODE.TXT' .
  mime_repository = cl_mime_repository_api=>if_mr_api~get_api( ).
  CALL METHOD mime_repository->put
    EXPORTING
      i_url                     = url
      i_content                 = ls_node-data
    i_language                = sy-langu
  EXCEPTIONS
    parameter_missing         = 1
    error_occured             = 2
    cancelled                 = 3
    permission_failure        = 4
    data_inconsistency        = 5
    new_loio_already_exists   = 6
    is_folder                 = 7
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDMETHOD.                    "onactiononclick
This will help you in solving your problem.
Regards
Manoj Kumar

Similar Messages

  • Why is my adobe photoshop elements 12 not working. it says initializing and then it says there is an error and closes itself

    why is my adobe photoshop elements 12 not working. it says initializing then error and shuts itself down.

    Three things you can try:
    1. Clean the superdrive with a proprietory CD/DVD lens cleaner that uses tiny brushes.
    2. Perform an SMC reset:
    Resetting the SMC (System Management Controller) on Intel-based Macs:
    http://support.apple.com/kb/ht3964  and
    http://support.apple.com/kb/HT1237?viewlocale=en_US
    Resetting your Mac's PRAM and NVRAM:
    http://support.apple.com/kb/ht1379
    If you are using a Wireless Keyboard:
    http://support.apple.com/kb/TS3273
    3. Try the free DVD player VLC:
    http://www.videolan.org/vlc/
    which performs better than the built-in DVD Player.

  • Why inspect element is not working in firebug after updating firefox to 14 version?

    firefox upgraded to 14.0.1. After this, I am not able to see element html code in firebug.
    i.e inspect element is not working as expected.

    If you still experience this problem, please post it to the [https://groups.google.com/forum/#!forum/firebug Firebug discussion group].
    Sebastian

  • Why is elements 12 not working with OS 10  yosemite  Editing tools aren't working like they used to.????

    Can someone tell my why Elements 12 photo editing tools wont work with OS 10 Yosemite?

    duplicate, see:
    why is elements 12 not working with OS 10  yosemite  Editing tools aren't working like they used to.????

  • My purchased download of Photoshop Elements did not work and I have been trying to reach a real person at Adobe.  Has anyone ever been able to do that.  If so can you tell me how to do that.

    My purchased download of Photoshop Elements did not work and I have been trying to reach a real person at Adobe.  Has anyone ever been able to do that.  If so can you tell me how to do that.

    Hi vision4success ,
    I would like to gather some information regarding your issue, So, please answer the questions below:
    What is the exact issue that you are facing?
    Do you get any error while installing Photoshop element?
    What is the Operating System that you are using?
    Since when you are facing this problem. Has it ever worked for you?
    What all steps did you try from your end?
    If you have any other details regarding the issue that might help us, please feel free to mention that as well.
    Waiting for you reply.
    Regards,
    Sarika

  • Webi report on OLAP Bex query -  Cost element Hierarchy not working Drill down

    Hello,
    We have a BO report on Bex query, Not on universe, we have a Hierarchy for Cost Element Group, and we are expecting the Drill down functionality for that in BO report, but it does not.
    Webi report on OLAP Bex query -  Cost element Hierarchy not working Drill down
    Any pointers how to do it please
    Thanks
    Krishna

    Hi,
    WebI reports on BEx source don't use same Drill feature as other sources, it's replaced by expland/collapse of hierarchy nodes (documented in WebI user guide in § "24.1 Drill defined"). This means you have to create query which selects all hierarchy sub-tree you plan on exploring later in report, otherwise if no data is available under a node there will be no '+/-' sign to visit this part of tree.
    You could try first to select "All members" from hierarchy in QueryPanel and see if behavior in report suits your needs. Then you should restrict hierarchy member selection to what's really needed to avoid performance issues.
    Regards,
    Loic

  • Remove Element does not work

    Hi Experts,
    I want to loop over a node and remove all elements in this node if they don't match a certain pattern (which needs to be checked by getting the details o these elements).
    So looping over the node and checking whether the pattern matches works pretty fine (I've checked by using a counter variable which counts the number of matches and compares to the total size of the node). But removing the elements does not work.
    I always get the complete table as the result but not without all those elements I that they'd be removed already. I also check the success status (boolean) of the remove function and it delivers always "true" so it seems to work.
    This is the relevant coding:
           for(int c = 0 ; c < wdContext.nodeMatnrlist().size() ; c++){
              wdContext.nodeMatnrlist().moveTo(c);          
              GetMaterialDetails(wdContext.currentMatnrlistElement().getMaterial());          
              if(!wdContext.currentMaterialDetailsElement().modelObject()
    .getOutput().getMaterial_General_Data().getCreated_By().equals("BAIV-SS09-21")){
                   success = wdContext.nodeMatnrlist().removeElement(wdContext.nodeMatnrlist().getCurrentElement());
                   counter++;
    any Ideas on this?
    Many thanks in advance!
    Cheers
    Tobias
    Edited by: Tobias Fickinger on Sep 4, 2009 7:04 PM

    Hi Tobias.
    Try this instead:
    wdContext.nodeMatnrlist().invalidate();
    Regards.
    Julio Herrera

  • Elements 10 not working and uninstall not working either help please?

    Elements 10 does not work and I have tried to uninstall it with the intention of re-installing.   When I press un-install it tells me it is still uninstalling or changing the program but this has been happening for three hours?  Windows installer is saying 'cancelling' the same for two hours.  I am stuck please help.  Many thanks in advance from a well qualified luddite!

    Update - I am manually un-installing because as I can't get photoshop to work - (it says it is scanning for updated and never stops -)  I assume it is corrupt.  I have selected it and then uninstalled - had no further options offered to me and now it is saying ' please wait until the current program is finished unistalling or being changed'  I am totally confused.  Now I am getting the message 'Install server not responding'  Please help.

  • Element substitution not working properly during unmarshal

    Hi everybody,
    I've following situation. I have a project (call it project A) which contains a schema (lets call it the abstract schema). In the abstract schema there is an element which was declared as abstract. Furthermore there is another element (call it container) which shall be able to contain as much "abstract" elements as the user wants to. It obvious that an element could not be abstract, so I've created another project (call it project b) which has a schema (call it concrete schema) whichs imports the abstract schema. In the concrete schema I will have some elements which substitute the abstract element from the abstract schema.
    Now I've an xml document whichs root element is the container (from the abstract schema), and it should contain the non-abstract elements from the concrete schema. So far so good, everything will be validated, there are no errors. But unfortunately the unmarshal progress will not return the expected result. Validation during unmarshal progress is ok as I said but after unmarshalling the xml file, there is no concrete element in the returned result.
    I don't know what could be wrong. Did somebody already worked with element substituion in that way and is able to help me?
    Because its very complicated to describe I've created a minimal testcase (http://www.mailing-list-disaster.com/generic-jobengine.tar.gz) . Just compile both projects and run the using-abstract-engine application.
    Thx for suggestions and with best regards
    Johannes Homuth

    Hi Ram
    Thanks for the reply.
    No it does not take from any other LOV and there is no existing LOV mapping for this item.
    Its in the iExpense>Create expense report>General Information screen> Approver LOV
    The APPROVER LOV needs to be mapped with the field "Cost Center" which is not there in the standard functionality.
    Regards,
    AD

  • Xsd:element ref not working with jaxb

    Hi,
    I'm trying to implement a simple web service based on jax-ws.
    My probem is that binding does not working when I use the <xsd:element ref="..."/> attribute in the schema description.
    Here is the web service implementation :
    @Stateless()
    @WebService(
    serviceName="AlarmBeanService",
    targetNamespace="http://two.one.net/jws/alarm/",
    endpointInterface="net.one.two.jws.alarm.AlarmBeanPortType")
    public class AlarmBean implements AlarmBeanPortType {
    public AlarmCreateOut persist(AlarmCreateIn in) {
    return new AlarmCreateOut();
    My AlarmCreateIn message is defined in AlarmCreateIn.xsd :
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:c="http://two.one.net/jws/alarm/schema/common/"
    targetNamespace="http://two.one.net/jws/alarm/schema/create/in/"
    elementFormDefault="unqualified"
    attributeFormDefault="unqualified">
    <xsd:import namespace="http://two.one.net/jws/alarm/schema/common/" schemaLocation="../common/AlarmDataTypes.xsd"/>
    <xsd:element name="AlarmCreateIn">
    <xsd:annotation>
    <xsd:documentation>
    </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="c:alarm" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    This way it's not working, my "alarm" object in AlarmCreateIn is always null.
    But it works if referencing my alarm object like in the following xsd :
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:alarm="http://two.one.net/jws/ctypes/alarm/"
         targetNamespace="http://two.one.net/jws/alarm/schema/create/in/"
         elementFormDefault="unqualified"
         attributeFormDefault="unqualified">
         <xsd:import namespace="http://two.one.net/jws/ctypes/alarm/" schemaLocation="../../ctypes/alarm/Alarm.xsd" />
         <xsd:element name="AlarmCreateIn">
              <xsd:annotation>
                   <xsd:documentation>
                   </xsd:documentation>
              </xsd:annotation>
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element name="alarm"      type="alarm:AlarmXsd"          minOccurs="0" />
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
    </xsd:schema>
    Any ideas on what happen?
    Thanks.
    Edited by will_mad at 07/24/2007 10:15 AM

    Most likely you chose the logical file instead of the correct file for the PSE editor. The one you can see, at the top level of the PSE 10 folder in Applications, is the welcome screen. The actual editor is hidden in the Support Files folder. You want this one:

  • Premiere Elements 11 not working on a networked system

    Could someone please confirm to me that Premiere Elements 11 does not work with redirected My Documents folders? Is this something Adobe will look to change?

    SG
    I have long known of the merits of the Homegroup sharing of computers, especially as it is related to printers and non Adobe files on external hard drives.
    So, when you brought up the point
    But on an ethernet home network, it works just fine. I can easily have my program on one computer and my media files and even my project on another and edit a video between them.
    That was a great tip which I had not run into before and consequently have not taken advantage of. So, I gave it a try between my Premiere Elements 11 on Windows 7 64 bit and Windows 8 64 (with everything possible being shared between the two as allowed by Homegroup Sharing).
    Bottom line is that it did finally work fine, but it took some doing to get there. The final obstacle was clicking Yes to the Open Project message of:
    The Scratch Discs are write protected or unavailable. To open this project, the scratch disks will be set to your My Documents folder. Would you like to continue?
    Have you run into that?
    Thanks.
    ATR

  • Photoshop Elements 2 not working in new Win 7 PC

    I have a new PC and my Photoshop Elements 2
    is not working properly on it. Are they incompatable? May I download a patch to make it work on Win 7?
    If I have to upgrade, which one to upgrade to? I'm a novice, not an expert so I don't need any full version high powered product.
    Thank you, in advance, for your thoughts here.

    A number of people have reported getting PSE 2 to work on Windows 7 by using the various compatibility options on Windows 7:
    http://www.johnrellis.com/psedbtool/photoshop-elements-faq.htm#_Run_in_Vista
    If you choose to upgrade to a newer version, definitely go with the latest, PSE 8, which is the only one that Adobe promises will work on Windows 7 (though earlier versions do indeed run).

  • PS Elements 12 not working

    My PS Elements 12 was working fine (Windows 8.1), when suddenly I could not use it anymore.  When I open the program there is a message "...EDITOR NOT WORKING...  ANy solution?

    Sorry, but I don't understand. PSE has nothing at all to do with creative cloud. If you're saying that you can't save work in any program, that's probably something wrong with your OS X installation. If you just are having a problem in PSE, the first thing to do is to go to the editor's preferences>general, click this button, and restart the editor:

  • Why does my premiere elements 12 not work ?

    Have installed photoshop elements and premier elements 12  photoshop works fine but premier does not .Have tried re installing but no luck  I have read that disc my be faulty / hoe do I ge replacement / Thanks Meleches.

    Try installing from a different source. Use the link below to download the free trial. Its identical to the full disk version. After installation you can activate it with the serial number from your DVD packaging.
    It’s a good idea to uninstall PRE12 before you begin the download.
    http://www.adobe.com/cfusion/tdrc/index.cfm?product=premiere_elements&loc=us

  • Why does my serial key for Photoshop Elements 7 not work?

    I purchased Elements 7 about 4 years ago and am trying to install it on my new computer so I have a basic form of Photoshop until I get a new form of it. Why will my serial code that came with the software not work? I've even copied it directly from my Products and Services account page.

    Error "The serial number is not valid for this product" | Creative Suite

Maybe you are looking for

  • Get the data from a dbase file - .dbf.

    Hello all - good morning working on Sunday :(. I am needing to get the data from old application which run the dbase program. Need to automatique the data getting. If you have any idea, please tell to me. Thanks to you, Nóra.

  • Swipe features in Lion on older macbook?

    I just upgraded to Lion with my 13" macbook pro with the glass trackpad.  But I want to upgrade my macbook without the multi touch trackpad.   My concern is all the gestures that you use with Lion on the trackpad.   Currently with 10.6 I use expose b

  • Problem downloading with internet explorer

    when the adobe starts to install, theres an error screen that pops up telling me to "close internet explorer to continue".  When I do this the same screen just keeps popping up when I push "retry"

  • Safari auto-fill question... I think

    I just installed 4.0.2 and I cannot get the program to stop giving me the drop-down options of Top Hits, History, and Bookmarks as I type in an address. This is incredibly annoying and I cannot seem to turn that off. I just want to be able to type in

  • PS Scripting

    I'm looking for a good (i.e., able to be understood by a non-programmer) resource on PS scripting.  I'm not even sure what I want to do is possible.  I'd like to generate a script that will do a batch Merge to HDR Pro.  I'd like to point the script a