File Upload Using BAPI
Hi all,
I'm facing a problem during uploading an file through BAPI from WebDynpro Application.
The BAPI im using is 'BAPI_DOCUMENT_CREATE2'.
this works well in R/3 But when used in WebDynpro it is not working. It indicates with an error of 'Error while looking and saving the particular file'.
Could anyone tell me what is the problem
Well you are getting into the specifics of this BAPI, of which I am limited with the help I can give because I don't have access to an ECC system. However if I remember right this BAPI does allow you to specify the upload desitnation and you can override the SAPFTP with SAPFTPA. The parameter name is PF_FTP_DEST if memory serves me. This will instead upload the document from the application server instead of the frontend.
So what you can do is still use the fileUpload UI element in WDA, but then write the file content back into the local App server file system using the ABAP DATASET commands. You can then call the BAPI passing the file location on the application server and telling it to use the SAPFTPA upload method.
The core of the problem is the BAPI was designed to perform the upload itself. It would actually be easier now if it just accepted a binary string as an input parameter that contained the document content. But oh well, you must work with what you have.
Similar Messages
-
Sales order details uploading using BAPI method in LSMW
Hi Guys,
Sales order details uploading using BAPI in LSMW, could you please suggest me, is any standard method or programs is available for this.
I have some queries about this.
1) One header line having multiple line items, in this case we able to upload use the LSMW method,
if possible please tell me the steps.
2) Do we need to do any config changes while uploading data?
3) Flat file should be which format.
4) Steps to process each step wise if possible.
Please help me
Thanks,
Gourisanakar.Hi Gouri Sankar,
would you be able to upload the sales orders with multiple line items using BAPI LSMW?
if so could you plz suggest?
Thanks in advance.
Suresh/ -
File uploads using servlets to oracle8i database
Hi,
Help please, How I can a File Upload using BLOB's into the oracle database, any sugestions...
Thanks
Moacyr
[email protected]Try the jason hunter book Java Servlet Programming for a very good description or the web site hosted by o'reilly
www.servlets.com
Has a very neat java class for decoding multipart mime encoded files (the upload stream from the browser). Seems to accomodate most of the differing browsers intretation of the standard.
Note to Oracle: This should really be handled by the servlet engine as an Oracle extension. Where the servlet engine strips the mime encoding out before the servlet is called placing the decoded file in an associated extension call. ie: cast the request to an Oracle request object which has file uploaded method. -
File uploads using jQuery with jquery.fileupload.js fails in Firefox over SSL
Please see the link below where I originally posted the question.
http://stackoverflow.com/questions/27792614/file-uploads-using-jquery-with-jquery-fileupload-js-fails-in-firefox-over-sslThanks. In my estimation that is exactly the issue. But that doesn't help with a resolution.
The actual file size: 945,991 bytes
If Firefox is miscalculating the length (in Safari/Chrome 945991 and 946241 in Firefox), then Firefox is reporting erroneously and should be raised as a bug in Firefox, would you agree? -
File Upload using Flex/ColdFusion. 2044 error
I am looking for a little more clarity around the file upload using Flex and Cold Fusion. When I run this using my server I get Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.
I did create a regular cfform and had it use my ColdFusion upload form and that worked fine, so I feel good about the upload form. I am starting to think there is a permission error with the Flash Player writing to the folder. When this is ran, it will show the file being 100% loaded but the complete event is never triggered. I put alerts to see where it hits and 100 does show at the same time as my error message. The complete alert never shows. I also put an alert in my cfm page and it never reaches that page to hit it. Whether I use an absolute URL or relative path. I have also tried the urlrequestmethod.post and nothing changed. Thanks in advance. BTW. I am using Flex 3.
This is my mxml file
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:example="com.example.*" horizontalAlign="center" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import com.example.FileDownload
import mx.controls.Label
import com.example.FileUpload]]>
</mx:Script>
<mx:Label id="title" text="File I/O Example" fontSize="24" fontStyle="bold" />
<mx:Text id="subtitle" text="From Programming ActionScript 3.0, Chapter 22: Networking and communication" width="100%" textAlign="center" fontSize="12" /><example:FileDownload
id="fileDownload" creationComplete="fileDownload.init(downloadProgress, cancelDownload);" />
<example:FileUpload id="fileUpload" creationComplete="fileUpload.init(uploadProgress, cancelUpload);" />
<mx:HBox>
<mx:Panel title="Upload File" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
<mx:ProgressBar id="uploadProgress" label="" mode="manual" />
<mx:ControlBar horizontalAlign="right">
<mx:Button id="startUpload" label="Upload..." click="fileUpload.startUpload();" />
<mx:Button id="cancelUpload" label="Cancel" click="fileUpload.cancelUpload();" enabled="false" />
</mx:ControlBar>
</mx:Panel>
<mx:Panel title="Download File" paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
<mx:ProgressBar id="downloadProgress" label="" mode="manual" />
<mx:ControlBar horizontalAlign="right">
<mx:Button id="startDownload" label="Download..." click="fileDownload.startDownload();" />
<mx:Button id="cancelDownload" label="Cancel" click="fileDownload.cancelDownload();" enabled="false" />
</mx:ControlBar>
</mx:Panel>
</mx:HBox></mx:Application>
here is my coldfusion upload script
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script>alert('hello')</script>
<cfset currentPath = getCurrentTemplatePath()>
<cfset currentDirectory = getDirectoryFromPath(currentPath)>
<cfoutput>This directory is #currentDirectory#</cfoutput>
<cffile action="UPLOAD" filefield="Filefield" destination="#currentDirectory#" nameconflict="OVERWRITE"/>
</body>
</html>
here is the package
package
com.example { import flash.events.*;
import flash.net.FileReference;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import mx.controls.Button;
import mx.controls.ProgressBar;
import mx.core.UIComponent;
import mx.controls.Alert;
public class FileUpload extends UIComponent {
// Hard-code the URL of the remote upload script.
private const UPLOAD_URL:String = "upload_script.cfm";
private var fr:FileReference;
// Define reference to the upload ProgressBar component.
private var pb:ProgressBar;
// Define reference to the "Cancel" button which will immediately stop the upload in progress.
private var btn:Button;
public function FileUpload() {}
/*** Set references to the components, and add listeners for the SELECT,
* OPEN, PROGRESS, and COMPLETE events.
public function init(pb:ProgressBar, btn:Button):void {
// Set up the references to the progress bar and cancel button, which are passed from the calling script.
this.pb = pb;
this.btn = btn;
fr =
new FileReference();fr.addEventListener(Event.SELECT, selectHandler);
fr.addEventListener(Event.OPEN, openHandler);
fr.addEventListener(ProgressEvent.PROGRESS, progressHandler);
// fr.addEventListener(Event.COMPLETE, completeHandler);
/*** Immediately cancel the upload in progress and disable the cancel button.
public function cancelUpload():void {fr.cancel();
pb.label =
"UPLOAD CANCELLED";btn.enabled =
false;}
/*** Launch the browse dialog box which allows the user to select a file to upload to the server.
public function startUpload():void {fr.browse();
/*** Begin uploading the file specified in the UPLOAD_URL constant.
private function selectHandler(event:Event):void {
var request:URLRequest = new URLRequest(UPLOAD_URL);
/* request.url = UPLOAD_URL*/request.method = URLRequestMethod.POST;
try
{fr.upload(request);
}catch (error:Error){
trace
("error uploading")}
/*** When the OPEN event has dispatched, change the progress bar's label
* and enable the "Cancel" button, which allows the user to abort the
* upload operation.
private function openHandler(event:Event):void {pb.label =
"UPLOADING";btn.enabled =
true;}
/*** While the file is uploading, update the progress bar's status and label.
private function progressHandler(event:ProgressEvent):void {pb.label =
"UPLOADING %3%%";pb.setProgress(event.bytesLoaded, event.bytesTotal);
if(event.bytesLoaded==event.bytesTotal){
trace(Event.COMPLETE)Alert.show(
"100")}
/*** Once the upload has completed, change the progress bar's label and
* disable the "Cancel" button since the upload is already completed.
private function completeHandler(event:Event):void {Alert.show(
"in function")pb.label =
"UPLOADING COMPLETE";pb.setProgress(0, 100);
btn.enabled =
false;}Presumably you need to add a result handler to your request.
-
I am a new servlet programmer.......
iam using tomcat server......
can any one pls help in writing code for file upload using servlets and jsp without using multipart class or any other class like that....
Please URGENT..Slow down! "Urgent" is from your perspective alone. I, myself, am not troubled or worried in the least.
hi ugniss
thanks for ur reply....sorry i was not
y i was not asked not to use multipart class or any
other class like that...is there any other
possibility to do file uploading from jsp to
servlet...
Just as an aside, a JSP is a Servlet. But even if I move beyond that, the question does not make sense. If you want a "JSP to upload to a Servlet", then simply do so in memory. You are still (likely) within the same scope of a given request. However, if instead you are referring to a JSP that is displayed on a browser, then really you are talking about HTML, which is what the browser will receive. And since you are now talking about a browser, your only real, viable option is a multi-part file upload. So, it is either server or it is browser. And either way, the question leads to very established options, as outlined above.
the main concept is.. in the browser the user selects
a particular file and clicks the button upload..after
clicking upload the jsp should sent the file to the
servlet in streams...there the servlet gets in and
saves in a server location........this is wat i hav
to do...
Okay. So, after reading my previous (redundant) paragraph, we have arrived at the crux of the issue. You have a JSP that will be output as HTML to a client (browser) which you want to upload content to your server (handled by a Servlet). So, you are now stuck again with multi-part. The requirement to not use multi-part is non-sensical. You can overcome it, say, if you write your own applet or standalone Swing client. However, if your users are invoking this functionality from a browser, you are limited by the options that W3C has provided you. Use multi-part.
is there aby possibilty to do this.....can any one
pls help....Take the advice to download and review Jakarta Commons FileUpload. Inform your management that their requirement makes no technical sense. Research on your own. There are dozens of examples (and tutorials) on file upload using multi-part. Embrace it. Live it. Love it.
- Saish -
Material master upload using BAPI...
Helo SDNers,
I am trying to upload material master using BAPI.
data : begin of t_mat occurs 0,
material type matnr, " Material - MATNR
ind_sec type mbrsh, " Industry sector - MBRSH
mat_typ type mtart, " Material type - MTART
plant type werks_d, " plant - WERKS_D
stge_loc type lgort_d, " Storage location - LGORT_D
sales_org type vkorg, " Sales org - VKORG
distr_chan type vtweg, " Distribution channel - VTWEG
mat_desc type maktx, " Material description - MAKTX
base_uom type meins, " Base unit of measurement- MEINS
mat_grp type matkl, " material group - MATKL
division type spart, " Division - SPART
gen_itmcatmgrp type MTPOS, " General item category group -MTPOS_MARA
gros_weight type BRGEW, " Gross weight - BRGEW
net_weight type NTGEW, " Net weight - NTGEW
mat_grppack type MAGRV, " Material group pack - MAGRV
delv_plant type DWERK_EXT, " Delivery plant
tax_clasif type TAXKM, " Tax classification
item_catgrp type MTPOS, " Item category group
aval_check type MTVFP, " Availability check
trans_grp type TRAGR, " Transportation group
load_grp type LADGR, " Loading group
pur_grp type EKGRP, " Purchasing grp,
mrp_type type DISMM, " MRP type
mrp_contr type DISPO, " MRP Controller
lot_size type DISLS, " Lot size,
gr_processing type WEBAZ, " GR Processing time
schdmargin_key type FHORI, " Schedule margin key
batch_mangment type XCHPF, " Batch management
strog_cond type RAUBE, " Storage condition
source_list type KORDB, " Source list
mrp_grp type DISGR, " MRP group
reorder_point type MINBE, " Reorder point
procurement_type type BESKZ, " Procurement type
sp_procurement_type type SOBSL, " Special Procurement type
inhouse_prod type DZEIT, " Inhouse production
safety_stock type EISBE, " Safety stock
strategy_group type STRGR, " Strategy group
availabilty_grp type MTVFP, " Availability group
batch_entry type KZECH , " Batch entry
valuation_class type BKLAS, " Valuation class
price_control type VPRSV, " Price control
moving_price type VERPR, " Moving price
standard_price type STPRS, " Standard price - STPRS
langu(2), " Language
end of t_mat.
this is my internal table i have these many content in my excel file
please explain me what the following code does .....
move-corresponding wa to bapi_head.
bapi_head-basic_view = 'X'.
bapi_head-sales_view = 'X'.
bapi_head-purchase_view = 'X'.
bapi_head-mrp_view = 'X'.
bapi_head-forecast_view = 'X'.
bapi_head-work_sched_view = 'X'.
bapi_head-prt_view = 'X'.
bapi_head-storage_view = 'X'.
bapi_head-warehouse_view = 'X'.
bapi_head-quality_view = 'X'.
bapi_head-account_view = 'X'.
bapi_head-cost_view = 'X'.
and also please help with an example how do i upload data from IT (my internal table) using BAPI.
Regards,
Ranjith NHi ,
First you upload your Excel data into Internal Table.
Move all data to Respected BAPI Structures.
and then call 'BAPI_MATERIAL_SAVEDATA' and pass all structures.
Sample Code:
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_fname
i_begin_col = v_c1
i_begin_row = l_v_r
i_end_col = v_cl
i_end_row = v_rl
TABLES
intern = i_excel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc eq 0.
LOOP AT i_excel.
CASE i_excel-col.
WHEN 0001.
wa_final-field1 = i_excel-value.
WHEN 0002.
wa_final-field2 = i_excel-value.
WHEN 0003.
wa_final-field3 = i_excel-value.
WHEN 0004.
wa_final-field4 = i_excel-value.
WHEN 0005.
wa_final-field5 = i_excel-value.
WHEN 0006.
wa_final-field6 = i_excel-value.
WHEN 0007.
wa_final-field7 = i_excel-value.
WHEN 0008.
wa_final-field8 = i_excel-value.
WHEN 0009.
wa_final-field9 = i_excel-value.
WHEN 0010.
wa_final-field10 = i_excel-value.
WHEN 0011.
wa_final-field11 = i_excel-value.
WHEN 0012.
wa_final-field12 = i_excel-value.
WHEN 0013.
wa_final-field13 = i_excel-value.
WHEN 0014.
wa_final-field14 = i_excel-value.
WHEN 0015.
wa_final-field15 = i_excel-value.
WHEN 0016.
wa_final-field16 = i_excel-value.
ENDCASE.
*-at end of each row, a record needs to append the internal table
AT END OF row.
APPEND wa_final TO i_final.
CLEAR: wa_final.
ENDAT.
ENDLOOP.
ENDIF.
Move all your Inatrnal tbale data to respected BAPI structures
*& Form MOVE_HEADDATA
* Move Header data to BAPI Header.
FORM move_headdata .
Move Header Data to BAPI Fields
MOVE : wa_final-matnr TO wa_mathead-material,
wa_final-mbrsh TO wa_mathead-ind_sector,
wa_final-mtart TO wa_mathead-matl_type.
To get UOM
SELECT SINGLE * FROM t006 INTO t006 WHERE msehi = wa_final-meins.
MOVE: t006-isocode TO wa_mara-base_uom_iso,
c_x TO wa_marax-base_uom_iso.
**-- Move Material Descriptions
PERFORM move_materialdescription .
ENDFORM. " MOVE_HEADDATA
*& Form MOVE_CLIENTDATA
* Move Basic data to Clientdata
FORM move_clientdata .
MOVE : wa_final-spart TO wa_mara-division,
wa_final-bismt TO wa_mara-old_mat_no,
wa_final-extwg TO wa_mara-extmatlgrp,
wa_final-mtpos_mara TO wa_mara-item_cat,
wa_final-groes TO wa_mara-size_dim,
wa_final-zeivr TO wa_mara-doc_vers,
wa_final-ekwsl TO wa_mara-pur_valkey.
MOVE : c_x TO wa_marax-division,
c_x TO wa_marax-old_mat_no,
c_x TO wa_marax-extmatlgrp,
c_x TO wa_marax-item_cat,
c_x TO wa_marax-size_dim,
c_x TO wa_marax-doc_vers,
c_x TO wa_marax-pur_valkey.
ENDFORM. " MOVE_CLIENTDATA
*& Form MOVE_STORAGELOCATIONDATA
* Move storage location data to STORAGELOCATIONDATA
FORM move_storagelocationdata .
CLEAR: wa_mard,wa_mardx.
MOVE : wa_final-werks TO wa_mard-plant,
wa_final-lgort TO wa_mard-stge_loc.
MOVE : wa_final-werks TO wa_mardx-plant,
wa_final-lgort TO wa_mardx-stge_loc.
ENDFORM. " MOVE_STORAGELOCATIONDATA
*& Form MOVE_SALESDATA
* Move Salesdate to SALESDATA
FORM move_salesdata .
MOVE : wa_final-vkorg TO wa_mvke-sales_org,
wa_final-vtweg TO wa_mvke-distr_chan,
wa_final-dwerk TO wa_mvke-delyg_plnt,
wa_final-versg TO wa_mvke-matl_stats,
wa_final-ktgrm TO wa_mvke-acct_assgt,
wa_final-mtpos TO wa_mvke-item_cat,
wa_final-mvgr1 TO wa_mvke-matl_grp_1,
wa_final-mvgr2 TO wa_mvke-matl_grp_2,
wa_final-mvgr3 TO wa_mvke-matl_grp_3,
wa_final-mvgr4 TO wa_mvke-matl_grp_4,
wa_final-mvgr5 TO wa_mvke-matl_grp_5,
wa_final-vrkme TO wa_mvke-sales_unit.
MOVE : wa_final-vkorg TO wa_mvkex-sales_org,
wa_final-vtweg TO wa_mvkex-distr_chan,
c_x TO wa_mvkex-delyg_plnt,
c_x TO wa_mvkex-matl_stats,
c_x TO wa_mvkex-acct_assgt,
c_x TO wa_mvkex-item_cat,
c_x TO wa_mvkex-matl_grp_1,
c_x TO wa_mvkex-matl_grp_2,
c_x TO wa_mvkex-matl_grp_3,
c_x TO wa_mvkex-matl_grp_4,
c_x TO wa_mvkex-matl_grp_5,
c_x TO wa_mvkex-sales_unit.
ENDFORM. " MOVE_SALESDATA
*& Form MOVE_MATERIALDESCRIPTION
* Move MATERIALDESCRIPTION to Material Description
FORM move_materialdescription .
CLEAR: wa_makt,i_makt.
MOVE : wa_final-maktx TO wa_makt-matl_desc,
sy-langu TO wa_makt-langu.
APPEND wa_makt TO i_makt.
CLEAR wa_makt.
ENDFORM. " MOVE_MATERIALDESCRIPTION
*& Form basic_data
FORM basic_data .
**-- Move Material Data at Storage Location Level
PERFORM move_storagelocationdata .
MOVE : wa_final-vkorg TO wa_mvke-sales_org,
wa_final-vtweg TO wa_mvke-distr_chan.
MOVE : wa_final-vkorg TO wa_mvkex-sales_org,
wa_final-vtweg TO wa_mvkex-distr_chan.
**-- Move Material Data at Client Level
PERFORM move_clientdata .
IF ALT_UOM is not Given in flat file Move BASEUOM as ALT_UOM
IF wa_final-meinh EQ c_space.
MOVE : wa_final-meins TO wa_marm-alt_unit,
wa_final-meins TO wa_marmx-alt_unit.
ELSE.
MOVE : wa_final-meinh TO wa_marm-alt_unit,
wa_final-umren TO wa_marm-numerator.
MOVE : wa_final-meinh TO wa_marmx-alt_unit,
c_x TO wa_marmx-numerator.
ENDIF.
MOVE : wa_final-numtp TO wa_marm-ean_cat,
wa_final-brgew TO wa_marm-gross_wt,
wa_final-volum TO wa_marm-volume,
wa_final-voleh TO wa_marm-volumeunit,
wa_final-gewei TO wa_marm-unit_of_wt.
APPEND wa_marm TO i_marm.
CLEAR wa_marm.
MOVE : c_x TO wa_marmx-ean_cat,
c_x TO wa_marmx-gross_wt,
c_x TO wa_marmx-volume,
c_x TO wa_marmx-volumeunit,
c_x TO wa_marmx-unit_of_wt.
APPEND wa_marmx TO i_marmx.
CLEAR wa_marmx.
ENDFORM. " basic_data
*& Form sales_data1
FORM sales_data1 .
Move Sales & Plant Data
MOVE : wa_final-werks TO wa_marc-plant,
wa_final-mtvfp TO wa_marc-availcheck,
wa_final-ladgr TO wa_marc-loadinggrp,
wa_final-prctr TO wa_marc-profit_ctr.
MOVE : wa_final-werks TO wa_marcx-plant,
c_x TO wa_marcx-availcheck,
c_x TO wa_marcx-loadinggrp,
c_x TO wa_marcx-profit_ctr.
MOVE: wa_final-tragr TO wa_mara-trans_grp,
c_x TO wa_marax-trans_grp.
**-- Move Sales Data
PERFORM move_salesdata .
Move Tax Data
MOVE : 'JP' TO wa_mlan-depcountry_iso,
'MWAR' TO wa_mlan-tax_type_1,
wa_final-taklv TO wa_mlan-taxclass_1.
APPEND wa_mlan TO i_mlan.
CLEAR wa_mlan.
ENDFORM. " sales_data1
*& Form purchase_data
FORM purchase_data .
Move Plant Data
MOVE : wa_final-werks TO wa_marc-plant,
wa_final-werks TO wa_marcx-plant.
Move PO data
MOVE : wa_final-ekgrp TO wa_marc-pur_group,
wa_final-kautb TO wa_marc-auto_p_ord,
wa_final-usequ TO wa_marc-quotausage,
wa_final-kordb TO wa_marc-sourcelist,
c_x TO wa_marcx-pur_group,
c_x TO wa_marcx-auto_p_ord,
c_x TO wa_marcx-quotausage,
c_x TO wa_marcx-sourcelist.
MOVE: wa_final-matkl TO wa_mara-matl_group,
wa_final-bstme TO wa_mara-po_unit,
c_x TO wa_marax-matl_group,
c_x TO wa_marax-po_unit.
ENDFORM. " purchase_data
*& Form mrp_data
FORM mrp_data .
**-- Move Material Data at Storage Location Level
PERFORM move_storagelocationdata .
Move All MRP data
MOVE: wa_final-diskz TO wa_mard-mrp_ind,
c_x TO wa_mardx-mrp_ind.
MOVE : wa_final-werks TO wa_marc-plant,
wa_final-dismm TO wa_marc-mrp_type,
wa_final-dispo TO wa_marc-mrp_ctrler,
wa_final-beskz TO wa_marc-proc_type,
wa_final-sobsl TO wa_marc-spproctype,
wa_final-mtvfp TO wa_marc-availcheck,
wa_final-minbe TO wa_marc-reorder_pt,
wa_final-fxhor TO wa_marc-pl_ti_fnce,
wa_final-disls TO wa_marc-lotsizekey,
wa_final-bstmi TO wa_marc-minlotsize,
wa_final-bstma TO wa_marc-maxlotsize,
wa_final-bstfe TO wa_marc-fixed_lot,
wa_final-mabst TO wa_marc-max_stock,
wa_final-ausss TO wa_marc-assy_scrap,
wa_final-dzeit TO wa_marc-inhseprodt,
wa_final-plifz TO wa_marc-plnd_delry,
wa_final-webaz TO wa_marc-gr_pr_time,
wa_final-fhori TO wa_marc-sm_key,
wa_final-eisbe TO wa_marc-safety_stk,
wa_final-strgr TO wa_marc-plan_strgp,
wa_final-wzeit TO wa_marc-replentime,
wa_final-lgfsb TO wa_marc-sloc_exprc,
wa_final-sbdkz TO wa_marc-dep_req_id,
wa_final-kzbed TO wa_marc-grp_reqmts,
wa_final-miskz TO wa_marc-mixed_mrp,
wa_final-stlal TO wa_marc-alternative_bom,
wa_final-stlan TO wa_marc-bom_usage.
MOVE : wa_final-werks TO wa_marcx-plant,
c_x TO wa_marcx-mrp_type,
c_x TO wa_marcx-mrp_ctrler,
c_x TO wa_marcx-proc_type,
c_x TO wa_marcx-spproctype,
c_x TO wa_marcx-availcheck,
c_x TO wa_marcx-reorder_pt,
c_x TO wa_marcx-pl_ti_fnce,
c_x TO wa_marcx-lotsizekey,
c_x TO wa_marcx-minlotsize,
c_x TO wa_marcx-maxlotsize,
c_x TO wa_marcx-fixed_lot,
c_x TO wa_marcx-max_stock,
c_x TO wa_marcx-assy_scrap,
c_x TO wa_marcx-inhseprodt,
c_x TO wa_marcx-plnd_delry,
c_x TO wa_marcx-gr_pr_time,
c_x TO wa_marcx-sm_key,
c_x TO wa_marcx-safety_stk,
c_x TO wa_marcx-plan_strgp,
c_x TO wa_marcx-replentime,
c_x TO wa_marcx-sloc_exprc,
c_x TO wa_marcx-dep_req_id,
c_x TO wa_marcx-grp_reqmts,
c_x TO wa_marcx-mixed_mrp,
c_x TO wa_marcx-alternative_bom,
c_x TO wa_marcx-bom_usage.
ENDFORM. " mrp_data
*& Form accounting_data
FORM accounting_data .
Move Plant Data
MOVE: wa_final-werks TO wa_marc-plant,
wa_final-werks TO wa_marcx-plant.
Move Account Data
MOVE : wa_final-werks TO wa_mbew-val_area,
wa_final-bklas TO wa_mbew-val_class,
wa_final-vprsv TO wa_mbew-price_ctrl,
wa_final-verpr TO wa_mbew-moving_pr,
wa_final-peinh TO wa_mbew-price_unit,
wa_final-stprs TO wa_mbew-std_price.
MOVE : wa_final-werks TO wa_mbewx-val_area,
c_x TO wa_mbewx-val_class,
c_x TO wa_mbewx-price_ctrl,
c_x TO wa_mbewx-moving_pr,
c_x TO wa_mbewx-price_unit,
c_x TO wa_mbewx-std_price.
ENDFORM. " accounting_data
*& Form cost_data
FORM cost_data .
Move Plant Data
MOVE: wa_final-werks TO wa_marc-plant,
wa_final-awsls TO wa_marc-variance_key,
wa_final-verid TO wa_marc-prodverscs, " Production Version
wa_final-werks TO wa_marcx-plant,
c_x TO wa_marcx-variance_key,
c_x TO wa_marcx-prodverscs.
Move Cost Data
MOVE : wa_final-werks TO wa_mbew-val_area,
wa_final-bklas TO wa_mbew-val_class,
wa_final-vprsv TO wa_mbew-price_ctrl,
wa_final-ekalr TO wa_mbew-qty_struct.
MOVE : wa_final-werks TO wa_mbewx-val_area,
c_x TO wa_mbewx-val_class,
c_x TO wa_mbewx-price_ctrl,
c_x TO wa_mbewx-qty_struct.
ENDFORM. " cost_data
Call All Structures in to BAPI
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = wa_mathead
clientdata = wa_mara
clientdatax = wa_marax
plantdata = wa_marc
plantdatax = wa_marcx
storagelocationdata = wa_mard
storagelocationdatax = wa_mardx
valuationdata = wa_mbew
valuationdatax = wa_mbewx
salesdata = wa_mvke
salesdatax = wa_mvkex
IMPORTING
return = i_return
TABLES
materialdescription = i_makt
unitsofmeasure = i_marm
unitsofmeasurex = i_marmx
taxclassifications = i_mlan.
IF i_return-type = 'A' OR i_return-type = 'E' .
DATA : l_v_string TYPE string,
l_v_msg1 TYPE string,
l_v_msg2 TYPE string.
MOVE i_return-message TO l_v_string.
CONDENSE l_v_string.
PERFORM fill_error_table USING 'E'
'ZMSG_MM'
'098'
v_reccon
l_v_string
v_error = v_error + 1.
CLEAR: l_v_string.
ELSEIF i_return-type = 'S'.
PERFORM fill_error_table USING 'S'
i_return-id
i_return-number
i_return-message_v1
i_return-message_v2
i_return-message_v3
i_return-message_v4.
v_success = v_success + 1.
ENDIF .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
IF sy-subrc = 0.
COMMIT WORK AND WAIT. "for the update to table Transcation
ENDIF.
Regards,
Siva. -
Material Master Upload using Bapi getting error "****** not a valid unit of
Hi Gurus,
i am uploading material master using BAPI Material_master_save_data , where the volume and Unit of Volume is Blank, Still i am getting error as "****** not a valid unit of volume ".kindly help me to resolve the issue.Many Thanks In advance.Jurgen,
I could able to solve the issue for invalid unit Error ....Now i am getting **** unit of measure is not defined , pls check your entry or else i am getting alternate unit of mesure is same as base unit of measure .
I have used below logic for Purchase Order Unit and Base Unit of measure .
if wa_upload-unmsr EQ wa_upload-ord_uom .
bapi_mara1-base_uom = wa_upload-unmsr.
bapi_mara1-po_unit = wa_upload-ord_uom .
elseif wa_upload-unmsr NE wa_upload-ord_uom.
wa_upload-ord_uom = wa_upload-alt_uom.
bapi_mara1-po_unit = wa_upload-ord_uom.
endif.
Many Thanks for your help. -
Reliable file upload using JDev, AS and other
Hello,
I'm not sure this is the right place to post this message, sorry if I was wrong to put it here.
The question is our company is developing software, for active data exchange with other systems. We decided to exchange in xml format, by means of both web services and web interface (so that exchange could happen both automatically and on user request). We use JDev to develop, Oracle AS to deploy application. Systems we exchange can use various platforms, in fact, it doesn't matter what exactly they use. The question is we need a reliable way to exchange large (sometimes small, but can be 1Gb or, for example, 10Gb) files, maybe with appropriate security, so that it could continue if something happens with network connection.
One simple decision is to have a web service that accepts, for example, 100K at a time, and another service continuously calls it until file is transfered. So it can check response code. But are there better decisions? I think, there are libraries or smth like this?
Thanks in advance, believe, it's a right place to get help.
ValeriyAnother, simpler (we think), such package is Jenkov HTTP Multipart File Upload. It's a servlet filter which can work in front of both servlets and JSP's. The servlet filter parses the uploaded file and stores it temporarily on the servers disk. When the servlet or JSP executes afterwards, it can obtain all the information about the file, from the request attributes. There is a decent manual for HTTP Multipart File Upload on the website.
Just search for "Jenkov HTTP Multipart" on Google and you'll find it. HTTP Multipart is free, open source, Apache Licsense. -
HTML File Upload - using DAD - Error
I have set up my document table, the document upload package is in there, but my HTML for the file upload is not working correctly:
DAD info
DAD Name: /pls/portal
Document Table: dw_target.documents
Document Access Procedure: document_api.download
here is the upload HTML:
<html>
<head>
<title>test upload</title>
</head>
<body>
<form enctype="multipart/form-data" action="http://MYURL:7777/portal/pls/portal/dw_target.document_api.download" method="post">
File to upload: <input type="file" name="file"><br>
<input type="submit" value="Upload">
</form>
</body>
</html>
But i get this error when i try to upload a doc:
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
anyone have any insight on how to get the file upload to work (specifically how to configure the HTML to correctly use the upload process?
using Oracle App Server 10g
jasonPschar,
What is "dw_target.documents"?
Joel -
File Upload using Tomcat 5.x Apache 2.x
Hi,
Once I updated my tomcat 5.x to apache 2.x and ran my upload jsp code using java api i wrote to upload file to server, all pictures or videos received seems distorted.. At first i thought of bit shift or something but when i upload a textfile all look right.. Anyone know what the heck is going on before i disect my code.
thanks
henrymake sure your modjk logs don't have any errors.
Here's a peice out of my httpd.conf
#ADDed Oct 15,2003, seemed to remove modjk error
AddType multipart/form-data .gif .png .jpg .peg .jpeg .jpeI used to get strange modjk logged errors.
Also did you compile jk2 from source???
com.oreilly.servlet --- cos
http://www.servlets.com/cos/index.html
http://www.servlets.com/cos/cos-05Nov2002.zip
But if my bit shift is correct wouldn't my regular textfile upload be distored?From what I remember, the problem is something to do with logical AND or OR, with the bits. Apache receives it fine, passess it through jk, and and either the most sig or least gets lost. Image data is critical as every bit counts, text file, you may not notice it(white space), or every nTH file upload might fail.
here are the version numbers of software I use, and have compiled all from source.
apache-httpd-2.0.47
tomcat-4.1.27
jk2-connectors-2.0.2 -
Hi All,
I want to upload single or multiple CSV files using a user interface written in WebDynpros. The files will then be parsed and converted to XML.
I did something similar with jsps earlier but am not sure how to go about it with WebDynpros.
If anyone has already done something similar then please share your views.
Thanks in advance.
NoamanHi,
check this link
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web dynpro sample applications and tutorials.htm#ui
File Upload/Download 23/30
Tutorials will help you.
Regards,
RK -
Guys,
I am trying to upload a new document using PRC API's. Below is required code snippet that i am using.
IRemoteDocument remoteDoc = documentManager.createRemoteDocument(folderID,dataSourceID,document.getPath()); remoteDoc.setOverrideName(document.getName()); remoteDoc.setOverrideDescription(document.getDescription()); remoteDoc.setType("http://www.plumtree.com/dtm/mime", document.getFileType());int docID = -1;docID = remoteDoc.save();
dataSourceID - ID of my file upload datasource , document - is my java object which has all the document related properties such as , name , description , MIME type of document etc..Below is different document path's(scenarios) that I have triedc:\work\sample.txt\\servername\work\sample.txthttp:\\appserver:7001\appName\uploadfiles\sample.txt
When I execute this code from my application i get a below error.
com.plumtree.remote.prc.PortalException: null; nested exception is: java.rmi.RemoteException: Error in function PTDataSource.ImportDocument(vDocumentLocationBagAsXML == '<?xml version="1.0" encoding="ucs-2"?><PTBAG V="1.1" xml:space="preserve"><I N="PTC_DTM_SECT">1001</I><S N="PTC_DOC_ID">application/msword</S><S N="PTC_UNIQUE">\\PHUSEH-L33664.NA.novartis.net\work\sample.doc</S></PTBAG>', lDocumentTypeID == 100, pCard == com.plumtree.server.impl.directory.PTCard@c27b6f, bSummarize == false, pProvider == null): Error in function PTDataSource.ImportDocument (vDocumentLocationBagAsXML == <?xml version="1.0" encoding="ucs-2"?><PTBAG V="1.1" xml:space="preserve"><S N="PTC_DOC_ID">application/msword</S><I N="PTC_DTM_SECT">1001</I><S N="PTC_UNIQUE">\\PHUSEH-L33664.NA.novartis.net\work\sample.doc</S></PTBAG>, lDocumentTypeID == 100, pCard == com.plumtree.server.impl.directory.PTCard@c27b6f, bSummarize == false, pProvider == null): SOAP fault: faultcode='soapenv:Server.userException' faultstring='java.lang.NullPointerException' at com.plumtree.remote.prc.DocumentWrapper.save()
Below is my environment.Plumtree is running on Weblogic 8.1 (Solaris OS) , ptupload webservice is running on weblogic8.1 solaris,My upload document portlet is running on weblogic 8.1 (Windows OS)
If anyone has any working sample code please send it to my ID [email protected] or else please upload it here.Thank You ,
Dan.make sure your modjk logs don't have any errors.
Here's a peice out of my httpd.conf
#ADDed Oct 15,2003, seemed to remove modjk error
AddType multipart/form-data .gif .png .jpg .peg .jpeg .jpeI used to get strange modjk logged errors.
Also did you compile jk2 from source???
com.oreilly.servlet --- cos
http://www.servlets.com/cos/index.html
http://www.servlets.com/cos/cos-05Nov2002.zip
But if my bit shift is correct wouldn't my regular textfile upload be distored?From what I remember, the problem is something to do with logical AND or OR, with the bits. Apache receives it fine, passess it through jk, and and either the most sig or least gets lost. Image data is critical as every bit counts, text file, you may not notice it(white space), or every nTH file upload might fail.
here are the version numbers of software I use, and have compiled all from source.
apache-httpd-2.0.47
tomcat-4.1.27
jk2-connectors-2.0.2 -
How to get full path of a file uploaded using file control on a jsp ?
Hi all...
I have a jsp on which i am using a file element (input type="file") to upload files present on the physical file system.. Thats working fine.. But i want to retrieve the full path of the file uploaded for further computation.
What are the possible ways which can give me the full path ?? (e.g. "D:\data\text\Output.txt" )
Thanks all for attending the question..
Regards
PrasadSome browsers send the full path. Some do not.
You can not affect this in any way shape or form.
All you can count on receiving is a filename - no path information.
So you will have to have some other way for the user to pass along this information.
If they are uploading to a "remote web site" they could specify a folder to put the uploaded file in.
You could classify it and put all image files in "images" and all script files in "scripts" etc etc by default, and let the user deal with it in their own HTML.
Hope this helps,
evnafets -
Error in image file upload using dreamweaver
Greeting to you all!
Please I need you PRO help. My case seem similar to some of the ones I have seen but my code is completely different.
I wrote this code below using PHP in Dreamweaver and its used to upload images to MySQl database. Now when I upload about 6 images, it shows File Uploaded Successfully. But if I try to upload any thing below 6 images, it will refuse to upload and will echo Upload Failed.
<?php
if(isset($_POST['submit']))
$projid=$_POST['projid'];
$projname=$_POST['projname'];
$name=basename($_FILES['file_upload']['name']);
$t_name=$_FILES['file_upload']['tmp_name'];
$dir='upload';
if(move_uploaded_file($t_name,$dir."/".$name))
$nameone=basename($_FILES['file_uploadone']['name']);
$t_name=$_FILES['file_uploadone']['tmp_name'];
$dir='upload1';
if(move_uploaded_file($t_name,$dir."/".$name))
$nametwo=basename($_FILES['file_uploadtwo']['name']);
$t_name=$_FILES['file_uploadtwo']['tmp_name'];
$dir='upload2';
if(move_uploaded_file($t_name,$dir."/".$name))
$namethree=basename($_FILES['file_uploadthree']['name']);
$t_name=$_FILES['file_uploadthree']['tmp_name'];
$dir='upload3';
if(move_uploaded_file($t_name,$dir."/".$name))
$namefour=basename($_FILES['file_uploadfour']['name']);
$t_name=$_FILES['file_uploadfour']['tmp_name'];
$dir='upload4';
if(move_uploaded_file($t_name,$dir."/".$name))
$namefive=basename($_FILES['file_uploadfive']['name']);
$t_name=$_FILES['file_uploadfive']['tmp_name'];
$dir='upload5';
if(move_uploaded_file($t_name,$dir."/".$name))
mysql_select_db ($database_ProjMonEva,$ProjMonEva);
$qur="insert into tbl_images (imageid, projid, projname, name, path, nameone, pathone, nametwo, pathtwo, namethree, paththree, namefour, pathfour, namefive, pathfive) values ('','$projid','$projname','$name','upload/$name','$nameone','upload/$nameone','$nametwo', 'upload/$nametwo','$namethree','upload/$namethree','$namefour','upload/$namefour','$namefi ve','upload/$namefive')";
$res=mysql_query($qur,$ProjMonEva);
echo 'File uploaded successful';
else
echo 'upload failed!';
?>
I see the problem to come from the echo but I am stock and dont know how to correct it. Can any one please help me.
Thank you in advance MikeHi Bregent,
I have been able to resolve the issue. I modified the code this way: This I believe will help those having the same issues.
These is how I was able to achieve it.
1. I divided the code into two parts called addnew.php and addnewproject.php.
The addnewproject.php as seen below will call the addnew.php when the submit button on addnewproject.php is clicked
<form action="addnew.php" method="POST" id="Add New Project" enctype="multipart/form-data">
<div align="center">
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="formcells4"><strong id="subheaders">Core Details</strong></td>
<td></td>
</tr>
<tr>
<td id="dates">*Code (Eg. 2104/12/AB23):<br />
<label for="projcode"></label>
<span id="sprytextfield1">
<input type="text" name="projcode" id="projcode2" />
<span class="textfieldRequiredMsg">A value is required.</span></span><br /></td>
<td></td>
</tr>
<tr>
<td colspan="2" id="dates">Project Name:
<label for="projname3"></label>
<span id="sprytextfield2">
<input type="text" name="projname" id="projname3" />
<span class="textfieldRequiredMsg">A value is required.</span></span></td>
</tr>
<tr>
<td colspan="2" id="dates">Project Description:<span id="description"><br />
<label for="projdesc"></label>
<span id="txt_projdesc">
<textarea name="projdesc" id="projdesc" cols="70" rows="8"></textarea>
<span class="textareaRequiredMsg">A value is required.</span></span></span></td>
</tr>
<tr>
<td id="formcells"><p id="dates">*Date Entered: <em>YYYY/MM/DD</em><span id="year">
<label for="projappdate"><br />
</label>
<span id="txt_dateproapp">
<input type="text" name="projappdate" id="projappdate" />
<span class="textfieldRequiredMsg">A value is required.</span></span></span></p></td>
<td id="formcells"><p id="dates">*Project LGA:<span id="txt_projlga">
<label for="projlga"><br />
</label>
<span id="txt_lga">
<select name="projlga" id="projlga">
<option value="1">.... Select from list ....</option>
<?php
do {
?>
<option value="<?php echo $row_rsLGA['lga']?>"><?php echo $row_rsLGA['lga']?></option>
<?php
} while ($row_rsLGA = mysql_fetch_assoc($rsLGA));
$rows = mysql_num_rows($rsLGA);
if($rows > 0) {
mysql_data_seek($rsLGA, 0);
$row_rsLGA = mysql_fetch_assoc($rsLGA);
?>
</select>
<span class="selectRequiredMsg">Please select an item.</span></span></span></p></td>
</tr>
<tr>
<td id="formcells6"><p id="dates">*Project Community:<span id="txt_ojcommunity">
<label for="projcommunity"><br />
</label>
<select name="projcommunity" id="projcommunity">
<option value="1">.... Select from list ....</option>
<?php
do {
?>
<option value="<?php echo $row_rsCommunity['community']?>"><?php echo $row_rsCommunity['community']?></option>
<?php
} while ($row_rsCommunity = mysql_fetch_assoc($rsCommunity));
$rows = mysql_num_rows($rsCommunity);
if($rows > 0) {
mysql_data_seek($rsCommunity, 0);
$row_rsCommunity = mysql_fetch_assoc($rsCommunity);
?>
</select>
</span></p></td>
<td id="formcells6"><p id="dates">*Project State:<span id="txt_projstate"><br />
<select name="projstate" id="projstate">
<option value="1">.... Select from list ....</option>
<?php
do {
?>
<option value="<?php echo $row_rsState['state']?>"><?php echo $row_rsState['state']?></option>
<?php
} while ($row_rsState = mysql_fetch_assoc($rsState));
$rows = mysql_num_rows($rsState);
if($rows > 0) {
mysql_data_seek($rsState, 0);
$row_rsState = mysql_fetch_assoc($rsState);
?>
</select>
</span></p></td>
</tr>
<tr>
<td height="63" id="formcells8"><p id="dates">Project Cost:<span id="txt_projcost"><br />
<label for="projcost"></label>
<span id="txt_projectcost">
<input name="projcost" type="text" id="projcost" />
<span class="textfieldRequiredMsg">A value is required.</span></span></span></p></td>
<td id="formcells"><p id="dates">*Project Type:<span id="txt_projtype"><br />
<label for="projtype"></label>
<select name="projtype" id="projtype">
<option value="1">.... Select from list ....</option>
<?php
do {
?>
<option value="<?php echo $row_rsType['projtypelist']?>"><?php echo $row_rsType['projtypelist']?></option>
<?php
} while ($row_rsType = mysql_fetch_assoc($rsType));
$rows = mysql_num_rows($rsType);
if($rows > 0) {
mysql_data_seek($rsType, 0);
$row_rsType = mysql_fetch_assoc($rsType);
?>
</select>
</span></p></td>
</tr>
<tr>
<td colspan="2" id="formcells2"><p id="dates">Project Baseline Data:<span id="sprytextarea2"><br />
<label for="projbaselinedata"></label>
<textarea name="projbaselinedata" id="projbaselinedata" cols="70" rows="8"></textarea>
</span></p></td>
</tr>
<tr>
<td colspan="2" id="formcells3"><p id="dates">Expected Outcome Of Project:<span id="sprytextarea3"><br />
<label for="Projexpoutcome"></label>
<textarea name="Projexpoutcome" id="Projexpoutcome" cols="70" rows="8"></textarea>
</span></p></td>
</tr>
</table>
<table width="600" border="0" cellpadding="0" cellspacing="0" id="teamtable">
<tr>
<td colspan="2"><strong id="subheaders">Beneficiaries</strong></td>
</tr>
<tr>
<td width="241"><p>Adult Men Beneficiaries: <span id="txt_adultmen">
<label for="adultmen"><br />
</label>
<input name="adultmen" type="text" id="adultmen" />
</span></p></td>
<td width="259"><p>Adult Female Beneficiaries:<span id="txt_adultfem"><br />
<label for="adultfem"></label>
<input name="adultfem" type="text" id="adultfem" />
</span></p></td>
</tr>
<tr>
<td><p>Adult Children Beneficiaries:<span id="txt_totalchildren"><br />
<label for="children"></label>
<input name="totalchildren" type="text" id="totalchildren" />
</span></p></td>
<td><p>Total Beneficiaries:<span id="sprytextfield4"><br />
<label for="totalben"></label>
<input name="totalben" type="text" id="totalben" readonly="readonly" />
</span></p></td>
</tr>
<tr>
<td><p> </p></td>
<td><p> </p></td>
</tr>
<tr>
<td><strong id="subheaders">Project Team</strong></td>
<td><p> </p></td>
</tr>
<tr>
<td><p>*Project Team Leader:<span id="spryselect1"><br />
<label for="projteamlead"></label>
<select name="projteamlead" id="projteamlead">
<option value="1">.... Select from list ....</option>
<?php
do {
?>
<option value="<?php echo $row_rsProjectTeam['fullname']?>"><?php echo $row_rsProjectTeam['fullname']?></option>
<?php
} while ($row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam));
$rows = mysql_num_rows($rsProjectTeam);
if($rows > 0) {
mysql_data_seek($rsProjectTeam, 0);
$row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam);
?>
</select>
</span></p></td>
<td><p>*Deputy Team Leader:<span id="spryselect2"><br />
<label for="projteamlead"></label>
<select name="projdepteamlead" id="projdepteamlead">
<option value="1">.... Select from list ....</option>
<?php
do {
?>
<option value="<?php echo $row_rsProjectTeam['fullname']?>"><?php echo $row_rsProjectTeam['fullname']?></option>
<?php
} while ($row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam));
$rows = mysql_num_rows($rsProjectTeam);
if($rows > 0) {
mysql_data_seek($rsProjectTeam, 0);
$row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam);
?>
</select>
</span></p></td>
</tr>
<tr>
<td><p>*Project Officer:<span id="spryselect3"><br />
<label for="projteamlead"></label>
<select name="projofficer" id="projofficer">
<option value="1">.... Select from list ....</option>
<?php
do {
?>
<option value="<?php echo $row_rsProjectTeam['fullname']?>"><?php echo $row_rsProjectTeam['fullname']?></option>
<?php
} while ($row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam));
$rows = mysql_num_rows($rsProjectTeam);
if($rows > 0) {
mysql_data_seek($rsProjectTeam, 0);
$row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam);
?>
</select>
</span></p></td>
<td><p>*Liason Officer:<span id="spryselect4"><br />
<label for="projteamlead"></label>
<select name="projliasonofficer" id="projliasonofficer">
<option value="1">.... Select from list ....</option>
<?php
do {
?>
<option value="<?php echo $row_rsProjectTeam['fullname']?>"><?php echo $row_rsProjectTeam['fullname']?></option>
<?php
} while ($row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam));
$rows = mysql_num_rows($rsProjectTeam);
if($rows > 0) {
mysql_data_seek($rsProjectTeam, 0);
$row_rsProjectTeam = mysql_fetch_assoc($rsProjectTeam);
?>
</select>
</span></p></td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="300" id="moredetails2"> </td>
<td width="300"> </td>
</tr>
<tr id="moredetails">
<td width="300" id="moredetails"><strong id="subheaders">Meeting Dates</strong></td>
<td width="300"><strong id="subheaders">Other Dates</strong></td>
</tr>
<tr id="formrows">
<td width="300" id="formrows"><p id="dates">*1st Meeting Date: <em>YYYY/MM/DD</em><span id="txt_projmeeting1"><br />
<input type="text" name="projmeeting1" id="projmeeting1" />
</span></p></td>
<td width="300" id="formrows"><p id="dates">*Project Start Date: <em id="formcells">YYYY/MM/DD</em><span id="txt_projstartdate">
<label for="projstartdate"></label>
<input type="text" name="projstartdate" id="projstartdate" />
</span>
<label for="projstartdate"></label>
</p></td>
</tr>
<tr>
<td width="300" id="formrows"><p id="dates">*2nd Meeting Date: <em>YYYY/MM/DD</em><span id="txt_projmeeting2"><br />
<input type="text" name="projmeeting2" id="projmeeting2" />
</span>
<label for="projteam2"></label>
<label for="projmeeting2"></label>
</p></td>
<td width="300" id="formrows"><p id="dates">*Project End Date: <em>YYYY/MM/DD</em><span id="txt_projenddate"><br />
<label for="projenddate2"></label>
<input type="text" name="projenddate" id="projenddate" />
</span></p></td>
</tr>
<tr>
<td width="300" id="formrows"><p id="dates">*3rd Meeting Date: <em>YYYY/MM/DD</em><span id="txt_projmeeting3"><br />
<input type="text" name="projmeeting3" id="projmeeting3" />
</span></p></td>
<td width="300" id="formrows"><p id="dates">*MoU Signing Date: <em id="formcells">YYYY/MM/DD</em><span id="txt_projmousigndate"><br />
<label for="projmousigndate"></label>
<input type="text" name="projmousigndate" id="projmousigndate" />
</span></p></td>
</tr>
<tr>
<td colspan="2" id="formrows2"><div align="center" id="notice"><img src="images/notice.jpg" width="501" height="73" /></div></td>
</tr>
</table>
</div>
<p align="center"></p>
<p align="center" id="text">
<input type="file" name="file_upload" />
<input type="file" name="file_uploadone" />
<input type="file" name="file_uploadtwo" />
</p>
<p align="center" id="text">
<input type="file" name="file_uploadthree" />
<input type="file" name="file_uploadfour" />
<input type="file" name="file_uploadfive" />
</p>
<p align="center">
<input type="submit" name="submit" value="Save & Submit"/>
</p>
</form>
The addnew.php will now execute and add the data and image file names and path to MySQL database and upload the images to their various locations. it will also check the image file size be sure its not more than 100kb and must really be an iamge with format .jpg, .png and .gif.
<?php
if(isset($_POST['submit']))
$projcode=$_POST['projcode'];
$projname=$_POST['projname'];
$projname=$_POST['projname'];
$projdesc=$_POST['projdesc'];
$projappdate=$_POST['projappdate'];
$projcommunity=$_POST['projcommunity'];
$projlga=$_POST['projlga'];
$projstate=$_POST['projstate'];
$projcost=$_POST['projcost'];
$projtype=$_POST['projtype'];
$projbaselinedata=$_POST['projbaselinedata'];
$Projexpoutcome=$_POST['Projexpoutcome'];
$adultmen=$_POST['adultmen'];
$adultfem=$_POST['adultfem'];
$totalchildren=$_POST['totalchildren'];
$totalben=$_POST['totalben'];
$projteamlead=$_POST['projteamlead'];
$projdepteamlead=$_POST['projdepteamlead'];
$projofficer=$_POST['projofficer'];
$projliasonofficer=$_POST['projliasonofficer'];
$projmeeting1=$_POST['projmeeting1'];
$projmeeting2=$_POST['projmeeting2'];
$projmeeting3=$_POST['projmeeting3'];
$projmousigndate=$_POST['projmousigndate'];
$projstartdate=$_POST['projstartdate'];
$projenddate=$_POST['projenddate'];
$name=basename($_FILES['file_upload']['name']);
$t_name=$_FILES['file_upload']['tmp_name'];
$dir='imageone';
// Validate uploaded image file
if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_upload']['type']) ) {
die('<p>Only browser compatible images allowed</p></body></html>');
} else if ( $_FILES['file_upload']['size'] > 100000 )
die('<p>Sorry file too large</p></body></html>');
if(move_uploaded_file($t_name,$dir."/".$name))
echo 'File 1 uploaded successfully....!';
else
echo 'File 1 upload failed or was not submitted....! ';
$nameone=basename($_FILES['file_uploadone']['name']);
$t_name=$_FILES['file_uploadone']['tmp_name'];
$dir='imagetwo';
// Validate uploaded image file
if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadone']['type']) ) {
die('<p>Only browser compatible images allowed</p></body></html>');
} else if ( $_FILES['file_uploadone']['size'] > 100000 )
die('<p>Sorry file too large</p></body></html>');
if(move_uploaded_file($t_name,$dir."/".$nameone))
echo 'File 2 was uploaded successfully....!';
else
echo '...File 2 upload failed or was not submitted! ';
$nametwo=basename($_FILES['file_uploadtwo']['name']);
$t_name=$_FILES['file_uploadtwo']['tmp_name'];
$dir='imagethree';
// Validate uploaded image file
if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadtwo']['type']) ) {
die('<p>Only browser compatible images allowed</p></body></html>');
} else if ( $_FILES['file_uploadtwo']['size'] > 100000 )
die('<p>Sorry file too large</p></body></html>');
if(move_uploaded_file($t_name,$dir."/".$nametwo))
echo 'File 3 uploaded successfully';
else
echo '...File 3 upload failed or was not submitted! ';
$namethree=basename($_FILES['file_uploadthree']['name']);
$t_name=$_FILES['file_uploadthree']['tmp_name'];
$dir='imagefour';
// Validate uploaded image file
if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadthree']['type']) ) {
die('<p>Only browser compatible images allowed</p></body></html>');
} else if ( $_FILES['file_uploadthree']['size'] > 100000 )
die('<p>Sorry file too large</p></body></html>');
if(move_uploaded_file($t_name,$dir."/".$namethree))
echo 'File 4 uploaded successfully';
else
echo '...File 4 upload failed or was not submitted! ';
$namefour=basename($_FILES['file_uploadfour']['name']);
$t_name=$_FILES['file_uploadfour']['tmp_name'];
$dir='imagefive';
// Validate uploaded image file
if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadfour']['type']) ) {
die('<p>Only browser compatible images allowed</p></body></html>');
} else if ( $_FILES['file_uploadfour']['size'] > 100000 )
die('<p>Sorry file too large</p></body></html>');
if(move_uploaded_file($t_name,$dir."/".$namefour))
echo 'File 5 uploaded successfully';
else
echo '...File 5 upload failed or was not submitted! ';
$namefive=basename($_FILES['file_uploadfive']['name']);
$t_name=$_FILES['file_uploadfive']['tmp_name'];
$dir='imagesix';
// Validate uploaded image file
if ( !preg_match( '/gif|png|jpeg/', $_FILES['file_uploadfive']['type']) ) {
die('<p>Only browser compatible images allowed</p></body></html>');
} else if ( $_FILES['file_uploadfive']['size'] > 100000 )
die('<p>Sorry file too large</p></body></html>');
if(move_uploaded_file($t_name,$dir."/".$namefive))
echo ' File 6 uploaded successfully';
else
echo '....File 6 upload failed or was not submitted! ';
mysql_select_db ($database_XXXXXXXX,$XXXXXXXX); where XXXXXXXX is my database connection details. Please change to yours.
$qur=("insert into tbl_projects (projid, projcode, projname, projdesc, projappdate, projcommunity, projlga, projstate, projcost, projtype, projbaselinedata, Projexpoutcome, adultmen, adultfem, totalchildren, totalben, projteamlead, projdepteamlead, projofficer, projliasonofficer, projmeeting1, projmeeting2, projmeeting3, projmousigndate, projstartdate, projenddate, name, path, nameone, pathone, nametwo, pathtwo, namethree, paththree, namefour, pathfour, namefive, pathfive) VALUES ('', '$projcode','$projname','$projdesc', '$projappdate', '$projcommunity', '$projlga', '$projstate', '$projcost', '$projtype', '$projbaselinedata', '$Projexpoutcome', '$adultmen', '$adultfem', '$totalchildren', '$totalben', '$projteamlead', '$projdepteamlead', '$projofficer', '$projliasonofficer', '$projmeeting1', '$projmeeting2', '$projmeeting3', '$projmousigndate', '$projstartdate', '$projenddate','$name','imageone/$name','$nameone','imagetwo/$nameone', '$nametwo', 'imagethree/$nametwo', '$namethree', 'imagefour/$namethree', '$namefour', 'imagefive/$namefour', '$namefive', 'imagesix/$namefive')");
$res=mysql_query($qur,$XXXXXXXX);
?>
Thank you. Hope this helps all those that are learning
Message was edited by: Prince Mike
Maybe you are looking for
-
I just got a new Mac- I have transferred my itunes but how do I transfer my iphone to the new itunes? i dont want my whole iphone to blank so please help
-
My iMac has panic issues, need help.
I've got an iMac 4,1 and it's panicking in a bad way. It's not used for whole lot, just email, web, and printer sharing. The thing won't boot sometimes and I'm forced to leave it on. It only panics on boot. Sometimes when going into Safe Boot, bu
-
ZEN2 and 4.83SP2 ??!!
Hi, I know it is not supported, but is there a way to make it work ? TIA Alex Leibovici Swiss Red Cross
-
SES with VPD (Virtual Private Database)?
I am trying to use SES to search a database with row-level security enabled in the form of VPD. My plan is to have SES index the database as a user with read permissions on all data, and likely use Query-Time Authorization to filter results. The trou
-
Windows 7: Acrobat 8 crash and other glitches
I'm using Adobe Acrobat 8.1.6 Standard on Windows 7 rtm and there are some massive problems with Acrobat: First problem I found is in combination with Office 2007 and Calibri font which is the standard title font of Word 2007. When I convert a Word d