Display of attached files in portal
Hi all,
We have a custom ABAP program where files can be attached and displayed. This program is also called in portal through Transaction iView.
Now in R/3 when a file is attached and displayed it opens the file. But in portal when the same thing is done, it asks for program to open the file.
We are unable to get the solution to this problem. Our portal consultant says that in portal it is temporarily downloading the file for display but while downloading it is not carrying the extension of the file hence it is unable to open it.
What could be the solution to this problem.
Thanks
VK
Since this is working in R/3 properly so , may i know how in the portal the file is getting downloading is it thorugh programme if yes does the code allows us to download file format please do let us know
Similar Messages
-
How to display the attached file of DMS in WEB Dynpro
Hello everybody! I have to work with DMS documents on the portal. Do You know, how display the attached files of DMS document in WEB Dynpro?
Pavel TruhlářHi Pavel,
By using the below F.M we can display DMS Document.
CALL FUNCTION 'CVAPI_DOC_VIEW'
EXPORTING
PF_DOKAR = 'ZAP'
PF_DOKNR = LS_DMS_TABLE-DOKNR
PF_DOKVR = '00'
PF_DOKTL = '000'
PF_HOSTNAME = 'DEFAULT'
PF_APPL_START = ' '
PF_GET_URL = 'X'
IMPORTING
PFX_URL = V_URL
EXCEPTIONS
ERROR = 1
NOT_FOUND = 2
NO_AUTH = 3
NO_ORIGINAL = 4
OTHERS = 5.
After getting the V_URL Create External Window.
LO_API_COMPONENT = WD_THIS->WD_GET_API( ).
LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
LO_WINDOW = LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW(
URL = LW_URL ).
BR,
Jack. -
Display Material |Attachment File in ALV report
Dear All,
I have to make ALV report for mutliple material attachment file.I want to display material wise attachment where user can see in report. We can see attachment list in Service For Object button in MM03 tcode for single material. And i also i do not want attachement list on tool bar where like MM03 is dispalying.
I need ALV report for materialcodewise image/attachment file like,
MaterialCode File
A101 any filename
B101 any filename
So user can click on file base on material, then file will open and he can see image/attachment.
Please guide me for above mentioned query.
Regards,
Shivam.Dear Shivam,
You can have multiple attachments for a sinlge material. You need to consider that in your report.
for getting the list of attachments using the static method CL_BINARY_RELATION=>READ_LINKS.
DATA: lw_BOR TYPE sibflporb.
DATA: lt_rel TYPE OBL_T_RELT,
lw_rel type OBL_S_RELT.
DATA: lt_links TYPE obl_t_link,
lw_links type OBL_S_LINK.
DATA: lo_root TYPE REF TO cx_root.
lw_bor-instid = <Materail no.> "<------- Materail No.
lw_bor-typeid = 'BUS1001006'.
lw_bor-catid = 'BO'.
lw_rel-sign = 'I'.
lw_rel-option = 'EQ'.
lw_rel-low = 'ATTA'. "<----------Attachments
APPEND lw_relt TO lt_rel.
TRY.
CALL METHOD cl_binary_relation=>read_links
EXPORTING
is_object = lw_bor
it_relation_options = lt_rel
IMPORTING
et_links = lt_links.
CATCH cx_root INTO lo_root.
ENDTRY.
Once you get the list of attachment populate your output table using the same.
you can use FM SO_OBJECT_READ to get details of attachment.
Make the column with attachment as hotspot, so that ALV take action in sinlge user click.
In the user-command of ALV write the code to open the attachment.
you can use the FM SO_DOCUMENTS_MANAGER
Hope this helps you.
Regards,
Sachinkumar Mehta -
Error while displaying the attached file
Hi ,
I am doing one task ,where I need to attach a TIFF file to the workitem .
I am getting desired output while attaching the file from presentation server but While doing from application server , I am able to attach the file to corrseponding workitem but when i tried to display it ,it gives an error <b>" Operation could not be performed"</b>
So could you please help me out how to do this ?
I am using a FM "SCMS_UPLOAD" for uploading file from application server .
Is there any other way to upload or read the file .
ThanksHi,
Use the other FM's
'SO_OBJECT_UPLOAD'
OR
If you are trying to read the file from an SAP Application server,
1) "OPEN DATASET" to open the file,
2) "READ DATASET" to read the data into an internal table
3) "CLOSE DATASET".
OR
* Retrieve Data file from Application server(Upload from Unix)
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
OPEN DATASET i_file FOR INPUT IN TEXT MODE.
IF sy-subrc NE 0.
MESSAGE e999(za) WITH 'Error opening file' i_file.
ENDIF.
DO.
* Reads each line of file individually
READ DATASET i_file INTO wa_datatab.
* Perform processing here
ENDDO.
Regards,
Nandha -
How to Display DMS document in Enterprise Portal
Hi All,
I have a scenario as described below.
I have a workitem which goes to user in his/her UWL for execution. When this workitem gets executed it displays an Adobe Interactive form.
Iin this Adobe form i am giving links to DMS(Document Management System) documents. So when this link is clicked the related DMS document files should get displayed.
Thru BAPI i m able to get DMS document number its Object Links and details of the files (PDF,DOC,XLS etc..) attached to it.
But I am not able to display this attached files on my enterprise portal. I debugged in R/3 and found out standard Function Modules which are used to display this attached documents of DMS and wrap them in RFC and called this RFC when user clicks link on Adobe Form in EP.
The problem I m facing is this RFC is not able to display the attached document files of DMS document on Portal front end. it gives error as u201CException condition "NOT_SUPPORTED_BY_GUI" raised., error key: RFC_ERROR_SYSTEM_FAILURE"
The reason behind why it is running successfully in R/3 is, it gets front end as SAPGUI but while we execute it thru portal it does not get frontend type as SAPGUI cause portal always runs in Browser not on SAPGUI.
So, Is there any way to display this DMS document files on Enterprise Portal?? Or is it possible using Knowledge Management?? Or any other standard BAPI or FMs which can be used for the same purpose??
Regards,
DhruvHi Steelman,
You have to create a new iview and include it in the page that youhave created.
There are many types of iviews that you can create.
Please refer these link
http://help.sap.com/saphelp_nw2004s/helpdata/en/f5/eb51590e6a11d7b84900047582c9f7/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/f5/eb50360e6a11d7b84900047582c9f7/content.htm
Revert back for further queries.
Regards,
Sharadha -
Set Attached File name to Table Cell
Hello All,
I have a scenario where:
1. I have a dynamic table.
2.Every Row has a Button for attaching the new File.
3. When we add new Row to the Table, I want to get the attached file name in the corresponding cell. i.e Cell2 in following example.
I have tried doing it this way
The script which I'm using on Add button is
app.execMenuItem("AddFileAttachment");
var o = event.target.dataObjects;
var n = "";
DataNode.Table1.Row1.Cell2.rawValue = "";
if (o !== null) {
for (var i = 0; i < o.length; i += 1) {
n = o[this.parent.index].name;
var countVal = (DataNode.Table1.Row1.instanceManager.count-1);
xfa.resolveNode("DataNode.Table1.Row1["+countVal+"].Cell2").rawValue = n;
But I'm not able to display the attached file name in Cell2 of the Table.
How can we do it?
Thanks and Regards,
NikhilHello All,
I even tried doing the same using http://eslifeline.wordpress.com/2009/04/06/adding-attachments-to-pdf-form/
But I'm not able to add the file name to the table cell.
Can anyone please guide me through this?
Thanks and Regards,
Nikhil Joshi -
Attach files to a Shopping Cart in SRM portal using a ABAP program.
Hello.
We need to attach files to a Shopping Cart using a ABAP program and see them in SRM portal.
Currently we know how to attach files in the backend using the function Xxxxxxxxxx but with this function we can not see the attachment in the SRM portal.
Do you know someway to attach files direclty in the front-end using a program?
Maybe i have to attach first in the back-end and after that transfer to front-end?
I have seen some thread but the solution provided is in the other way arround (transfer from front-end to backend) and then is not useful for my proble.
Thanks in advance.
Kr,
Angel.Hello Angel,
You can attach a file to SC ,and it is a standard functionality provided in SRM.
While creating a Shopping cart,under Documents and attachements tab,there is an option to select a local file and attach it to a SC
If you are looking at attaching the document in SRM and sending it to BE system.(R/3 system), then have a look at SAP note Note 1057932 - FAQ: Atachment transfer to backend, Required Configurations.
The Following BADIs will have to be implemented to allow the above functionality
For transfer of attachments in PO , activate the BADI BBP_CREATE_PO_BACK. Set the values of the following parameters in the
method BBP_CREATE_PO_BACK~Fill_PO_INTERFACE
CV_ATTACH_TRANSFER_ACTIVE = 'X'
CV_ATTACH_BE_STORAGE_CAT = 'DMS_C1_ST'
CV_ATTACH_BE_DOC_TYPE = 'SRM'.
For transfer of attachments in PR, activate the BADI
BBP_CREATE_REQ_BACK. Set the values of the following parameters in the method BBP_CREATE_REQ_BACK~FILL_REQ_INTERFACE
CV_ATTACH_TRANSFER_ACTIVE = 'X'
CV_ATTACH_BE_STORAGE_CAT = 'DMS_C1_ST'
CV_ATTACH_BE_DOC_TYPE = 'SRM'.
Award points if useful.
Thanks
Arshad -
Hi all,
I need to Open a file which is stored in the Data base Table & the Data type is of BLOB so i am populating the data but i need to display the attachment which is stored in the BLOB file when the button is clicked & i am using Oracle 10g
I have been just placed a Button & written the below code in WHEN_BUTTON_PRESSED Trigger & i have tried it out by placing a image icon & WHEN_IMAGE_PRESSED but it's not getting worked
It is Directly Coming in to Exception..
DECLARE
vblob BLOB;
vmime VARCHAR2(30);
BEGIN
select attachment,MIME_TYPE into vblob,vmime
from Table_name_a
where UNIQUE_ID = 16842;--:ITEM_RESULT.DRAWINGNO;
htp.init;
owa_util.mime_header( vmime, false);
-- owa_util.mime_header( 'image/jpeg', false);
-- owa_util.mime_header( 'image/jfif', false);
-- owa_util.mime_header( 'image/gif', false);
-- owa_util.mime_header( 'application/word' , FALSE);-- to read MS WORD doc
owa_util.mime_header( 'application/pdf' , FALSE);-- to read ADObE
message ('attachment type is' ||vmime);
message ('attachment type is' ||vmime);
owa_util.http_header_close;
wpg_docload.download_file(vblob);
exception
when no_data_found then
dbms_output.put_line('1. attachment type is' ||vmime);
-- NULL;
end;
so if any body has any idea Please let me Know
Hope for the Reply.
Thanks & Regards
K Nikethan ReddyHi,
Thanks for the reply,
The Document which u Refer is Showing how to Retrieve the Files from the Local System (i.e by giving the path) but i need to populate it from the database.
K Nikethan Reddy. -
How to attach files in a mail from user4s PC in a Portal aplication
Hello,
I am trying to send a mail with attachments from PL/SQL but I don4t know what must I do to attach files from the user's PC. Our aplication is developed with Portal.
Does anybody knows any java program than can be used like portlet who opens the Outlook??
Thank you.You can use methods listed inside Fuego.IO, but they don't work if you run your process in a client, I mean not the server.
You can use JSP or methods developed in java in order to upload your files and Fuego.IO methods to access them after you upload them.
Another thing you should consider is that if you upload files using Fuego library, there's a size limit for files.
Take a look on How to Use FileChooser on for Client files
Hope this help.
Pablo -
Displaying byte array PDF file in Portal
Hi,
i need to display a PDF file. The PDF is stored in a byte array. This works fine when i run my code (see below) from the .jpf via the debugger/browser, but when i use it as a portlet, in the portal, it does not work ?
Any help is much appreciated.
Thanks
Mark
byte[] pdfDocument = docStore.getPDF();
ServletOutputStream outPdf = response.getOutputStream();
response.setContentType("application/pdf");
outPdf.write(pdfDocument);
outPdf.flush();
outPdf.close();Mark,
Note that the portal sets the content type (e.g, text/html) and encoding
as the portal page starts rendering. In your case, the
setContentType() would be useless since the servlet container won't let
you change it. You can either use a popup browser window for the pdf as
Kunal suggested, or use an iframe if you want to render the pdf inside
the portlet window.
Subbu
Mark Gilleece wrote:
Hi,
i need to display a PDF file. The PDF is stored in a byte array. This works fine when i run my code (see below) from the .jpf via the debugger/browser, but when i use it as a portlet, in the portal, it does not work ?
Any help is much appreciated.
Thanks
Mark
byte[] pdfDocument = docStore.getPDF();
ServletOutputStream outPdf = response.getOutputStream();
response.setContentType("application/pdf");
outPdf.write(pdfDocument);
outPdf.flush();
outPdf.close(); -
IPAD3/IPAD2 :PDF files/ attachments sent in an email displayed inline ( embedded within the main email) in the message text on both my Ipad2 and Ipad three, however the same email displayed the PDF File icons/ attachment on both my Iphone and a friend’s PC. How do i get both my IPAD devices to display the PDF icons/attachments? Bearing in mind if i open the same email over the internet the PDF Icons/attachments display OK!
Has anyone come across this? Your advice/help would be most appreciatedThis happens to me all the time.
If is a one page PDF it seems as though it comes over already open and inline in the body of the email. Multiple page PDF files show as the PDF icon.
I can't find any official documentation of this - other than based on my own experience with PDF attachments in my various email accounts.
Message was edited by: Demo -
How make to know when the attachment file display its visible or hidden
Hi guys,
sorry for my english.
In my scenario I have two button for open or close the attachment file display with the script 'app.execMenuItem("ShowHideFileAttachment");'.
But i don't know when the attachment file display its visible or hidden or detect when the user clicks on show/hidden in the display.
Anybody knows?
Thanks in advance.
ZAMPAZAMPA.Thanks radzmar,
You help me a lot, but how i make to ask to pdf is it panel of attachment its open?
I make this:
event.target.viewState == {overViewMode:7}
but return false all the time when panel of attachment its open and when its close.
ZAMPAZAMPA. -
Cross domain error while displaying .SWF files in portal
Hi Experts,
i am working on EP ,
i am trying to display a .swf file in a iview but that file is giving an error as
Add a cross domain policy file to the external data web server
this swf file is retriving data from BI system.
Please suggest !!
i got a solution of putting a crossdoaim.xml file in root directory but thats not possibleI think two urls will work for you:
Xcelsius SWF with QaaWS through SSL: Cannot access external data
http://livedocs.adobe.com/flex/3/html/help.html?content=security2_04.html -
Display a PDF file from local drive
Hi,
I would like to display a pdf file that is actually stored on the portal server hard drive.
What I have tried to do is link an iFrame element to the url of the file: "D:
MyFolder
myFile.pdf"
But it doesn't work. I have the following error when trying to do that:
com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=D:/MyFolder/myFile.pdf
Does this means that iFrame can only display http URLs ? What are the other ways to easily display pdf files ?? I'am stuck with that problem and can't find any other solution.
I also tried with "servletResponse.getOutputStream().write(fileByteContent);" but the problem is that I am not in a PAR application, and I don't have the servletResponse element and don't know how to get it.
Thanks for your help.
Thibault SchalckHi,
You can not access the .pdf file using the nornal path (c:
), use the following code to open the pdf in ur iframe, this will work i used it in my application.
String sFileName =
strCampCodeVal"_"nReqIdVal+".pdf";
String sFile =
"C:
SBLI
BCP
barcode_files
"+sFileName;
File fFile = new File(sFile);
if ( fFile == null )
System.out.println("System can not download the
file at this time. Please try again later.");
return;
//Checking the file for existence
if ( !fFile.exists() || !fFile.canRead() )
System.out.println("You have specified an
invalid file to download. Please check and try
again.");
return;
//set the content type its important , try with applicatio/pdf also
res.setContentType("application/force-download");
//seting the header
res.setHeader("Content-disposition",
"attachment;filename=" + sFileName);
res.setHeader("Cache-control", "must-revalidate");
ServletOutputStream sosCur = res.getOutputStream();;
//reading the in and writing the stream
BufferedInputStream bisFile = null;
try
byte [] bBuffer = new byte[4096];
bisFile = new BufferedInputStream(new
FileInputStream(fFile));
int nBytes = -1;
while( (nBytes = bisFile.read(bBuffer, 0, 4096))!=-1 )
sosCur.write(bBuffer, 0, nBytes);
catch(Exception ex){
This will resove your issue.All the best..
Regards..
krishna.. -
Problem with attaching file to Sales Order
Hello,
In my company we have the possibility to attach files to sales orders, e.g. pdf files with the printing details.
These files are added by the GUI user, this works fine.
Now we have an extra order creation stream in which a pdf file has to be added to the SO without user interaction.
I found a helpful link ( /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background )
This program creates URL links with no problem, but the file generation is not implemented yet.
I tried to add the file functions to his sample report but still have one problem. The file is uploaded, but not reported as a PDF file in sap. If I select the created attachment SAP allows only the saving of the attachment. After saving the created file is a good PDF file, it opens with PDF-viewers.
Why does SAP not know this is a PDF file and report it as such (and open the pdf viewer when selected).
Thanks, Frank.
source-code:
REPORT zzfb_brc .
* Report Z_RMTIWARI_ATTACH_DOC_TO_BO
* Written By : Ram Manohar Tiwari
* Function : We need to maintain links between Business Object and
* the attachment.Attachment document is basiclally a
* business object of type 'MESSAGE'.In order to maintain
* links, first the attachment will be crated as Business
* Object of type 'MESSAGE' using Message.Create method.
* Need to check if we can also use FM
* 'SO_DOC_INSERT_WITH_ORIG_API1' or SO_OBJECT_INSERT rather
* than using Message.Create method.
* I took this program and removed all the parts for adding URL's and
* notes.
* Include for BO macros
INCLUDE : <cntn01>.
* Load class.
CLASS cl_binary_relation DEFINITION LOAD.
CLASS cl_obl_object DEFINITION LOAD.
PARAMETERS:
* Object_a
p_botype LIKE obl_s_pbor-typeid DEFAULT 'BUS2032', "SO
p_bo_id LIKE obl_s_pbor-instid DEFAULT '0000757830', "example number
* Object_b
p_docty LIKE obl_s_pbor-typeid DEFAULT 'MESSAGE' NO-DISPLAY,
p_msgtyp LIKE sofm-doctp DEFAULT 'EXT' NO-DISPLAY,
* Relationship
p_reltyp LIKE mdoblrel-reltype DEFAULT 'ATTA'.
TYPES: BEGIN OF ty_message_key,
foltp TYPE so_fol_tp,
folyr TYPE so_fol_yr,
folno TYPE so_fol_no,
doctp TYPE so_doc_tp,
docyr TYPE so_doc_yr,
docno TYPE so_doc_no,
fortp TYPE so_for_tp,
foryr TYPE so_for_yr,
forno TYPE so_for_no,
END OF ty_message_key.
DATA : lv_message_key TYPE ty_message_key.
DATA : lo_message TYPE swc_object.
DATA : lt_doc_content TYPE STANDARD TABLE OF soli-line,
ls_doc_content TYPE soli-line.
* Create an initial instance of BO 'MESSAGE' - to call the
* instance-independent method 'Create'.
swc_create_object lo_message 'MESSAGE' lv_message_key.
* Upload the pdf file, for now from the frontend, in the future from
* the server.
DATA:
* dsn(40) TYPE C VALUE '/usr/sap/trans/convert/1.pdf', "server location
l_lines TYPE i. "filelenght
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'c:t1.pdf'
filetype = 'BIN'
IMPORTING
filelength = l_lines
TABLES
data_tab = lt_doc_content.
* no exceptions, the file is there in this example
break brouwersf.
** the coding for the server input, for later
*OPEN DATASET dsn FOR INPUT IN BINARY MODE.
*IF sy-subrc <> 0.
* EXIT.
*ENDIF.
*READ DATASET dsn INTO ls_doc_content.
*WHILE sy-subrc EQ 0.
* APPEND ls_doc_content TO lt_doc_content.
* READ DATASET dsn INTO ls_doc_content.
*ENDWHILE.
*CLEAR ls_doc_content.
*CLOSE DATASET dsn.
* define container to pass the parameter values to the method call
* in next step.
swc_container lt_message_container.
* Populate container with parameters for method
swc_set_element lt_message_container 'DOCUMENTTITLE' 'Title'.
swc_set_element lt_message_container 'DOCUMENTLANGU' 'E'.
swc_set_element lt_message_container 'NO_DIALOG' 'X'.
swc_set_element lt_message_container 'DOCUMENTNAME' p_docty.
swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
swc_set_element lt_message_container 'DocumentSize' l_lines.
swc_set_element lt_message_container 'DocumentContent' lt_doc_content.
swc_call_method lo_message 'CREATE' lt_message_container.
* Refresh to get the reference of create 'MESSAGE' object for attachment
swc_refresh_object lo_message.
* Get Key of new object
swc_get_object_key lo_message lv_message_key.
* Now we have attachment as a business object instance. We can now
* attach it to our main business object instance.
* Create main BO object_a
DATA: lo_is_object_a TYPE sibflporb.
lo_is_object_a-instid = p_bo_id.
lo_is_object_a-typeid = p_botype.
lo_is_object_a-catid = 'BO'.
* Create attachment BO object_b
DATA: lo_is_object_b TYPE sibflporb.
lo_is_object_b-instid = lv_message_key.
lo_is_object_b-typeid = p_docty.
lo_is_object_b-catid = 'BO'.
*TRY.
CALL METHOD cl_binary_relation=>create_link
EXPORTING
is_object_a = lo_is_object_a
is_object_b = lo_is_object_b
ip_reltype = p_reltyp.
* Check if everything OK...who cares!!
COMMIT WORK.Hi,
Welcome to the SDN Forums!!!
You need to supply the PC file extension in the container element 'DOCUMENTTYPE'.
swc_set_element lt_message_container 'DOCUMENTTYPE' p_msgtyp.
In your case change the above statement as below:
swc_set_element lt_message_container 'DOCUMENTTYPE' 'pdf'.
<b>OR</b> change the default value of p_msgtyp to 'PDF'.
Cheers,
Ramki Maley.
Please reward points if the answer is helpful.
For info on awarding points click on this link: https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
Message was edited by: Ramki Maley
Maybe you are looking for
-
Don't have anymore to add. Unsure of steps necessary. Computer does, however see and access old drive when set up as a slave, with the newer HD as the master.
-
How do I undock the viewer window?
A simple feature that was on Motion 4 when you use several screens... I can't find how to undock the main viewer window to put it on a different screen! Thanks
-
Pictures attached to emails do not show.
When I open some emails with pictures embedded or attached, I only get an empty box with a torn page symbol or a red cross or a square, triangle and circle
-
Tkds30xx drivers for labview 5
Hey,..hi! I'm working in a project and i'm using labview 5 to control a tds3014b scope, i download the ivi drivers from ni site but they are for labview 7.1, i don't have a way to upgrade the labview, when i tray to open the tkds30xx.llb to browse t
-
Thinking about moving from Aperture to Lightroom 1) I installed the trial version using the CC app on my Mac = plug-in menu blank. 2) Uninstall, reboot, re-install = same result 3) repeated 1 & 2 on another Mac = same result 4) Took a flyer and signe