Function to Sub Conversion
Howdy,
I've got a very basic question, I have a simple function, I wanna convert it to sub!
Private Function getActiveHyperlink() As IHTMLElement
Dim element As IHTMLElement = HtmlEditor1.StateQuery.GetActiveHtmlElement()
While String.Compare(element.tagName, "BODY", StringComparison.OrdinalIgnoreCase) <> 0
If String.Compare(element.tagName, "A", StringComparison.OrdinalIgnoreCase) = 0 Then
Return element
End If
element = element.parentElement
End While
Return Nothing
End Function
The conversion is so easy, just remove the "Private Function" and "End Function" but I don't know how to do with Return(s) in a sub!
Cheers.
The conversion is so easy, just remove the "Private Function" and "End Function" but I don't know how to do with Return(s) in a sub!
Why?
Private Sub getActiveHyperlink(ByRef thisIHTMLElement As IHTMLElement)
Dim element As IHTMLElement = HtmlEditor1.StateQuery.GetActiveHtmlElement()
While String.Compare(element.tagName, "BODY", StringComparison.OrdinalIgnoreCase) <> 0
If String.Compare(element.tagName, "A", StringComparison.OrdinalIgnoreCase) = 0 Then
thisIHTMLElement = element
End If
thisIHTMLElement = element.parentElement
End While
thisIHTMLElement = Nothing
End Sub
Similar Messages
-
MouseListener for mousedown function in sub-menu buttons
Hello people, sorry to ask this as i am quite new to using AS
in flash, im using AS2.
Basically i have a menu which appears on a mouseover on a
button, on this menu i have some buttons. These buttons need to
have the function that when the user clicks and holds down the
mouse button it moves through an animation frame by frame.
i understand the basica principal of:
var mouseListener:object = newObject ();
then calling it
mouseListener.onMouseDown = function() {
imgBar.prevFrame();
if you see my attached code you will see this is basically
it, i will attach the code that i have on the top level of my flash
file, the onPress functions currently work but i need them replaced
with onMouseDown.
As i said i am quite new to this so i appologise if this is a
noobish error.
Thanks for you time and help.I'm not sure what "i-apps" is. Could you let me know?
iPhoto, iTunes, iDVD, iMovie, etc.
I tried to do the two suggestions at the link from Glo H. First, I dragged out the song and then the background music that was in there. When I clicked on the black audio icon, no sound waves appeared.
I think it is just this sub-menu in this one particular theme that is having a problem.
Drag the music of your choice to the audio well, and look at the slider for menu volume. Is it to the far left, for "minimum"? If it is, move it to the middle.
If the problem persists, give this basic remedy a try. Quit iDVD and delete your iDVD preferences. To do this, go to your username> library> preferences> com.apple.idvd.plist. Delete this file. Then reopen iDVD; it will create a new preference file with all of the default settings. -
Function module for conversion in basic unit of measure....
Hi,
Can someone give me a function module, which will convert the Unit of measure into basic unit of measure
Say a a material has 3 CA (Cases) in a PO and the conversion factor(UMREZ in table MARAM) for CA for that material is 4 and converison for MP (Master pack) is 12,then
3CA = 9 PC = (9/12) MP
But I want a function module which will do this conversions ?Hi,
Use MD_CONVERT_MATERIAL_UNIT
Thanks,
Naren -
Function Module for conversion from one UOM to any other UOM
Hi All,
I need to convert a quantity value that user inputs in any UOM and want to convert this Quantity to 'KG' in CRM
Can any one please tell me any Function Module to do so?
NOTE: I need this in CRM
Thanks and Regards
Shekhar
Edited by: shekhar tagra on Jul 26, 2010 4:54 PM
Edited by: shekhar tagra on Jul 26, 2010 4:55 PMHi ,
i'm using the conversion function UPX_CRM_CONVERSION_FACTOR in planning layout where there is in column the calendar week.
So when select one week, the function return 0 instead if i select more than one week, only on the last week, the conversion factor is 0.
Why this function have this behavior? I would that the conversion factor is the same for all week.
Thanks.
Andrea -
Function module for conversion from dollar to indian currency
what is the standard function module used for the conversion of one type of currency to other?
try this CONVERT_TO_LOCAL_CURRENCY.
Otherwise go to se37 and search for ConvertCurrency -
Query on Function Module for conversion of text - language specific
Hi,
In my interface program i have query regarding CDHDR table.
Problem: Object Class(CDHDR-OBJECTCLAS). The technical name of the object name shall
be translated to meaningful business text
For EXample. I am getting the value for the field OBJECTCLAS is EINKBELEG shall be converted as 'Purchasing Document'
Kindly suggest me if there any standard SAP function module is available to convert the German text into EnglishHi,
to pass the internal table to a tables parameter
both must be of same type
if both are of same type
u can use INT1[] = INT2[] to pass internal table value to internal table of FM
if structures are not same then
u will have to loop thru int1 and move values selectively to int2 and everytime append int2
this should sove ur prob
tc
saji -
Partner function - Vendor sub range at Po and Goods receipt
Hi friends,
I maintained Vendor -A , Mainvendor. This vendor having multiple Locations in Indai.
for taht i maintained create each location as one vendor and assign in vendor sub-range.
When i create purchase order main vendor - A i placed to order. In that PO having 3 line items.
line item 1 - ordered & Goods supply from Vendor -B. so in Vendor sub range i maintained Vendeor - B.
line item 2 - ordered & Goods supply from Vendor -C. so in Vendor sub range i maintained Vendeor - C.
line item 3 - ordered & Goods supply from Vendor -D. so in Vendor sub range i maintained Vendeor - D.
When i made Goods Receipt How system consider each item wise goods supplier different . How ll i capture Excise for supplier.
But in SAP Po header having only one Goods supplier accepting. how mainatin for this process.Hi,
Vendor Sub range functionlity is mainly used for alternative Partner data control likes multiple currencies, purchasing data, FOB,Min order values and partners data.
In your case you have maintained different locations for a vendor using the vendor sub range. Based on the line item vice system received the locations in MIGO. Any have your order will send to single main vendor. VSR allow different purchasing and partner data controls not different vendor. Once you have chose the VSR code in PO item vice FOB locations changed.
Thanks,
Thiru
Edited by: thiru on Jul 15, 2010 5:56 AM -
Missing functionality of file conversion by right click in windows
Previously I was able to right click on a file on the desktop of folder which would bring up a window which had "conver to pdf" and other pdf options. Due to a crash, I had to reinstall Acrobat Pro 8 but the ability to right click on a file and convert to pdf is no longer available in the right click menu. I have reinstalled Acrobat and updated but to no avail. I am using XP and Office 2207. I have no problems converting from within the application such as Word or in Acrobat but would like the convenience of being able to convert by right clicking a file.
Any suggestions or help would be greatly appreciated!
StanI checked the preferences and document settings and there wasn't anything that could be configured there. Thanks any way.
Stan -
Using CORR function with sub-queries
I need to compute the correlation of two datasets, however here is my problem:
The table stores responses to a questionnaire, with these columns:
RESPONSE_ID, QUES_ID, ANS_CD
What my query needs to get is the Correlation of 2 sets of ANS_CD, one with QUES_ID=x and one with QUES_ID=y. What I have looks like this:
SELECT CORR ((SELECT ans_cd
FROM fact_responses
WHERE ques_id=x) ,
(SELECT ans_cd
FROM fact_responses
WHERE ques_id=y)
FROM fact_responses
And i get a 'single row subquery returns more than one row' error. Can someone who has more experience with this help me out? I don't want to create a new table to store the data for this one reportThe short and sweet of it is that you are trying to correlate question x against question y. With three questions, you are looking for the correlation as such:
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
Is that correct? -
Functionality of GL & Sub-GL in ECC 6.0
Hi Guys,
In SAP ECC6.0, is there any functionality of Sub-General Ledger (Sub-GL) within main GL? As far as master records are concerned, I understand that these are the Sub-GLs and there is one recon a/c, but what if within a GL, I wnat to see further bifurcation. For eg. Within Provision for expense a/c I want to see the expense heads.
Please let me know the GL & Sub-GL functionality in ECC6.0
Thanks in Advance,
Amish.Hi Amish,
Normally this is the requirement of those clients who were using Oracle prior to SAP. As there is no concept of Sub-GL's of GL accounts in SAP, the informations are provided through different reports. I think both of your requirements can be met through AIS (Audit Information System).
Got to SAP Query...... T.Code SQ01....... Select thee Cross Client area.
Select User Group /SAPQUERY/AU Audit Information System (AIS)
Execute the query...... OS *** A I S *** G/L Account Analysis
In the selection screen enter the number of your provision account and execute the report. It'll show you all the other GL accounts which were posted against the provision account. You can also limit the data by period/posting date selection.
I hope it'll work................... if it is not then you better create a query or an ABAP report.
Regards, -
Re-using a function with minor changes to load sub Nav menu
Hi.
I have a function that loads xml and uses its to create a
main navigation menu. When an object is selected the movie detects
which button has been selected and traces the label for that
button. I need to take this a step further and have a
sub-navigation menu load when the "Home2" button is selected. As
you can see from the comments in the code with 2 minor changes to
the createBoxes function, the sub-nav menu can be loaded instead of
the main nav menu. My problem is this, I need to main nav menu is
be present at all times, I only need the sub nav to load when the
Home 2 button is pressed and I somehow need to reuse the
createBoxes function with the changes stated in the the comments in
order to load the sub nav menu when required. I want to reuse this
function (if possible) instead of duplicating the code in a new
function.
If anyone can show me how this is done I would be very
greatful.
Thanks
Barry.basically the submenu will look exactly the same as the main
menu, only it will be positioned to the right of it when the home2
button is pressed. I then need it to unload when any other button
is pressed. By changing the following lines in the current
createBoxes function the submenu loads as I would like. I am just
wondering if it is possible to pass in a couple of vars to change
the lines of code as detailed below, depending on whether the home2
button or one of the other mainn nav buttons is pressed.
The code that when changed loads the submenu:
In function createBoxes change var il:XMLList =
xml.navigation.main_navigation; to var il:XMLList =
xml.navigation.main_navigation.sub_navigation; . This loads the sub
nav instead of the main nav but in the same position as the main
nav.
by also changing box.x = 100; to box.x = 260; in the function
createBoxes the sub nav menu loads in the position I would like it
to be.
Now I am wondering if changing the code to something like the
following (see attached code) could this work?
Barry. -
Function returning control via CType. Is this risk-free?
I want an easy way to get a TabPage's child (user)control without writing CType() functions everywhere.
For this I created a function that returns the control via CType:
Private Function ChildIRCControl() As IRCControl
Return CType(Me.TabControl1.TabPages(Me.TabControl1.SelectedIndex).Controls(1), IRCControl)
End Function
Now, is this risk-free to do or are there any chances that it will bug or don't work in some cases?
Thanks
//Visual Vincent
EDIT:
Now to rephrase and explain my badly written question:
The user is able to create new tabs, and for each new tab a IRCControl (which is a UserControl) is added to the tab's controlcollection.
Now there's no problem doing the above. BUT since the tabs are created programmatically, I cannot get the control inside the tabpage without some kind of cast function.
Example of creating a new tab:
Private Sub CreateNewTab()
Dim IRCc As New IRCControl 'This is a normal UserControl.
Me.TabControl1.TabPages.Add("New Tab")
Me.TabControl1.TabPages(Me.TabControl1.SelectedIndex).Controls.Add(<a control that has nothing to do with this question>)
Me.TabControl1.TabPages(Me.TabControl1.SelectedIndex).Controls.Add(IRCc)
End Sub
Now to access the UserControl in the currently selected tab I need some kind of Cast function. I use CType for this:
CType(Me.TabControl1.TabPages(Me.TabControl1.SelectedIndex).Controls(1), IRCControl)
But typing this long CType function in every If statement needed and every Loop used takes time, and is horrible to read.
Now, will it work just like the normal CType if I access it like this instead?
Private Function ChildIRCControl() As IRCControl 'The UserControl
Return CType(Me.TabControl1.TabPages(Me.TabControl1.SelectedIndex).Controls(1), IRCControl)
End Function
Private Sub ModifyTextBox() 'Example
ChildIRCControl().TextBox1.Text = "Hello World!"
End Sub
Hope this explanation is better for you guys, and sorry for not bringing all this up before.
I hope your day has been better than yesterday, but that it's worse than tomorrow...
Please mark as answer if I solved your problem. :)Now, is this risk-free to do or are there any chances that it will bug or don't work in some cases?
To make it safe you would subclass the Tab and TabPage controls and make this method a function of the new Tab. Then, that class would include code to ensure that only your custom tab pages were added, and that for each added tab page the first
control was the correct type - presumably creating it automatically or from a value passed to it in the constructor. That control is then a property of the tab page, and there is no need to use the Controls collection or do any type conversion.
The problem is that you actually have no control over the order of items added into the Controls array if you are using the designer. Even if you are sure that each tab page has one of the controls, it might not be at index 1.
You could scan the tab page Controls collection, but if there are several of that control type then you also need a way to know which one you really want. That's what your code should be checking. If you correctly identify the control in
the collection there is no need for CType - it's already the correct type. You can check the type without trying to do the conversion by using TypeOf. See
https://msdn.microsoft.com/en-us/library/0ec5kw18.aspx
Thanks for the answer.
I guess I could have added this to my initial question too: I'm creating the TabPages and UserControls programmatically and that's why I need to use some kind of Cast function. There are two controls in each tabpage, and they're added in this order:
Private Sub <Some kind of sub>()
Dim IRCc As New IRCControl 'The UserControl
<The new TabPage>.Controls.Add(<The other control>)
<The new TabPage>.Controls.Add(IRCc)
End Sub
So the only thing I wanted to know was if I could do this:
If ChildIRCControl().TextBox1.Text = "blahablaha"
ChildIRCControl().RichTextBox1.Text = "blabla"
End If
Instead of writing the long CType, or any other cast function all the time,
If CType(Me.TabControl1.TabPages(Me.TabControl1.SelectedIndex).Controls(1), IRCControl).TextBox1.Text = "blahablaha" Then
CType(Me.TabControl1.TabPages(Me.TabControl1.SelectedIndex).Controls(1), IRCControl).RichTextBox1.Text = " "blabla"
End If
as it's both a readability and writability nightmare.
And at last I apologize for the badly explaining question that I wrote.
I hope your day has been better than yesterday, but that it's worse than tomorrow...
Please mark as answer if I solved your problem. :) -
How to call a function with parameters in ScriptStart function
i am trying to call ScriptStart function from SUD dialog. This is how iam calling Call ScriptStart(path & "test.vbs","abc") abc is function which is written test.vbs. It is working. But when i want to pass some parameters to the abc function of test.vbs. It is not working why. can anybody suggest where i went wrong. I am calling the same function as Call ScriptStart(path & "test.vbs","abc(" & text1.Text & ")"). It is not working why ? Is the ScriptStart function only point to functions. it does not take any parameters or waht ?
Hi abc421,
Another option in addition to UserCommands would be to use ScriptInclude(path). If you execute a ScriptInclude(path) command at the beginning of your VBScript, then all the functions and Subs in the VBscript located at "path" are now available to you-- including passing parameters and receiving return values from functions. If you are calling a VBscript that uses only VBScript variables, then this is the preferred method.
If instead you are calling a VBScript that uses global DIAdem variables declared in a VAS file (their variable names all end with the "_" character), then those parameters are already available at the subroutine called with ScriptStart(path, routine).
Brad Turpin
DIAdem Product Support Engineer
National Instruments -
Problem calling Oracle function from Access 2007 / ADO
Hopefully, I'm posting this in the correct forum. I'm also posting on an Access forum as I'm not entirely sure where the issue lies.
I'm calling an Oracle function from Access 2007 using an ADO Command object.
The function takes three input parameters and has a return value and an output parameter. The output parameter is a BLOB, and the return value is varchar2 (either "T" or "N") based on the outcome of the function.
If I pass correct values to the function, I get the following error message (errs out on the command.execute line):
Run-time error '-2147467259 (80004005)':
[Oracle][ODBC][Ora]ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 1
Here's the function:
FUNCTION GET_ITEMREV_ATTACH(P_ORGANIZATION_ID IN NUMBER,
P_INVENTORY_ITEM_ID IN NUMBER,
P_REVISION IN VARCHAR2,
X_DRAWING OUT BLOB) RETURN VARCHAR2 IS
RESULT VARCHAR2(1);
BEGIN
RESULT := 'T';
BEGIN
SELECT L.FILE_DATA
INTO X_DRAWING
FROM FND_ATTACHED_DOCUMENTS AD,
MTL_ITEM_REVISIONS_B IR,
FND_DOCUMENTS_TL D,
FND_LOBS L
WHERE AD.ENTITY_NAME = 'MTL_ITEM_REVISIONS' AND
AD.PK1_VALUE = IR.ORGANIZATION_ID AND
AD.PK2_VALUE = IR.INVENTORY_ITEM_ID AND
AD.PK3_VALUE = IR.REVISION_ID AND
AD.CATEGORY_ID = 1001216 AND
D.DOCUMENT_ID = AD.DOCUMENT_ID AND
D.LANGUAGE = 'US' AND
L.FILE_ID = D.MEDIA_ID AND
IR.ORGANIZATION_ID = P_ORGANIZATION_ID AND
IR.INVENTORY_ITEM_ID = P_INVENTORY_ITEM_ID AND
IR.REVISION = P_REVISION;
EXCEPTION
WHEN OTHERS THEN
RESULT := 'N';
END;
RETURN(RESULT);
END GET_ITEMREV_ATTACH;
Here's the VB code I'm using to call the function:
Private Sub Command8_Click()
Dim CMD As New ADODB.Command
Dim conn As ADODB.Connection
Dim Param1 As ADODB.Parameter
Dim Param2 As ADODB.Parameter
Dim Param3 As ADODB.Parameter
Dim ParamBlob As ADODB.Parameter
Dim ParamReturn As ADODB.Parameter
Set conn = New ADODB.Connection
With conn
.ConnectionString = "Driver={Oracle in OraHome92};Dbq=OAPLY;UID=***;PWD=*******"
.CursorLocation = adUseClient
.Open
End With
Set CMD = New ADODB.Command
Set CMD.ActiveConnection = conn
CMD.CommandText = "immi_attach_pub.get_itemrev_attach"
CMD.CommandType = adCmdStoredProc
Set ParamReturn = CMD.CreateParameter("RESULT", adVarChar, adParamReturnValue, 1)
CMD.Parameters.Append ParamReturn
Set Param1 = CMD.CreateParameter("P_ORGANIZATION_ID", adInteger, adParamInput, 1, 6)
CMD.Parameters.Append Param1
Set Param2 = CMD.CreateParameter("P_INVENTORY_ITEM_ID", adInteger, adParamInput, 4, 5207)
CMD.Parameters.Append Param2
Set Param3 = CMD.CreateParameter("P_REVISION", adVarChar, adParamInput, 2, "04")
CMD.Parameters.Append Param3
Set ParamBlob = CMD.CreateParameter("X_DRAWING", adLongVarBinary, adParamOutput, 200000)
CMD.Parameters.Append ParamBlob
CMD.Execute , , adExecuteNoRecords *** this is where the error occurs
conn.Close
MsgBox CMD.Parameters("RESULT")
End Sub
I've tried using different data types for the varchar2 parameters (adVarChar, adBSTR, adChar) with no difference.
If I pass a bogus value for Param3...."'04'"...the function returns "N" indicating that it actually executed something. But, when I pass the correct value "04", it returns the above mentioned error.
I can execute the function in PL/SQL just fine, so I'm thinking there's something wrong with the parameters, datatype, or other definitions on the Access side.
Does anyone have any thoughts? I'm at a dead end with this. Sorry for the long post. Thank you.I tried your code with 11107 ODBC/client/database (but with a NULL output blob for convenience sake) and got no errors.
If you're using 92 ODBC/client, you may want to try upgrading to something more current, or at least getting the latest patch(9208) to see if that helps. Since it works for me I'm guessing it may be a resolved bug in that version.
Hope it helps,
Greg -
About the effect for batch level conversion from material to plant level
Dears,
Now we use batch management at material level in our system, now we want to change to batch level from material level to plant level, what effects or risks it will bring during the process of conversion?
Thanks a lot
ZhongkaiHi
check the following SAP help link it is very helpful:
http://help.sap.com/saphelp_40b/helpdata/es/d2/1d4b6e5733d1118b3f0060b03ca329/content.htm
at the link you can find the following
Specify batch level and activate status management
In this IMG activity, you specify the following:
the level at which batch numbers are unique
whether batch status management is active in the client
the plants in which batch status management is active
the initial status of new batches
Batch level
Batch numbers can be unique at the following levels:
at plant level
at material level
at client level for a material
If you choose plant level, the batch number is unique in conjunction with the respective material and the plant. If you choose material level, the batch number is unique together with the material. At client level, the batch number is unique in the whole client.
To change the batch level, you have to start a conversion program. This program first checks whether conversion is possible and outputs an error log containing all batch numbers that occur more than once at the new level. Now you need to manually transfer these batch records to numbers within Inventory Management using a transfer posting 'material to material'.
If you change the level from plant level to a higher level, it is possible that batches with the same batch numbers in different plants are actually identical. In this case, all you have to do is remove stocks (including previous period stocks) so that all batches with the same batch numbers, except one, can be reorganized.
When you convert from plant level to material level, the material is then to be handled in batches in all plants in which it is defined.
Standard settings
In the standard R/3 System, batches are unique at plant level.
Activities
To change the batch level, proceed as follows:
1. Choose the level at which you want your batches to be unique.
2. Save the new settings and choose Back.
3. Select function Batch level -> Conversion.
4. If necessary, carry out the conversion in test mode first.
Further notes
Note that you cannot reset conversion from plant level to a higher level in the standard.
If you create a client by copying an existing client, initially, there are no settings in the target client at batch level. The system makes the settings in the target client only when you have carried out an activity (maintaining master data or posting a goods movement, for example).
SETTINGS BEFORE/AFTER CLIENT COPY:
Source client Target client
Client level Material level
Material level Material level
Plant level Plant level
Batch status management
Batch status management is an additional function provided by the standard R/3 System.
Standard settings
Batch status management is not active in the standard R/3 system.
Activities
To activate batch status management, proceed as follows:
1. Choose Batch status management active.
2. Save the new setting and choose Back.
3. Choose Batch status management -> conversion.
4. If necessary, carry out the conversion in test mode first.
Further notes
Batch status management is linked to the batch level. At material and at plant level, the status management settings are valid within the client, that is for all plants. However, if you have defined batches to be unique at plant level, you have to select the plants in which status management is to be active using function Plants with status management.
If you activate status management, all existing batches are assigned status 'unrestricted'. If you deactivate status management, the systems transfers all restricted batches to unrestricted stock within conversion. Restricted stock only exists if status management is active.
If you create a client by copying an existing client, status management is automatically activated if batches exist in the target client, independent of the settings in the source client. If no batches exist in the target client, it is not activated. In this case, you have to activate or deactivate status management manually, if required.
Plants with batch status management
Activities
To select the plants in which status management is to be active, proceed as follows:
1. Set characteristic Batch status management for those plants in which batch status management is to be active.
2. Save your settings and choose function Back.
3. Choose function Batch status management -> conversion
4. If necessary, carry out the conversion in test mode first.
Initial status of a new batch
Using this function, you can specify for each material type which initial status new batches are to be assigned. However, if you use a quality management system, this specifies the status of the batches.
Hope it will help
Best Regards
Maybe you are looking for
-
when i run customer ledger i got it in two currencies because i have two receivebles in euro and usd , but i have discrepencies the balance in euro and it is equivalent in usd not matching for example in euro the balance is 100 euro but inthe equi
-
Concept of Process 2LIS_03_BX and 2LIS_03_BF
Hi all, I tried to load the data from R/3 for initialization and material movement with the following steps : 1. I run the infopackage to load the data for initialization stock from R/3. Let say I config the setup table on 24 Nov 2005. When I check
-
Hey all, so I'm using Final Cut Pro 5.0.3, I can export video no problem, but when it comes to exporting audio, FCP will export the whole track (approx. 35 min.) but there will only be about 1 min of the audio at the begining, after that its 34 min o
-
I bought a cd with Lightroom 5. After installation and registration I am not able to use 'help' function and I cannot update the software. Is anyone able to give me a hint how to handle it? Thank you in advance arl
-
Hi all, create a Infosource load this sample data, Create an ODS object and load into it and Query on the ODS 1,Take Access database, retreat for 2000 row random sample 2,Create Datasource 3,Load data 4,Build ODS5, 5,Query Can someone please