How to call DLL in BSP
hi,
1. Can anyone suggest me how to call a dll in a bsp. if you can help me with a sample code it'll be helpful.
2. Is it possible to call VBScript in BSP
Thnx in Advance
Vinodh
It is done the same way you do in normal HTML.
A BSP is only an HTML page which ABAP is compiled into during runtime just like a JSP page or ASP page.
<htmlb:content design="design2003">
<htmlb:page title = "Test submit ">
<htmlb:form id="myform" method="POST" enctype="multipart/form-data">
<htmlb:inputField id="myFile"
visible="true"
width="300px" /><br>
<htmlb:listBox id="filelist"
width="300px" />
<script>
function selectFolder(){
var myText = "Browse for file";
var objShell = new ActiveXObject("Shell.Application");
var ssfWINDOWS = 0;
var objFolder;
objFolder = objShell.BrowseForFolder(0, myText, 0, ssfWINDOWS);
if (objFolder != null) {
document.forms.myform.myFile.value=objFolder.Items().Item().Path;
getFileList(objFolder.Items().Item().Path);
function getFileList(id) {
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var myStartingFolder = id;
if ( myStartingFolder != null || myStartingFolder != "" ) {
var myFolder = FSO.GetFolder( myStartingFolder );
var myFileList = new Enumerator(myFolder.files);
// First clear all entries
document.forms.myform.filelist.options.length = 0;
for (; !myFileList.atEnd(); myFileList.moveNext()) {
document.forms.myform.filelist.options[document.forms.myform.filelist.options.length] = new Option(myFileList.item().name,FSO.GetFileName(myFileList.item()));
} // start folder found
} // getFileList
</script>
<htmlb:button id="myButton"
onClientClick="selectFolder()"
text="Browse" />
</htmlb:form>
</htmlb:page>
</htmlb:content>
Just remember with ActiveX you have security issues to keep in mind!
Similar Messages
-
hi,
Can anyone suggest me how to call a dll in a bsp. if you can help me with a sample code it'll be helpful.
Thnx in Advance
VinodhWhat exactly do you mean by calling a DLL? Do you want to host an ActiveX Control? Do you want to call a DCom Object or a .Net Object? Or perhaps you are wanting to call a WebService writting in .Net?
For a Native DCom Object or .Net Object your would need the SAP DCom Connector or .Net Connector respectively. For an ActiveX control, BSP is no different than any other Web environment - Client Side JavaScript or VBScript should do the trick. I'm sure you can google many an example from the Web.
If I am off base here, just let me know. Also this question might be better suited to the BSP forum instead of the ABAP one. -
How to call webservices in BSP and ABAP
I am new to use webservices.Please help me to call a ABAP Webservice in ABAP program and How to call a other Webservice like Java Webservice in ABAP. Please give me steps to follow.
Thanks,
Suneetha.May be this prog. will give u the required info.
Use a free web service in an ABAP program which validates * an email-id.
REPORT zvalidate_email.
PARAMETERS: p_mail(100) LOWER CASE. " E-Mail id to be verified
DATA: http_client TYPE REF TO if_http_client .
DATA: w_string TYPE string ,
w_result TYPE string ,
r_str TYPE string .
DATA: result_tab TYPE TABLE OF string.
START-OF-SELECTION .
CLEAR w_string .
CONCATENATE
'http://www.webservicex.net/ValidateEmail.asmx/IsValidEmail?Email=' p_mail
INTO
w_string .
CALL METHOD cl_http_client=>create_by_url
EXPORTING
url = w_string
IMPORTING
client = http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
CALL METHOD http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
CALL METHOD http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
CLEAR w_result .
w_result = http_client->response->get_cdata( ).
REFRESH result_tab .
SPLIT w_result AT cl_abap_char_utilities=>cr_lf INTO TABLE result_tab .
READ TABLE result_tab INTO r_str INDEX 2.
IF r_str+44(1) = 't'.
WRITE:/ 'Valid email address'.
ELSE.
WRITE:/ 'Invalid email address'.
ENDIF. -
i have a .DLL file made in VB6, this file return me some info in String format.
how can i call this file and get data.
any suggestion....?sabre150 wrote:
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
I've heard that jna is easier to use, haven't had to go native myself for a long time though. -
Hi everybody,
I am trying to call a dll from my java application. Pls tell me how to do it, I seached and found JNI. Is it true
pls help me and send me some examples
Thank you and have a nice dayjava_and_me wrote:
I am trying to call a dll from my java application. Pls tell me how to do it, I seached and found JNI. Is it trueYes, it is true. JNI is the way to go. You'll probably have to write some C code on your own as well, as the DLL is unlikely to be in the format expected by Java already.
pls help me and send me some examplesOf course. [Here you are|http://www.lmgtfy.com/?q=JNI+tutorial]. -
How to call dlls for valve system
I need to call the dll file I made from visual C++.The main theme is to control valve system from labview. I put the control switches(booleans) in labview and now want to connect it to the initial C++ program I made for valve control.Is there any way that I can use the on/off switchs(booleans) and code interface node for the system to work?Please help.I am having problems with dll calling .
I got the message" call library function :function not found in library".
I had checked for the function name,its same as is on the header file.I had tried for both C and stdcall calling conventions,still it didnot work.
please suggest what could be wrong. -
How to call custom BSP application (copied from standard)
Hi,
I came across 1 interesting link in SDN.
[Enhancement procedure of BSP application HRRCF_RECRUITER in eRecruitment]
My requirement is also similar.
I need to copy the HRRCF_TRM_SRCH application.
I know how to make the changes for the logic (like copying the standard controller & iterator class etc.)
But I donu2019t know how to call the custom BSP application.
One requirement is, I need to call a BSP application, in which there are only UI(user interface/screen) changes .
That is, if there are only changes made to hitlist_cand.bsp page . And no changes made to hitlist_cand.do page.
Eg: Removing one button from screen.
Second requirement is, I need to call a BSP application in which there are logic changes also.
(I know how to change the standard controller class to custom class)
Eg: Changing logic of button.
We tried renaming the application name from standard to custom one (with Namespace=SAP itself, though it gave a warning) in the table T77RCF_LOG_APPL .
Then we used this name to configure the start page link. But still the execution control is going to standard page & not to custom BSP application.
How will I know which BSP application(Appl A), is calling the BSP application (Appl B) in which I want to make changes ?
The starting application is HRRCF_START_INT.
Would really appreciate solutions posted.
Thanks,
Nisha Vengal.Hi Nisha,
I think you have an issue to call custom BSP.
- Ignore the warning message (in the table T77RCF_LOG_APPL) as it is just a warning message. I did not touch start page link at all.
- Additionally you need to make (I had to made) an entry in table u2018V77RCF_SMG_NAVIu2019.
Let me know, if you need anything else.
...Naddy -
LabVIEW Gurus:
I am working with some software engineers who have no experience in LabVIEW. Unfortunately I have little experience in C/C++ to make sense of their inquiry.
Basically we are dealing with “Data Marshalling”. I will call a DLL and issue a command (string) and get back a 2-D array and an integer. So far so good.
The C/C++ programmer requested that I provide them with a pointer/memory address in which they will store data, so I can read it once the dll returns the array and integer. I browsed through the example online http://decibel.ni.com/content/docs/DOC-1690 and thought that if I wanted to read from the dll, the process is a simple as calling the appropriate function and configure the parameter (no pointers needed).
So, is there a specific way that they need to write the C/C++ code to be used in LabVIEW? Or what else to I have to take into consideration?
Thank you,
SantiagoThat example is pretty simplistic as it only deals with integers. In this case no pointers are required since everything is returned by value. When you're dealing with arrays, however, you need to deal with pointers. If you open the Example Finder (Help -> Find Examples) and search for "dll" you will see the "Call DLL" example. That contains many examples of how to call DLL functions with a wide variety of datatypes. I strongly suggest looking at that example. There is also a chapter in the LabVIEW Help on calling DLLs (Fundamentals -> Calling Code Written in Text-Based Progamming Language).
You have 2 things to consider:
You're dealing with arrays - this means you typically need to pre-allocate the memory in LabVIEW, and it sounds like that's what the DLL expects you to do. This amounts to using the Initialize Array function to create your 2D array of the appropriate size and datatype.
You may be dealing with a C++ DLL. LabVIEW can only interface to C DLLs. This doesn't mean that you can't create a DLL in C++, but it does mean that the C++ programmers need to add an extern "C" modifier to the function calls, otherwise you get name mangling, and LabVIEW won't be able to call the DLL. The DLL programmers should know what that means. -
How to call a labview dll from excel-VBA?
How to call a simple Labview DLL from Excel VBA?
I have seen examples of DLL calls from VB but does it work the same way for VBA? I have 2000 excel and Labview 8.5. I created the DLL and tried to call it from VBA using the same type of code as in NI's website example(ofcourse its a bit diff with 8.5)
http://zone.ni.com/devzone/cda/tut/p/id/...
BUT it errors out when called from excel
ERROR: The object invoked has disconnected from its clientYou would need to provide more details about the LabVIEW DLL, such as the prototypes of the functions (VIs) that you're trying to call, and your actual VBA code. Specifically, what object you're trying to create. You should also make sure the Run-Time Enginer is installed, as well as any required libraries such as the VISA Run-Time if you're using VISA. Have you made sure to enable the ActiveX server for the DLL?
A search yielded the following items that you may wish to peruse:
http://forums.ni.com/ni/board/message?board.id=170&message.id=261345&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=45099&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=299209&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=195846&requireLogin=False -
How to call a Webdynpro view from BSP page (MVC) in a new window?
Dear Experts,
kindly advise how to call a webdynpro view from BSP application after performing an event (through button or hyper link).
Regards,
Sarat.Hi,
This has been discussed many times in several forums.
Please check the method CL_WD_UTILITIES=>CONSTRUCT_WD_URL, to create a runtime url for your WD Application and call this URL.
Refer thread: Call Webdynpro Application from BSP Application
Hope this will be useful!
Regards,
Meganadhan S -
How to call BSP based iview using Parameters
Hi,
i developed one BSP application which takes 2 input parameters 1. Document No 2. Item No.
I created a iView based on this BSP Application. I would like to call this iView by hardcoding input parameters.
Input: Document No, Item and Submit button. output displays some text based on input. which is working fine, No issues.
Now, i developed a iViews using these BSP application. If i call iViews, again no Issues. Which works great, we need to enter input manally.
I would like to call my iViews with document no = '0004000000' , Item No = '000001' and Submit = 'SET'. Which directly should display the data for above document item.
that means iView URL + Document = '0000400000' & Item = '000001' & submit = 'SET'.
how to call Parametrized iViews???
I'm talking about Application Parameters in documentation (http://help.sap.com/saphelp_nw04/Helpdata/EN/88/266a3e54a2e946e10000000a114084/content.htm).
ApplicationParameter
You can enter parameter values for certain screen fields for displaying a SAP transaction here.
This field is optional.
The parameter values are specified with the following syntax:
<Screen_field1>=<Parameter1>
&<Screen_field2>=<Parameter2>
&<...>=<...>,...
Thanks,
Ben.
Edited by: Nagesh Ganisetti on Jan 29, 2009 9:18 AMI want to pass values dynamically? How to pass values dynamically using URL???
assume my BSP URL wiht parameters:
http://nwd2bw1.corp.analog.com:8001/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sap/zzsdpra123/start.htm?gv_doc=0040013811&gv_item=000001 WORKING GREAT!!!
Developed an iView using ZZPRA123 BSP application in portal without APPLICATION PARAMETERS.
http://nwd2bw1.corp.analog.com:50100/irj/servlet/prt/portal/prtmode/preview/prtroot/pcd!3aportalcontent!2fcom.analog.analog!2fcom.analog.SD_BI_REPORTS!2fcom.analog.SD_iviews!2fcom.analog.z_quote_text?sap-config-mode=true&_gv_doc%3d0040013811&gv_item%3d000001 NOT WORKING.
Simple BSP application: ON INITIALIZATION Method
event handler for data retrieval
data: gv_name type thead-tdname.
data: lt_line1 type standard table of tline,
lt_line2 type standard table of tline,
lt_line3 type standard table of tline,
lt_line4 type standard table of tline.
data: l_rfcwa type rfcdest.
data: event type ref to cl_htmlb_event,
url type string,
parameter type string,
url_page type ref to if_bsp_page.
l_rfcwa = 'PRD_CLI002'.
if gv_doc is initial.
CALL METHOD request->get_form_field
EXPORTING
name = 'gv_doc'
formfield_encoding = 0
receiving
value = gv_doc.
endif.
concatenate gv_doc gv_item into gv_name.
call function 'ZBI_STNDARD_TEXT'
destination l_rfcwa
exporting
name = gv_name
tables
lines1 = lt_line1
lines2 = lt_line2
lines3 = lt_line3
lines4 = lt_line4.
gt_line1[] = lt_line1[]. "Internal Header Text
gt_line2[] = lt_line2[].
gt_line3[] = lt_line3[].
gt_line4[] = lt_line4[].
Layout:
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
<htmlb:page title="Quote Texts " >
<htmlb:form>
<htmlb:inputField id = "gv_sid"
value = "<%= gv_doc %>"
visible = "FALSE"
submitOnEnter = "TRUE" />
<htmlb:inputField
id = "gv_itm"
value = "<%= gv_item %>"
visible = "FALSE"
submitOnEnter = "TRUE" />
<htmlb:textView text = "Quote Texts for <%= gv_doc %> "
design = "HEADER1"
layout = "BLOCK"
textColor = "dark blue" />
<% if gt_line1 is INITIAL. %>
<htmlb:textView text = "No Internal Header Text Found"
design = "HEADER2" />
<% else. %>
<htmlb:textView text = "Internal Header Text"
design = "HEADER2" />
<% loop at gt_line1 into gs_line. %>
<htmlb:textView id = "textEdit"
layout = "BLOCK"
text = "<%= gs_line-tdline %>" />
<% endloop. %>
<% ENDIF. %>
<%--* External Header text --%>
<% if gt_line2 is INITIAL. %>
<htmlb:textView text = "No External Header Text Found"
layout = "BLOCK"
design = "HEADER2" />
<% else. %>
<htmlb:textView text = "External Header Text"
layout = "BLOCK"
design = "HEADER2" />
<% clear gs_line. %>
<% loop at gt_line2 into gs_line. %>
<htmlb:textView id = "textEdit"
layout = "BLOCK"
text = "<%= gs_line-tdline %>" />
<% endloop. %>
<% ENDIF. %>
<%Internal Item text%>
<% if gt_line3 is INITIAL. %>
<htmlb:textView text = "No Internal Item Text Found"
layout = "BLOCK"
design = "HEADER2" />
<% else. %>
<htmlb:textView text = "Internal Item Text"
layout = "BLOCK"
design = "HEADER2" />
<% clear gs_line. %>
<% loop at gt_line3 into gs_line. %>
<htmlb:textView id = "textEdit"
layout = "BLOCK"
text = "<%= gs_line-tdline %>" />
<% endloop. %>
<% ENDIF. %>
<%External Item text%>
<% if gt_line4 is INITIAL. %>
<htmlb:textView text = "No External Item Text Found"
layout = "BLOCK"
design = "HEADER2" />
<% else. %>
<htmlb:textView text = "External Item Text"
layout = "BLOCK"
design = "HEADER2" />
<% clear gs_line. %>
<% loop at gt_line4 into gs_line. %>
<htmlb:textView id = "textEdit"
layout = "BLOCK"
text = "<%= gs_line-tdline %>" />
<% endloop. %>
<% ENDIF. %>
</htmlb:form>
</htmlb:page>
</htmlb:content>
Please guide me to call iview using dynamic parameters.
Thanks,
Ben.
Edited by: Nagesh Ganisetti on Feb 2, 2009 8:47 AM
Edited by: Nagesh Ganisetti on Feb 2, 2009 8:48 AM
Edited by: Nagesh Ganisetti on Feb 2, 2009 8:49 AM -
How to call an abap report in BSP..
hi all,
Please can anybody tell me how to call an abap report in BSP application.....since I am new to BSP....
with regards,
Santoshcheck this thread
Urgent!! How to call a custom transaction or an ABAP program in BSP? -
How to call a abap report in BSP
hi all,
Please can anybody tell me how to call abap report in BSP..
with regards,
Santosh.Also see below BSP tutorial
http://help.sap.com/saphelp_nw04/helpdata/en/c8/101c3a1cf1c54be10000000a114084/content.htm
Regards. -
"HOW to use Labview call Dll compiled by VC++"
"hello,I use VC++ compile a DLL,and i want to call DLL Function in LABVIEW program.But there is a dll function
when i call it in labview.There is error.The prototype of Dll Function that make error is "USHORT DLLFUN __stdcall IBWRT(unsigned short dev_address,const char *pstrWrite)",The second paramenter is a char pointer,
and the paramenter pass a command which content is
"MEASURE:CURRENTC? 1A,0.001MA".
When i use VC++ to call this function,i program followed:
CString m_wrt;
int ReturnW;
m_wrt="MEASURE:CURRENTC? 1A,0.001MA";
char buffer[40];
strcpy(buffer,m_wrt);
ReturnW=IBWRT(4,buffer);
and this call is correct.
But when i use labview to call this function.ther
e is
error.So, who can help me,to tell me how to call this
function.Thanks."Are you asking about porting code or calling C++ code in LabVIEW? As far as porting code, there's no easy way to move code back and forth between LabVIEW and C++. However, if you are trying to call C++ code in LabVIEW, you can compile it as a DLL and call it in LabVIEW using the Call Library Function node.
Chad B. » National Instruments » ni.com -
How to call the DLL writing in Vb6.0 from testsatnd?
Hi,
I want to call a dll writting in VB6.0 from teststand. But as i see from the "Step Setting" in teststand, only the C/C++ Dll can be selected in the "adapter" type. I try to use this one as my adapter to call my VB6.0 dll, in result, there is no function can be seen in the "function" tab in teststand.Anyone know how to call the DLL writing in Vb6.0?
Solved!
Go to Solution.Hi Ivan,
Just to be sure that your DLL is not wrong
you have check if all functions are well and present.
There is tool called "Dependency Walker" You can download it at http://dependencywalker.com/ .
With it you can look "inside" your dll
If you will see your functions there, you will see them (in my case !!always!!) in TestStand, too.
Hope this helps
Greetings
Juergen
=s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
Maybe you are looking for
-
What is the difference between Create shapes or masks from text characters?
What is the main difference between Create shapes or masks from text characters and why use one over the other, or when is one preferred over the other? I am still fairly new to AE and am trying to better understand this, or can you point me to where
-
Free characteristics Functioanlity is not working please advice
HI I got an problem in the report with the multiprovider ZCOPA_M01 If I open the report for this multiprovider and there are 2 default characteristics displayed in the query and after removing the drill down for those two characteristics and Now IF I
-
Whenever I reply to an e-mail the window comes up but without the paper airplane in the top left corner. The only way to send the reply is to close it and save as a draft. Then I can pull it up from Drafts and it has the airplane on it.
-
when downloading the new Flash Player to view video on Facebook * Shockwave Flash 11.1 r102 * Google Update * The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web sit
-
Well, with the new PS3 update, the PS3 can connect to Media Servers. I have been trying to connect the PS3 with my computer wirelessly. I own an iMac and an Airport which gives me a wireless internet connection for my iMac, MacBook, PSP, and PS3. The