Big-O for different sized loops
Hi,
When calculating the big-O complexity of a piece of code, I understand how the principle works with the following example where the loops all use N as a number (from http://forum.java.sun.com/thread.jspa?forumID=31&threadID=580958):
for (int i=0; i<N; i++)
for (int j=0; j><N; j++)
for (int k=0; k><N; k++)
for (int l=0; l><N; l++)
// N*N*N*N iterationsyet I am not so sure of how to calculate big-O for an example like this:
for(int w = 0; w < A; w ++) {
for (int d = 0; d < B; d ++){
for (int e = 0; e < C; e++) {
for (int i = 0; i < E; i ++){
for (int f = 0; f < B; f ++){
for (int g = 0; g < C; g ++) {
for (int h = 0; h < F; h ++){
for (int i = 0; i < B; i ++){
for (int j = 0; j < C; j ++) {
}where some loops use the same variables but most do not.
Any help would be appreciated
Cheers
N
an algorithm like "while x<n do y" is O(n)*O(y) = O(n*O(y))
an algorithm like "x ; y" is O(x) + O(y) = O(max{x, y})
so your example which isn't really that complicated is
O(A)*(O(B)*O(C) + O(E) + O(B)*O(C) + O(F) + O(B)*O(C)) =
O(A)*(O(BC) + O(E) + O(BC) + O(F) + O(BC)) =
O(A)*O(max{BC, E, F}) =
O(max{ABC, AE, AF})
Similar Messages
-
How to keep aspect ratio for different sized resolutions?
If I have a 1280 x 800 resolution widescreen moniter, and I have this fullscreen game that likes to run in 800 x 600 but I don't like the way that the game stretches across the whole widescreen moniter. The only way for me to keep everything in a good aspect ratio is to put my resolution at 1280 x 800 but the game doesn't like that.
Would there be a way to set it so that the 800 x 600 resolution is set to have the correct aspect ratio rather than being stretched across the widescreen? ie, so it looks like a square with black spots on both sides.
I heard that a modeline generator would be the thing I want, but I'm not sure how I should go about this stuff. If you have any reading on it, please give it to me.Thank you very much. I never thought to look in the BIOS.
There wasn't an option to keep aspect ratio and stretch but I was able to center it rather than stretching.
Now my framebuffer boot up got centered, I need to find out how to make the framebuffer bootup be 1280x800 rather than 1024x768. This should be simple, but the guide in the sample menu.lst only gives square-y resolutions. -
I'm not Photoshop saavy, but I can work well in Pages. I just need to know how to resize for different size printed materials. For example, how do I change the size of one design to accommodate three printed pieces - 8.5" x 11", a 11" x 17", and then the same image in 24"x36"?
Any help would be greatly appreciated!!Commercial Printing requires images to be 300 dpi (pixels per inch).
You will have to do the maths as we don't know how big the images are, whether they fill each size or only part of them.
If they bleed (go off the edge of the paper) they will need an extra 3/8" (.375") on each edge.
So for an image to fill the largest size and bleed you need an image 7425 x 11025 pixels. I hope you have a good camera. You can aways reduce the dimensions down from that.
Peter -
Usb-6009 high-speed continuous acquisition for slow control loop application
Hi,
After watching a few Youtube videos, I successfully built a control loop in LabVIEW using my USB-6009. Currently, this loop is limited by the speed my actuator can take and respond to commands, topping out at 200 Hz. This is completely sufficient for my application. My question is more regarding the wasted potential of the USB-6009 to acquire samples at a much higher rate than what would be obtained if I used a simple single sample-on-demand during every iteration of the loop.
It seems to me that having the USB-6009 continuously acquire samples and having my control loop periodically check in for the latest data when it is ready to execute would have the advantage of allowing me to average groups of samples together to lower the overall noise associated with the measurement process (I am reading voltages from an amplified photodiode).
1) Does anyone know how I would instruct the USB-6009 to continuously acquire at say 10 kHz, so that on each loop I will have 50 or so samples that can be averaged together for a more accurate measurement of my control variable? Unfortunately, I'm new to this and not too familiar with DAQmx Timing.vi.
2) I've heard that reading into a buffer can increase latency for moving data into the computer. Given the low speed of my control loop, I don't foresee this as being a problem. Is this a correct assumption? I can probably live with an extra millisecond of latency.
3) I goofed around briefly with DAQmx Timing and managed to see a buffer overflow error. Certain rare events will by necessity cause my control loop to take much longer to execute, so I cannot guarantee that occasionally during normal operation I will not overflow the buffer. Can I suppress this error so that the dialog box does not pop up and the program continues to run uninterrupted? If the buffer overflows and old data gets overwritten it isn't a big deal for me since the control loop is only concerned with the latest data anyway.
Thanks for any info!Howdy Patrick!
Here is a picture of the front panel:
Here is the block diagram:
And I've attached a copy of the VI saved for LabVIEW 7.1.
Regards,
Barron
Applications Engineering
National Instruments
Attachments:
most recent samples.vi 73 KB -
How can I run the report for different input values at the same time?
Reports version: Report Builder 6.0.8.13.1
Oracle version: Oracle8i Enterprise Edition Release 8.1.7.0.0
I want to run the same report for different input parameter values and spool each o/p to different file and ftp to a server. For this, as a first step, I am spooling different input values in to a file, reading those values through a loop and calling the report for that input values. Each report run/execution is taking 15 minutes. Total report execution is taking approximately 4 hours (assuming 16 different input values) to complete. So I have to wait 4 hours to see ALL outputs.
I would like to run the report parallel for ALL the input values and I should be able to see the ALL outputs with in 15 or 16 minutes.
In my shell script, I added & symbol at the end of the report call to start/run the job in the background. Due to this the control passed to the next step after the report call. At this place I have an ftp command to send the output file to a different server and it is giving error some thing like o/p file is not available/created yet". This is due to the fact that report writer is NOT yet completely started/initiated or it is NOT completed the spooling.
How can I run the report at the same time for all the input values and save the time?
Thanks in advance.
Kishore.Increase the number of server engines running right now it seems there is only one engine running ,increase it to 4 or 6
and then atleast 4 or 6 reports will run simultaneously.
For FTPing the output add to your sript to check whether it is locked and if not then only try to ftp .
Also for more better functionality read the document (chapter 15 ) for 10g reports for its new fuinctionality.
http://download.oracle.com/docs/cd/B14099_17/bi.1012/b14048/toc.htm
Thanks
Subodh -
Print in different page for different material type in Sapscript
Hi all
How do I do the above matter?
Currently I have a script that print all material according to some condition.
My client request to have a different page of material list for different material type.
Please advise
azHi,
1) Sort the internal table by material type.
call func 'OPEN_FORM'.
loop at itab.
at new mattype.
if mattype = 'A'.
call fun 'START_FORM'.
exporting
page = 'PAGEA'.
elseif mattype = 'B'.
call fun 'START_FORM'.
exporting
page = 'PAGEB'.
endat.
call func 'WRITE_FORM'.
AT end of mattype.
call function 'END_FORM'.
endat.
endloop.
call function 'CLOSE_FORM'.
Thanks,
Nethaji. -
Re: Running the same (Forte) application multiple times -for different
Hi
We had the same problem - how to deploy a number of identical applications, using each their own db.
(for training).
The solution we used is to wrap the entire application into different applications by using a very small
module called KURSUS01, KURSUS02 etc, that did nothing but call the start procedure of the main app.
Then in the dbsession connect, we made a call appname to get the application name, and appended the
first 8 chars to the dbname. Thus our dbnames now points to logicals name: rdbdataKURSUS01, rdbdataKURSUS02 etc.
All this allows us to deploy the identical apps in the same env, or change one version, and run both the old
and new program on the same pc and server at the same time (eg. KURSUS01 and KURSUS02).
I also think this is a kludge - but it works nicely!
Jens Chr
KAD/Denmark
-----Original Message-----
From: Haben, Dirk <[email protected]>
To: 'Soapbox Forte Users' <[email protected]>
Date: 15. januar 1999 09:41
Subject: Running the same (Forte) application multiple times - for different business clients.
Hi All
We have a number of different business clients all willing to use our
application.
The (forte) application is to run on our machines etc for these (business)
clients.
All (business) clients will have their data kept in separate Oracle DBs
(instance).
The problem now is that the entire (forte) application is written using
DBSessions.
Now, depending on what business client needs to be serviced (so to speak) we
need to attach to the right DB - or use the "right" SO.
The two options we can think of are:
Option1:
Programatic change to somehow "know" what (business) client (DB) I'm talking
about and then use the right DB.
Pro:
Only one forte environment to maintain
Can run multiple (business) clients on same PC at the same time
Con:
Requires many program changes
bending O-O rules(?)
can't dynamically name SOs so can it be done at all? (ResourceMGRs maybe?)
Option2:
Use separate environments! One for each business client.
Pro:
More defined separation of app and data,
SLA-easy
Con:
Maintain "n" number of environments
Can only run the application for one environment (business client) at a time
on one PC - Big Negative here!
Not knowing any feasible solution to option 1 (without much code changes and
developer moaning) I would go for option two; as I have already worked on
multi-environment setups on VMS back at the Hydro (hi guys).
I would appreciate any comments from anyone who has solved this problem.
How, Why Pro Con etc.
TIA,
Dirk Haben
Perth, WA
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Hi
We had the same problem - how to deploy a number of identical applications, using each their own db.
(for training).
The solution we used is to wrap the entire application into different applications by using a very small
module called KURSUS01, KURSUS02 etc, that did nothing but call the start procedure of the main app.
Then in the dbsession connect, we made a call appname to get the application name, and appended the
first 8 chars to the dbname. Thus our dbnames now points to logicals name: rdbdataKURSUS01, rdbdataKURSUS02 etc.
All this allows us to deploy the identical apps in the same env, or change one version, and run both the old
and new program on the same pc and server at the same time (eg. KURSUS01 and KURSUS02).
I also think this is a kludge - but it works nicely!
Jens Chr
KAD/Denmark
-----Original Message-----
From: Haben, Dirk <[email protected]>
To: 'Soapbox Forte Users' <[email protected]>
Date: 15. januar 1999 09:41
Subject: Running the same (Forte) application multiple times - for different business clients.
Hi All
We have a number of different business clients all willing to use our
application.
The (forte) application is to run on our machines etc for these (business)
clients.
All (business) clients will have their data kept in separate Oracle DBs
(instance).
The problem now is that the entire (forte) application is written using
DBSessions.
Now, depending on what business client needs to be serviced (so to speak) we
need to attach to the right DB - or use the "right" SO.
The two options we can think of are:
Option1:
Programatic change to somehow "know" what (business) client (DB) I'm talking
about and then use the right DB.
Pro:
Only one forte environment to maintain
Can run multiple (business) clients on same PC at the same time
Con:
Requires many program changes
bending O-O rules(?)
can't dynamically name SOs so can it be done at all? (ResourceMGRs maybe?)
Option2:
Use separate environments! One for each business client.
Pro:
More defined separation of app and data,
SLA-easy
Con:
Maintain "n" number of environments
Can only run the application for one environment (business client) at a time
on one PC - Big Negative here!
Not knowing any feasible solution to option 1 (without much code changes and
developer moaning) I would go for option two; as I have already worked on
multi-environment setups on VMS back at the Hydro (hi guys).
I would appreciate any comments from anyone who has solved this problem.
How, Why Pro Con etc.
TIA,
Dirk Haben
Perth, WA
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/> -
Can I make my web page stretch and shrink to fill different sized browsers?
Hey team,
I just built my first site in iWeb: www.dylanjamesgeorge.com
I'm using iWeb version 3.0.2
I set the page width to 1200px because that's what looks best on my screen, however when I look at the site on a larger or smaller screen it doesn't look good. When I check out some other websites they manage to make their content stretch to fill different sized browsers. Something about using relative sizes (%) instead of absolute sizes (pixels) for the page dimensions?
I know iWeb doesn't offer this option, but I'm wondering if there's anyway to change the code manually.
I'm just trying to avoid people with small screens having to scroll to see content and people with large screens being left with lots of void space on either side of the screen.
Thanks in advance for your time.
DylanHey Roddy,
Thanks for your reply. I've read that before, but what I'm trying to do is get the content on my page to move as the browser window gets smaller. For example, if I grab the bottom right hand corner of my browser right now and make the window smaller, the content of this page will adjust itself to stay centered until the window is too small, THEN it will add a scroll bar. Any idea how to make this happen in iWeb? -
How can i set different font for different tabs/pages
I want to set different fonts for different tabs/pages?
is it possible to do the same? If yes how?
I can change the fonts under tools>options>contents>advanced. but that changes global settings.
tried some add ons too- but that too changes the global settings.
some pages like tweetdeck do not display icons etc properly under custom fonts.
when i check "allow pages to select their own font" tweetdeck shows up fine but a number of other pages show fonts that are too big or some non standard fonts.
Is there a way where i can select site default fonts for some sites/tabs, and custom fonts for other sites/tabs?
otherwise i have to open different sites in different browsers- say i use my custom fonts- which apply globally, and open tweetdeck etc in Internet Explorer or Chrome etc. if i can have all tabs in one window/browser, that would be great.It's not a built-in feature to override a page's styles on a tab-by-tab or site-by-site basis, but perhaps someone has created an add-on for this?
It also is possible to create style rules for particular sites and to apply them using either a userContent.css file or the Stylish extension. The Greasemonkey extension allows you to use JavaScript on a site-by-site basis, which provides further opportunity for customization. But these would take time and lots of testing to develop and perfect (and perfection might not be possible)...
Regarding size, does the zoom feature help solve that part? In case you aren't familiar with the keyboard and mouse shortcuts for quickly changing the zoom level on a page, this article might be useful: [[Font size and zoom - increase the size of web pages]]. -
Same item used in different pages & for different tables
Hi,
i created some items, which work like a filter for my tables. I've got a lot of tables and the items have always the same function. They filter the same column but they're used for different tables! If i want to copy 1 item to another page, it's forbidden to use the same name again and that's the reason why I've got to customize every item for every page. I can copy the items but i have to change the name and thats why i have to update the item name in my SQL Query & the Tablename. All which is marked i have to change for every page(new table)!
where upper(TABLENAME) like '%' || upper(:P158_FILTER_TABLENAME) || '%'
AND upper(KEYVALUE) like '%' || upper(:P158_FILTER_KEYVALUE) || '%'
AND DATE_INSERTED_PDW >= to_date(:P158_FILTER_DATE_INSERTED_PDW,'DD.MM.YYYY')
P158_FILTER_TABLENAME:
select distinct TABLENAME d, TABLENAME r
from ERR_MAPL //it's the tablename I have to update it on every new page/table
order by 1
By a Process I created i have the same Problem it's the same Process, it's only used in differnet tables:
BEGIN
FOR ii IN 1 .. WWV_Flow.g_f01.COUNT -- the row selector
LOOP
UPDATE ERR_MAPL SET RELOAD_FLAG = 1
WHERE ERR_ID = WWV_Flow.g_f02(WWV_Flow.g_f01(ii));
END LOOP;
END;
THX Mat
Message was edited by:
user552848Hi Carl Rutter,
You have to creat 2 special production order for this item. when issue the component make sure you issue the stock as per the cosumption becaue one have 10mmx10mm and the another item have 50x50 in this case you issue component by square inch wise. for example 10*10 = 100 squre inch.
50*50 = 2500 square inch so the cost will be approtionate. you can Use multiple uom method to obtain this, other wise you have covert into stock then you issue the component. If you want traxk size wise ,you can use batch option for Finishe goods.
Regards
Sridharan -
VBA inserting form fields, different positions result for different users.
I'm certianly at a loss for wrapping my head around this.
Adobe Acrobat 9 Standard (v 9.5.4)
Excel 2010 (VBA)
The problem: When I create the PDF document from Excel, I search for a string of text in order to capture the Quads for the containing rectangle. Then I use the quads to insert a control with numeric offsets. The problem that I am facing is that the offsets seem to be causing the controls to be in different locations for different users. For example, when I send (-26, -2, 100, 10) {x-offset, y-offset, width, height}; the control aligns exactly where I want it. But when another user user runs the exact same routine, or opens the PDF that I created, the fields are no longer positioned correctly.
Is there some setting that I am missing? EDIT, SOLVED: My Acrobat had a custom point to pixel setting. (Preferences > Page Display > Resolution)
Private Function makePdfControl(ByVal pdfPage As Integer, keyTerm As String, Optional ByVal keyTermLookAhead As Integer = 0, Optional ctrlType As String = "text", Optional cCoords As Variant = 0)
'pdfPage is the target page of the document
'keyTerm is the assembled search term: "Date Shipped >> DATESHIPPED"
'keyTermLookAhead is the number of words assembed into KeyTerm, zero based: "Date Shipped" >> "DATESHIPPED" >> "DATE" = 0, "SHIPPED" = 1
'ctrlType determines the type of control to place on the form; default is text
'cCoords carries an array of integers: x-offset, y-offset, width, and height
txt = ""
Dim fkt As Integer 'counter for keyTermLookAhead
Dim matchFound As Boolean 'flag that a match has been found
Dim maxWords As Integer 'the maximum number of words in pdfPage
Dim coord(3) As Integer 'local array container to provide interface for cCoords
p = 0
matchFound = False
maxWords = jso.getPageNumWords(pdfPage)
Do While p + keyTermLookAhead <= maxWords 'search all words in the target page; break if not found
p = p + 1
For fkt = 0 To keyTermLookAhead
txt = txt & jso.getPageNthWord(pdfPage, p + fkt)
Next fkt
If UCase(txt) <> UCase(keyTerm) Then 'the assembly of terms is complete, check if match
txt = "" 'prepare "txt" for next assembly
matchFound = False
Else
matchFound = True 'we've struck gold, exit the loop preserving val of "p" as the first word in the assembly
Exit Do
End If
Loop
If matchFound = True Then
Dim qtmp() As Variant
Dim q(7) As Double
qtmp = jso.getPageNthWordQuads(pdfPage, p)(0) 'collect the rectangle containing the first word of the search; output is a base-0x7 array
For a = 0 To 7
q(a) = qtmp(a) 'collect the data
Next a
If VarType(cCoords) <> 8204 Then '8204 means that we've inserted an array into the Varient type var cCoords
coord(0) = 0
coord(1) = 0
coord(2) = 100
coord(3) = 15
Else
coord(0) = cCoords(0) 'x-offset value
coord(1) = cCoords(1) 'y-offset value
coord(2) = cCoords(2) 'width value
coord(3) = cCoords(3) 'height value
End If
x0 = coord(0) 'x-offset var
y0 = coord(1) 'y-offset var
w = coord(2) 'ctrl width
h = coord(3) 'ctrl height
x = q(0) + x0
y = q(7) - h + y0
'origin point of doc matrix is lower-left corner
'origin point of control is lower left corner of the rectangle containing the first word of the search phrase
'offsets are placed from this point, negative x shifts to the left, negative y shifts down
'values are in points, not pixels
Set f = aForm.Fields.Add(keyTerm, ctrlType, pdfPage, x, y, x + w, y + h) '(uplf, lwlf, lwrt, uprt) 'add the control to the form using values passed in
End If
End Function
The above function is used while looping through the pages of the created PDF document. I am using the following function to create the document from Excel:
Private Sub exportToPDF()
DoEvents
Application.ScreenUpdating = False
Call showTabs(False)
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=pdfPathData, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=False, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Call showTabs(True)
Call locateDoc
Application.ScreenUpdating = True
End Sub
Message was edited by: ilivingston: solvedThanks for the reply, I did spend some time working on this issue... here is what I found...
1) First of all, I did have a custom Points to Inches setting in my Acrobat options... 110 vs 96. Resetting this allowed for me to see the alignment issue that my colleagues were referencing first hand.
As it turned out, my results were better, but still had inconsistency among different workstations. Leading me to..
2) The MSFT creator uses the default printer in some way to create the PDF. Because the different workstations were using different printers, we were getting different results. If everyone used an HP 1320, nobody would see any difference upon creating / adding fields.
The final solution was to change the Application.Printer to a common network printer before the export operation, and return the Application.Printer to the user default after the export completed. This has provided us with a common ground to work upon; we are lucky to have a network printer that can be used for this purpose, as I can see this becoming non-viable in environments where this would be unavailable. -
Things were going fine until about a month or so ago, now when I take files from older illustrator programs or other programs that ran fine with illustrator before, the colors change. This is a BIG problem for me right now! I tried the on line help thing and I was afraid to erase the files that it asked me to erase because I may want it back the way it now is some day and because I don't have the files from the older program... PLS help! Have tryed to call and am waiting for a chat to open,...
gaskins,
You may have different Color Settings, and if you use Pantone you should be aware that the whole interpretation has changed (a number of times, most radically recently).
If you say more, more can be said. -
Uploading data in MM01 for different material types
Hi,
I have a doubt regarding uploading the data in MM01 for different material types.
Generally in MM01, we have different views for different material types. The number of views will vary depending upon the material type that we select.
I have a scenario, where in to upload the data, I have a flat file that consists of data for different message types. So, how to upload the data in such case.
Can anyone help me on the same by providing explanation or sample code...? What would be the possible ways to upload data in such scenario.
That would be of great help.
Thanks & Regards,
Pradeep.See the below code and use FM SELECTION_VIEWS_FIND..
REPORT zjpmuim306 NO STANDARD PAGE HEADING LINE-SIZE 250 MESSAGE-ID
zjpm001.
*& I N B O U N D V I A A B A P : Batch input Session method *
*& Development ID: IM_DD_306_LJP *
*& Report : ZJPMUIM306 *
*& The Purpose of the Object is to interface Create Input Record *
*& for SAP Migration from the Material master of BPCS All the *
*& information received at BPCS is collected into a single record. *
*& By using session method upload data from file ,one item is
*& created for one record *
*& Change Log: *
*& Init Who Date Text *
*& MALIKDH1 Seshu Reddy 26-07-2003 Initial Version *
Constants *
CONSTANTS:c_vkorg(4) type c value 'JP20', " Sales Organization
c_vtweg(2) type c value 'TR' , " Distribution Channel
c_werks(4) Type c value 'JP01' , " Plant
c_viewlist(15) VALUE 'KDEALBSZXVPCFQG'," View list
c_scm_view TYPE msichtausw-dytxt VALUE 'SCM View',
c_sd_view TYPE msichtausw-dytxt VALUE 'SD View',
c_seq_code(2) VALUE 'Z1', " Sequential Code
c_keep(1) TYPE c VALUE 'X', " Keep
c_group LIKE apqi-groupid VALUE 'IM306', " Session Name
c_tcode LIKE tstc-tcode VALUE 'MM02', " Transaction Code
c_blank(1) VALUE ' ', " Blank
c_intls(1) VALUE 'N'. " Logistic Status
Variables *
DATA: g_flag1(1), " Variable to hold
g_flag(1), " Variable to hold
g_file LIKE rlgrap-filename VALUE
'C:\Documents and Settings\seshur\Desktop\HCLT123.CSV'. " File name
Internal tables/ Work area *
Internal Table for Delimter
DATA : BEGIN OF t_delim OCCURS 0,
text(1000),
END OF t_delim.
Internal table for BDC processing
DATA : t_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Internal table for holding the data which has to be uploaded.
DATA: BEGIN OF t_bpcs OCCURS 0,
matnr(15) TYPE c, " material no
dosage(40) TYPE c, " Dosage form(Local)
appearance(40) TYPE c, " Appearance
idcode(6) TYPE c, " Identification Code
prostformno(10) TYPE c, "SOP
weitab(7) TYPE c, " Weight/tablet
uom1(2) TYPE c, " UOM of Carton
uom2(2) TYPE c, " UOM of Case
carsize(14) TYPE c, " Carton size
cassize(14) TYPE c, " Case size
rupqty(11) TYPE c, " Round up
abvname(3) TYPE c, " Product short name
END OF t_bpcs.
*Internal table for t_bpcs
DATA: BEGIN OF t_mdata OCCURS 0,
matnr LIKE marc-matnr, " Material number
zzjp_dos_frm LIKE marc-zzjp_dos_frm, " Dosage form(Local)
zzjp_aprn LIKE marc-zzjp_aprn, " Appearance
zzjp_con_id LIKE marc-zzjp_con_id," Identification Code
zzjp_nyu_sop LIKE marc-zzjp_nyu_sop,"SOP
zzjp_wei_tab(10) type c , " Weight/tablet
zzjp_bio LIKE marc-zzjp_bio,"Biologics Indicator
zzjp_itf LIKE marc-zzjp_itf, " ITF code
zzjp_car(2) type c, " UOM of Carton
zzjp_cas(2) type c, " UOM of Case
zzjp_car_size(11) type c," Carton size
zzjp_cas_size(11) type c, " Case size
zzjp_rupqty(11) type c, " Round up
zzjp_init_ls LIKE marc-zzjp_init_ls, " Logistic Status
zzjp_re1 LIKE marc-zzjp_re1, "Document type(Local)
zzjp_re2 LIKE marc-zzjp_re2, "Report type
zzjp_re3 LIKE marc-zzjp_re3, "Shipping report type
zzjp_pro_id LIKE mvke-zzjp_pro_id," Product output sequence
zzjp_bu_id LIKE mvke-zzjp_bu_id, " Business unit indicator
zzjp_abv_name LIKE mvke-zzjp_abv_name," Product short name
zzjp_abv_id1 LIKE mvke-zzjp_abv_id1," Product short name output
zzjp_abv_id2 LIKE mvke-zzjp_abv_id2," Product short name internal
zzjp_spl_id LIKE mvke-zzjp_spl_id, " Sample internal order
END OF t_mdata.
Internal table for Mara Table
DATA: BEGIN OF t_mara OCCURS 0,
matnr LIKE mara-matnr, " material Number
vpsta LIKE mara-vpsta, " Maintenance status of complete material
pstat like mara-pstat, " Maintenance status
END OF t_mara.
Internal table for Material Master View Selection Screens
DATA: BEGIN OF t_bildtab OCCURS 0.
INCLUDE STRUCTURE mbildtab.
DATA: END OF t_bildtab.
internal table for T_bildtab
DATA: t_bildtab_dup LIKE t_bildtab OCCURS 0 WITH HEADER LINE.
*Work area for T_bildtab internal table(Views Selection)
DATA: BEGIN OF w_data,
flag1 type c,
anzd70 TYPE i,
field1(20) type c,
field2(20) type c,
field3(20) type c,
field4(20) type c,
count(2) TYPE c,
END OF w_data.
Main Processing *
START-OF-SELECTION.
Store data from file into internal table
PERFORM f_uplaod_data.
Transfer the uploaded data into t_mdata internal Table
PERFORM f_process_data.
Selecting The views based on Material number
PERFORM f_view_list.
Open a BDC Session
PERFORM f_bdc_open.
*Selecting the fields from mara table
SELECT matnr
vpsta
pstat
FROM mara
INTO TABLE t_mara
FOR ALL ENTRIES IN t_mdata
WHERE matnr = t_mdata-matnr.
SORT t_mara BY matnr.
SORT t_mdata BY matnr.
Transfer the uploaded data into BDCDATA structure
PERFORM f_process_bdc.
Close The BDC Session
PERFORM f_close_group.
*& Form F_VIEW_LIST *
Routine to used for Calling the function module *
Selection_views_find *
FORM f_view_list.
CALL FUNCTION 'SELECTION_VIEWS_FIND'
EXPORTING
bildsequenz = c_seq_code
pflegestatus = c_viewlist
TABLES
bildtab = t_bildtab
EXCEPTIONS
call_wrong = 1
empty_selection = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " F_VIEW_LIST
*& Form f612_view_sort *
Routine to used for Selecting The views based on Material Number *
FORM f612_view_sort.
t_bildtab_dup[] = t_bildtab[].
Reading the Internal table t_mara
READ TABLE t_mara WITH KEY matnr = t_mdata-matnr.
TRANSLATE t_mara-pstat USING ' $'.
CLEAR: w_data-flag1, w_data-anzd70.
LOOP AT t_bildtab_dup.
IF t_bildtab_dup-pstat CA t_mara-pstat.
w_data-anzd70 = w_data-anzd70 + 1.
IF t_bildtab_dup-kzanz IS INITIAL.
t_bildtab_dup-kzanz = 'X'.
w_data-flag1 = 'X'.
MODIFY t_bildtab_dup.
ENDIF.
ELSE.
IF NOT t_bildtab_dup-kzanz IS INITIAL.
CLEAR t_bildtab_dup-kzanz.
w_data-flag1 = 'X'.
MODIFY t_bildtab_dup.
ENDIF.
ENDIF.
ENDLOOP.
TRANSLATE t_mara-pstat USING '$ '.
IF NOT w_data-flag1 IS INITIAL.
SORT t_bildtab_dup BY kzanz DESCENDING idxbd ASCENDING.
ENDIF.
*Reading The internal table for T_bildtab_dup
READ TABLE t_bildtab_dup WITH KEY dytxt = c_scm_view.
IF t_bildtab_dup-kzanz = 'X'.
WRITE sy-tabix TO w_data-count.
w_data-count = w_data-count + 2.
IF w_data-anzd70 > 18.
w_data-count = w_data-count - 18.
ENDIF.
CONCATENATE 'MSICHTAUSW-DYTXT(' w_data-count ')' INTO w_data-field1.
CONCATENATE 'MSICHTAUSW-KZSEL(' w_data-count ')' INTO w_data-field2.
ENDIF.
READ TABLE t_bildtab_dup WITH KEY dytxt = c_sd_view.
IF t_bildtab_dup-kzanz = 'X'.
WRITE sy-tabix TO w_data-count.
IF w_data-anzd70 > 18.
w_data-count = w_data-count + 2.
w_data-count = w_data-count - 18.
ENDIF.
CONCATENATE 'MSICHTAUSW-DYTXT(' w_data-count ')' INTO w_data-field3.
CONCATENATE 'MSICHTAUSW-KZSEL(' w_data-count ')' INTO w_data-field4.
ENDIF.
ENDFORM. " f612_view_sort
*& Form f_uplaod_data *
Routine to used for Uploading the data from file to Internal table *
FORM f_uplaod_data.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = g_file
filetype = 'DAT'
TABLES
data_tab = t_delim
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
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF t_bpcs IS INITIAL.
LOOP AT t_delim.
SPLIT t_delim-text AT ',' INTO t_bpcs-matnr
t_bpcs-dosage
t_bpcs-appearance
t_bpcs-idcode
t_bpcs-prostformno
t_bpcs-weitab
t_bpcs-uom1
t_bpcs-uom2
t_bpcs-carsize
t_bpcs-cassize
t_bpcs-rupqty
t_bpcs-abvname.
APPEND t_bpcs.
ENDLOOP.
ENDIF.
ENDFORM. " f_uplaod_data
*& Form F_BDC_OPEN
Routine to create BDC Session to be processed
FORM f_bdc_open.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = c_group
keep = c_keep
user = sy-uname
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE S000 WITH 'Batch input session is created successfully'(T02).
ENDIF.
ENDFORM. " F_BDC_OPEN
*& Form F_PROCESS_BDC
Processing of BDCDATA Structure
FORM f_process_bdc.
LOOP AT t_mdata.
PERFORM f612_view_sort.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=AUSW'.
PERFORM f_bdc_field USING 'RMMG1-MATNR'
t_mdata-matnr.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
IF w_data-anzd70 > 18.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
ENDIF.
reading the t_bildtab internal table
READ TABLE t_bildtab_dup WITH KEY dytxt = c_scm_view.
IF t_bildtab_dup-kzanz = 'X'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
w_data-field1.
PERFORM f_bdc_field USING w_data-field2 'X'.
g_flag = 'X'.
ENDIF.
reading the t_bildtab internal table
READ TABLE t_bildtab_dup WITH KEY dytxt = c_sd_view.
IF sy-subrc EQ 0.
g_flag = 'X'.
ENDIF.
IF t_bildtab_dup-kzanz = 'X'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
w_data-field3.
PERFORM f_bdc_field USING w_data-field4 'X'.
g_flag1 = 'X'.
ENDIF.
IF g_flag = 'X' AND g_flag1 = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-VTWEG'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'RMMG1-VKORG'
c_vkorg.
PERFORM f_bdc_field USING 'RMMG1-VTWEG'
c_vtweg.
CLEAR g_flag.
CLEAR g_flag1.
ELSE.
IF g_flag = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
ELSE.
IF g_flag1 = 'X'.
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '0080'.
PERFORM f_bdc_field USING 'BDC_CURSOR'
'RMMG1-VTWEG'.
PERFORM f_bdc_field USING 'RMMG1-WERKS'
c_werks.
PERFORM f_bdc_field USING 'RMMG1-VKORG'
c_vkorg.
PERFORM f_bdc_field USING 'RMMG1-VTWEG'
c_vtweg.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=ENTR'.
ENDIF.
ENDIF.
ENDIF.
*Processing of SCM View
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM f_bdc_field USING 'BDC_CURSOR' 'MARC-ZZJP_DOS_FRM'.
PERFORM f_bdc_field USING 'MARC-ZZJP_DOS_FRM'
t_mdata-zzjp_dos_frm.
PERFORM f_bdc_field USING 'MARC-ZZJP_APRN'
t_mdata-zzjp_aprn.
PERFORM f_bdc_field USING 'MARC-ZZJP_CON_ID'
t_mdata-zzjp_con_id.
PERFORM f_bdc_field USING 'MARC-ZZJP_NYU_SOP'
t_mdata-zzjp_nyu_sop.
PERFORM f_bdc_field USING 'MARC-ZZJP_WEI_TAB'
t_mdata-zzjp_wei_tab.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAR'
t_mdata-zzjp_car.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAS'
t_mdata-zzjp_cas.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAR_SIZE'
t_mdata-ZZJP_CAR_SIZE.
PERFORM f_bdc_field USING 'MARC-ZZJP_CAS_SIZE'
t_mdata-ZZJP_CAS_SIZE.
PERFORM f_bdc_field USING 'MARC-ZZJP_RUPQTY'
t_mdata-ZZJP_RUPQTY.
PERFORM f_bdc_field USING 'MARC-ZZJP_BIO'
t_mdata-zzjp_bio.
PERFORM f_bdc_field USING 'MARC-ZZJP_ITF'
t_mdata-zzjp_itf.
PERFORM f_bdc_field USING 'MARC-ZZJP_INIT_LS'
t_mdata-zzjp_init_ls.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE1'
t_mdata-zzjp_re1.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE2'
t_mdata-zzjp_re2.
PERFORM f_bdc_field USING 'MARC-ZZJP_RE3'
t_mdata-zzjp_re3.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'/00'.
*Processing of SD View
PERFORM f_bdc_dynpro USING 'SAPLMGMM' '4000'.
PERFORM f_bdc_field USING 'BDC_CURSOR' 'MVKE-ZZJP_PRO_ID'.
PERFORM f_bdc_field USING 'MVKE-ZZJP_PRO_ID'
t_mdata-zzjp_pro_id.
PERFORM f_bdc_field USING 'MVKE-ZZJP_BU_ID'
t_mdata-zzjp_bu_id.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_NAME'
t_mdata-zzjp_abv_name.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_ID1'
t_mdata-zzjp_abv_id1.
PERFORM f_bdc_field USING 'MVKE-ZZJP_ABV_ID2'
t_mdata-zzjp_abv_id2.
PERFORM f_bdc_field USING 'MVKE-ZZJP_SPL_ID'
t_mdata-zzjp_spl_id.
PERFORM f_bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM f_bdc_dynpro USING 'SAPLSPO1' '0300'.
PERFORM f_bdc_field USING 'BDC_OKCODE'
'=YES'.
perform f_bdc_insert.
REFRESH T_BDCDATA.
ENDLOOP.
ENDFORM. " F_PROCESS_BDC
*& Form f_bdc_dynpro
p_prog is the program name to which data is passed *
p_dyno is the screen number to which the data is passed
Routine for populating the BDCDATA structure with the
Screen related information
FORM f_bdc_dynpro USING p_prog
p_dyno.
t_bdcdata-program = p_prog.
t_bdcdata-dynpro = p_dyno.
t_bdcdata-dynbegin = 'X'.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " F_bdc_dynpro
*& Form F_BDC_FIELD
p_fnam is the field name to which value is passed
p_fval is the field value which is passed
p_fnam is the field name to which value is passed
p_fval is the field value which is passed
FORM f_bdc_field USING p_fnam
p_fval.
t_bdcdata-fnam = p_fnam.
t_bdcdata-fval = p_fval.
APPEND t_bdcdata.
CLEAR t_bdcdata.
ENDFORM. " F_bdc_field
*& Form F_PROCESS_DATA *
Routine to used for moving data from T_bpcs internal table to *
t_mdata Internal Table *
FORM f_process_data.
LOOP AT t_bpcs.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_bpcs-matnr
IMPORTING
output = t_mdata-matnr.
MOVE t_bpcs-dosage TO t_mdata-zzjp_dos_frm.
MOVE t_bpcs-appearance TO t_mdata-zzjp_aprn.
MOVE t_bpcs-idcode TO t_mdata-zzjp_con_id.
MOVE t_bpcs-prostformno TO t_mdata-zzjp_nyu_sop.
MOVE t_bpcs-weitab TO t_mdata-zzjp_wei_tab.
MOVE c_blank TO t_mdata-zzjp_bio.
MOVE c_blank TO t_mdata-zzjp_itf.
MOVE t_bpcs-uom1 TO t_mdata-zzjp_car.
MOVE t_bpcs-uom2 TO t_mdata-zzjp_cas.
MOVE t_bpcs-carsize TO t_mdata-zzjp_car_size.
MOVE t_bpcs-cassize TO t_mdata-zzjp_cas_size.
MOVE t_bpcs-rupqty TO t_mdata-zzjp_rupqty.
MOVE c_intls TO t_mdata-zzjp_init_ls.
MOVE c_blank TO t_mdata-zzjp_re1.
MOVE c_blank TO t_mdata-zzjp_re2.
MOVE c_blank TO t_mdata-zzjp_re3.
MOVE c_blank TO t_mdata-zzjp_pro_id.
MOVE c_blank TO t_mdata-zzjp_bu_id.
MOVE t_bpcs-abvname TO t_mdata-zzjp_abv_name.
MOVE c_blank TO t_mdata-zzjp_abv_id1.
MOVE c_blank TO t_mdata-zzjp_abv_id2.
MOVE c_blank TO t_mdata-zzjp_spl_id.
APPEND t_mdata.
ENDLOOP.
ENDFORM. " F_PROCESS_DATA
*& Form f_bdc_close
Routine to close the BDC Session
FORM f_close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " f_close_group
*& Form f_bdc_insert
routine to input batch data into the Transaction MM02 from the
session created
FORM f_bdc_insert.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = c_tcode
TABLES
dynprotab = t_bdcdata
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " f_bdc_insert
Reward Points if it is useful
Thanks
Seshu -
Input range for different channels
Hi,
In one of my experiments, the data I acquire in different channels have different magnitudes (in Volts). Therefore, I am trying to set a different input range to these various channels. Here's a picture (input_range.png) of a part of my VI where I am trying to assign input ranges to the analog input channels.
Channels ai0-7 have the range +/-200mV and channels ai8-15 have +/-500V. I do not have the equipment with me at the moment, so I can't test this. But I am wondering whether this is how you would normally set different input ranges for different channels or whether there's a better way to do this.
Cheers.
Attachments:
input_range.PNG 15 KBThanks for the quick reply Mike.
I found the following post which showed me how to do it
http://forums.ni.com/ni/board/message?board.id=170&message.id=318492&query.id=74076#M318492
However, I am having difficulties in actually acheiving this. Firstly, I don't know how to set up the arrays as he's done there. Secondly, I could not get the auto-indexing to work. I've attached a pic of my attempt. When I try to enable auto-indexing on the right-hand side of the for-loop it breaks the wires and I can't even enable auto-indexing on the left hand side.
Will it be possible to attach a VI for this part so I can see what functions you've used.
Cheers.
Attachments:
input_range2.png 8 KB -
Is it possible to have same file size for different dpi?
I changed one.TIFF file (300dpi, 1024X1332) to .jpg files of four different dpi. But when I checked the four result jpg files, I found out that they are all in same file size and quality.( I also have checked the property of the files in the Windows.)
I think more DPI means more data and more file size. Am I wrong?
I use Photoshop CS 5.1(64bit, WINDOWS) - which is part of my Adobe Master Collection CS5.5.
TIFF(300dpi, 1024X1332) ->
1. JPG(72dpi, 1024X1332) : 306KB
2. JPG(108dpi, 1024X1332) : 306KB
3. JPG(144dpi, 1024X1332) : 306KB
4. JPG(600dpi, 1024X1332) : 306KB
I tested a few times more with different files. and same result comes out.(same file size for different dpi)
Thanks in advance.Yes absolutely. Great observation. PPI does not control the number of pixels, just how big they are.
Now, if you change the PPI in the Image Size dialog with Resample checked.. then, that is a different story. In that case you will be changing the pixel dimension of an image (i.e.,changing the total number of pixels making up the image) while keeping its print size.
In your test files, you will notice all the print sizes are different, because all you were telling Photoshop to do was change the size of the pixels (if or when the image is ever printed), which is really just a bit of metadata of the file.
Maybe you are looking for
-
When there is an update to a newer version of a browser like this update to Safari 5.1.4, is there an article that goes over the best way to update to a newer version of a browser that one knows of? Is it best to close all apps, install the update, t
-
How do I send attachments (documents) as a PDF?
How do I send attachments (documents) as a PDF?
-
Image loading via URL with resources in packages
And another newbie-question: When I want to access local media-files (for example images) in a subdirectory, I can use a url to get a local path/filename. For example: url = getClass().getResource("/path/image-name.gif"); image = getToolkit().getImag
-
Hello everyone, First of all, sorry about my poor english! I'm a brazilian undergraduate student but I never attended english classes, kinda auto-learned by attempts... well, I think this is enough to my introduction. Oops, that's something I need to
-
Exception raised: java.lang.reflect.InvocationTargetException
Hi Everybody, I run into the below problem while trying to set the security realm in the WebLogic sp8 examples. I tried to find information about it on this newsgroup but so I couldn't find any helpful solutions. Please, help. Tue Apr 17 11:59:20 GMT