Method createResource to Specify  file type of JPG TYPE or DOC type ?

Hi Experts i am using KM API's in WebDynpro JAVA to upload file into the Content Management of
Portal EP7.0. Below is the Code Excerpt, which works fine and file gets uploaded.
Problem is when i browse thru portal to path uploaded on KM  i see the file ICON stating it a BINARY
file. How can i change the ICON to read correct type.
is there a way when calling the createResource to state that this file is of  JPG TYPE or DOC type.
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User =
WPUMFactory .getUserFactory().getEP5User(sapUser);
ResourceContext resourseContext = new ResourceContext(ep5User);
RID pathRID = RID.getRID("/documents/Public Documents/MYDATA"); //Root Directory
IResourceFactory resourseFactory =  com.sapportals.wcm.repository.ResourceFactory.getInstance();
ICollection collection = (ICollection)resourseFactory.getResource(pathRID, resourseContext);
}InputStream stream = resource.read(false);
String resourceName = resource.getResourceName();
String resourceExtn = resource.getResourceType().getFileExtension();
com.sapportals.wcm.repository.Content content =
new com.sapportals.wcm.repository.Content( stream,"application/octet-stream",-1,"UTF-16");
com.sapportals.wcm.repository.IResource new_resource =
(com.sapportals.wcm.repository.IResource) collection.createResource(resourceName, null, content);
Greetings
Prashant

Hi Satish,
Thanks for the code excerpt. i already know the file type ,
String resourceExtn = resource.getResourceType().getFileExtension();
My problem is that after uploading the file in KM,  file is displayed as Binary type... check below tutorial on PAGE 14, the file has icon binary....not the .DOC icon.
[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a099a3bd-17ef-2b10-e6ac-9c1ea42af0e9]
what i want to achieve is since i already know the file type i am uploading the new resource created should be exactly of that type. so if i am uploading .DOC file is shuold see new resource as word document type . Thus it boils down to simple question
When creating new resource in KM , whats the way to specify that this is .DOC type resource or .JPEG type resource*
com.sapportals.wcm.repository.IResource new_resource =
(com.sapportals.wcm.repository.IResource) collection.createResource(resourceName, null, content);
Greetings
Prashant

Similar Messages

  • Requisition doc. type RV not allowed with doc. type

    Using the tcode ME51n, I created an Outline agreement(Doc type RV) and when i go to ME31K to create a contract and select With Ref to Purchase requisition and enter the Purchase requisition #, I get the error message Requisition doc. type RV not allowed with doc. type.
    I tried changing the settings for doc types for contract, but it doesnt seem to be working. Any solutions will greatly beappreciated.

    This is the settings in PR: SPRO-MM-Purchasing-PR-Define document type
    Doc type: RV     Outl. agmt. requisn.     10     01     02     RVB     R
    once above is correct than
    select the doc type RV and click on the allowed item category
    where can see as below
    Item cat  Text item category
         Standard
    K     Consignment
    D     Service
    select the doc type RV and click on the Link purchase requisitio in left side
    MK     Quantity contract     M     Material unknown          Standard
    WK     Value contract          Standard                          Standard
    WK     Value contract     K     Consignment          Standard
    WK     Value contract     M     Material unknown          Standard
    WK     Value contract     W     Material group          Standard
    Now go to contract doe type
    you will see
    MK     Quantity contract     10     02     AZ          SAP     MKK
    WK     Value contract     10     02     AZ          SAP     WKK
    select any doc type and click on allowed item category
    here you would see
         Standard
    K     Consignment
    L     Subcontracting
    M     Material unknown
    D     Service
    than click on link purchase requisition by selecting doc type MK or WK
    RV     Outl. agmt. requisn.          Standard          Standard
    RV     Outl. agmt. requisn.          Standard     K     Consignment
    RV     Outl. agmt. requisn.          Standard     M     Material unknown
    RV     Outl. agmt. requisn.     K     Consignment     K     Consignment
    RV     Outl. agmt. requisn.     D     Service     D     Service
    once you have all this set up than you can create the contract based on the RV reqs

  • How to disable 'Stock type' field in MIGO depending doc. type or mvt. type

    Does anybody knows how to deactivate (just display but not modify) field 'Stock field' in MIGO transaction if we just want to do that for an specific document type (UB)? If it's not possible, does anybody know how to do that but by movement type (351/101)?
    Now stock type can be changed from unrestricted (set by default) to blocked or under quarantine when we post GI or GR related to a STO (351/101) and we want to avoid users changing this field.
    Thanks in advance,
    Raquel

    USE t Code OMJX,  and set the Stock type to DISPLAY ONLY, but that'd be for all Mov.t types. The PO document type would not matter here!! You could use a USER EXIT upon SAVE to revert to what ever you need irrespective of user changes other wise.. Thats an option!! Talk to your ABAP' er
    Edited by: Pavan Kumar on Jul 18, 2008 12:32 AM

  • Lsmw Error during the specify files

    While doing Material master upload thru lsmw...using Batch input method
    During the specify files step i am getting this error
    File Name 'Converted Data': Max. 45 Characters. Remaining data saved.
    Message no. /SAPDMC/LSMW_OBJ_060028
    Pls Guide me.......

    Hi,
    How you save your source file?  Need to be saved in  as TAB delimited file
    OK. Check link:
    http://www.sap123.com/a/98/#loading-material-masters-with-lsmw-direct-input-method
    http://www.slideshare.net/arun_bala1/sap-sd-lsmw-legacy-system-migration-workbench
    Regards,
    Biju K

  • Incorrect PO doc type for STO

    Hi,
    When I am converting STO purchase requisitions manually from MD04 to Purchase order, the incorrect purchase order type "DPFS Int Ord. Type" is defaulted.
    By going to the following path,
    SPRO > Materials Maanagement > Purchasing > Purchase Requisition > Define Document Types
    I see that the link purchase requisition - document type looks like the linked screenshot.
    http://i43.tinypic.com/hv12dt.jpg
    The first entry is for Document type EUB (Description: DFPS, Int. Ord. Type). If I delete this entry then the purchase order is being correctly defaulted with documement type STO when I convert the purchase requision to purchase order.
    Is it recommended to delete this entry or is there any other way to get the correct default type in the PO ?
    Sincerely,
    Nicky

    There can be various ways of defaulting the right doc type like as mentioned below
    When you are converting manaully Pr to Po from md04, in  the first screen you can change the document type to the one you require.
    Also you could maintain in the transaction SPRO>MM->consumption based planning -->Procurement Proposals.
    If the order type of PR for STO is different you could specify in the linking of PR--> PO doc type too
    Regards
    Sangeeta

  • SAP 1099 - not showing credit memo - KG doc type

    Hello,
      When i run the generic w/h report for 1099, it is not showing credit memo , KG doc type .
    The vendor is flagged for 1099 and also the KG doc contains the W/H base and tax code .
    please let me know .
    thanks very much.

    Hi,
    I am sorry, the note is not releasead yet. I will let you know when it would be.
    Meanwhile, please check if the hints below resolves your issue:
    Please run the S_P00_07000134 report (RFIDDYYWT ) with option of 'Further Selection' 'Credit Memo Doc. types'  Technical name of P_CMDCTY with value of KG then desired result will show.
    with Additionally
    please refer the note no  945664
    MANUAL ACTIVITIES:
    1. Goto trasaction se38
    2. Give the program name as 'RFIDYYWT'
    3. Click on Goto->Text Elements->Selection Texts on the Menu bar
    4. Goto editable mode.
    5. Search for parameter 'P_CMDCTY'. Specify the selection text as
    'Credit Memo Doc. types'. Uncheck the adjoining checkbox for Dictionary
    ref.
    6. Activate the changes.
    I hope it helps.
    Best Regards,
    Vanessa Barth.

  • Default  Doc Type for PO

    Hi Friends..
    I need your help in solving a Puzzle in SAP.
    I want to use ME59N automatic po conversion option for creation of PO from PR.Here PR doc type is NB-Standard, I want PO doc type to be my own doc type " CT3 " doc type. I have made below settings,
    a.Activated Auto PO in VMR.
    b.Activated Auto PO in MMR
    c.Linked my CT3 doc type in SPRO.
    But, when I tried to do default doc type settings in SPRO, SAP didn't
    accept this Tcode (ME59N) & hence not successfull.
    SAP is taking default doc type as NB & not tailor made "CT3" doc type.
    Pl respond.
    Thanks,  VK.

    Hi,
    You hve done settings for Automatic PO, I think those setting are not required for you. Because your scenario is not Automatic PO.
    In ME21N transaction you can do personnel settings with this whenever you run the ME21N tcode by default system will pick tht doc type as default doc type. This can be user based setting.
    Hve you maintained the combination of PO document type and PR docuement type ? If you are using onli CT3 PO document type, assign this PO document type only.
    In SPRO - MM - Purchasing - Define default Doc types maintain the defulat doc type for ME21N transaction.
    Hope its clear, still if u hve questions let me know.
    reg
    Durga
    *Assign points if the info is useful

  • Doc type and drilldown Consolidate data transfered from FI

    Dear all members,
    I config doc type for data realtime update from FI.
    But when i run report CX34, doc type of data transfered from FI to EC-CS is blank.
    And I can't drilldown this data.
    Please show my mistakes
    Many thanks,
    Orchid
    Edited by: Orchid675 on Jul 2, 2010 5:12 AM

    Dear Orchid,
    in EC-CS the document number and the document type will be new, the doc type info will not be updated so the original FI doc type will disappear.
    Typically, in EC-CS all reported financial data (so documents from FI) will be updated with the same doc type at posting level SPACE (realtime update) or 00 (all other).
    I hope my question helps.
    Ciao,
    David

  • PO doc types

    Hi,
    What are the different document types available for purchase orders?

    Hi Chilster,
    Check the default document types in
    SPRO>MM>Purchasing>Purchase order>Define document type
    Spro>MM>Purchasing>Purchase Order>define document types--> copy from the standard doc.type and create your own document type with your own number range and field selection keys.
    Here you can select NB document type and click on copy and create your own document type as ZX.
    now system will copy all the datas from NB type like number range and filed selection key. If you want to keep same number range then keep it as it is but change the filed selection if you want to keep your own layout.
    Spro>MM>Purchasing>Purchase Order>define screen layout at doc, level-->select your fileld selection key and maintain the fields as per your business requirement
    Here you create new one same copy from esixting one and chage as per your requirement and then assign the new e.g. XXX to the new doc type.
    Regards,
    Nani.

  • Urgent: backend PO/PR doc type

    Hi,
    I am confused and need to check!
    Currently we have configured the transaction type for backend doc in users attributes. this doc type is for backend PR (ABP). config says if complete then PO otherwise PR..back end PO doc type is ACBP and it is not set in attributes
    when we order SC having valid source (R/3 contract) it auto picks up PO doc type ACBP in one system and creates PO. Is this doc type coming from R/3 doc type linkage or any other place. Pls help
    Alok

    I could find the mapping done in the PO change BADI..But I would like to ask, is there a standard function like giving both doc type in the attributes or only way is to configure the same doc type in R/3?
    Thanks!
    Alok

  • Using the value "Image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of preconfigured file types (.jpe, .jpg, .jpeg, .?

    On a form, using the value "image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of pre-configured file types (.jpe, .jpg, .jpeg, .gif, .png, .bmp, .ico, .svg, .svgz, .tif, .tiff, .ai, .drw, .pct, .psp, .xcf, .psd, .raw)?
    Say I wanted to add .gif, .jfif or .ico. I find this array limited, how can I add types to image?
    <input type="file" name="file" accept="image/*" id="file" />
    mimeTypes.rdf does not seem to allow this.

    ''mimeTypes.rdf'' has nothing to do with web development. It's a file that stores your file handling preferences (e.g. if you want ZIP files automatically saved or opened).
    You can't change the file types of the pre-defined content specifiers (audio/*, video/*, image/*), but you can specify additional MIME types. To add PDF to your above example,
    <pre><nowiki><input type="file" name="file" accept="image/*,application/pdf" id="file" /></nowiki></pre>
    For details, see
    * [https://developer.mozilla.org/En/HTML/Element/Input developer.mozilla.org/En/HTML/Element/Input]

  • I cannot save pictures from facebook to "my Pictures" files on my hard drive. There is no place to indicate the type of file, such as jpg etc.

    I have been copying a picture & pasting it on my AOL email & saving photos from Facebook from email . Also, I cannot watch videos posted by my friends on Facebook.
    Firefox works fast on scrolling thru Facebook but I haven't found it to be that helpful for simple things I want to do.
    Thanks for any help you can provide.

    Hi perric,
    On the first issue about pictures.
    * You can set Firefox to ask you where to save the file rather than always using the Downloads folder. This article describes how to set that: [[Startup, home page and download settings]].
    * When you say "there is no place to indicate the type of file, such as jpg etc." is the problem that Facebook isn't including that in the file name and you need to add it? If you could explain this part a bit more.
    * Another way to save pictures is to use the Page Info dialog. While on the page with the images, you can use either:<br><br>* right-click and choose View Page Info > Media<br>* Alt+t (open the classic Tools menu) > Page Info > Media<br><br>As you scroll down the list, you can preview and use the Save As button to save those "hard to get" images.
    On the second issue about videos.
    * Do you see a gray space indicating that you need a plugin? Or does the video not play when you click it? Please explain what you're experiencing in a little more detail.
    * In case you do not have the Flash player plugin for Firefox, you can get it here: http://get.adobe.com/flashplayer/ (make sure to uncheck any unwanted extras that Adobe might offer). If you do the download from IE, you won't get the right version. In that case, use this link to choose the non-IE plugin: http://get.adobe.com/flashplayer/otherversions/
    Hope that helps a bit.

  • [svn] 674: LCDS-110: If you don' t specify file type when using DocumentReference, a java.lang. NullPointerException occurs.

    Revision: 674
    Author: [email protected]
    Date: 2008-02-27 09:41:30 -0800 (Wed, 27 Feb 2008)
    Log Message:
    LCDS-110: If you don't specify file type when using DocumentReference, a java.lang.NullPointerException occurs.
    qa: yes
    bug: LCDS-110
    doc: no
    checkintests: passed
    Details:
    modules/common/src/java/flex/messaging/errors.properties
    * new error message
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-110
    http://bugs.adobe.com/jira/browse/LCDS-110
    Modified Paths:
    blazeds/branches/3.0.x/modules/common/src/java/flex/messaging/errors.properties

    Yes I know that ;) and I fixed it myself too by initializing it like this: private GameObject[] apple = new GameObject[max_apples];But now I get this error instead:
    Exception in thread "Thread-4" java.lang.ArrayIndexOutOfBoundsException: 3
         at Main.run(Main.java:35)
         at java.lang.Thread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 3
         at Main.paint(Main.java:134)
         at sun.awt.RepaintArea.paintComponent(Unknown Source)
         at sun.awt.RepaintArea.paint(Unknown Source)
         at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)So now I need help on this... =D CHEERS! :P

  • How do I specify file types to "not" backup

    I would like to not backup movie and TV shows as they are large and will eventually push the stuff I want backed up off of the drive due to the last on–last off policy.
    Any thoughts?

    I don't think there's any way to specify file types you don't want to back up, but, as SacMac said, you can exclude specific files and folders in the TM preference pane:
    >System Preferences...>Time Machine>Options>+, then navigate to what you want to exclude, and click "exclude".
    Good luck!

  • LSMW: Error concerning the logical path in Specify Files step

    Hi,
    I am trying on an ECC 6.0 EHP6 system to upload (open) POs from an existing SAP ERP system. Since I faced some complications in batch input recording method, I decided to go with the standard batch/direct input method.
    I selected object 0085 (Purchase Order) and method 0001 (Purchase Order). The program that is used is RM06EEI0. I followed all the usual steps, but in the "Specify Files" step I get the message:
    '****.lsmw.conv' does not exist; edit the logical path using transaction FILE
    Being aware of both the FILE and SF01 transactions, I created the logical path and file (through the FILE transaction). However, after the modification, I get the message:
    Logical file '****' is not assigned to physical file '****.lsmw.conv'
    There is also the related SAP Note 753511 (Logical and physical path and file name in transaction LSMW) that refers to this case.

    Hi,
    Click on specify file radio button>Legacy data-on the PC Front end
    where input file location like C:\mydocument\desktop\test.txt
    and give input in Name field: mydocument
    in delimiter section > select Tabular
    File structure section> tick on Field order matches source structure definition
    File type: Record end marker(Text file)
    then press enter key and other steps as same.
    Second thing you said that you have used Batch input recording
    after creation and recording finish , scroll the page below on recording and put a cursor unwanted field and remove unwanted input field.
    I hope your problem will resolve. you can find the steps pdf on Google search try now.
    Thanks
    Sanjeet Kumar

Maybe you are looking for