Uploading file and creating SAP office documnet in background
Hi,
Is ther any FM which will upload the PDF file from PC in SAP office to create document in SAP
i.e. create SOFM object , so that it can be used for attachmnets purpose?
P.S. I am trying to use SO_OBJECT_UPLOAD , which does not work in background - error is Front-end services are not available.
Regards,
Akshay
To upload in background you need to use OPEN DATASET later modify the record as you want to..also not the Window Path but you need to pass UNIX path.
Similar Messages
-
XI to read the action xml file and create a SAP notification in PM
Hi All
I am new to XI world can you please help me in doing this scenario.
I have to read an XML file and create a Notification in PM module of SAP.
Step by Step help would be great.
Thanks in Advance
SaiHi Sai,
To send data from XML file to SAP (any module) there are 2 ways..
1. File to IDoc and
2. File to RFC...
first Identify the concerned BAPI or IDOC for CREATION OF
NOTIFICATION ...then do the scenarios..
for Step by stp process go through this link...
New to XI
regards,
Ansar. -
File upload using commons-upload-file and tomcat 5.5
Hi,
This is my first post and I hope that I post it at the right place.
I'm trying to upload a file using commons-upload-file and tomcat 5.5.
Is there a way to prevent submitting a big file, If I detect that the file being uploaded exceed a limit that I have fixed ?
i.e. I check the request length, if it's bigger than 1meg I cancel the whole thing and the big file is not transferred.
The problem that I get at the moment is that it seems that the file is transferred even if I close request inputstream or response outputstream. Any help would be appreciated !
Thank you
RedgyWell here is a snippet of my code:
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
long maxSize = 50000;
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if(isMultipart){
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload();
upload.setSizeMax(maxSize);
try {
upload.parseRequest(request);
} catch (FileUploadException ex) {
ex.printStackTrace();
request.getInputStream().close();
response.getWriter().print("blah");
response.sendError(response.SC_INTERNAL_SERVER_ERROR);
response.getOutputStream().close();
}If the file is bigger than 50kb, it Throws the FileUploadException.
But whatever I do, It seems that there is still a connection between my browser and tomcat.. any clue ?
thanks
Edited by: redgyx on Jan 31, 2008 6:17 AM -
Music and Video on Nas in folders but how do i set up itunes on multiple computers to see and use these files and create libraries?
So i have had a itunes set up on my old PC, bought a NAS and copied the folders over to the NAS, i did this incorrectly and so then even when i told the old PC to use that folder it saw all the songs but wasnt able to play the songs as it was looking in the incorrect place.
So now i want my Mac as well as my PC and others to all use the music, videos etc on the NAS they are in itunes friendly folders (as they were compiled this way by the itunes on the old PC.
When i tell the mac to use the itunes library.itl file it sees the song list (about 100gb) but cant see any songs, so i have removed this file to another location for now with the hope to set up a new file and then get it to see the songs on the folder from the NAS.
Can someone tell me how to do this for all the Mac's and PC's on my network as i really want one master library that all use and add too.
Thanks for your help in advance.I have the same question but I am using two pc's
-
What is the best and most efficient way to read a .xls File and create a pipe-delimited .csv File?
Thanks in advance for your review and am hopeful for a reply.
ITBobbyP85You should have no trouble doing this in SSIS. Simply add a data flow with connection managers to an existing .xls file (excel connection manager) and a new .csv file (flat file). Add a source to the xls and destination to the csv, and set the destination
csv parameter "delay validation" to true. Use an expression to define the name of the new .csv file.
In the flat file connection manager, set the column delimiter to the pipe character. -
How can I copy part of a larger PDF file and create a smaller one?
How can I copy part of a larger PDF file and create a smaller one?
Hi,
Copy the content of PDF file in Adobe Reader and paset it to MS Word then create PDF file from the Word file.
This may not work for all PDF files as some PDF files are not created correctly or some content cannot be copied.
Acrobat XI Pro has features to extract/delete/crop pages in PDF files and you can download it from www.adobe.com(Trial version- 30 days free). Or you can upgrade your subscription to Acrobat Plus and see more information at https://www.acrobat.com/acrobatplus/en/home.html
Hisami -
How to upload file and show it's progress
hi
i want to upload files and show the progress of the upload
process how?
thanks in advance.Hey,
I attached a sample I did in Flash 8 using PHP. Hope it
helps.
http://www.cybercussion.com/vault/fileuploading.zip -
When I upload files and correct in lightroom then I export to another named file I keep getting two duplicates. numbered 1 and 2. this never happened before
When I first upload to lightroom I set up a file called new photos. When I correct them I export to a newly named file. But when I go to the newly named
File on my harddrive there are duplicate files
Stan -
How to crop a mp3 file and create a new small one from it?
Hi all,
I would crop a long mp3 sound file and create a new small one with the short part from the long mp3 sound file. How to do it? Anybody can help me?
Thank you very much.
Regard
DavidHave you managed to do this?
I would also like to know how.
Thanks
Jeff Singer -
How do I upload photos from PC to icloud. I have already moved photos to icloud upload file and nothing seems to upload. jnelso1
I have this problem too. Photo stream works fine on iPhone+iPad, but the photos are never loaded to my PC (Win 8.1). My shared folders works fine on iOS and PC, but not My photo stram.
In the beginning, a couple of years ago, it work, but not now (2014).
All iOS are updated, and PC-iCloud software/panel is Active, and Photo stream is activated.
What to do??
Reset all streams on PC? I tried, no result.
I can understand that it takes time to reload all Pictures from iCload to my PC, but I wait Days, weeks... -
Using ABAP Webdynpr How to Upload File and download file in SAP R/3
Hi SAP GURUS ,
I wanted to save employee profile from ESS to SAP so i am creating ESS Application .
For that I go with BDS Approach and create test program for this I got success while uploading file in my folder
which i have created with the help of class and content repository . but when i Using ABAP Webdynpro , i got error FM "BDS_BUSINESSDOCUMENT_CREATEF" message " error_kpro " .
Also I wanted to use KM for storage of Documents and wanted to retrive with help of ABAP Webdynpro .
So pls tell me / mailed me the process , approach and if you have examples .
Thanks in Advance ,
Vishwassap at gmailHi Vishwas,
Check out the thread [Efficient way of saving documents uploaded|Re: Efficient way of saving documents uploaded by users; and check the blog by Raja Thangamani.
Also check the thread [Export Images through Function Modules |Export Images through Function Modules;.
Hope it helps you. -
Upload file and link to sales order in SAP via rfc (C#)
Hello all,
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.
In a previous question I had a little question about the linking, that has been solved, I will post the test program later.
I now can link front end files (pdf's in this case) to the sales orders and it works fine.
Now we are developing a frontend in C# (build by a third party) which creates a sales order via a RFC. We also want that RFC to include the PDF file and link it to the created order.
In the interface of the RFC I included a table with 255 char lines. That is the same as in the example program. the problem is that our partner is yet unable to fill the interface in exact the same way as the example program does, so the linked pdf file is corrupted.
Does anyone have hints how C# should fill the interface table, or how I can change the interface?
code snippid table declaration for pdf table:
IT_PDF LIKE ZETEX_TAB_PDF
and
structure ZETEX_TAB_PDF consists of
LINE CHAR255
the sample program (see other topic on where I got it)
REPORT zzfb_brc LINE-SIZE 260.
* 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:tsimple.pdf'
filetype = 'BIN'
IMPORTING
filelength = l_lines
TABLES
data_tab = lt_doc_content.
* no exceptions, the file is there in this example
clear l_lines.
loop at lt_doc_content into ls_doc_content.
l_lines = l_lines + 255.
endloop.
compute l_lines = l_lines
+ STRLEN( ls_doc_content ).
** 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' 'Some 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' 'PDF'.
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.I woudl suggest you check ORDERS05 IDOC type (ORDCHG message type).
FM - idoc_input_ordchg -
Upload Files into SAP Office Folder in Background
Hi All ,
Has anyone tried uploading file(s) of any type say *.XLS , *.PDF to SAP office folder (Outbox) in the background . I am using the function module 'SO_DOCUMENT_REPOSITORY' with methods "SAVE" , "ATTCREATEFROMPC" and "SEND" . It works fine in foreground without any errors . But when tried to schedule in background , the job stops at the method call "ATTCREATEFROMPC" and gives a message "Database error for <INSERT INTO KPRO> " . It looks like the uderlyiong function module checks for an active GUI and fails during background .
Any thoughts or other solutions would be appreciated ....
ThanksHi,
I think ATTCREATEFROMPC method is for loading the file from frontend PC. It is bound to fail if you run it in background since there is no SAPGUI running it and it can't know the location.
You will need to use some other method to be able to read the files from the APP server, and have your documents on the APP server if you want to run your code in the background.
cheers,
Ajay -
Hi guys,
I do not have anything to do as of the moment, so I want to practice BDC on, lets say SU01. I have seen existing BDC programs here and I am confused as to why some are using read dataset, open dataset, etc. and others are not using them at all. Anyway, what I want to do is to create a flatfile and upload it then populate the fields in t-code SU01.
Also, if its not too much, I want some functional specs or requirements that I can practice here in the office:)
Again, thanks guys and have a nice day!:)
Message was edited by: viraylabHi,
In order to practice BDC you better go through recording first through the Tcode SHBD. There you provide the name for the recording and also the Tcode you want to use for BDC. Once you complete with the recording you press the back button and click on program button in the application toolbar. You get the complete program written to execute the BDC in both session method and also Call transaction Method.
BDC can be done using some flat files in presentation server as well as application server. Data sets will be used for loading the file from application server. For presentation server functions like Ws_Upload and WS_download will be used.
So if you want to create Flat file in presentation server upload the same through BDC you use functions BDC_open group for opening a session,BDC_insert group to insert the flat file and bdc_close group to close after completion of the upload of data.
Give me your mail id so that i can send you some specs for the same.
Hope this helps you.
Pls reward points for useful answers..
Regards,
Ram Mohan -
How to Parse the XML File and create an IDOC?
Hello friends,
I've an xml file which needs to be parsed and create an idoc into SAP to post the New Hire process? I need to create an ABAP for this
Could somebody help me do this?
Thankshere is the sample code for loading local xml file and parsing its using the abov ementioned FM
report y_xml_upload
no standard page heading.
data: filename type string ,
xmldata type xstring .
data: result_xml type standard table of smum_xmltb .
data: return type standard table of bapiret2 .
constants: line_size type i value 255.
data: begin of xml_tab occurs 0,
raw(line_size) type x,
end of xml_tab,
file type string,
size type i.
* upload the xml file
filename = 'C:raja123.xml' .
call function 'GUI_UPLOAD'
exporting
filename = filename
filetype = 'BIN'
has_field_separator = ' '
header_length = 0
importing
filelength = size
tables
data_tab = xml_tab
exceptions
others = 1.
************uncomment this and comment the call of SCMS_BINARY_TO_XSTRING if you dont have this fm in your system.
* if sy-subrc <> 0.
* clear: xmldata.
* exit.
* else.
* data: len type i.
* len = size.
* loop at xml_tab.
* if len <= line_size. exit. endif.
* concatenate xmldata xml_tab-raw(line_size)
* into xmldata in byte mode.
* len = len - line_size.
* endloop.
* if len > 0.
* concatenate xmldata xml_tab-raw(len)
* into xmldata in byte mode.
* len = len - size.
* endif.
* endif.
******* end of comment.
call function 'SCMS_BINARY_TO_XSTRING'
exporting
input_length = size
* FIRST_LINE = 0
* LAST_LINE = 0
importing
buffer = xmldata
tables
binary_tab = xml_tab
exceptions
failed = 1
others = 2
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 'SMUM_XML_PARSE'
exporting
xml_input = xmldata
tables
xml_table = result_xml
return = return .
Regards
Raja
do not forget to assign points to helpful answers
Maybe you are looking for
-
How to calculate Excise on Customs Duty?
Dear All, My client wants to calculate excise on the customs duty for the imported goods for which they can take CENVAT credit. So, the calculation should be on the following components: (Price*Quantity)Customs DutyPacking Currently, the customs duty
-
Sort order of documents in a collaboration room
hi everybody i have a collaboration room where documents are stored in it. the sort order of my folders in the collaboration room is determined by the names of the folders. now there are many folders in folders and at the bottom-level-folder there ar
-
Iphone notes won't display attached pdf
I can create a note with an attached PDF (dragged from a Finder window) on my Mac laptop (10.9.4). The note is synced through iClound and the attachment can be seen and opened on a second Mac laptop (10.9.4). On my iPad Air (IOS7) a paperclip symbol
-
BEx Broadcasting Email recipient issue
Hi Guys, We're having an issue in broadcasting the report. The email has been sent twice to the same user. The broadcasting is triggered via ABAP program in the process chain. For example: User A with a@ abc.com have received email from the broadcast
-
Two Different R/3 Source System IS AFS and IS Retail
Hi Gurus, I am on one implementation project. System landscape is such that there are two ECC systems. One is IS AFS and other is IS Retail. BIW reporting is requried from both the business. My query is whether we should go for two different BIW inst