Using &APP_ID. in uploaded javascript file
Hi dev's,
I fumbling around with a quite annoying problem.
When I create a javascript directly inside the "Header Text" of my page the script works perfectly:
<script type="text/javascript">
function fnc_setTreeItem (pItem)
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',0);
get.add(pItem,$x(pItem).value)
gReturn = get.get();
get = null;
</script> But when I use an uploaded javascript file instead because the source code becomes to much then the script runs on an error:
<!-- Custom js, css, libs -->
<script type="text/javascript" src="#APP_IMAGES#ukd_monitoring.js"></script> Firebug error description:
syntax error
E()apex_ns_3_1.js (line 1)
? in apex_ns_3_1.js@1("ContentArea")apex_ns_3_1.js (line 1)
$x("ContentArea")apex_3_1.js (line 1)
$x_Style(["BB", "ContentArea", "ContentBody" 0=BB 1=ContentArea 2=ContentBody], "display", "")apex_3_1.js (line 1)
$x_Show(["BB", "ContentArea", "ContentBody" 0=BB 1=ContentArea 2=ContentBody])apex_3_1.js (line 1)
filterAttributeRegions(a.htmldbButtonListCurrent f?p=4000:4...1,150#HEAD, "#HEAD")apex_builder.js (line 1)
propTest()apex_builder.js (line 1)
? in apex_3_1.js@1()apex_3_1.js (line 1)
[Break on this error] var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',0);\nIs there a possibility to get the APP_ID work inside an uploaded file?
Best regards,
Tobias
Hello Tobias,
Use $v('pFlowId') instead. That should work...
Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-)
Similar Messages
-
To help community members troubleshoot issues efficiently, sometimes we need to collect related files (such as Event logs, Network traces, Setup
log files, Screenshots, etc.) to perform a specific analysis.
We can simply use SkyDrive, which is a free storage on Windows Live, it’s easy to store and share your files and photos with almost anyone. To make the
steps clear, I would like to share the detailed steps for:
1. How to use SkyDrive to upload collected files?
2. How to post screenshots or other pictures in forum threads?
1.
How to use
SkyDrive to upload collected files?
1)
Open the
SkyDrive site.
2)
In the
Sign In page, if you own a Windows Live ID, please type your Windows Live ID and Password to sign in; Otherwise, you may click Sign Up to register a new one. See the following screen shot.
3)
After signing in Windows Live, click Create folder.
4) Name
the folder and edit permissions to share with relevant person.
Important Note: You
can share the folder with Everyone if there is no private/sensitive information (such as the screen shot of a prompt error message). To so so, simply select the "Everyone (Public)" option in the "Share with" box. Please refer to the following screen shot:
However, for private information that you do NOT want to be accessed by everyone, it is recommended to share with specified individuals. To do so, you can expand the "Share with" box, choose the "Select people..." option, and then type their
Live IDs in the Individual box. Please refer to the screen shot below:
5)
Drag the previously collected files directly to the Skydrive folder. For example:
6)
Click Upload.
7)
Click on the uploaded files and tell us the URL.
2.
How to post screenshots or other pictures in forum threads?
(This section updated on 1/16/2012 to reflect changes in Skydrive. Thanks to
Jeeped on the Microsoft Answers forums)
1) Please
use the above method to upload the picture files in advance. Then, in your Skydrive space, Right Click the picture and select
View Original. Press Ctrl + A, or Right Click and select Copy, to select it.
2)
Press Ctrl + C to copy this picture.
3)
Navigate to your post textbox, and press Ctrl + V, or Right Click and select Paste, to paste the picture there.
Then, the picture will be successfully inserted in that thread.I cant even open windows now!!!! it crashes mecilessly here is a copy of the only dump file i have. i retreved it from second life and cant copy it onto the clip board.
Problem signature: Problem Event Name:BlueScreen OS Version:6.1.7600.2.0.0.768.3 Locale ID:1033
Additional information about the problem: BCCode:124 BCP1:0000000000000000 BCP2:FFFFFA80050BE8F8 BCP3:0000000000000000 BCP4:0000000000000000 OS Version:6_1_7600 Service Pack:0_0 Product:768_1
Files that help describe the problem: C:\Windows\Minidump\073011-29484-01.dmp C:\Users\madamediva\AppData\Local\Temp\WER-72805-0.sysdata.xml
Read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline: C:\Windows\system32\en-US\erofflps.txt
dump_pciidex.sysdump_pciidex.sys+216e730fffff880`01464000fffff8b0`014700000x000000300000c0000x4a5bc1137/13/2009 7:19:47 PMntoskrnl.exentoskrnl.exe+782e2fffff800`02a03000fffff800`02fe00000x005dd0000x4a5bc6007/13/2009 7:40:48 PMMicrosoft® Windows® Operating
SystemNT Kernel & System6.1.7600.16385 (win7_rtm.090713-1255)Microsoft CorporationC:\Windows\system32\ntoskrnl.exeACPI.sysfffff880`00f46000fffff880`00f9d0000x000570000x4a5bc1067/13/2009 7:19:34 PMamdxata.sysfffff880`00c6c000fffff880`00c770000x0000b0000x4a12f2eb5/19/2009
1:56:59 PMatapi.sysfffff880`00e59000fffff880`00e620000x000090000x4a5bc1137/13/2009 7:19:47 PMataport.SYSfffff880`00e62000fffff880`00e8c0000x0002a0000x4a5bc1187/13/2009 7:19:52 PMAtiPcie.sysfffff880`01fe8000fffff880`01ff00000x000080000x4a0054865/5/2009 11:00:22
AMBATTC.SYSfffff880`00e1e000fffff880`00e2a0000x0000c0000x4a5bc3b57/13/2009 7:31:01 PMCI.dllfffff880`00d1a000fffff880`00dda0000x000c00000x4a5be01d7/13/2009 9:32:13 PMCLASSPNP.SYSfffff880`01800000fffff880`018300000x000300000x4a5bc11e7/13/2009 7:19:58 PMCLFS.SYSfffff880`00cbc000fffff880`00d1a0000x0005e0000x4a5bc11d7/13/2009
7:19:57 PMcng.sysfffff880`01000000fffff880`010730000x000730000x4a5bc8147/13/2009 7:49:40 PMcompbatt.sysfffff880`00e15000fffff880`00e1e0000x000090000x4a5bc3b67/13/2009 7:31:02 PMcrashdmp.sysfffff880`01ff0000fffff300`01ffe0000xfffffa800000e0000x4a5bcabd7/13/2009
8:01:01 PMdisk.sysfffff880`01fd2000fffff880`01fe80000x000160000x4a5bc11d7/13/2009 7:19:57 PMdump_dumpfve.sysfffff880`01235000fffff87f`012480000xffffffff000130000x4a5bc18f7/13/2009 7:21:51 PMdump_msahci.sysfffff880`01470000fffff87f`0147b0000xffffffff0000b0000x4a5bcabd7/13/2009
8:01:01 PMfileinfo.sysfffff880`01145000fffff880`011590000x000140000x4a5bc4817/13/2009 7:34:25 PMfltmgr.sysfffff880`010f9000fffff880`011450000x0004c0000x4a5bc11f7/13/2009 7:19:59 PMFs_Rec.sysfffff880`0122b000fffff880`012350000x0000a0000x4a5bc1117/13/2009 7:19:45
PMfvevol.sysfffff880`01f98000fffff880`01fd20000x0003a0000x4a5bc1a77/13/2009 7:22:15 PMfwpkclnt.sysfffff880`01400000fffff880`0144a0000x0004a0000x4a5bc1647/13/2009 7:21:08 PMhal.dllfffff800`02fe0000fffff800`030290000x000490000x4a5bdf087/13/2009 9:27:36 PMhwpolicy.sysfffff880`01f8f000fffff880`01f980000x000090000x4a5bc0fa7/13/2009
7:19:22 PMkdcom.dllfffff800`00bd1000fffff800`00bdb0000x0000a0000x4a5bdfdb7/13/2009 9:31:07 PMkl1.sysfffff880`01830000fffff880`01f8f0000x0075f0000x4c0f985b6/9/2010 9:34:19 AMksecdd.sysfffff880`01200000fffff880`0121a0000x0001a0000x4a5bc1567/13/2009 7:20:54 PMksecpkg.sysfffff880`015d3000fffff880`015fe0000x0002b0000x4a5bc84a7/13/2009
7:50:34 PMmcupdate.dllfffff880`00c9b000fffff880`00ca80000x0000d0000x4a5bdf657/13/2009 9:29:09 PMmountmgr.sysfffff880`00e3f000fffff880`00e590000x0001a0000x4a5bc11a7/13/2009 7:19:54 PMmsahci.sysfffff880`00ff0000fffff880`00ffb0000x0000b0000x4a5bcabd7/13/2009
8:01:01 PMmsisadrv.sysfffff880`00fa6000fffff880`00fb00000x0000a0000x4a5bc0fe7/13/2009 7:19:26 PMmsrpc.sysfffff880`01165000fffff880`011c30000x0005e0000x4a5bc17c7/13/2009 7:21:32 PMmup.sysfffff880`01452000fffff880`014640000x000120000x4a5bc2017/13/2009 7:23:45
PMndis.sysfffff880`01481000fffff880`015730000x000f20000x4a5bc1847/13/2009 7:21:40 PMNETIO.SYSfffff880`01573000fffff880`015d30000x000600000x4bbe946f4/8/2010 10:43:59 PMNtfs.sysfffff880`0124c000fffff880`013ef0000x001a30000x4a5bc14f7/13/2009 7:20:47 PMpartmgr.sysfffff880`00e00000fffff880`00e150000x000150000x4a5bc11e7/13/2009
7:19:58 PMpci.sysfffff880`00fb0000fffff880`00fe30000x000330000x4a5bc1177/13/2009 7:19:51 PMPCIIDEX.SYSfffff880`00c5c000fffff880`00c6c0000x000100000x4a5bc1147/13/2009 7:19:48 PMpcw.sysfffff880`0121a000fffff880`0122b0000x000110000x4a5bc0ff7/13/2009 7:19:27 PMPSHED.dllfffff880`00ca8000fffff880`00cbc0000x000140000x4a5be0277/13/2009
9:32:23 PMMicrosoft® Windows® Operating SystemPlatform Specific Hardware Error Driver6.1.7600.16385 (win7_rtm.090713-1255)Microsoft CorporationC:\Windows\system32\PSHED.dllPxHlpa64.sysfffff880`01159000fffff880`01164e000x0000be000x4a4162536/23/2009
7:16:35 PMrdyboost.sysfffff880`010bf000fffff880`010f90000x0003a0000x4a5bc48a7/13/2009 7:34:34 PMspldr.sysfffff880`0144a000fffff880`014520000x000080000x4a0858bb5/11/2009 12:56:27 PMtcpip.sysfffff880`01602000fffff880`017ff0000x001fd0000x4bbe94e24/8/2010 10:45:54
PMvdrvroot.sysfffff880`00fe3000fffff880`00ff00000x0000d0000x4a5bcadb7/13/2009 8:01:31 PMvolmgr.sysfffff880`00e2a000fffff880`00e3f0000x000150000x4a5bc11d7/13/2009 7:19:57 PMvolmgrx.sysfffff880`00c00000fffff880`00c5c0000x0005c0000x4a5bc1417/13/2009 7:20:33 PMvolsnap.sysfffff880`01073000fffff880`010bf0000x0004c0000x4a5bc1287/13/2009
7:20:08 PMWdf01000.sysfffff880`00e93000fffff880`00f370000x000a40000x4a5bc19f7/13/2009 7:22:07 PMWDFLDR.SYSfffff880`00f37000fffff880`00f460000x0000f0000x4a5bc11a7/13/2009 7:19:54 PMWMILIB.SYSfffff880`00f9d000fffff880`00fa60000x000090000x4a5bc1177/13/2009 7:19:51
PM -
Use function from external Javascript file
Hi All,
Is it possible to use function from other javascript file. If possible then please post some example.
ShonkyAs Harbs mentioned, you can use doScript().
Maybe you can do something like this:
First I created simple function in separate file and exported it JSXBIN
function myAlert(myString){
alert(myString);
Then, I copied contents of that JSXBIN and put it into variable
var securedFUNCTION = app.doScript("@JSXBIN@ES@[email protected]AffABC40BhAB0AzHjNjZiBjMjFjSjUDAC0EzAEByB");
or
var securedFUNC = eval("@JSXBIN@ES@[email protected]AffABC40BhAB0AzHjNjZiBjMjFjSjUDAC0EzAEByB");
And simply called function
myAlert('My test String');
Also, you can use include external script with #include to call JSXBIN, but you need to wrap contents of JSXBIN file into doScript or eval().
tomaxxi
http://indisnip.wordpress.com/ -
Uploading javascript file under static files
We uploaded the javascript file under static files. By default the mime type is "application/octet-stream". We are accessing this js file in our application however this is not working.
Is this because the mime type is "application/octet-stream"?
Please let us know how to change the mime type to javascript.Actually, we were having the same problem and determined it to be an IE bug. If we upload the .js file using Firefox, it saves as the correct mime type, x-javascript. If we use IE8, it gets uploaded as octet. Because of this, Firebug did not recognize the file, we got the following error: "the resource from this url is not text: " with the link to the uploaded file. Hence, none of the functions included in the file worked in our application.
-
how do upload the javascript files for the html edge animate banner to work in my Content Management System module. At present, the html cannot function because the reference javascript files are missing.
I am not very sure how the CMS manage their content but basically the javascript files need to be in the same folder as the HTML file for Animate content to play.
-
Using ftp to upload a file to Content Database
Hi Experts,
I am looking to upload the file to the Content DB using FTP.
Can any one let me know if there is any API for doing this and also if there any way to upload the attributes(META data) after uploading the file using FTP.
I have a tried already uploading the file using web services API now looking for FTP Upload.
Thanks
AhamedA quick search at google reveals there are plenty of FTP libraries available for the various mainstream programming languages (Java, C, C++ etc).
However, FTP has a very basic command set. (MKDIR, GET, PUT, DEL etc).
So you are not going to be able to perform more advanced document management tasks (such as lock a document, check-in, check-out, modify metadata, modify security, search, sort etc) through standard FTP commands.
In terms of setting metadata through FTP, you could potentially store the various processing instructions required in some type of XML file (or equivalent) and upload this XML file to the repository. A custom event handler could be created that listens for DOCUMENT_CREATED events, and then attempts to process the XML files and perform the various instructions contained within by calling the appropriate in-process Content DB FDK API.
It's ugly, but possible.
cheers
Matt. -
I am trying to debug a ASP.Net web application within visual studio 2010 using Firefox. I am able to set breakpoints in my C# code and they work but if I set a breakpoint in a javascript file then these do not work when using Firefox. Is there any way to do this?
Of course you can. I use the VS2010 built-in Javascript debug tool a lot, not only for IE, but also for firefox.
I encountered the "break point not working" issue several times, according to my experience, following is the solution to this problem, give them a shot:
1. There maybe errors in your javascript code, have a close look at your code, try to find the errors or eliminate this possibility.
2. Sometimes you have to refresh the page once after the page is loaded the first time. This solves the problem most of the time. -
Accessing substitution variables in static uploaded javascript file
Hi there,
I just created variables and a pageinit function in my page header and try to access these variables (Flow_Id, Page_Id etc) within a js-file I uploaded into workspace static files.
I try to use them within an URL ( e.g. "f?p="+ Flow_Id + ":100:" + Session_Id ), but they are -undefined- and thus lead to a 404-Page!
Here is the code:
onload="pageinit()" //in page html body attribute
//and the following code in the html header
<script type="text/javascript">
<!--
var Flow_Id; // application id
var Page_Id; // page id
var Session_Id; // session id
var Request; // request value
function pageinit(){
Flow_Id = html_GetElement('pFlowId').value; // application id
Page_Id = html_GetElement('pFlowStepId').value; // page id
Session_Id = html_GetElement('pInstance').value; // session id
Request = html_GetElement('pRequest').value; // request value
//-->
</script>Can someone please point me to the right direction!?
Thank you very much.
Regards
JohnnyHi Paul,
I tried with IE 8 now and could at least find out now, which lines of code are responsible for the error:
addmenu(menu=[
"mainmenu",
69,
153,
1,
style1,
1,
"left",
1,
0,
,"Home","f?p=" + $v('pFlowId') + ":100:" + $v('pInstance'),,"",1 // "Description Text", "URL", "Alternate URL", "Status", "Separator Bar"
,"Tab2","show-menu=list01","tab2.html","",1
,"Tab3","f?p=300:1:","tab3.html","",1
,"Tab4","show-menu=list04","tab4.html","",1
])It must be the way I try to create the first URL (for Home) I already mentioned, because if I hard-code the URL, it works without errors.
I could hard-code the URL, but then I always get a new session-id. So, at least I need to find a way of accessing the current session-id here.
As mentioned before, I also tried to set global variables within a javacript function in the page header and assigning the current values for the session and app-id and reference these variables within the js-file I uploaded to the static files. But that did not work either. These variables were undefined.
I guess they were undefined because at the time when the function was processed the variable might not have been set yet.
But I followed exactly the solution Carl Backstrom mentioned in some of his posts some years ago. God bless him.
I am not a javascript expert, so maybe you got a hint for me!?
Thanks again for your support.
Johnny -
Problem using email to upload image files to Mobile Me gallery
I will cross post this question to both Mail and Mobile Me discussion groups because I don't know where my problem lies.
I have published a gallery page from iPhoto to my Mobile Me gallery. There are two ways to upload additional photos. I am not having trouble adding image files with the Upload feature. I cannot get the email function to work. The emails I send to the email address for the gallery bounce back to my mail inbox.
Subject: Delivery Notification: Delivery has failed
and in the body of the bounced email:
Recipient address: [email protected]
Reason: SMTP transmission failure has occurred
Diagnostic code: smtp;521 5.2.1 Fatal failure of WOA
Remote system: dns;post.mac.com (TCP|10.150.69.91|51195|10.13.19.27|25) (mbin002.mac.com ESMTP [2.3.3/gso-r197-19Feb2007] ready to rumble)
Original-envelope-id: [email protected]
Reporting-MTA: dns;asmtp028-bge351000 (tcp-daemon)
Original-recipient: rfc822;[email protected]
Final-recipient: rfc822;[email protected]
Action: failed
Status: 5.2.1 (SMTP transmission failure has occurred)
Remote-MTA: dns;post.mac.com (TCP|10.150.69.91|51195|10.13.19.27|25)
(mbin002.mac.com ESMTP [2.3.3/gso-r197-19Feb2007] ready to rumble)
Diagnostic-code: smtp;521 5.2.1 Fatal failure of WOA
One of the images I am trying to attach is a jpeg file of 61 kb.
I have tried to drag the image from my desktop to the body of the email. I have tried using the "attach" function and selecting the file name. I am not sending any text with these files.
When I built these albums, I checked and enabled all the options.
I am having this same issue when I try to upload via email to any of my Mobile Me gallery pages.
There is currently one photo displayed here:
http://gallery.me.com/tplattenberger#100352
If anyone wishes to try to upload to that gallery using email (Send to Album) that would be great and if successful, that might provide a clue to my problem.
As I say, I currently have one photo there. If you find a lot more, please do not add.
What's the problem?
TomThe images I am trying are newly created and old.
A weird hint perhaps...
I just copied an image from Apple's home page and pasted it into the email and tried again...
it worked.
So I tried again, dragging from iPhoto and it did not work... the email bounced back.
So I tried again, this time using copy and paste (like I did from Apple's page) from iPhoto... it did not work.
Tom -
Hi all,
How to use uploaded javascript file in page. Here i tried the following way but not getting the result.
Created a file named att_val.js and uploaded that file shared component->static file. and added the following code to the HTML Header section of the Page attributes.
<script src="#APP_IMAGE#attr_val.js" type="text/javascript"></script>
When i press a button the function in attr_val should be called. But it is not callling the function.
Thanks.Hi,
Try
<script src="#APP_IMAGES#attr_val.js" type="text/javascript"></script>NOTE! plural IMAGES, not IMAGE
if that do not work, try also
<script src="#WORKSPACE_IMAGES#attr_val.js" type="text/javascript"></script>Regards,
Jari
http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
Edited by: jarola on Dec 6, 2011 2:56 PM -
Problem in uploading a file using Ws_upload.
Hi Experts,
I am using WS_UPLOAD for uploading .xls file into SAP Standard table T558A.
Problem is file is not uploaded to DB table.....getting error like
ERROR DURING FILE UPLOAD/DOWNLOAD as pop up message.....
can any boady please help on this issue.
Regards,
Praveena.Hi,
If you want to upload the data using EXCEL file use the function module ALSM_EXCEL_TO_INTERNAL_TABLE.
Examples for ALSM_EXCEL_TO_INTERNAL_TABLE.
http://wiki.sdn.sap.com/wiki/display/Snippets/Howtouse+FM'ALSM_EXCEL_TO_INTERNAL_TABLE' -
How to use the applet to upload the file ?
I am facing a problem that , I don't know how to use applet to upload the file to server .
I have the code to upload the file by using servlet .
However , I want to use applet to upload the file .But , the format of servlet I have used is "multipart/form-data"
but applet can not do so , I think it is the header of the data . I don't know what can I do .....
Can anyone give me some suggestion or coding to write the file upload by using applet ?
Besides , using the socket are there any other choices ?
thx a lot !!!!Well, to upload files you need to
Server App - running on the webserver
1. Open a socket
(Study the classes Socket, InputStream, OutputStream in the Java API)
2. Wait for connection.
3. Open FileOutputStream
3. Read data from InputStream, Write to FileOutputStream
4. Close InputStream and FileOutputStream
Applet
1. Open a filedialog (Swing, AWT)
2. Open file (FileInputStream)
3. Connect to uploadServer (steps described above)
4. Read FileInputStream, write OutputStream
5. Close File and Socket
This is just simpl and basic terms get you on the right track
Jonas -
Creating a sales document using BAPI in web dynpro by uploading a file
Hi ALL,
Can some one help me how to create a sales document using BAPI by uploading a file as input...Can someone provide me a sample program....
Thanks n Regards,
Praveenn.
Edited by: praveenn on Aug 23, 2011 12:42 PMHi Sri,
Thx for the response...
Here is the code that i followed for creating a BAPI_SALESORDER_CREATE1 by uploading a text file as input.
Just create a Attribute in the VIEW CONTEXT of type String.
method ONACTIONCREATE_SO .
types : Begin of ty_data,
sales_org type vkorg,
doc_type type AUART,
DISTR_CHAN type VTWEG,
DIVISION type spart,
material type matnr,
partn_role type PARVW,
PARTN_NUMB type kunnr,
end of ty_data.
DATA :it_table TYPE TABLE OF ty_data,
i_data TYPE TABLE OF string,
l_string TYPE string,
wa_table TYPE ty_Data,
l_xstring TYPE xstring,
fields TYPE string_table,
lv_field TYPE string.
DATA: wa_order_header_in TYPE BAPISDHD1,
it_order_items_in TYPE TABLE OF BAPISDITM,
wa_order_items_in TYPE BAPISDITM,
it_order_partners TYPE TABLE OF BAPIPARNR,
wa_order_partners TYPE BAPIPARNR,
it_return TYPE TABLE OF BAPIRET2,
wa_return TYPE BAPIRET2.
DATA : sales_doc type bapivbeln-vbeln.
DATA:
node_zfinal_node TYPE REF TO if_wd_context_node,
elem_zfinal_node TYPE REF TO if_wd_context_element,
stru_zfinal_node TYPE if_main_view=>element_zfinal_node .
get single attribute
wd_context->get_attribute(
EXPORTING
name = 'DATASOURCE'
IMPORTING
value = l_xstring ).
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
READ TABLE fields INTO lv_field INDEX 1.
wa_table-sales_org = lv_field.
READ TABLE fields INTO lv_field INDEX 2.
wa_table-doc_type = lv_field.
READ TABLE fields INTO lv_field INDEX 3.
wa_table-DISTR_CHAN = lv_field.
READ TABLE fields INTO lv_field INDEX 4.
wa_table-DIVISION = lv_field.
READ TABLE fields INTO lv_field INDEX 5.
wa_table-material = lv_field.
READ TABLE fields INTO lv_field INDEX 6.
wa_table-partn_role = lv_field.
READ TABLE fields INTO lv_field INDEX 7.
wa_table-partn_numb = lv_field.
APPEND wa_table TO it_table.
ENDLOOP.
loop at it_table into wa_table.
clear : wa_order_header_in.
wa_order_header_in-sales_org = wa_table-sales_org.
wa_order_header_in-doc_type = wa_table-doc_type.
wa_order_header_in-distr_chan = wa_table-distr_chan.
wa_order_header_in-division = wa_table-division.
clear : wa_order_items_in.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_table-material
IMPORTING
OUTPUT = wa_order_items_in-material.
*wa_order_items_in-req_qty = wa_table-req_qty.
append wa_order_items_in to it_order_items_in.
clear : wa_order_partners.
wa_order_partners-partn_role = wa_table-partn_role.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_table-partn_numb
IMPORTING
OUTPUT = wa_order_partners-partn_numb
*wa_order_partners-partn_numb = wa_table-partn_numb.
append wa_order_partners to it_order_partners.
endloop.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
order_header_in = wa_order_header_in
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = sales_doc
tables
RETURN = it_return
ORDER_ITEMS_IN = it_order_items_in
ORDER_ITEMS_INX =
order_partners = it_order_partners.
ORDER_SCHEDULES_IN =
get message manager
DATA: l_current_controller TYPE REF TO if_wd_controller,
l_message_manager TYPE REF TO if_wd_message_manager.
l_current_controller ?= wd_this->wd_get_api( ).
DATA: v_message_text TYPE string.
When Sales Order is created commit the data
IF NOT sales_doc IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING wait = 'X'.
CONCATENATE 'Sales Document' sales_doc 'has been created.' INTO v_message_text SEPARATED BY space.
Report Success message
CALL METHOD l_message_manager->report_success
EXPORTING
message_text = v_message_text.
ELSE.
v_message_text = 'Error Creating Sales Order'.
Report Error message
CALL METHOD l_message_manager->report_error_message
EXPORTING
message_text = v_message_text.
ENDIF.
endmethod.
Edited by: praveenn on Aug 30, 2011 2:41 PM -
Can we upload a file using HTTPService
Hi friends,
I want to know that can i send a file from flex to servlet or
struts using HttpService or not? I m using FileReference to upload
a file.
I just want to know that how can i send a file or multiple
files as request parameter? Please tell me about this.
Thanks in advance for your reply..To allow the user to identify a file to upload to the server
you must use FileReference. If you have data in memory (like XML or
arrays) you can use HTTPService and send the data using the POST
method on HTTPService.
There is no way to automatically read files from the user's
local machine. That would be a serious security threat. You can
imagine what could happen if you could write a Flash app that very
innocently ask for a file and then just went and uploaded all of
the data files in a user's directory without their permission.
So, no, you cannot automatically upload files using
FileReference or HTTPService or anything else. -
BAPO_PO_CREATE1 giving errors while creating PO by uploading a file?
Hi,
when i am creating Purchase Order using BAPO_PO_CREATE1 by uploading a File, it is giving below errors
1-> No instance of object type PurchaseOrder has been created. External reference:
2-> PO header data still faulty
3-> No master record exists for vendor 100017
4-> Vendor 100017 does not exist
5-> Can delivery date be met?
and i passed data to bapi as below
CONSTANTS: c_x TYPE c VALUE 'X',
c_err TYPE bdc_mart VALUE 'E'.
*Structures to hold PO header data
DATA : header LIKE bapimepoheader ,
headerx LIKE bapimepoheaderx .
*Internal Tables to hold PO ITEM DATA
DATA : item LIKE bapimepoitem OCCURS 0 WITH HEADER LINE,
itemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE,
*Internal table to hold messages from BAPI call
rettab LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: bapi_err_count TYPE i,
bapi_warnings TYPE i,
ponumber LIKE ekpo-ebeln,
item_num LIKE ekpo-ebelp.
DATA : BEGIN OF i_dbtab OCCURS 0,
bukrs LIKE ekko-bukrs, " company code
bsart LIKE ekko-bsart, " Po document type
bedat(10) TYPE c, " po document data
lifnr LIKE ekko-lifnr, " vendor
ekorg LIKE ekko-ekorg, " Purchase organisation
ekgrp LIKE ekko-ekgrp, " Purchase group
currency like ekko-waers,
item like ekpo-ebelp,
matnr(18) TYPE n, " Article
werks LIKE ekpo-werks, " Werks
mat_grp type matkl,
menge(10) TYPE c, " Menge
netwr type BAPICUREXT. " nat value
DATA : END OF i_dbtab.
DATA : wa_dbtab LIKE i_dbtab.
SELECTION-SCREEN DESIGN *
PARAMETERS: p_file LIKE rlgrap-filename MEMORY ID m01 OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = ''
static = ''
CHANGING
file_name = p_file.
START-OF-SELECTION.
PERFORM f_file_upload.
IF i_dbtab[] IS NOT INITIAL.
PERFORM f_po_create.
ENDIF.
*& Form f_file_upload
FORM f_file_upload .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = i_dbtab
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE e004 WITH 'File upload Failed'.
ENDIF.
ENDFORM. " f_file_upload
*& Form F_po_create
FORM f_po_create.
DATA : cc TYPE i,
l_lifnr LIKE lfa1-lifnr.
LOOP AT i_dbtab INTO wa_dbtab.
cc = cc + 1.
IF cc = 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_dbtab-lifnr
IMPORTING
output = l_lifnr.
*POPULATE HEADER DATA FOR PO
header-comp_code = wa_dbtab-bukrs.
header-doc_type = wa_dbtab-bsart. "Standard Order
header-creat_date = sy-datum.
header-vendor = wa_dbtab-lifnr.
header-purch_org = wa_dbtab-ekorg.
header-pur_group = wa_dbtab-ekgrp.
header-currency = wa_dbtab-currency.
*POPULATE HEADER FLAG.
headerx-comp_code = c_x.
headerx-doc_type = c_x.
headerx-creat_date = c_x.
headerx-vendor = c_x.
headerx-purch_org = c_x.
headerx-pur_group = c_x.
headerX-currency = c_x.
headerX-currency_iso = c_x.
ENDIF.
*POPULATE ITEM DATA.
item-po_item = wa_dbtab-item.
item-material = wa_dbtab-matnr.
item-plant = wa_dbtab-werks.
item-matl_group = wa_dbtab-mat_grp.
item-quantity = wa_dbtab-menge.
item-net_price = wa_dbtab-netwr.
APPEND item.
CLEAR item.
*POPULATE ITEM FLAG TABLE
itemx-po_item = wa_dbtab-item.
itemx-po_itemx = c_x.
itemx-material = c_x.
itemx-plant = c_x .
itemx-matl_group = c_x.
itemx-quantity = c_x .
itemx-net_price = c_x.
APPEND itemx.
CLEAR itemx.
ENDLOOP.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = header
poheaderx = headerx
IMPORTING
exppurchaseorder = ponumber
TABLES
return = rettab
poitem = item
poitemx = itemx.
PERFORM f_bapi_errors.
IF bapi_err_count = 0.
PERFORM bapi_commit.
PERFORM f_bapi_errors.
WRITE: 'Created Po no:', ponumber COLOR 5.
else.
PERFORM bapi_commit.
ENDIF.
ENDFORM. " F_po_change
FORM f_bapi_errors *
FORM f_bapi_errors.
CLEAR: bapi_err_count, bapi_warnings.
LOOP AT rettab.
CASE rettab-type.
WHEN 'S' OR 'I'.
WHEN 'W'.
ADD 1 TO bapi_warnings.
WRITE rettab-message COLOR 3.
PERFORM zjnc_dump_list USING 'RETTAB[]' 'RETTAB' 'Bapi Errors Table'.
WHEN OTHERS.
ADD 1 TO bapi_err_count.
WRITE rettab-message COLOR 6.
PERFORM zjnc_dump_list USING 'RETTAB[]' 'RETTAB' 'Bapi Errors Table'.
ENDCASE.
ENDLOOP. " LOOP AT RETTAB
IF bapi_err_count <> 0.
MESSAGE e999 WITH 'Note Messages and inform SAP Support'.
ENDIF.
REFRESH rettab.
ENDFORM. "f_bapi_errors
*& Form bapi_commit
FORM bapi_commit.
commit the changes
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X' " COMMIT WORK AND WAIT
IMPORTING
return = rettab. " Confirmations
ENDFORM. "bapi_commit
can anyone me how to solve it.HI,
Also 'Can delivery date be met ' is the usual information meesage u get when u give date atleast a day after today as date .
Write an inner join for vendor master table and the PO details
(Which is also a recommened way of checking value from master table all the time )
Maybe you are looking for
-
Word 2010 to pdf in Acrobat X under Win 7 64: numbers and letters added to bookmarks
In some documents I convert, the bookmarks are prefixed with what appear to be 'internal' codes like 99B; in others -- based on the same template, and with the same formatting -- the bookmarks are created appropriately. It's clearly a Word 2010/Acrob
-
I hav an Imac and all of a sudden I cannot ope most apple programs like Iphoto. when I try to update the software I cannot open software update nor the app store.
-
Hi all, I'm trying to set a workflow to be generate when i create a new PO. (With tcode ME21N) I tried to put a workflow on BUS2012 (which i think is the correct one for this transaction): BUS2012 RELEASED WS90000004 BUS2012 RELEASESTEPCR
-
Is there a way to make the wires disappear?
My program has grown pretty big and now there are wires everywere. I remember that I had that same problem when I used Logic Works and the way to fix it was to give names to the notes and then the whole thing would be "wireless". Is there anything li
-
Address data pop up in Email Header
Hi Experts, While creating a new Email in inteaction center, when we give some name in TO field and click on CHECK button then a pop up opens with all possible names. When we click on any one of these names, again a new pop up for ADDRESS DATA comes