VerifyUDCValue

Validate Segment Value

Minor Business Rule

Object Name: N3201210

Parent DLL: CMFG

Location: Client/Server

Language: NER

1.Functional Description

1.1Purpose
The Business Function will validate a UDC value entered by the user. 



1.2Setup Notes and Prerequisites
This BSFN should be called if the Selection Value is not blank and Required field is not 'C' 

(Calculated)

If the value is being checked for Range the CNUM(Y/N) must be passed in.


1.3Special Logic

None

2.Technical Specifications

2.4Internal Function Load()

Processing


1.)If BF Selection Value is not equal to Blank


1.1) If BFSystem Code in not equal to Blank AND If BF UsCd is not equal to Blank. 

 F0004 Get User Define Code Type

     BF System Code  -> szSystem Code

      BF User Defined Codes->szRecordType

    '1' ->cCall Type

'1' ->cSuppressErrorMessage

    VA mnCodeLength <-mnUDCCodeLength

  BF CodeNum <-cCodeNumeric

'1' ->mnIndex

'1' ->mnKeys


1.2) VA mnSegmentLength =length([BF Selection Value])


1.3) If VA mnCodeLength is Lower than VA mnLowerLimit and BF SuppressErrorMsg not equal to 1
ErrorCode=1
VA szErrorMsgId = 1290


Else

// Left-pad zero for numeric value to  match UDC

If VAmnCodeLength is greater than VA mnLowerLimit and  VA CodeNum (Y/N) is equal to "Y"
BF SelectionValue = lpad([ BF SelectionValue], '0' , [Va mnCodeLenth])

Endif


1.4)Validate UDC Value

BF System Code   ->szSystemCode

BF UserDefined Codes->szUserDefinedCodes

BF SelectionValue ->szUserDefinedCodeValue

cErrorCode <-cReturnCode

1.5) If VA cErrorCode is equal to Zero

VA cErrorCode='1'

VA szError MsgID=1290

Endif

  Endif

Endif




2.) If BF Lower Limit of Value is not equal to Blank AND BF Upper Limit of Value is not equal to 

Blank


2.1) If VA Code Num(Y/N) is not equal to 'Y' 

2.1.1) If BF Selection Value is less than BF LowerLimit of Value or BF Selection Value 
Greater than BF Upper Limit


cErrorCode =1

 VA ErrorMsgID = 3728

Endif

Else


 2.1.2) String, Convert String To Numeric

BF Selection Value->szGenericString

VA mnSegmentValue ->mnNumericValue

VA IsStringNumeric<-cErrorCode


2.1.3) If VA IsStringNumeric is equal to '1'

String, Convert String to Numeric

BF Lower Limit of Value ->szGenericString

VA mnLowerLimit ->mnNumericValue

VA IsStringNumeric <-cErrorCode


2.1.4) If VA IsStringNumeric is equal to '1'

String, Convert String to Numeric

BF Upper Limit of Value ->szGenericString

VA mnUpper Limit ->mnNumericValue

VA IsStringNumeric<-cErrorCode


    EndIf

    EndIf


2.2 ) If VA cIsStringNumeric is not equal to '1' or Va mnSegmentValue is less than VA 
mnLower limit or VA mn SegmentValue is Greater than VA mn UpperLimit


VA cErrorCode =1

VA szErrorMsgId=3728

EndIf


Endif

  Endif


Endif


Data Structure

D3201210 - Validate Segment Value

Parameter NameData ItemData TypeReq/OptI/O/Both
szSystemCodeSYcharOPTNONE

A user defined code (98/SY) that identifies a system. Valid values include: 01 Address Book 03B Accounts Receivable 04 Accounts 
Payable 09 General Accounting 11 Multicurrency

szUserDefinedCodesRTcharOPTNONE

A code that identifies the table that contains user defined codes. The table is also referred to as a UDC type.

szLowerAllowedValueLVALcharOPTNONE

The lower allowed value of this specific segment.  If you enter a value here,then you must also enter an upper allowed value.

szAllowedValueUpperUVALcharOPTNONE

The upper allowed value of this specific segment.  If you enter a value here,then you must also enter an lower allowed value.

cNumericYNCNUMcharOPTNONE

Determines whether a user defined code is numeric or alphanumeric. Valid values are:    Y Indicates that the code is numeric and should be 
right-justified.    N Indicates that the code is alphanumeric and should be left-justified.

cErrorCodeERRCcharOPTNONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

szErrorMsgIdDTAIcharOPTNONE

A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

cRequiredToBeATRQcharOPTNONE

A code that specifies whether a segment is required or optional in a configuration, or whether the system must calculate it to specification 
when you enter an order. Valid codes are: R Segment answer is required during order entry. O Segment answer is optional during order 
entry. C Segment is calculated during order entry. You define the calculation with assembly inclusion rules.

szSegmentValueSGVLcharOPTNONE

An answer to the configurator feature and option questions that appear during order entry. When you define cross-segment editing rules, 
you compare the segment answers to values to determine invalid configurations. When you define assembly inclusion rules, you create unique 
configurations by comparing the segment answers to values to assign parts, prices, calculated values, or routing steps.

Related Functions

None

Related Tables

None