Decimal Field Pattern limit to 2 decimals only
Hi,
I am want to limit a numeric field to 4 leading digits and only 2 trailing digits, example 1,234.59. I have set this pattern up in the Display pattern: num{z,zz9.99}|num{z,zz9.zz}|num.currency{}.
The problem is if the user enters less than 4 leading digits, s/he can enter more than 2 decimal places. The the field rounds off the value, which I do not want. Example: enters 123.456 = displays 123.46 rather than 123.45.
Any suggestions?
Thanks,
Pam
Pam:
Try setting the field to be Numeric instead of Decimal, and place this in the exit event.
Uncomment the alerts to see the individual results
// multiply by 100 to shift without rounding
temp1 = this.rawValue * 100;
//app.alert("temp1: " + temp1);
// convert to int. to drop remaining decimals
temp2 = parseInt(temp1);
//app.alert("temp2: " + temp2);
// divide by 100 to shift back 2 places
temp3 = temp2 / 100;
//app.alert("temp3: " + temp3);
// return data to field
this.rawValue = temp3;
Similar Messages
-
How to change the Display Pattern for Decimal Fields dynamically
hi all,
Can any one help me how to change the display pattern for decimal fields dynamically???
Currently I am using z,zzz,zzz,zz9.999 Display pattern for Quantity Field. If the value is blank it is displaying as 0.000 on the Screen. But I don't want this to be printed.
Please help me how to solve this ASAP.
Thanks,
PrabhuHi,
Alternatively you can handle it in the context.
In the context area, click on the quantity. In the bottom, click on the conditions tab, and put a condition
<quan field> NE initial.
So the field will not be printed if there is no value.
Regards,
Vidya Chowdhary A. -
What I've found so far is that the only way to get the % symbol into a numeric/decimal field at all is to set the "display pattern" to display the % symbol after numbers have been entered into the field.
The reason I want the field to be numeric and not text is because I have to run a FormCalc caculation that populates a third field.
(NumericField1 * Numeric Field2*) + NumericField1Thanks for the reply Niall.
I ended up chanigng the numeric field to a decimal field instead, and added the following display pattern: num{zzzz9.99'%'}
So although the user can't enter a % symbol into the field, a % symbol automaticaly populates when the user enters a number.
My criteria involved ensuring that a user could not enter a number with more than two numbers after the decimal, so I also set a trailing digits max of 2 (in the Obect > Field settings)
This is the FormCalc formula I used in the "calculate" event to calculate the salary increase amount request: (DecimalField1 * NumericField2) *.01 + NumericField2
This formula is meant to calculate the salary amount a manager is requesting their employee's salary be increased to. -
Format of a numeric/decimal field
Can we set the format of a decimal field to display zzz.999 without rounding off the value. For example,I have a decimal field with display & Edit pattern set as "zzz.999" and trailing digits limited to 3. If I enter a value 123.456, its ok. But if I put 123.4567 the value is rounded off and displayed as 123.457. Can we limit it somehow to truncate anything extra than 3 trailing digits.
Thanks
ShwetaMaybe not automatically, but you should be able to do this with a little JavaScript in the form.
Mike -
Pleas help with rounding decimal field
I have a totals field that is summing several fields. I wish to have this totals field provide a rounded sum. I've tried setting the trailing digits to 0 but it will not round up, only round down. I have a display pattern for the field of num{($z,zzz,zz9.99)} . Example 162.59 is displaying 162.00 in total field instead of 163.00. Is there something I'm missing or am I missunderstanding how a decimal field works?
code in "calculate" event:
var test=xfa.form.topmostSubform.personnel_page.person_1.salary_cost1.rawValue+
xfa.form.topmostSubform.personnel_page.person_2.salary_cost2.rawValue+
xfa.form.topmostSubform.personnel_page.person_3.salary_cost3.rawValue+
xfa.form.topmostSubform.personnel_page.person_4.salary_cost4.rawValue+
xfa.form.topmostSubform.personnel_page.person_5.salary_cost5.rawValue+
xfa.form.topmostSubform.personnel_page.person_6.salary_cost6.rawValue+
xfa.form.topmostSubform.personnel_page.person_7.salary_cost7.rawValue+
xfa.form.topmostSubform.personnel_page.person_8.salary_cost8.rawValue+
xfa.form.topmostSubform.personnel_page.person_9.salary_cost9.rawValue+
xfa.form.topmostSubform.personnel_page.person_10.salary_cost10.rawValue;
//this rounds the value upon exit of field
var result = MATH.round(test.value);
this.value = result;In FormCalc you have a function which do just what you are looking for..
Ceil(162.59)
Put it in a messageBox and see the output..
form1.#subform[0].Button1::click - (FormCalc, client)
$host.messageBox(Ceil(162.59));
OR
You can use the Ceil function of the MATH object in Java Script.
form1.#subform[0].Button1::click - (JavaScript, client)
xfa.host.messageBox("" + Math.ceil(162.59));
Thanks
Srini -
Decimal field prob on editable ALV
Hello everyone,
I have a field referring to standard data type TB_BZBETR which is currency field with CURR and 2 decimal places, is a editable one in ALV. When trying to enter any value first its displaying like 0.00 and then when i enter any value like 22 it is storing like 0.22 and when i try to enter like 22.22 it is not allowing me saying that decimal places not allowed. The only way i can enter is not giving point '.' in between like if 2224 is entered then it is storing like 22.24.
What wud be the prob please help me.
Thanks.as ABAP does not store decimals, the amount values are interpreted according to the decimals in the currency.
I have a field referring to standard data type TB_BZBETR which is currency field with CURR and 2 decimal places,
The default is 2 decimals, but some currencies like JPY, MEX are usually defined without decimals. So make sure your amount field is linked to a currency field via the ALV field catalog and maintain this field with the appropriate currency.
regards,
JNN -
Hi,
I have developed a Module pool program. I have a screen field type DEC. I have two modes, EDIT and DISPLAY. In EDIT mode, when i enter 0.00 into this screen field and press save, the value displayed is BLANK and not '0.00' as required. In DISPLAY mode the value is displayed correctly as '0.00'.
I tried changing the screen field to type CHAR. But the same field variable is declared as TYPE 'p' for underlying calculations. Thus it gives me an 'SCREEN FORMAT ERROR'.
Any ideas how to diplay '0.00' in the decimal field in EDIT mode?
Awaiting your responses.
Regards,
SandeepWhat you are seeing is the stanard way the gui handles these fields in the particular mode(change,display). You can not get around this using the decimal field. Your only solution is to make are character field on the screen as well as character field in the underlying program.
Regards,
Rich Heilman -
Invalid Number Error for Decimal Field While Loading Data
I am loading a delimited text file using the SQL* loader however I am reciving an error in my decimal fields. When a decimal field only has leading zeros before the decimal point I receive invalid number error. Below will clarify:
i.e.) 00000000.30 [*Invalid number*]
i.e.) 00046567.45 [*Valid number*]
i.e.) 00000001.00 [*Valid number*]
I've tried setting the precision/scale in the table, tried declaring it a decimal field instead of number, none of these methods fixed the issue. Any help I would really appreciate.
POLICY_NUMBER NUMBER,
EFFECTIVE_DATE DATE "YYYYMMDD" NULLIF EFFECTIVE_DATE = '',
TRANSACTION_DATE DATE "YYYYMMDD",
TRANSACTION_AMOUNT DECIMAL EXTERNAL, -- Tried TRANSACTION_AMOUNT DECIMAL EXTERNAL (10) & TRANSACTION_AMOUNT NUMBER
MF_TRX_CODE NUMBER,
USER_ID CHAR,
GROUP_NUMBER NUMBER,
EXPIRATION_DATE DATE "YYYYMMDD" NULLIF EXPIRATION_DATE = '',
BILL_NUMBER NUMBER,Any help is greatly appreciated. Thanks before hand.Hi,
Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
Connected as hr
SQL> SELECT * FROM TEST;
TRANSACTION_AMOUNT
SQL> SELECT * FROM TEST;
TRANSACTION_AMOUNT
11000,00
293,37
2000,00
1134,32
0,30
SQL>Between the selects I loaded the table with sql*loader using...
Load Data
INFILE *
APPEND
INTO TABLE TEST
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
TRANSACTION_AMOUNT DECIMAL EXTERNAL
BEGINDATA
00011000.00
00000293.37
00002000.00
00001134.32
00000000.30The log is
SQL*Loader: Release 10.2.0.1.0 - Production on Tue Dec 23 17:23:47 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: test.ctl
Data File: test.ctl
Bad File: test.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table TEST, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
TRANSACTION_AMOUNT FIRST * | CHARACTER
Table TEST:
5 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Space allocated for bind array: 16512 bytes(64 rows)
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 5
Total logical records rejected: 0
Total logical records discarded: 0
Run began on Tue Dec 23 17:23:47 2008
Run ended on Tue Dec 23 17:23:50 2008
Elapsed time was: 00:00:02.86
CPU time was: 00:00:00.06Regards, -
Dezimalfeld und Berechnung/ decimal-field and calculation
Hallo zusammen,
in einerm Formular versuche ich mehrere Dezimalfelder anzulegen, die am Ende zu einer Summe berechnet werden sollen.
Wenn die Stellen hinter dem Komma "00" lauten, werden sie nicht dargestellt.
Welche Einstellung muss ich wählen?
Wie muss die Einstellung für das Summenfeld lauten?
Freue mich über jeden Hinweis oder Tipp.
Hi,
in a form I'm trying to create several decimal fields that are to be calculated at the end to a sum.
If the digits after the decimal point are "00", they are not shown.
What setting should I choose?
What must be the setting for the total field?
I am pleased with every hint or tip.In a form I'm trying to create several decimal fields that are to be calculated at the end to a sum.
If the digits after the decimal point are "00", they are not shown.
What setting should I choose?
What must be the setting for the total field?
In the field's validation pattern, In pattern field box copy this pattern num{(zzzz9.99)}
This should work for your problem
Thanks,
Jaison -
Web dynpro + adobe form decimal field round off
hello all,
I am now developing an application which is based on the SAP WebDynpro and Adobe form, but the application has an error, if one can help me to resolve the error, I will be very thankful.
The error is as follows, for a decimal filed on the Adobe form which is binded to a deicmal attribute of Webdynpro, if I get the value of the decimal field using the programming code as "context.nodexx.getAttribute("xx")", the decimal value is rounded off (e.g., 2.4 is changed to 2.0, 2.7 is changed to 3.0).
for example:In Web Dynpro, A node name is "TestNode" which has a type of decimalattribute named "TestAttr" , in adobe form a decimal field bind to the TestAttr . when i input 2.3 in adobe form, i click the button with code:
this.wdComponentAPI.getMessageManager.reportSuccess(this.wdContext.nodeTestNode.getTestAttr()+"");
the rusult is : 2.0
if i input the value 2.5 the result will be 3.0
Thanks All !Hi,
there is a special display pattern to check for null values:
null{pattern}
Example:
null{'please enter a value'}
But I don't know if WDJ is really sending a null value. You can combine this with alternatives using '|' to separate alternatives.
Regards,
Juergen -
Can we move space to decimal field
Hi all
can we move space to decimal field(0.00).
regards,
kiranhi santosh
in output if IVBAK-INCO1 is not equal to PUA.i should get values only for PUA.here i am geting values correctly for PUA.
But other than PUA, if i am having CRF i am geting 0.00.
instead of 0.00, i should get blank.
i tried out this code.
but it is not working.
IF IVBAK-INCO1 NE 'PUA'.
var = ' '.
ENDIF.
regards,
kiran.
Edited by: joginpally sai kiran on Nov 5, 2008 4:14 PM
Edited by: joginpally sai kiran on Nov 5, 2008 4:18 PM -
how to limit sharing apps to only two devices? because i have an iPod touch and an iPad. i just want to limit the sharing of apps to those two. because my brother is using my apple id too on his ipod. i want to limit it to mine only. tnx!
You can go into settings and turn sharing off in the programs on the device you don't want to share too.
-
Data flow fails on packed decimal field moving iSeries DB2 data from one iSeries DB to another
I' trying to use SSIS to move table content from one iSeries DB2 database to another. I'm using the .Net providers for OleDb\IBM DB2 for i5/OS IBMDA400 OLE DB Provider in the connection managers for the source and destination and the test connection
works fine. When I try to run the data flow task however it fails on the first packed decimal field it encounters with the exceptions ...
[select from hydro520 hydroweb2 blpmstr [16]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "component "select from hydro520 hydroweb2 blpmstr" (16)" failed because error code 0x80004002 occurred, and the error
row disposition on "output column "MSPRIB" (55)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
[select from hydro520 hydroweb2 blpmstr [16]] Error: The component "select from hydro520 hydroweb2 blpmstr" (16) was unable to process the data. Pipeline component has returned HRESULT error code 0xC0209029 from a method call.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "select from hydro520 hydroweb2 blpmstr" (16) returned error code 0xC02090F5. The component returned a failure code when the pipeline
engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
...in the progress tab. Can someone kindly tell me what I need to do to get the connection manager to work with DB2 packed decimal fields? Or is it a different issue all together? Thanks tonnes for any help, RoscoeHi rpfinn,
From the Data Types mapping rules between SSIS and DB2, we can see that both the NUMERIC and DECIMAL data types in DB2 are mapped to DT_NUMBERIC data type in SSIS. Now that the source data in your DB2 database is NUMERIC data type, changing the DT_NUMBRIC
data type to DT_DECIMAL is invalid. Besides, if we check the data types of the target External column and Output column from the Advanced Editor for ADO NET Source adapter, the data type should be defined as DT_NUMERIC with Precision as 9 and Scale as 2. I
am not clear where you see the DT_NUMBERIC(9,0) e.g. DT_NUMERIC with Precision as 9 and Scale as 0, but it may be the cause of the issue. You need to make sure the DT_NUMERIC data type also has Scale 2 instead of 0.
If you don’t know how to modify the data type, please elaborate the Data Flow Task of the package so that we can make further analysis. Besides, the error messages you posted are incomplete, it will be helpful if you post the complete error message.
Regards,
Mike Yin
If you have any feedback on our support, please click
here
Mike Yin
TechNet Community Support -
Can I know the precision and scale of a decimal field using ACEDAO?
Using ACEDAO in VC++, I am trying to retrieve the field details of an Access database (.accdb file) table of which one field is of decimal type. I am able to get the details using the functions of
DAO::_FieldPtr field;
as follows:
fieldName = field->GetName().GetBSTR();
nType = field->GetType() // returns DAO::dbDecimal
lSize = field->GetSize(); // returns 16
lAttr = field->GetAttributes(); // returns 0x000002H
nOrdinal = field->GetOrdinalPosition(); // returns 11
bAutoIncrement = ((lAttr & DAO::dbAutoIncrField) > 0);
DAO::PropertiesPtr props;
DAO::PropertyPtr prop;
int k, nProp;
std::wstring propName, propNames;
props = field->GetProperties();
if(props)
nProp = props->GetCount(); // returns 33
for(k = 0; k < nProp; k++)
prop = field->GetProperties()->GetItem((short) k);
if(prop)
propName = prop->GetName().GetBSTR();
propNames += propName;
propNames += L"\n";
// After exiting the loop, propNames contain 33 properties as:
// Value
// Attributes
// CollatingOrder
// Type
// Name
// OrdinalPosition
// Size
// SourceField
// SourceTable
// ValidateOnSet
// DataUpdatable
// ForeignName
// DefaultValue
// ValidationRule
// ValidationText
// Required
// AllowZeroLength
// AppendOnly
// Expression
// FieldSize
// OriginalValue
// VisibleValue
// GUID
// ColumnWidth
// ColumnOrder
// ColumnHidden
// Description
// DecimalPlaces
// DisplayControl
// TextAlign
// AggregateType
// ResultType
// CurrencyLCID
//But does not have any property named "Scale" or "Precision"
I could not find any function for retrieving the value for precision and scale for the decimal field.
Though I am able to retrieve the field value as a decimal number and get the required information from the structure, I think it is not the right way. Because, what will happen if the data for field is not available in the table?
Is there any other method to retrieve the precision and scale of a decimal type field using ACEDAO?
Thanks.I cannot find a method or property in ACEDAO to retrieve the precision and scale of a field. Maybe you could try get the number of a decimal type and use some mathematical methods to get the precision.
I find there are some way to get the precision by ADO or OLEDB.
For ADO way, you could check this thread:
https://social.msdn.microsoft.com/Forums/office/en-US/883087ba-2c25-4571-bd3c-706061466a11/how-can-i-programmatically-access-scale-property-of-a-decimal-data-type-field?forum=accessdev
For OLE DB , you could use IColumnsInfo::GetColumnInfo to get DBCOLUMNINFO::bPrecision.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms722704(v=vs.85).aspx
Also people in C++ may not familiar with access development, the
Access for Developers forum is good place for access develop issue. You could try there.
Hope this helps some.
Shu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Bulk collect limit 1000 is looping only 1000 records out of 35000 records
In below code I have to loop around 35000 records for every month of the year starting from Aug-2010 to Aug-2011.
I am using bulk collect with limit clause but the problem is:
a: Limit clause is returning only 1000 records.
b: It is taking too much time to process.
CREATE OR REPLACE PACKAGE BODY UDBFINV AS
F UTL_FILE.FILE_TYPE;
PV_SEQ_NO NUMBER(7);
PV_REC_CNT NUMBER(7) := 0;
PV_CRLF VARCHAR2(2) := CHR(13) || CHR(10);
TYPE REC_PART IS RECORD(
PART_NUM PM_PART_HARSH.PART_NUM%TYPE,
ON_HAND_QTY PM_PART_HARSH.ON_HAND_QTY%TYPE,
ENGG_PREFIX PM_PART_HARSH.ENGG_PREFIX%TYPE,
ENGG_BASE PM_PART_HARSH.ENGG_BASE%TYPE,
ENGG_SUFFIX PM_PART_HARSH.ENGG_SUFFIX%TYPE);
TYPE TB_PART IS TABLE OF REC_PART;
TYPE REC_DATE IS RECORD(
START_DATE DATE,
END_DATE DATE);
TYPE TB_MONTH IS TABLE OF REC_DATE;
PROCEDURE MAIN IS
/* To be called in Scheduler Programs Action */
BEGIN
/* Initializing package global variables;*/
IFMAINT.V_PROG_NAME := 'FULL_INVENTORY';
IFMAINT.V_ERR_LOG_TAB := 'UDB_ERR_FINV';
IFMAINT.V_HIST_TAB := 'UDB_HT_FINV';
IFMAINT.V_UTL_DIR_NAME := 'UDB_SEND';
IFMAINT.V_PROG_TYPE := 'S';
IFMAINT.V_IF_TYPE := 'U';
IFMAINT.V_REC_CNT := 0;
IFMAINT.V_DEL_INS := 'Y';
IFMAINT.V_KEY_INFO := NULL;
IFMAINT.V_MSG := NULL;
IFMAINT.V_ORA_MSG := NULL;
IFSMAINT.V_FILE_NUM := IFSMAINT.V_FILE_NUM + 1;
IFMAINT.LOG_ERROR; /*Initialize error log table, delete prev. rows*/
/*End of initialization section*/
IFMAINT.SET_INITIAL_PARAM;
IFMAINT.SET_PROGRAM_PARAM;
IFMAINT.SET_UTL_DIR_PATH;
IFMAINT.GET_DEALER_PARAMETERS;
PV_SEQ_NO := IFSMAINT.GENERATE_FILE_NAME;
IF NOT CHECK_FILE_EXISTS THEN
WRITE_FILE;
END IF;
IF IFMAINT.V_BACKUP_PATH_SEND IS NOT NULL THEN
IFMAINT.COPY_FILE(IFMAINT.V_UTL_DIR_PATH,
IFMAINT.V_FILE_NAME,
IFMAINT.V_BACKUP_PATH_SEND);
END IF;
IFMAINT.MOVE_FILE(IFMAINT.V_UTL_DIR_PATH,
IFMAINT.V_FILE_NAME,
IFMAINT.V_FILE_DEST_PATH);
COMMIT;
EXCEPTION
WHEN IFMAINT.E_TERMINATE THEN
IFMAINT.V_DEL_INS := 'N';
IFMAINT.LOG_ERROR;
ROLLBACK;
UTL_FILE.FCLOSE(F);
IFMAINT.DELETE_FILE(IFMAINT.V_UTL_DIR_PATH, IFMAINT.V_FILE_NAME);
RAISE_APPLICATION_ERROR(IFMAINT.V_USER_ERRCODE, IFMAINT.V_ORA_MSG);
WHEN OTHERS THEN
IFMAINT.V_DEL_INS := 'N';
IFMAINT.V_MSG := 'ERROR IN MAIN PROCEDURE ||IFMAINT.V_PROG_NAME';
IFMAINT.V_ORA_MSG := SUBSTR(SQLERRM, 1, 255);
IFMAINT.V_USER_ERRCODE := -20101;
IFMAINT.LOG_ERROR;
ROLLBACK;
UTL_FILE.FCLOSE(F);
IFMAINT.DELETE_FILE(IFMAINT.V_UTL_DIR_PATH, IFMAINT.V_FILE_NAME);
RAISE_APPLICATION_ERROR(IFMAINT.V_USER_ERRCODE, IFMAINT.V_ORA_MSG);
END;
PROCEDURE WRITE_FILE IS
CURSOR CR_PART IS
SELECT A.PART_NUM, ON_HAND_QTY, ENGG_PREFIX, ENGG_BASE, ENGG_SUFFIX
FROM PM_PART_HARSH A;
lv_cursor TB_PART;
LV_CURR_MONTH NUMBER;
LV_MONTH_1 NUMBER := NULL;
LV_MONTH_2 NUMBER := NULL;
LV_MONTH_3 NUMBER := NULL;
LV_MONTH_4 NUMBER := NULL;
LV_MONTH_5 NUMBER := NULL;
LV_MONTH_6 NUMBER := NULL;
LV_MONTH_7 NUMBER := NULL;
LV_MONTH_8 NUMBER := NULL;
LV_MONTH_9 NUMBER := NULL;
LV_MONTH_10 NUMBER := NULL;
LV_MONTH_11 NUMBER := NULL;
LV_MONTH_12 NUMBER := NULL;
lv_month TB_MONTH := TB_MONTH();
BEGIN
IF CR_PART%ISOPEN THEN
CLOSE CR_PART;
END IF;
FOR K IN 1 .. 12 LOOP
lv_month.EXTEND();
lv_month(k).start_date := ADD_MONTHS(TRUNC(SYSDATE, 'MM'), - (K + 1));
lv_month(k).end_date := (ADD_MONTHS(TRUNC(SYSDATE, 'MM'), -K) - 1);
END LOOP;
F := utl_file.fopen(IFMAINT.V_UTL_DIR_NAME, IFMAINT.V_FILE_NAME, 'W');
IF UTL_FILE.IS_OPEN(F) THEN
/*FILE HEADER*/
utl_file.put_line(F,
RPAD('$CUD-', 5, ' ') ||
RPAD(SUBSTR(IFMAINT.V_PANDA_CD, 1, 5), 5, ' ') ||
RPAD('-136-', 5, ' ') || RPAD('000000', 6, ' ') ||
RPAD('-REDFLEX-KA-', 13, ' ') ||
RPAD('00000000-', 9, ' ') ||
RPAD(IFMAINT.V_CDS_SPEC_REL_NUM, 5, ' ') ||
RPAD('CD', 2, ' ') ||
RPAD(TO_CHAR(SYSDATE, 'MMDDYY'), 6, ' ') ||
LPAD(IFSMAINT.V_FILE_NUM, 2, 0) ||
RPAD('-', 1, ' ') || RPAD(' ', 9, ' ') ||
RPAD('-', 1, ' ') || RPAD(' ', 17, ' ') ||
RPAD('CD230', 5, ' ') ||
RPAD(TO_CHAR(SYSDATE, 'MMDDYY'), 6, ' ') ||
LPAD(IFSMAINT.V_FILE_NUM, 2, 0) ||
LPAD(PV_REC_CNT, 8, 0) || RPAD(' ', 5, ' ') ||
RPAD('00000000', 8, ' ') || RPAD('CUD', 3, ' ') ||
RPAD(IFMAINT.V_CDS_SPEC_REL_NUM, 5, ' ') ||
RPAD(IFMAINT.V_GEO_SALES_AREA_CD, 3, ' ') ||
RPAD(IFMAINT.V_FRANCHISE_CD, 2, ' ') ||
RPAD(IFMAINT.V_DSP_REL_NUM, 9, ' ') ||
RPAD('00136REDFLEX', 12, ' ') || RPAD(' ', 1, ' ') ||
RPAD('KA', 2, ' ') || RPAD('000000', 6, ' ') ||
RPAD('00D', 3, ' ') ||
RPAD(IFMAINT.V_VENDOR_ID, 6, ' ') ||
RPAD(IFSMAINT.V_FILE_TYPE, 1, ' ') ||
RPAD('>', 1, ' ') || PV_CRLF);
/*LINE ITEMS*/
OPEN CR_PART;
FETCH CR_PART BULK COLLECT
INTO lv_cursor limit 1000;
FOR I IN lv_cursor.FIRST .. lv_cursor.LAST LOOP
SELECT SUM(A.BILL_QTY)
INTO LV_CURR_MONTH
FROM PD_ISSUE A, PH_ISSUE B
WHERE A.DOC_TYPE IN ('CRI', 'RRI', 'RSI', 'CSI')
AND A.DOC_NUM = B.DOC_NUM
AND B.DOC_DATE BETWEEN TRUNC(SYSDATE, 'MM') AND SYSDATE
AND A.PART_NUM = LV_CURSOR(i).PART_NUM;
FOR J IN 1 .. 12 LOOP
SELECT SUM(A.BILL_QTY)
INTO LV_MONTH_1
FROM PD_ISSUE A, PH_ISSUE B
WHERE A.DOC_TYPE IN ('CRI', 'RRI', 'RSI', 'CSI')
AND A.DOC_NUM = B.DOC_NUM
AND B.DOC_DATE BETWEEN lv_month(J).start_date and lv_month(J)
.end_date
AND A.PART_NUM = LV_CURSOR(i).PART_NUM;
END LOOP;
utl_file.put_line(F,
RPAD('IL', 2, ' ') ||
RPAD(TO_CHAR(SYSDATE, 'RRRRMMDD'), 8, ' ') ||
RPAD(LV_CURSOR(I).ENGG_PREFIX, 6, ' ') ||
RPAD(LV_CURSOR(I).ENGG_BASE, 8, ' ') ||
RPAD(LV_CURSOR(I).ENGG_SUFFIX, 6, ' ') ||
LPAD(LV_CURSOR(I).ON_HAND_QTY, 7, 0) ||
LPAD(NVL(LV_CURR_MONTH, 0), 7, 0) ||
LPAD(LV_MONTH_1, 7, 0) || LPAD(LV_MONTH_2, 7, 0) ||
LPAD(LV_MONTH_3, 7, 0) || LPAD(LV_MONTH_4, 7, 0) ||
LPAD(LV_MONTH_5, 7, 0) || LPAD(LV_MONTH_6, 7, 0) ||
LPAD(LV_MONTH_7, 7, 0) || LPAD(LV_MONTH_8, 7, 0) ||
LPAD(LV_MONTH_9, 7, 0) || LPAD(LV_MONTH_10, 7, 0) ||
LPAD(LV_MONTH_11, 7, 0) ||
LPAD(LV_MONTH_12, 7, 0));
IFMAINT.V_REC_CNT := IFMAINT.V_REC_CNT + 1;
END LOOP;
CLOSE CR_PART;
/*TRAILER*/
utl_file.put_line(F,
RPAD('$EOF-', 5, ' ') || RPAD('320R', 4, ' ') ||
RPAD(SUBSTR(IFMAINT.V_PANDA_CD, 1, 5), 5, ' ') ||
RPAD(' ', 5, ' ') ||
RPAD(IFMAINT.V_GEO_SALES_AREA_CD, 3, ' ') ||
RPAD(TO_CHAR(SYSDATE, 'MM-DD-RR'), 6, ' ') ||
LPAD(IFSMAINT.V_FILE_NUM, 2, 0) ||
LPAD(IFMAINT.V_REC_CNT, 8, 0) || 'H' || '>' ||
IFMAINT.V_REC_CNT);
utl_file.fclose(F);
IFMAINT.INSERT_HISTORY;
END IF;
END;
FUNCTION CHECK_FILE_EXISTS RETURN BOOLEAN IS
LB_FILE_EXIST BOOLEAN := FALSE;
LN_FILE_LENGTH NUMBER;
LN_BLOCK_SIZE NUMBER;
BEGIN
UTL_FILE.FGETATTR(IFMAINT.V_UTL_DIR_NAME,
IFMAINT.V_FILE_NAME,
LB_FILE_EXIST,
LN_FILE_LENGTH,
LN_BLOCK_SIZE);
IF LB_FILE_EXIST THEN
RETURN TRUE;
END IF;
RETURN FALSE;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END;
END;Try this:
OPEN CR_PART;
loop
FETCH CR_PART BULK COLLECT
INTO lv_cursor limit 1000;
exit when CR_PART%notfound;
FOR I IN lv_cursor.FIRST .. lv_cursor.LAST LOOP
SELECT SUM(A.BILL_QTY)
INTO LV_CURR_MONTH
FROM PD_ISSUE A, PH_ISSUE B
WHERE A.DOC_TYPE IN ('CRI', 'RRI', 'RSI', 'CSI')
AND A.DOC_NUM = B.DOC_NUM
AND B.DOC_DATE BETWEEN TRUNC(SYSDATE, 'MM') AND SYSDATE
AND A.PART_NUM = LV_CURSOR(i).PART_NUM;
FOR J IN 1 .. 12 LOOP
SELECT SUM(A.BILL_QTY)
INTO LV_MONTH_1
FROM PD_ISSUE A, PH_ISSUE B
WHERE A.DOC_TYPE IN ('CRI', 'RRI', 'RSI', 'CSI')
AND A.DOC_NUM = B.DOC_NUM
AND B.DOC_DATE BETWEEN lv_month(J).start_date and lv_month(J)
.end_date
AND A.PART_NUM = LV_CURSOR(i).PART_NUM;
END LOOP;
utl_file.put_line(F,
RPAD('IL', 2, ' ') ||
RPAD(TO_CHAR(SYSDATE, 'RRRRMMDD'), 8, ' ') ||
RPAD(LV_CURSOR(I).ENGG_PREFIX, 6, ' ') ||
RPAD(LV_CURSOR(I).ENGG_BASE, 8, ' ') ||
RPAD(LV_CURSOR(I).ENGG_SUFFIX, 6, ' ') ||
LPAD(LV_CURSOR(I).ON_HAND_QTY, 7, 0) ||
LPAD(NVL(LV_CURR_MONTH, 0), 7, 0) ||
LPAD(LV_MONTH_1, 7, 0) || LPAD(LV_MONTH_2, 7, 0) ||
LPAD(LV_MONTH_3, 7, 0) || LPAD(LV_MONTH_4, 7, 0) ||
LPAD(LV_MONTH_5, 7, 0) || LPAD(LV_MONTH_6, 7, 0) ||
LPAD(LV_MONTH_7, 7, 0) || LPAD(LV_MONTH_8, 7, 0) ||
LPAD(LV_MONTH_9, 7, 0) || LPAD(LV_MONTH_10, 7, 0) ||
LPAD(LV_MONTH_11, 7, 0) ||
LPAD(LV_MONTH_12, 7, 0));
IFMAINT.V_REC_CNT := IFMAINT.V_REC_CNT + 1;
END LOOP;
end loop;
CLOSE CR_PART;
Maybe you are looking for
-
Problems with screen resolution after reinstalling Windows 7 Home Premium
Product Name: HP Pavilion dv6 Notebook PC Product Number: A6X94UA#ABA BIOS: F.1C Processor: Intel Core i7-2670QM Graphics Device: Intel HD Graphics Family I recently had to wipe my laptop and reinstall Windows 7 Home Premium (created restore disk fro
-
Finder Crash when launched by iTunes
After upgrading to Mavericks: Launch iTunes Select "File->Add to Library" Finder opens and suddenly close by itself This issue happens also in Safe Mode I've never had this kind of problem with Mountain Lion Any suggestion ?
-
This has been "bugging" me for a while. 1) Open a raw file (.CR2) 2) output the file to JPG or open directly ===> i.e. the resulting image is 3888 x 2592 3) use Automate > Fit Image ===> i.e. 1200 pixels (reducing the image by a factor of 3.24) =====
-
Sending Engineering Change requests through ALE
dear all, I want to send Engineering Change requests from one client to other can any one guide me if some standerd SAP Message type is provided for that? I have checked ECMMAS, it is not working for me. Regards, Nitin Verma
-
Upgrading from 10.4.11 to 10.5 - question
I just received my 10.5 install dvd & I'm going to do an "archive & install" on my G5 iMac (non-Intel processor) but before I do so I'm trying to make sure that all my 3rd party software (Photoshop, Lightroom, Office) will remain intact ... I've back