Custom validate data length 6 to 8
I have a form that requires a minimum of 6 characters and a maximum of 8. The only accepted input are lowercase letters and numbers. I am unable to find a way to validate this. I can check the length with "None" or with "Custom" I can validate the inputted data however this appears to work for fixed lengths only but not variable lengths. Is there any way to validate both at the same time. Thanks in advance.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script src="SpryAssets/SpryValidationTextField.js"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet">
</head>
<body>
<span id="sprytextfield1">
<label for="text1"></label>
<input type="text" name="text1" id="text1">
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
<script>
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "custom", {validation:myValidation, validateOn:["blur", "change"]});
function myValidation(value) {
return /^([a-z0-9]{6,8})$/.test(value)
</script>
</body>
</html>
Similar Messages
-
Hi Team,
I am getting error while tring to Check in any document in Sharepoint 2007. Error - "Unable to validate data. System.Web.Configuration.MachineKey.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength).
Anybody please let me know how to resolve the issue. It has affected our 9 site collection with almost 2000+ sites. Please email me your your suggestion or you can share your ideas here also.
Tried to reset the IIS, checked the Internet connection speed (8MBps). Cleared the cache and all but no luck.
Thanks,
PronobHello,
I have found this support window for you:
http://support.microsoft.com/kb/556031
http://technet.microsoft.com/en-in/library/cc298582%28v=office.12%29.aspx
This may help you
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Validate Street and House Number in the Customer Master Data (xd01/xd02)
All.
I need to validate if the fields street and house number are in blank in the Customer Master Data transaction (xd01/xd02). I found an user-exit (EXIT_SAPMF02D_001), which I can validate the customer data (KNA1, KNB1, etc) before to save. The problem is in the KNA1 structure, there aren't the fields street (STREET) and house number (NOUSE_NUM1), there is only the field STRAS, which street and house number values are concatenated.I solved this problem using field-symbol to catch these values in the screen, but I know it isn't a good solution. Is there another solution to solve this ? I had problem using this user-exit. It shows a message error type 'E' when either field street or field house number are in blank, after show this message if the user click in the tabs navigator button before press enter button, the transaction shows the error message "System error on reading table DYNTAB, screen no. 0370". Does Somebody know this problem?
Best regards,
Alexandre
ps: I'm coding in the ECC 6.Amit.
Thanks for your suggestion, but I need to validate these values typed by the user. When I create a customer, I can't get these values in the ADRC table.
Regards, Alexandre -
Data length error in record 86.
Data length error in record 86.
Message no. FV147
Diagnosis
An error occurred in the processing of the data to be imported. It is highly probable that this is a data error.
Contact your data provider.
System Response
Any account statement processing currently underway and any outstanding is being terminated.
Procedure
Check the structure of the supplied data. If the statement data you have obtained is error-free, you can simply restart the program. All those statements which have already been imported correctly will not be reimported.
{1:F01SCBLINBBXXXX3446100003}{2:O9400634140719SCBLINBBXXXX34461000031407190634N}{3:{108:00000000000718}}{4:
:20:14071905fr309439
:25:52205785839
:28C:611
:60F:D140718INR792788,04
:61:1407180718CR100000,00N169NONREF
:86:IN36701407187774 VIJBH14199069837
IN36701407187774 VIJBH14199069837
AGARWAL AGENCIES
:61:1407180718CR150000,00N169NONREF
:86:IN36701407187251 SBIN414199017384
IN36701407187251 SBIN414199017384
EAGLE FOOTWERE
:61:1407180718CR100000,00N169NONREF
:86:IN36701407187052 SAA96678573
IN36701407187052 SAA96678573
TANVEER TRADERS
:61:1407180718CR98000,00N169NONREF
:86:IN36701407186828 SBIN314199982628
IN36701407186828 SBIN314199982628
MODERN AGENCY
:61:1407180718CR179000,00N169NONREF
:86:IN36701407186029 SAA96670577
IN36701407186029 SAA96670577
BALAJI ENTERPRISES
:61:1407180718CR60000,00N169NONREF
:86:IN36701407185397 367845438
IN36701407185397 367845438
SAKSHI ENTERPRISES
:61:1407180718CR2000000,00N169NONREF
:86:IN3670140718H568 SBIN414199360804
IN3670140718H568 SBIN414199360804
RELAXO FOOTWEARS LIMITED
:61:1407180718CR38000,00N169NONREF
:86:IN3670140718G554 CBINH14199566672
IN3670140718G554 CBINH14199566672
WONDER WALK AGENCIES
:61:1407180718CR113000,00N169NONREF
:86:IN3670140718F851 JAKA140718621672
IN3670140718F851 JAKA140718621672
JYOTI SALES PROP MR AMIT VOHRA S
:61:1407180718CR54200,00N169NONREF
:86:IN3670140718F006 BKIDN14199343033
IN3670140718F006 BKIDN14199343033
SHAH FOOT WEAR
:61:1407180718CR64000,00N169NONREF
:86:IN3670140718F094 BKIDN14199343132
IN3670140718F094 BKIDN14199343132
MUSKAN TRADERS
:61:1407180718CR114500,00N169NONREF
:86:IN3670140718F423 SBIN414199302946
IN3670140718F423 SBIN414199302946
GOUTAM DISTRIBUTORS
:61:1407180718CR63000,00N169NONREF
:86:IN3670140718D651 SD1141261589
IN3670140718D651 SD1141261589
M K FOOTWEAR
:61:1407180718CR67913,00N169NONREF
:86:IN3670140718D057 SBIN414199247753
IN3670140718D057 SBIN414199247753
SSS PG STORES
:61:1407180718CR130000,00N169NONREF
:86:IN3670140718D183 UTBIN14199275937
IN3670140718D183 UTBIN14199275937
GOPAL SHOES
:61:1407180718CR48000,00N169NONREF
:86:IN3670140718C628 CBINH14199546949
IN3670140718C628 CBINH14199546949
AGGARWAL FOOTWEAR
:61:1407180718DR5000000,00N506PIRLXOIN01A00468
PIRLXOIN01A00468
:86:PIRLXOIN01A00468 SCBLR12014071800003757
CASH SCBLR12014071800003757
RELAXO FOOTWEARS LIMITED
SIN09373C0000423 00001 PIRLXOIN01A0
0468
PIRLXOIN01A00468
:61:1407180718DR4000000,00N506PIRLXOIN01A00469
PIRLXOIN01A00469
:86:PIRLXOIN01A00469 SIN09373Q0000468
PIRLXOIN01A00469-SIN09373Q0000468
SB3670140718HK96
SIN09373C0000424-00001 PIRLXOIN01A0
0469
:61:1407180718DR1699195,25N699TRF
:86:316031790865 PAY001
316031790865 PAY001
GRAND WISE ENTERPRISES LIMITED
AKMP037
USD28,030.8 60.5755/INR743.76 1
DEBIT IMEX CUSTOMER A/C
:61:1407180718CR480000,00N195NONREF
:86:IL36701407182157 BARBR52014071800734481
CASH BARBR52014071800734481
APNA FOOT WEAR
SENDER IFSCBARB0CHARMI
IL36701407182157
:61:1407180718CR235000,00N195NONREF
:86:IL36701407185517 SBINR52014071801147506
CASH SBINR52014071801147506
PRAKASH FOOT WEAR
FUND TRF FRM 33174969142 TO52205785
SENDER IFSCSBIN0016310
IL36701407185517
:61:1407180718CR500000,00N195NONREF
:86:IL36701407185083 SBINR12014071801142317
CASH SBINR12014071801142317
MODERN FOOTWEARS
SENDER IFSCSBIN0001521
IL36701407185083
:61:1407180718CR800000,00N195NONREF
:86:IL36701407184746 HDFCR52014071851912408
CASH HDFCR52014071851912408
FASHION SQUARE
SENDER IFSCHDFC0000412
IL36701407184746
:61:1407180718CR332000,00N195NONREF
:86:IL36701407184713 SBINR52014071801140001
CASH SBINR52014071801140001
WINGS POLYMERS
SENDER IFSCSBIN0001581
IL36701407184713
:61:1407180718CR450000,00N195NONREF
:86:IL36701407184302 FDRLR52014071800031798
CASH FDRLR52014071800031798
ABHINAV ENTERPRISE
SENDER IFSCFDRL0001492
IL36701407184302
:61:1407180718CR650000,00N195NONREF
:86:IL36701407183976 UCBAR32014071800058993
CASH UCBAR32014071800058993
GAYLORD SHOE AND CHAPPAL
SENDER IFSCUCBA0000048
IL36701407183976
:61:1407180718CR700000,00N195NONREF
:86:IL36701407183860 SBINR52014071801134507
CASH SBINR52014071801134507
FOOTWEAR HOUSE
RTGS TGH CHQ NO 172867
SENDER IFSCSBIN0008602
IL36701407183860
:61:1407180718CR250000,00N195NONREF
:86:IL36701407183487 SBINR52014071801131379
CASH SBINR52014071801131379
PRATAP AGENCY PROP MRS SUNITA KUMRA
SENDER IFSCSBIN0014152
IL36701407183487
:61:1407180718CR254740,00N195NONREF
:86:IL36701407182511 HDFCR52014071851915942
CASH HDFCR52014071851915942
HEPHZIBAH AGENCIES
SENDER IFSCHDFC0001498
IL36701407182511
:61:1407180718CR398000,00N195NONREF
:86:IL36701407182496 BARBR52014071800726312
CASH BARBR52014071800726312
RAZA FOOT WEAR
SENDER IFSCBARB0BASTIX
IL36701407182496
:61:1407180718CR300000,00N195NONREF
:86:IL36701407182349 KKBKR52014071800664337
CASH KKBKR52014071800664337
M M DISTRIBUTORS
PAYMENT
SENDER IFSCKKBK0000958
IL36701407182349
:61:1407180718CR61136,00N169NONREF
:86:IN3670140718C504 IOBAN14199026875
IN3670140718C504 IOBAN14199026875
M S CHINNS TRADERS
:61:1407180718CR79995,00N169NONREF
:86:IN3670140718C142 SBIN414199219784
IN3670140718C142 SBIN414199219784
FRONTIER TRADING COMPANY
:61:1407180718CR100000,00N169NONREF
:86:IN3670140718B731 SBIN414199200112
IN3670140718B731 SBIN414199200112
SHRI AMBEY TRADERS
:61:1407180718CR125000,00N169NONREF
:86:IN3670140718B521 N199140025581074
IN3670140718B521 N199140025581074
SHYAM BROTHERS
:61:1407180718CR68000,00N169NONREF
:86:IN3670140718A144 1205061871400003
IN3670140718A144 1205061871400003
POPULAR TRADERS PROP PISHORI LAL SETHI
:61:1407180718CR41000,00N169NONREF
:86:IN3670140718A044 P14071849681718
IN3670140718A044 P14071849681718
AKSHAY FOOTWEARS
:61:1407180718CR50000,00N169NONREF
:86:IN3670140718A099 BARBH14199284604
IN3670140718A099 BARBH14199284604
STAR ENTERPRISE
:61:1407180718CR100000,00N169NONREF
:86:IN3670140718A002 SAA21370357
IN3670140718A002 SAA21370357
JAI OMKAR ENTERPRISES
:61:1407180718CR120000,00N169NONREF
:86:IN36701407189725 UTBIN14199269504
IN36701407189725 UTBIN14199269504
SANTI STORES
:61:1407180718CR100000,00N169NONREF
:86:IN36701407189538 SBIN414199107266
IN36701407189538 SBIN414199107266
VINAYAK TRADING
:61:1407180718CR100000,00N169NONREF
:86:IN36701407189842 SAA3564919
IN36701407189842 SAA3564919
SKY STYLE MARKETING PROP.ABHISHEK S
:61:1407180718CR120000,00N169NONREF
:86:IN36701407189384 MAHBH14199609866
IN36701407189384 MAHBH14199609866
ROYAL FOOT WEAR
:62F:D140718INR1697499,29
:64:C140718INR59273846,71
-}{5:{CHK:CHECKSUM DISABLED}{MAC:MACCING DISABLED}}SAP REPLAY
Regarding the incidence itself, kindly consider that The 86-record
limitation is not a bug of the program, but the standard design.
The error is coded as FV147, when the Note to Payee in Record 86
exceeds 65 characters in Program RFEKA400.
You will need to contact your Bank in order to obtain a correct file:
I have attached some documentation on this message that will allow your
bank to create it.
Otherwise, you may use the following user-exit (SAP NOTE 494777):CMOD
Enhancement Exit Name FEB00004 > EXIT_RFEKA400_001.
This User Exit is called in RFEKA400 in the line: PERFORM
PROCESS_RAW_DATA TABLES SWIFT. In Include ZXF01U06, you have
the option to process the raw data.
Hope this information is useful to you. -
Query in customer master data upload ....?
Hi Guru's,
I am uploading the customer master data from presentaion server to customer tables using functional module SD_CUSTOMER_MAINTAIN_ALL.
while check the Function module separatly and it working properley and i am able to ctere customer...
and i am using the same function module in the program i am unable to upload ..could please check and let me know where i am doing mistake in the below program logis..and values also moving properly before calling function module..while calling the functinal module the controle comming out of the loop and program went to dump i am able to see the message in dump as like this(it may helpfull for resolve):
Name of function module...............: "SD_CUSTOMER_MAINTAIN_ALL"
Name of formal parameter..............: "O_KNA1"
Technical type of actual parameter....: "C"
Technical length of actual parameter..: 20 bytes
Technical type of formal parameter....: "u"
Technical length of formal parameter..: 3634 bytes
Name of formal parameter at caller....: "O_KNA1"
*& Report ZERP_CUSTOMER_CREATE_UPLOAD
REPORT zerp_customer_create_upload.
PARAMETERS:p_files TYPE string.
*DATA :xkunnr(10) LIKE kna1-kunnr. "unique KUNNR
DATA: gs_i_kna1 TYPE kna1,
gs_i_knb1 TYPE knb1,
gs_i_knvv TYPE knvv,
gs_return TYPE bapireturn1,
gs_i_bapiaddr1 TYPE bapiaddr1,
gt_t_xknvi TYPE STANDARD TABLE OF fknvi,
gwa_t_xknvi TYPE fknvi,
gt_t_xknbk TYPE STANDARD TABLE OF fknbk,
gwa_t_xknbk TYPE fknbk,
gt_t_yknvp TYPE STANDARD TABLE OF fknvp,
gwa_t_xknvp TYPE fknvp.
TYPES:BEGIN OF gty_itab1,
abc(305),
END OF gty_itab1.
DATA: gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
gwa_itab1 TYPE gty_itab1.
TYPES :BEGIN OF gty_itab2,
ktokd(4), "customer account grp kna1
kunnr(10), "customer kna1
name1(35), "name1 kna1
sortl(10), "sort filed kna1
stras(35), "house number and adres kna1
pstlz(10), "postal code kna1
ort01(35), "city kna1
land1(3), "country kna1
telf1(16), "tele phone no kna1
telfx(31), "fax num kna1
kukla(2), "cust classificaion kna1
bukrs(4), "company code knb1
akont(10), "reconcilation acct knb1
vkorg(4), "sales org knvv
vtweg(2), "distr chan knvv
spart(2), "division knvv
zterm(4), "terms of payment knvv
bzirk(6), "sales district knvv
vkbur(4), "sales office knvv
vkgrp(3), "sales grp knvv
kdgrp(2), "cust grp knvv
waers(5), "currency knvv
konda(2), "price grp knvv
kalks(1), "pricing procedure assign knvv
lprio(2), "delivery plant knvv
vsbed(2), "shipping conditions knvv
vwerk(4), "delivering plant knvv
inco1(3), "inco1 knvv
inco2(28), "inco2 knvv
kkber(4), "cred control area knvv
ktgrd(2), "acc assgn grp knvv
taxkd(1), "tax classification 4 cust knvi
bankn(18), "bank account number knbk -
xkunnr(10),
END OF gty_itab2.
DATA: gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
gwa_itab2 TYPE gty_itab2.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_files
filetype = 'ASC'
TABLES
data_tab = gt_itab1
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT gt_itab1 INTO gwa_itab1.
gwa_itab2 = gwa_itab1-abc(305).
APPEND gwa_itab2 TO gt_itab2.
ENDLOOP.
LOOP AT gt_itab2 INTO gwa_itab2.
SPLIT gwa_itab2 AT ',' INTO gwa_itab2-ktokd
gwa_itab2-kunnr
gwa_itab2-name1 gwa_itab2-sortl
gwa_itab2-stras gwa_itab2-pstlz
gwa_itab2-ort01 gwa_itab2-land1
gwa_itab2-telf1 gwa_itab2-telfx
gwa_itab2-kukla gwa_itab2-bukrs
gwa_itab2-akont gwa_itab2-vkorg
gwa_itab2-vtweg gwa_itab2-spart
gwa_itab2-zterm gwa_itab2-bzirk
gwa_itab2-vkbur gwa_itab2-vkgrp
gwa_itab2-kdgrp gwa_itab2-waers
gwa_itab2-konda gwa_itab2-kalks
gwa_itab2-lprio gwa_itab2-vsbed
gwa_itab2-vwerk gwa_itab2-inco1
gwa_itab2-inco2 gwa_itab2-kkber
gwa_itab2-ktgrd
gwa_itab2-taxkd
gwa_itab2-bankn.
*moving files values from ITAB2 work area to global structure related to FM.
gs_i_kna1-ktokd = gwa_itab2-ktokd.
gs_i_kna1-kunnr = gwa_itab2-kunnr.
gs_i_kna1-name1 = gwa_itab2-name1.
gs_i_kna1-sortl = gwa_itab2-sortl.
gs_i_kna1-stras = gwa_itab2-stras.
gs_i_kna1-pstlz = gwa_itab2-pstlz.
gs_i_kna1-ort01 = gwa_itab2-ort01.
gs_i_kna1-regio = gwa_itab2-land1.
gs_i_kna1-telf1 = gwa_itab2-telf1.
gs_i_kna1-telfx = gwa_itab2-telfx.
gs_i_kna1-kukla = gwa_itab2-kukla.
gs_i_knb1-bukrs = gwa_itab2-bukrs.
gs_i_knb1-akont = gwa_itab2-akont.
*I FOR GOT TO INCLUDE THE ZTERM VALUE IN EXCELL SHEET SO INCLUDED HARD CODE HERE
gs_i_knb1-zterm = '0001'.
gs_i_knvv-vkorg = gwa_itab2-vkorg.
gs_i_knvv-vtweg = gwa_itab2-vtweg.
gs_i_knvv-spart = gwa_itab2-spart.
gs_i_knvv-zterm = gwa_itab2-zterm.
gs_i_knvv-bzirk = gwa_itab2-bzirk.
gs_i_knvv-vkbur = gwa_itab2-vkbur.
gs_i_knvv-vkgrp = gwa_itab2-vkgrp.
gs_i_knvv-kdgrp = gwa_itab2-kdgrp.
gs_i_knvv-waers = gwa_itab2-waers.
gs_i_knvv-konda = gwa_itab2-konda.
gs_i_knvv-kalks = gwa_itab2-kalks.
gs_i_knvv-lprio = '02'. "gwa_itab2-lprio.
gs_i_knvv-vsbed = gwa_itab2-vsbed.
gs_i_knvv-vwerk = gwa_itab2-vwerk.
gs_i_knvv-inco1 = gwa_itab2-inco1.
gs_i_knvv-inco2 = gwa_itab2-inco2.
gs_i_knvv-kkber = gwa_itab2-kkber.
gs_i_knvv-ktgrd = gwa_itab2-ktgrd.
gwa_t_xknvi-tatyp = 'UTXJ'. "HARD CODE
gwa_t_xknvi-aland = 'US'. "HARD CODED
gwa_t_xknvi-kz = '0'. "HADR CODE
gwa_t_xknvi-taxkd = '0'. "gwa_itab2-taxkd.
APPEND gwa_t_xknvi TO gt_t_xknvi.
gwa_t_xknbk-bankn = gwa_itab2-bankn.
APPEND gwa_t_xknbk TO gt_t_xknbk.
gs_i_knb1-lockb = 'X'.
gs_i_knvv-kzazu = 'X'.
gs_i_knvv-kztlf = 'X'.
gs_i_knvv-perfk = 'X'.
gs_i_knvv-prfre = 'X'.
gs_i_kna1-spras = 'EN'.
CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
EXPORTING
i_kna1 = gs_i_kna1
i_knb1 = gs_i_knb1
i_knvv = gs_i_knvv
I_BAPIADDR1 =
I_BAPIADDR2 =
I_MAINTAIN_ADDRESS_BY_KNA1 = ' '
I_KNB1_REFERENCE = ' '
I_FORCE_EXTERNAL_NUMBER_RANGE = ' '
I_NO_BANK_MASTER_UPDATE = ' '
I_CUSTOMER_IS_CONSUMER = ' '
I_RAISE_NO_BTE = ' '
PI_POSTFLAG = ' '
PI_CAM_CHANGED = ' '
PI_ADD_ON_DATA =
I_FROM_CUSTOMERMASTER = ' '
IMPORTING
e_kunnr = xkunnr
o_kna1 = xkunnr
E_SD_CUST_1321_DONE =
TABLES
T_XKNAS =
t_xknbk = gt_t_xknbk
T_XKNB5 =
T_XKNEX =
T_XKNVA =
T_XKNVD =
t_xknvi = gt_t_xknvi
T_XKNVK =
T_XKNVL =
T_XKNVP =
T_XKNZA =
T_YKNAS =
T_YKNBK =
T_YKNB5 =
T_YKNEX =
T_YKNVA =
T_YKNVD =
T_YKNVI =
T_YKNVK =
T_YKNVL =
t_yknvp = gt_t_yknvp
T_YKNZA =
T_UPD_TXT =
EXCEPTIONS
client_error = 1
kna1_incomplete = 2
knb1_incomplete = 3
knb5_incomplete = 4
knvv_incomplete = 5
kunnr_not_unique = 6
sales_area_not_unique = 7
sales_area_not_valid = 8
insert_update_conflict = 9
number_assignment_error = 10
number_not_in_range = 11
number_range_not_extern = 12
number_range_not_intern = 13
account_group_not_valid = 14
parnr_invalid = 15
bank_address_invalid = 16
tax_data_not_valid = 17
no_authority = 18
company_code_not_unique = 19
dunning_data_not_valid = 20
knb1_reference_invalid = 21
cam_error = 22
OTHERS = 23.
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 sy-subrc EQ 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
WRITE: / 'Error Message:', 'error in creation'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / 'costomer', gwa_itab2-kunnr, 'created'.
ENDIF.
ENDLOOP.please let me know if my qestion is not clear...
and please cinfirm me ..that can i use the function module (SD_CUSTOMER_MAINTAIN_ALL) instead of BAPI (BAPI_CUSTOMER_CREATEFROMDATA1) for uploading customer master data.
please respond me ASAP.
thanks in advance and will give full points
thanks®ards
Srinivas. -
Cannot Enter more than 1000 partners in Customer master data(Partner Funct)
Dear Friends,
In Customer Master Data -> Sales Area Data -> Partner Functions-> I can able to enter 1000 partners.
Now When I am trying to enter more than 1000 partners, system is not allowing me(no lines are available to enter partner)
According to my requirement I have to enter another 500 partners(business requirement)
Please suggest me how can I able to enter more than 1000 partner in customer master.
Quick reply will be appreciated and rewarded.
Thank youHello,
It is very clear that, unless you change the Data element for KNVP-PARZA, the system will not allow you to maintain morethan 999 partner functions for a cusotmer master.
This is very exceptional case and I handled the situation in my project with the Duplication of customer master data for Sold to party and maintained the remaining partner functions over there.
Please check with your Business/ Architect team whether they allow this. As an alternative, they have to go with duplication of sold to party for the maintanance of additional ship to parties.
OR
Should go for char length changes for data element KNVP-PARZA (NOT RECOMENDED).
Hope it helps. Let me know if not.
Thanks,
Ram. -
Adding a custom meta data field which lists out content id based on query
How can we add a custom meta data filed which lists out content id based on query like dDocType <matches> `AssociatedProduct`?
Or other alternative would be to have a custom metadata field such that it allows selection of content id using link wizard which we typically use in site studio. It would be preferable to have this second option as it is user friendly. Can we do this on a check-in screen?
-PratapThanks for the reply Deepak.
We got it resolved. We did following changes in /ucm/custom/SiteStudio/resources/ss_custom_field_resources.htm file and it worked cleanly.
Added following section at the end before body tag
===================================================================================================
<@dynamichtml ss_parent_definition_field_entry@>
<$include super.std_edit_entry$>
<$if isQuery and isTrue(isQuery)$></td><td><$endif$>
<$include ss_contributor_base_scripts$>
<script type="text/javascript" src="<$HttpRelativeWebRoot$>resources/<$SSContributorSourceDir$>/sitestudio/wcm.contentserver.popup.js"></script>
<script language="JavaScript">
function OnSelectParentId()
var selectParentIdOptions = {};
selectParentIdOptions.httpCgiPath = '<$HttpCgiPath$>';
selectParentIdOptions.queryText = 'dDocType <matches> `Country`';
selectParentIdOptions.coreContentOnly = '<$if coreContentOnly and isTrue(coreContentOnly)$>1<$else$>0<$endif$>';
selectParentIdOptions.callback = function( returnParams )
returnParams = returnParams || {};
if( returnParams && returnParams['dDocName'] && ( returnParams.dDocName.length > 0 ) )
// Set the actual metadata value
<$if isQuery AND isTrue(isQuery)$>
for (var i=0; i < document.<$formName$>.elements.length; i++)
var elt=document.<$formName$>.elements;
if (elt.name=="<$fieldName$>")
elt.value = returnParams.dDocName;
<$else$>
document.<$formName$>.<$fieldName$>.value = returnParams.dDocName;
<$endif$>
WCM.ContentServerPopup.ChooseManagedDocument(selectParentIdOptions);
</script>
<input type="button" value="<$lc("wwBrowse")$>..." onclick="OnSelectParentId();">
<@end@>
======================================================================================
Then modified the section which show xWebsiteSection, xRegionDefinition etc to include my custom meta data defitnion as well ('xParentContentType')
===================================================================
<@dynamichtml std_edit_entry@>
<$if fieldName and ( fieldName like "xWebsites|xDontShowInListsForWebsites" )$>
<$include ss_website_query_text_field$>
<$elseif fieldName and strEquals( fieldName, "xWebsiteSection" )$>
<$include ss_website_section_field_entry$>
<$elseif fieldName and strEquals( fieldName, "xRegionDefinition" )$>
<$include ss_region_definition_field_entry$>
<$elseif fieldName and strEquals( fieldName, "xParentContentType" )$>
<$include ss_parent_definition_field_entry$>
<$else$>
<$include super.std_edit_entry$>
<$endif$>
<@end@>
====================================================================
This worked fine.
Regards,
Pratap -
How to validate date formate YYYY-MM-DDThh:mm:ss ?
i have implemented validation for YYYY-MM-DD <br>
but how to validate for time <br>
here is the code for date validation
could you please anyone help me on this issue
<br><br><br> public static boolean validateDateFormate(String date) <br><br>
{ <br>
<br> try { <br>
<br> String dateFormat="yyyy-MM-ddYYYY-MM-DDThh:mm:ss";
<br> String temp = date.substring(0,date.indexOf("-"));
<br> if(temp.length()!= 4)
<br> return false;
<br> SimpleDateFormat df=new SimpleDateFormat(dateFormat);
<br> Date date1=df.parse(date);
<br>String resultDateString=df.format(date1);
<br>System.out.println("date1"+resultDateString);
<br> if ( !date.equals(resultDateString)) { return false; }
<br> } catch (Exception de) {
<br> System.out.println(de);
<br> return false;
<br>
<br>}
<br> return true;
<br> }A useful Data util class
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.StringTokenizer;
public final class SlacDate implements Comparable
public final static int FormatDDMMCCYY = 0;
public final static int FormatMMDDCCYY = 1;
public final static int FormatDATETIME = 2;
public final static int FormatMMMDDTIME = 3;
public final static int FormatTIMESTAMP = 4;
public final static int FormatCCYYMMDD = 5;
public final static int FormatCCYYMMDDHHMM = 6;
public final static int FormatCCYYMMDDHHMMSS = 7;
public final static int FormatDDMMCCYYTIME = 8;
public final static int FormatDATEVERBOSE = 9;
public final static int FormatDATETIMEVERBOSE = 10;
public final static int FormatHHMMSS = 11;
public final static int FormatHHMMSSMIL = 12;
public final static int FormatDB2TIMESTAMP = 13;
public final static int FormatUDBTIMESTAMP = 14;
public final static int JANUARY = 1;
public final static int FEBRUARY = 2;
public final static int MARCH = 3;
public final static int APRIL = 4;
public final static int MAY = 5;
public final static int JUNE = 6;
public final static int JULY = 7;
public final static int AUGUST = 8;
public final static int SEPTEMBER = 9;
public final static int OCTOBER = 10;
public final static int NOVEMBER = 11;
public final static int DECEMBER = 12;
public final static int MONTHS_IN_YEAR = 12;
public final static int SUNDAY = 1;
public final static int MONDAY = 2;
public final static int TUESDAY = 3;
public final static int WEDNESDAY = 4;
public final static int THURSDAY = 5;
public final static int FRIDAY = 6;
public final static int SATURDAY = 7;
public final static int DAYS_IN_WEEK = 7;
private final static int DefaultHours = 12;
private final static int DefaultMinutes = 0;
private final static int DefaultSeconds = 0;
private final static int DefaultMillis = 0;
private final static int DaysInMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
private final static String MonthAbbrev[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
private final static String MonthVerbose[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
private final static String DaysOfWeekAbbrev[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
private final static String DaysOfWeek[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
private final static String DayExtension[] = { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th" };
private final static String EMPTY = "";
private final static String COLON = ":";
private final static String PERIOD = ".";
private final static String HYPHEN = "-";
private final static String SPACE = " ";
private final static String ZERO = "0";
private static String s_dateSep = HYPHEN;
private int m_dd, m_mm, m_yyyy, m_hh, m_min, m_ss, m_mil;
private static long MillisInSecond = 1000;
private static long MillisInMinute = MillisInSecond * 60;
private static long MillisInHour = MillisInMinute * 60;
private static long MillisInDay = MillisInHour * 24;
* JDK_BST_FIX
* Static initialisation block - check JDK vendor/version in order to determine whether
* an adjustment to correctly report British summertime needs to be made. This is required
* in order to fix a bug in some Sun & IBM JDKs. If an untested version of the Sun or IBM JDK
* is used, we log an error message warning that this block of code should be examained and
* changed as appropriate. This is ugly, but will prevent a new JDK being used and this bug
* creeping back in.
* Note the following JDKs have been tested under both NT & AIX
* JDK Version NT AIX
* 1.1.7 (IBM) x x
* 1.1.7A (IBM) ?
* 1.1.7B (IBM) ? ?
* 1.1.8 (IBM) x x
* 1.2.2 (IBM) ok ok
* 1.1.7 (SUN) x x
* 1.1.8 (SUN) x x
* 1.2 (SUN) x x
private final static String SunVendorString = "Sun Microsystems Inc.";
private final static String IBMVendorString = "IBM"; // Can also be 'IBM Corporation'
private final static String SunProblemJDKs[] = { "1.1.4", "1.1.5", "1.1.6", "1.1.7", "1.1.7A", "1.1.7B", "1.1.8", "1.2", "1.2.2" };
private final static String SunOKJDKs[] = { "1.0.2", "1.1.2", "1.1.3", "1.4.0", "1.4.2"};
private final static String IBMProblemJDKs[] = { "1.1.4", "1.1.5", "1.1.6", "1.1.7", "1.1.7A", "1.1.8" };
private final static String IBMOKJDKs[] = { "1.0.2", "1.1.2", "1.1.3", "1.1.7B", "1.2.2", "1.3.0", "1.3.1" };
private static boolean s_adjustForBST = false;
static
String vendor = System.getProperty("java.vendor");
String jdk = System.getProperty("java.version");
// Check applies to Sun only.
if (vendor.equals(SunVendorString) || vendor.startsWith(IBMVendorString))
String problemJDKs[] = null;
String OKJDKs[] = null;
if (vendor.equals(SunVendorString))
problemJDKs = SunProblemJDKs;
OKJDKs = SunOKJDKs;
else
problemJDKs = IBMProblemJDKs;
OKJDKs = IBMOKJDKs;
// Determine whether we need to make adjustment
for (int i = 0; i < problemJDKs.length; i++)
if (problemJDKs.equals(jdk))
s_adjustForBST = true;
break;
// If we do not need to make the adjustment then check that the
// JDK reported is one of the versions that we know to be good.
// If it is not log an error message.
if (!s_adjustForBST)
boolean goodJDK = false;
for (int i = 0; i < OKJDKs.length; i++)
if (OKJDKs[i].equals(jdk))
goodJDK = true;
break;
/* CR176 - we now anticipate that all JDKs post 1.3.x are "good" ones
if (!goodJDK)
// We do not use the SingletonLogger mechanism since we
// cannot be sure that these singleton objects have been instantiated
// at this point, and in any case it is not desirable to introduce
// this dependancy into SlacDate.
System.err.println("JDK VERSION ERROR : Unsupported JDK - '" + jdk + "' provided by '" + vendor + "'. SlacDate class requires examination.");
* Construct the date with todays date.
* <p>This should be the only place where a Date object is explicitly instantiated. All
* other code should use SlacDate. If the s_adjustForBST flag is set and the date falls
* between the last sunday of March and the last Sunday of October (inclusive) then we need
* to make an adjustment of +1 hour so that British Summertime is correctly reported.
private SlacDate()
init(Calendar.getInstance());
* Construct the date with the specified day, month and year.
* @param year The year to set the date to
* @param month The month to set the date to
* @param date The date to set the date to
* @exception InvalidDateException Invalid date parameters passed in.
public SlacDate(int year, int month, int date) throws InvalidDateException
init(year, month, date, DefaultHours, DefaultMinutes, DefaultSeconds, DefaultMillis);
* Construct the date with the specified day, month, year, hour and minute.
* @param year The year to set the date to
* @param month The month to set the date to
* @param date The date to set the date to
* @param hr The hour to set the date to
* @param min The minute to set the date to
* @exception InvalidDateException Invalid date parameters passed in.
public SlacDate(int year, int month, int date, int hr, int min) throws InvalidDateException
init(year, month, date, hr, min, DefaultSeconds, DefaultMillis);
* Construct the date with the specified day, month, year, hour, minute and second.
* Will default to 0 milliseconds.
* @param year The year to set the date to
* @param month The month to set the date to
* @param date The date to set the date to
* @param hr The hour to set the date to
* @param min The minute to set the date to
* @param sec The second to set the date to
* @exception InvalidDateException Invalid date parameters passed in.
public SlacDate(int year, int month, int date, int hr, int min, int sec) throws InvalidDateException
init(year, month, date, hr, min, sec, DefaultMillis);
* Construct the date with the specified day, month, year, hour, minute, second and milliseconds.
* @param year The year to set the date to
* @param month The month to set the date to
* @param date The date to set the date to
* @param hr The hour to set the date to
* @param min The minute to set the date to
* @param sec The second to set the date to
* @param millis The milliseconds to set the date to
* @exception InvalidDateException Invalid date parameters passed in.
public SlacDate(int year, int month, int date, int hr, int min, int sec, int millis) throws InvalidDateException
init(year, month, date, hr, min, sec, millis);
* Construct the date from a timestamp.
public SlacDate(long timestamp) throws InvalidDateException
Calendar cal = Calendar.getInstance();
cal.setTime(new Date(timestamp));
init(cal);
* Construct the date from the specified string. Note that the date must
* be in day/month/year format.
* @param date The date string.
* @exception InvalidDateException The date passed in is invalid.
public SlacDate(String date) throws InvalidDateException
init(date);
* Construct the date from the specified string. The format passed in will
* identify the format of the date.
* @param date The date string.
* @param format The format of the date.
* @exception InvalidDateException The date passed in is invalid.
public SlacDate(String date, int format) throws InvalidDateException
if (format == FormatCCYYMMDD || format == FormatCCYYMMDDHHMM || format == FormatCCYYMMDDHHMMSS)
boolean valid = false;
date = date.trim();
if (date.length() >= 8)
try
int year = Integer.parseInt(date.substring(0,4));
int month = Integer.parseInt(date.substring(4,6));
int day = Integer.parseInt(date.substring(6,8));
int hour;
int min;
int sec;
if (date.length() > 8)
hour = Integer.parseInt(date.substring(8,10));
min = Integer.parseInt(date.substring(10,12));
if (date.length() >= 14)
sec = Integer.parseInt(date.substring(12,14));
else
sec = DefaultSeconds;
else
hour = DefaultHours;
min = DefaultMinutes;
sec = DefaultSeconds;
init(year, month, day, hour, min, sec, DefaultMillis);
valid = true;
catch (Exception e)
if (!valid)
throw new InvalidDateException("Invalid date: " + date + " for the specified format");
else if (format == FormatDB2TIMESTAMP || format == FormatUDBTIMESTAMP)
// 2002-02-04 10:49:30.999000 (UDB)
// 2002-02-04-10.49.30.999000 (DB2)
int year = Integer.parseInt(date.substring(0,4));
int month = Integer.parseInt(date.substring(5,7));
int day = Integer.parseInt(date.substring(8,10));
int hour = Integer.parseInt(date.substring(11,13));
int min = Integer.parseInt(date.substring(14,16));
int sec = Integer.parseInt(date.substring(17,19));
int millis = Integer.parseInt(date.substring(20,23));
init(year, month, day, hour, min, sec, millis);
else
init(date);
* Construct the date with the java.util.Date passed in.
public SlacDate(Date date)
init(date);
* Init the date with the java.util.Date passed in.
private void init(Date date)
Calendar cal = Calendar.getInstance();
cal.setTime(date);
init(cal);
* Return whether this date is after the date passed in.
* @d2 The date to compare against.
* @return Whether this date is after the date passed in.
public boolean after(SlacDate d2)
int xx = d2.getYear();
if (m_yyyy > xx)
return true;
else if (m_yyyy < xx)
return false;
else
xx = d2.getMonth();
if (m_mm > xx)
return true;
else if (m_mm < xx)
return false;
else
xx = d2.getDate();
if (m_dd > xx)
return true;
else if (m_dd < xx)
return false;
else
xx = d2.getHour();
if (m_hh > xx)
return true;
else if (m_hh < xx)
return false;
else
xx = d2.getMinute();
if (m_min > xx)
return true;
else if (m_min < xx)
return false;
else
xx = d2.getSecond();
if (m_ss > xx)
return true;
else if (m_ss < xx)
return false;
else
return (m_mil > d2.getMillisecond());
private void appendHoursMinutes(StringBuffer str, String separator)
if (m_hh < 10)
str.append(ZERO);
str.append(Integer.toString(m_hh));
if (!separator.equals(EMPTY))
str.append(separator);
if (m_min < 10)
str.append(ZERO);
str.append(Integer.toString(m_min));
private void appendTime(StringBuffer str, String separator, boolean addMillis)
appendHoursMinutes(str, separator);
if (!separator.equals(EMPTY))
str.append(separator);
if (m_ss < 10)
str.append(ZERO);
str.append(Integer.toString(m_ss));
if (addMillis)
if (!separator.equals(EMPTY))
str.append(separator);
if (m_mil < 100)
str.append(ZERO);
if (m_mil < 10)
str.append(ZERO);
str.append(m_mil);
* Version of the asString() method which defaults to FormatDDMMCCYY.
* <p>An example date in this format is:
* <pre>
* 25-02-1999
* </pre>
* @return The Date as a string in DDMMCCYY format.
public String asString()
return asString(FormatDDMMCCYY);
* Convert the date to a String. This will format the Date as defined by the format
* passed in. The default parameter is FormatDDMMCCYY.
* The valid formats are:
* <ul>
* <li>FormatDDMMCCYY</li>
* <li>FormatMMDDCCYY</li>
* <li>FormatDATETIME</li>
* <li>FormatDDMMTIME</li>
* <li>FormatTIMESTAMP</li>
* <li>FormatCCYYMMDD</li>
* <li>FormatCCYYMMDDHHMM</li>
* <li>FormatCCYYMMDDHHMMSS</li>
* <li>FormatDDMMCCYYTIME</li>
* <li>FormatDATEVERBOSE</li>
* <li>FormatDATETIMEVERBOSE</li>
* <li>FormatHHMMSS</li>
* <li>FormatHHMMSSMIL</li>
* <li>FormatDB2TIMESTAMP</li>
* <li>FormatUDBTIMESTAMP</li>
* </ul>
* @param format The format to return the string in.
* @return The date in string format (as specified by the format parameter).
public String asString(int format)
StringBuffer str = new StringBuffer(20);
if (format == FormatDB2TIMESTAMP || format == FormatUDBTIMESTAMP)
str.append(Integer.toString(getYear()));
str.append(HYPHEN);
int month = getMonth();
if (month < 10)
str.append(ZERO);
str.append(Integer.toString(month));
str.append(HYPHEN);
int day = getDate();
if (day < 10)
str.append(ZERO);
str.append(Integer.toString(day));
String dateTimeSeparator = new String();
if (format == FormatDB2TIMESTAMP)
dateTimeSeparator = HYPHEN;
else if (format == FormatUDBTIMESTAMP)
dateTimeSeparator = SPACE;
str.append(dateTimeSeparator);
String timeSeparator = new String();
if (format == FormatDB2TIMESTAMP)
timeSeparator = PERIOD;
else if (format == FormatUDBTIMESTAMP)
timeSeparator = COLON;
appendTime(str, timeSeparator, true);
str.append("000");
else if (format == FormatDATETIME || format == FormatMMMDDTIME || format == FormatTIMESTAMP)
str.append(getMonthNameAbbrev());
str.append(SPACE);
if (m_dd < 10)
str.append(ZERO);
str.append(Integer.toString(m_dd));
str.append(SPACE);
appendTime(str, COLON, false);
if (format == FormatDATETIME)
str.append(SPACE);
str.append(Integer.toString(m_yyyy));
else if (format == FormatTIMESTAMP)
str.append(COLON);
str.append(formattedMillis(m_mil));
else if (format == FormatHHMMSS)
appendTime(str, COLON, false);
else if (format == FormatHHMMSSMIL)
appendTime(str, COLON, true);
else if (format == FormatCCYYMMDD || format == FormatCCYYMMDDHHMM || format == FormatCCYYMMDDHHMMSS)
str.append(Integer.toString(m_yyyy));
if (m_mm < 10)
str.append(ZERO);
str.append(Integer.toString(m_mm));
if (m_dd < 10)
str.append(ZERO);
str.append(Integer.toString(m_dd));
if (format == FormatCCYYMMDDHHMMSS)
appendTime(str, EMPTY, false);
else if (format == FormatCCYYMMDDHHMM)
appendHoursMinutes(str, EMPTY);
else if (format == FormatDATEVERBOSE || format == FormatDATETIMEVERBOSE)
str.append(Integer.toString(m_dd));
if (m_dd > 10 && m_dd < 14)
str.append(DayExtension[0]);
else
str.append(DayExtension[m_dd%10]);
str.append(SPACE);
str.append(getMonthName());
str.append(SPACE);
str.append(Integer.toString(m_yyyy));
if (format == FormatDATETIMEVERBOSE)
str.append(",");
str.append(SPACE);
appendTime(str, COLON, false);
else
// DDMMCCYY, MMDDCCYY, DDMMCCYYTIME
int first;
int second;
if (format != FormatMMDDCCYY)
first = getDate();
second = getMonth();
else
second = getDate();
first = getMonth();
if (first < 10)
str.append(ZERO);
str.append(Integer.toString(first));
str.append(s_dateSep);
if (second < 10)
str.append(ZERO);
str.append(Integer.toString(second));
str.append(s_dateSep);
str.append(Integer.toString(getYear()));
if (format == FormatDDMMCCYYTIME)
str.append(SPACE);
appendTime(str, COLON, false);
return str.toString();
* Return whether this date is before the date passed in
* @d2 The date to compare against.
* @return Whether this date is before the date passed in.
public boolean before(SlacDate d2)
return (!after(d2) && !equals(d2));
* Clone the current date.
* @return The cloned SlacDate object
public Object clone()
SlacDate d = new SlacDate();
d.m_dd = m_dd;
d.m_mm = m_mm;
d.m_yyyy = m_yyyy;
d.m_hh = m_hh;
d.m_min = m_min;
d.m_ss = m_ss;
d.m_mil = m_mil;
return d;
* Compare this date with the supplied date.
* Hours, minutes, seconds and milliseconds are taken into consideration.
* Returns:
* -1 this date is before the supplied date.
* 0 this date is equal to the supplied date.
* 1 this date is after the supplied date.
public int compareTo(Object o2)
SlacDate d2 = (SlacDate)o2;
if (equals(d2))
return 0;
if (after(d2))
return 1;
return -1;
* Compare this date with the supplied date.
* Hours, minutes, seconds and milliseconds are NOT taken into consideration.
* Returns:
* -1 this date is before the supplied date.
* 0 this date is equal to the supplied date.
* 1 this date is after the supplied date.
public int compareDate(Object o2)
SlacDate baseDate = (SlacDate)o2;
SlacDate startBaseDate = new SlacDate(baseDate.getCalendar().getTime());
startBaseDate.setHour(0);
startBaseDate.setMinute(0);
startBaseDate.setSecond(0);
startBaseDate.setMillisecond(0);
SlacDate endBaseDate = new SlacDate(baseDate.getCalendar().getTime());
endBaseDate.setHour(23);
endBaseDate.setMinute(59);
endBaseDate.setSecond(59);
endBaseDate.setMillisecond(999);
int compare = 0;
if (before(startBaseDate))
compare = -1;
else if (after(endBaseDate))
compare = 1;
return compare;
* Compare this date with today's date.
* Hours, minutes, seconds and milliseconds are NOT taken into consideration.
* Returns:
* -1 this date is before today.
* 0 this date is equal to today.
* 1 this date is after today.
public int compareToToday()
return compareDate(today());
* Calculate the difference (in days) between the two dates.
* Note the difference may be negative.
* @param from The <i>start</i> date
* @param to The <i>to</i> date
* @return The difference between the dates in days.
public static int daysBetween(SlacDate from, SlacDate to)
int dayFrom;
int monthFrom;
int yrFrom;
int dayTo;
int monthTo;
int yrTo;
int mult = 1;
if (from.after(to))
mult=-1;
dayFrom = to.getDate();
monthFrom = to.getMonth();
yrFrom = to.getYear();
dayTo = from.getDate();
monthTo = from.getMonth();
yrTo = from.getYear();
else
dayFrom = from.getDate();
monthFrom = from.getMonth();
yrFrom = from.getYear();
dayTo = to.getDate();
monthTo = to.getMonth();
yrTo = to.getYear();
int cnt=0;
try
if (yrFrom != yrTo)
// Different Years.
for (int i=yrFrom+1; i<yrTo; i++)
cnt += SlacDate.daysInYear(i);
for (int i=monthFrom+1; i<13; i++)
cnt+=daysInMonth(i, yrFrom);
for (int i=1; i<monthTo; i++)
cnt+=daysInMonth(i, yrTo);
cnt += (daysInMonth(monthFrom, yrFrom)-dayFrom);
cnt += dayTo;
else
if (monthFrom != monthTo)
// Same Year but different months.
for (int i=monthFrom+1; i<monthTo; i++)
cnt+=daysInMonth(i, yrFrom);
cnt += (daysInMonth(monthFrom, yrFrom)-dayFrom);
cnt += dayTo;
else
// Same Year and month.
cnt += (dayTo-dayFrom);
catch (InvalidDateException ide)
// This should never happen
return cnt * mult;
* Calculate the number of days from the specified date.
* Note the difference may be negative.
* @param date The date to calculate from
* @return The diference between the two dates in days (may be negative).
public int daysFrom(SlacDate date)
return daysBetween(date, this);
* Calculates the number of days in a given month in a given year
* copes with century dates!
* @param month The month to determine the day count
* @param year The year the month is in (only relevant for February).
* @exception InvalidDateException Invalid parameters passed in. Ie the month was >= 12
* or the month was < 0.
public static int daysInMonth(int month, int year) throws InvalidDateException
if (month > 12 || month <= 0)
throw new InvalidDateException("Invalid month specified to SlacDate.daysInMonth(): " + month);
// month-1, because DaysInMonth array is 0-based.
return (month == FEBRUARY && isLeapYear(year)) ? 29 : DaysInMonth[month-1];
* Calculates the number of days in a given year.
* @param year The year the month is in (only relevant for February).
public static int daysInYear(int year)
return (isLeapYear(year)) ? 365 : 364;
* Calculate the number of days to the specified date.
* Note the difference may be negative.
* @param date The date to calculate to
* @return The diference between the two dates in days (may be negative).
public int daysTo(SlacDate date)
return daysBetween(this, date);
* Decrement the date by the specified number of years, months and days.
* @param years The number of years to increment by
* @param months The number of months to increment by
* @param days The number of days to increment by
public void decrement(int years, int months, int days)
decrementYears(years);
decrementMonths(months);
decrementDays(days);
* Decrement the date by the specified number of days.
* @param days The number of days to decrement by
public void decrementDays(int days)
incrementDays(days * -1);
* Decrement the date by the specified number of hours.
* @param hours The number of hours to decrement by
public void decrementHours(int hours)
incrementHours(hours * -1);
* Decrement the date by the specified number of milliseconds.
* @param seconds The number of seconds to decrement by
public void decrementMilliseconds(int milliseconds)
incrementMilliseconds(milliseconds * -1);
* Decrement the date by the specified number of minutes.
* @param minutes The number of minutes to decrement by
public void decrementMinutes(int minutes)
incrementMinutes(minutes * -1);
* Decrement the date by the specified number of months.
* @param years The number of months to decrement by
public void decrementMonths(int months)
incrementMonths(months * -1);
* Decrement the date by the specified number of seconds.
* @param seconds The number of seconds to decrement by
public void decrementSeconds(int seconds)
incrementSeconds(seconds * -1);
* Decrement the date by the specified number of years.
* @param years The number of years to decrement by
public void decrementYears(int years)
incrementYears(years * -1);
* Calculate the difference between two dates to the nearest second as a String.
* @param from The start date
* @param to The end date
public static String differenceBetween(SlacDate from, SlacDate to)
SlacDate f, t;
if (from.after(to))
t = from;
f = to;
else
t = to;
f = from;
int secs = 0;
int mins = 0;
int hours = 0;
int days = 0;
int months = 0;
int years = 0;
secs = t.getSecond() - f.getSecond();
mins = t.getMinute() - f.getMinute();
hours = t.getHour() - f.getHour();
days = t.getDate() - f.getDate();
months = t.getMonth() - f.getMonth();
years = t.getYear() - f.getYear();
if (secs < 0)
secs += 60;
mins--;
if (mins < 0)
mins += 60;
hours--;
if (hours < 0)
hours += 24;
days--;
if (days < 0)
try
days += daysInMonth(f.getMonth(), f.getYear());
catch (InvalidDateException ide)
days += 30;
months--;
if (months < 0)
months += 12;
years--;
StringBuffer sb = new StringBuffer();
sb.append(years).append(s_dateSep);
sb.append(months).append(s_dateSep);
sb.append(days).append(SPACE);
sb.append(hours).append(COLON);
sb.append(mins).append(COLON);
sb.append(secs);
return sb.toString();
* Calculate the difference between the date passed in and this date.
* Note that if the date passed in is in the future the difference will be
* negative.
* @param from The date from which to return the difference
* @return The difference from the date passed in in String format
public String differenceFrom(SlacDate from)
return differenceBetween(from, this);
* Calculate the difference between this date and the one passed in.
* Note that if the date passed in is in the past the difference will be
* negative.
* @param to The date to which to return the difference
* @return The difference to the date passed in in String format
public String differenceTo(SlacDate to)
return differenceBetween(this, to);
* Return whether the two dates are the same. This will check right down to the second.
* @param d2 The date to compare against
* @return Whether the dates are the same.
public boolean equals(SlacDate d2)
return ((m_yyyy == d2.m_yyyy) &&
(m_mm == d2.m_mm) &&
(m_dd == d2.m_dd) &&
(m_hh == d2.m_hh) &&
(m_min == d2.m_min) &&
(m_ss == d2.m_ss) &&
(m_mil == d2.m_mil));
public String format(DateFormat df)
Calendar cal = getCalendar();
return df.format(cal.getTime());
private final String formattedMillis(int millis)
String rString = null;
if (millis < 10)
rString = "00" + millis;
else if (millis < 100)
rString = ZERO + millis;
else
rString = EMPTY + millis;
return rString;
public Calendar getCalendar()
Calendar cal = Calendar.getInstance();
cal.set(m_yyyy, m_mm-1, m_dd, m_hh, m_min, m_ss);
cal.set(Calendar.MILLISECOND, m_mil);
return cal;
* Return the Date/Time in CCYYMMDD format.
* <p>An example date in this format is:
* <pre>
* 19990225
* </pre>
* @return The Date as a string in CCYYMMDD format.
public String getCCYYMMDD()
return asString(FormatCCYYMMDD);
* Return the Date/Time in CCYYMMDDHHMM format.
* <p>An example date in this format is:
* <pre>
* 199902251423
* </pre>
* @return The Date as a string in CCYYMMDDHHMM format.
public String getCCYYMMDDHHMM()
return asString(FormatCCYYMMDDHHMM);
* Return the Date/Time in CCYYMMDDHHMMSS format.
* <p>An example date in this format is:
* <pre>
* 19990225142356
* </pre>
* @return The Date as a string in CCYYMMDDHHMMSS format.
public String getCCYYMMDDHHMMSS()
return asString(FormatCCYYMMDDHHMMSS);
public int getDate() { return m_dd; }
* Return the date in DATETIME format.
* <p>An example date in this format is:
* <pre>
* Feb 25 14:21:09 1999
* </pre>
* @return The Date as a string in DATETIME format.
public String getDATETIME()
return asString(FormatDATETIME);
* Return the Date/Time in DATETIMEVERBOSE format.
* <p>An example date in this format is:
* <pre>
* 25th February 1999, 14:21:09
* </pre>
* @return The Date as a string in DATETIMEVERBOSE format.
public String getDATETIMEVERBOSE()
return asString(FormatDATETIMEVERBOSE);
* Return the Date/Time in DATEVERBOSE format.
* <p>An example date in this format is:
* <pre>
* 25th February 1999
* </pre>
* @return The Date as a string in DATEVERBOSE format.
public String getDATEVERBOSE()
return asString(FormatDATEVERBOSE);
* Return the day o -
How I can validate date of birth?
Month-Date-Year
Example: 11-21-1960
ThanksYou could use a regular expression:
E.g.
var dateRegExp = "^(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])-(19|20)\d\d$"; // mm-dd-yyyy
if (oField.rawValue.search(dateRegExp) === -1) {
// error!
Or you could use a date object as suggested in the previous post, but also stop the user from typing in a date so they will be forced to use the date selection box. This would ensure that the date is always in the correct format. To stop the user from typing in data, put the following code in the change event for the field:
if (xfa.event.change.length == 1) {
xfa.event.change = ""; -
Validate Date and block JavaScript page change
how I can validate date acrobat, can block JavaScript page change, only change with a button?
If you use the "util.scand" method date validation is part of the process. It either returns the number of milliseconds from the Epoch date used by JavaScript for the date time object the null value.
Date Arithmetic has some sample scripts, but you need to keep in mind that Date and Time are not independent and using "new Date()" returns the date and time at the time that line of code is executed and that can cause issues for the computing of dates only.
Are you sure of day count, most differences include the start and end dates in the number of days for the calculation.
Custom calculation for today's date field (format is None):
// get today's date an time
var oToday = new Date();
// set to start of day
oToday.setFullYear(oToday.getFullYear(), oToday.getMonth(), oToday.getDate(), 0, 0, 0, 0)
// set field value
event.value = util.printd("d/mm/yyyy", oToday);
Custom calculation for the difference in days field (format None):
var cEnteredDate = this.getField("EnteredDate").value;
var cToday = this.getField("Today").value;
event.value = "";
if(cEnteredDate != "" && cToday != "") {
// process only if date values not empty
// convert date strings to date time objectat midnight
var oEnteredDate = util.scand("d/mm/yyyy", cEnteredDate );
if (oEnteredDate == null) {
app.alert("Error in processing entered date", 2, 0);
oEnteredDate.setFullYear(oEnteredDate.getFullYear(), oEnteredDate.getMonth(),oEnteredDate.getDate(), 0, 0, 0, 0)
var oToday = util.scand("d/mm/yyyy", cToday);
if(oToday == null) {
app.alert("Error converting today", 2,0);
oToday.setFullYear(oToday.getFullYear(), oToday.getMonth(),oToday.getDate(), 0, 0, 0, 0)
// convert date objects to days
var nEnteredDate = Math.floor(oEnteredDate.getTime() / (1000 * 60 * 60 * 24));
var nToday = Math.floor(oToday.getTime() / (1000 * 60 * 60 * 24));
// compute & format the difference
event.value = util.printf("%,0 1.0f", (nToday - nEnteredDate)); -
Export with data length semantics
Hello,
I've following problem.
I have a table abcd which contains 2 VARCHAR2 columns with different data length semantics (one with BYTE, one with CHAR). Charset is Single Byte; let's say WE8MSWIN1252, so data length semantics should not be a problem. should not. details later.
So this would be:
create table abcd (a_char VARCHAR2(2 CHAR), a_byte VARCHAR2(2 BYTE));after that I export the table via exp. I'm not setting NLS_LENGTH_SEMANTICS environment variable, so BYTE is used.
In the dump file the data length semantics for the byte col is omitted, as I exported it with BYTE:
create table abcd (a_char VARCHAR2(2 CHAR), a_byte VARCHAR2(2));after that, I "accidently" import it with data length semantics set to CHAR, and the table looks like this now
abcd
a_char VARCHAR2(2 CHAR)
a_byte VARCHAR2(2 CHAR)Same happens vice versa when using CHAR for export and BYTE for import...
In single byte charsets this might not be so much of a problem, as one CHAR is equal to one BYTE, but...
If I compile plsql against the original table, and run against the outcoming table after export, I get an ORA-4062, and I have to recompile...
Would not be a problem if the plsql I compile would be on the database...Big problem is that the ORA-4062 occurs in forms, where it's difficult for me to recompile (I would have to transfer all the sources to customer and compile there).
Is there any possibility to export data length semantics regardless which environment variable is set?
database version would be 9.2.0.6; but if there exists a solution in higher versions I would also be happy to hear them...
many thanks,
regardsI can't reproduce your problem:
SQL> show parameter nls_length_semantics
NAME TYPE VALUE
nls_length_semantics string BYTE
SQL> create table scott.demo( col1 varchar2(10 byte), col2 varchar2(10 char) );
SQL> describe scott.demo
Name Null? Type
COL1 VARCHAR2(10)
COL2 VARCHAR2(10 CHAR)
$ export NLS_LENGTH_SEMANTICS=BYTE
$ exp scott/tiger file=scott.dmp tables=demo
SQL> drop table scott.demo;
$ export NLS_LENGTH_SEMANTICS=CHAR
$ imp scott/tiger file=scott.dmp
SQL> describe scott.demo
Name Null? Type
COL1 VARCHAR2(10 BYTE)
COL2 VARCHAR2(10)
SQL> alter session set nls_length_semantics=byte;
SQL> describe scott.demo
Name Null? Type
COL1 VARCHAR2(10)
COL2 VARCHAR2(10 CHAR)Can you post a test like mine?
Enrique
PS If you have access to Metalink, read Note:144808.1 Examples and limits of BYTE and CHAR semantics usage. From 9i and up, imp doesn't read nls_length_semantics from the environment.
Edited by: Enrique Orbegozo on Dec 16, 2008 12:50 PM
Edited by: Enrique Orbegozo on Dec 16, 2008 12:53 PM -
Which is the best approach to upload customer master data?
Hi Everyone,
I have to load customer master data which is extracted from ecc by using generic data source(view) when i try to trigger DTP it is showing error message as duplicates because the customer has two sales area ,two person number and two consumernumber and four partner functions.
So i tried to make all these as compounding attributes but the length is exeeding 60 for these attributes so how can i implement this.can i implement hierarchy's?
Please give me any suggestions.
Thanks and Regards,
G.KavyasreeHi Yogesh,
The issue is not resolved yet.If the length is manageable in compounding attributes.please suggest me the solution.
yes ,by enhancing two data sources 0customer_attr and 0customer_sales_attr i can meet my client requirement .but i dont know how to join these datasources based on customer number in bi (i.e customer genral data from 0customer_attr datasource and sales area data from 0customer_sales_attr datasource ) and generate a report on these two datasources data.
my report should look like this .
customer_id firstname city country sales_org distribution_channel division telephone
100 mary newyork us 1010 10 10 +1xxxx456
100 mary newyork us 1010 20 10 +1xxxx457
100 mary newyork us 1010 20 20 +1xxxx433
101 richard texas us 1010 10 10 +1xxxx351
Please provide your valuable suggestions.
Thanks,
Kavya -
we want to validate data in web form in planning through Java Script Code ?
how we can do it and what is the location of that Java Script file ?
One more thing ... if we make any changes in Java Script code then is it necessary to stop and start planning server or application ?
Thanks in Advance ..... :-)Hi,
you can resolve this problem, adding a JavaScript code in validateData.js.
For example you can change and/or insert the code in validateForm function, that save the data only if the function return true.
There are also another function and the code example in SampleValidateData.js that you can see.
You find the ValidateData.js in the folder "custom" of your installation.
For example:
/default web application directory/deployments/your web server/HyperionPlanning/webapps/HyperionPlanning/custom
I report an example for control the data before saving it:
function validateForm(){
if (equalsIgnoreCase(applicationName,"BDG"))
if (equalsIgnoreCase(formName,"1.10A ECO"))
var rowPrecVers = currentDataGrid.endRow;
var colPrecVers = 2;
var rowActVers = 3;
var colActVers = 3;
var valTotPrecVers = 0;
var valTotActVers = 0;
valTotPrecVers = currentDataGrid.fullPrecision[rowPrecVers][colPrecVers];
for(rowActVers; rowActVers < currentDataGrid.endRow; rowActVers++){
valTotActVers = valTotActVers + parseFloat(currentDataGrid.fullPrecision[rowActVers][colActVers]);
if(valTotPrecVers < valTotActVers){
alert("Ops!!!Don't match" + "\n"
+ "Previous Version: " + valTotPrecVers + "\n"
+ "Actual Version: " + valTotActVers);
valid = false;
return valid;
else{
return valid;
Insert and modify this code in validateForm function.
If in your installation use Tomcat web server, you must save the change on the ValidateData.js file each time. If you use the WebLogic web server tou must restart the service. For other web server I don't know.
Take it easy and have fun!!!
Flavio -
How to get the salesprice and condition for a customer / material / date
Hi all,
how can I get the correct price and condition for a customer / material / date ?
I know this is possible using the BAPI_SALESORDER_SIMULATE, but this bapi is using to much ressources on the system.
I'm trying to get the correct price and condition WITHOUT using that BAPI.
Does anyone know how it is possible ? As said before : I have the customer, material and a date.
thanks in advance for your helpHi
You need it because it's possible to have a complex pricing procedure, and you can't do it with a simple select on a table. Think that you can have pricing requirements, formulas (ie: VOFM) and so on in your pricing procedure (tcode V/08).
I hope this helps you
Regards
Eduardo -
Demo - Extraction of Customer Master Data from SAP R/3 ECC6 to MDM5.5
Hello,
I am new to MDM . Would appreciate if someone can give a solution to the below request.
We are doing a demo project in our Company to extract all the master data related to SALES cycle. We are doing an extraction of Customer Master Data. Currently we have the unlicensed version of MDM and very soon we will get the licensed version.
We have the Customer Master Repository created in MDM Console. The IDOC type we are using is DEBMDM05.
Is there a easy way to map the fields of IDOC to the MDM Repository. Right now we are doing a manual process of comparing the IDOC fields and MDM Repo in an excel but this is tedious and time consuming.
Can anyone suggest an easier way to identify so that we know which fields match correctly.
Thanks
LeenaHi Leena,
First of all you have 2 options to generate IDOCs from SAP R/3 system
1.mdmgx>one IDoc per record
2.mdm_clnt_extr>for generating single IDoc having entire set of records.
Secondly,if you want to get the data mapped automatically,you should use standard maps provided by SAP(Business Content).
If at all you have created new fields then you should manually map those fields.
If any other queries pl ask
Reward points if found useful
Regards,
Pramod.
Maybe you are looking for
-
Itunes on my pc will not open or do anything.
I have been trying to open Itunes on my desktop pc for days and nothing happens, everytime I click on it nothing happens, nothing comes up, no error messages or anything, tried to open in safemode and nothing happened. My computer and all my other pr
-
Hi, When iam installing TDS Addon 1.36 it's showing error message like Add-in TDS: Add on installation failed because another version is already installed. please ensure that the version number is higher than the version prasently installed. I checke
-
Hi everyone I am missing the old feature in LC designer 7.1 to mark an active field as not being part of the taborder. Have anyone found a way to set this up in LC designer 8.2 We have many forms with open fields that we fill out automatic when the u
-
Patch 6313706-installed lang patch
Hi, I am applying patch 6313706 on linux. And i have AR as installed language on my EBS. But i cant find the translation patch for 6313706. I can see all other lang patches but not for ARABIC lang. Do i need to skip this tanslation patch??? Regards T
-
Weird stereo phasing effect on audio output
Not really sure where to post this, so this board will have to do. This just started recently out of the blue. It's especially noticeable on headphones: the stereo signal seems to very rapidly shift phase between the left and right speakers. I'm gett