Ifs front-end document check statement

Source: Internet
Author: User

Source code file: splitreservedlot. APL
Related window: frmsplitreservedlot2

Problem description: When batch number is split, any batch number can be split, which may result in incorrect batch number information.
Example: The number (1900-1) has 5 processes (10/20 ../50). The number is 20.
If the number 1900-1 is not 20, splitting the number at 20 will lead to incorrect information;

PS: currently, 2k4/SP4 versions are not able to be split in the process. This is what we customized later.
That is, add a new field in the reserved_lot_batch_tab table:
Parent_operation_no indicates the data that the sub-batch number is split from a process of the parent batch number.
Later I will talk about the WIP part. Basically, the IFS's WIP data managed by batch number is not accurate;

Solution:
When the split batch number is applied, check whether the WIP of this batch number in this process is sufficient?
Next, assume that the data before splitting
Operation_no lot_no output WIP
10 1900-1 20 0 => indicates that 10th of processes have been completed
20 1900-1 15 5 => indicates that the number of WIP in the 20th process is 5
30 1900-1 0 15 => indicates that the number of WIP in the 30th process is 15
The batch number cannot be split in this 10-step process,
Up to five processes can be split in 20 processes;
Up to 15 processes can be split in 30 processes;

Specific implementation:
1) Write A checkqty function: Check whether the number of WIP is sufficient and does not pass ncheck = 1; otherwise, ncheck = 0;
Function: checkqty
Description:
Returns
Parameters
Static variables
Local Variables
Number: nrowi
Number: nrowj
Number: nsum
Number: nopnoi
Number: nopnoj
Number: nwip
Actions
Set nsum = 0
Set nrowi = tbl_minrow
-- Two-layer loop. The outer loop is used here.
While saltblfindnextrow (hwndtbl, nrowi, 0, row_markdeleted)
Call saltblsetcontext (hwndtbl, nrowi)
Set nsum = 0
Set nopnoi = hwndtbl. colnparentoperationno
Set nwip = hwndtbl. colnwipqty
Set nrowj = tbl_minrow
-- Inner Loop
While saltblfindnextrow (hwndtbl, nrowj, 0, row_markdeleted)
Call saltblsetcontext (hwndtbl, nrowj)
Set nopnoj = hwndtbl. colnparentoperationno
-- Count the number of splits with the same operation_no
If nopnoi = nopnoj
Set nsum = nsum + hwndtbl. colnreservedqty
-- If the number of shards exceeds the WIP value, 1 is returned.
If nsum> nwip
Set ncheck = 1
Return true
Set ncheck = 0
Return false
2) Modify pm_datasourcesave
On pm_datasourcesave
If wparam = method_execute
If dfnqtysplit> norigreservedqty
Call alertbox (translateconstant (text_splitreslot_qtysplit), caption_error, info_ OK)
Return false
-- Add the call here
Call checkqty ()
-- Check failed. error dialog box
If ncheck = 1
Call alertbox (translateconstant (text_splitreslot_qtywip), caption_error, info_ OK)
Return false
... The following is omitted

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.