QCOrder

QCOrder

 

Property

Description

Table

BEAS_QSFTHAUPT

Primary key

DocEntry/i

$transaction

no

$branch

no

$mask

no

 

Fields

Name

Type

Description

DocEntry

Edm.Int32

Entity Relation: QCOrderSamples -> DocEntry

Entity Relation: QCOrderMeasurement -> DocEntry

Entity Relation: QCOrderAttachment -> DocEntry

Database: "BEAS_QSFTHAUPT"."DocEntry"

DocOrder

Edm.String(20)

Id of the QC order document

First letter present the document type

Goods receipt PO (I) Purchase goods receipt

Production (E) Assembly posting in production

Sales-Return (R) Sales credit or offset

Reaching Date of Expiry (C) Set at "batches to be verified"

Stock transfer (T) for stock transfer

Goods Receipt (M) for all manual postings

AP Invoice (X) purchase invoices

Negative Purchase returns (Y) for returns from purchase with negative amounts

Credit Memos (O) credit memos

Negative Delivery (P) deliveries with negative amounts

Negative Invoices (Q) invoices with negative amounts

Split batch (A) At batch split

Transfer batch (B) At a batch transfer

 

At the end, the number of the origin document is displayed (goods receipt, work order document etc.)

Primary key

Database: "BEAS_QSFTHAUPT"."CHARGE_ID"

DocOrder2

Edm.Int32

Primary key

Database: "BEAS_QSFTHAUPT"."BELNR_ID"

DocDate

Edm.DateTimeOffset

Database: "BEAS_QSFTHAUPT"."PRODUZIERT_AM"

ItemCode

Edm.String(50)

Entity Relation: Item -> ItemCode

Linked table: OITM

Linked column: ItemCode

Database: "BEAS_QSFTHAUPT"."ItemCode"

ItemName

Edm.String(255)

Database: "BEAS_QSFTHAUPT"."BEZ"

IVersionId

Edm.String(20)

Database: "BEAS_QSFTHAUPT"."U_beas_ver"

DrawingNumber

Edm.String(50)

Database: "BEAS_QSFTHAUPT"."ZNR"

WhsCode

Edm.String(20)

Database: "BEAS_QSFTHAUPT"."WHSCODE_ORG"

Quantity

Edm.Decimal

Quantity in Stock unit

Database: "BEAS_QSFTHAUPT"."MENGE"

UoMStock

Edm.String(1)

Stock onut

Linked table: BEAS_ME

Linked column: ME_ID

Database: "BEAS_QSFTHAUPT"."ME_ID"

ItemInfo

Edm.String(16000)

Database: "BEAS_QSFTHAUPT"."QCINFO"

DistNumber

Edm.String(40)

Database: rtrim("BEAS_QSFTHAUPT"."BatchNum")

QCInspectionPlanId

Edm.String(20)

Linked table: BEAS_QSARTIKELHAUPT

Linked column: ItemCode

Database: "BEAS_QSFTHAUPT"."PRUEFAUFTRAG"

ParentQCOrder

Edm.String(20)

If defined: This QC order is part of QC order .... lined to field BEAS_QSFTHAUPT.CHARGE_ID (DocumentNumber)

Linked table: BEAS_QSFTHAUPT

Linked column: PARENTCHARGEID

Database: "BEAS_QSFTHAUPT"."ParentChargeId"

ItemQcLinkId

Edm.Int32

In Item Master Data you can define the link to the QC Inspection plan

In this field the Number of link is saved

Linked table: BEAS_QSVERWEIS

Linked column: NR

Database: "BEAS_QSFTHAUPT"."QcItemNr"

RuleId

Edm.String(20)

In Item QC Link you can define a rule

This rule is additional check for parallel qc orders.

Linked table: BEAS_QSARTIKELSUB

Linked column: RuleId

Database: "BEAS_QSFTHAUPT"."RuleId"

Type

Edm.String(1)

Type of Base document

Constraints:

Goods receipt PO=W

Manufacturing Access=E

Operation=F

Exceeded Expiry date=C

Stock transfer=U

Book in manually=M

Return=R

Stock transfer=T

Batch=B

A/P invoice=X

Shopping return=Y

Incoming credit note=Z

Outgoing credit=O

Delivery=P

Outgoing invoice=Q

Database: "BEAS_QSFTHAUPT"."TYP"

BaseType

Edm.String(20)

Database: "BEAS_QSFTHAUPT"."BaseType"

BaseDocEntry

Edm.Int32

Database: "BEAS_QSFTHAUPT"."BASEDOCENTRY"

BaseDocOrder

Edm.String(20)

Database: "BEAS_QSFTHAUPT"."BASEORDER"

BaseLineNumber

Edm.Int32

Database: "BEAS_QSFTHAUPT"."BASELINENUM"

BaseLineNumber2

Edm.Int32

Database: "BEAS_QSFTHAUPT"."BASELINENUM2"

CardCode

Edm.String(20)

Database: rtrim("BEAS_QSFTHAUPT"."CardCode")

PrjCode

Edm.String(20)

Project Id

Linked table: OPRJ

Linked column: PrjCode

Database: "BEAS_QSFTHAUPT"."Project"

PrjUID

Edm.Int32

Link to Project Line

Linked table: BEAS_PRJ_LINE

Linked column: PRJUID

Database: "BEAS_QSFTHAUPT"."PRJUID"

CreatedUserSign

Edm.Int32

Internal User Sign

Linked table: OUSR

Linked column: INTERNAL_K

Database: "BEAS_QSFTHAUPT"."INTERNAL_K"

CreatedPersonellId

Edm.String(20)

Created by Personell Id

Linked table: BEAS_PERS

Linked column: PERS_ID

Database: "BEAS_QSFTHAUPT"."PERS_ID"

CreatedBeasVersion

Edm.String(20)

Database: "BEAS_QSFTHAUPT"."BEASVERSION"

CreatedStation

Edm.String(40)

Database: "BEAS_QSFTHAUPT"."Station"

WoDocEntry

Edm.Int32

Database: "BEAS_QSFTHAUPT"."FERT_BELNR_ID"

WoLineNumber

Edm.Int32

Database: "BEAS_QSFTHAUPT"."FERT_BELPOS_ID"

WoLineNumber2

Edm.Int32

Database: "BEAS_QSFTHAUPT"."FERT_POS_ID"

SamplesOpen

Edm.Int32

Database: (select count(*) from "BEAS_QSFTMESSUNG" where "BEAS_QSFTMESSUNG"."CHARGE_ID"="BEAS_QSFTHAUPT"."CHARGE_ID" and "BEAS_QSFTMESSUNG"."BELNR_ID"="BEAS_QSFTHAUPT"."BELNR_ID" and Coalesce("BEAS_QSFTMESSUNG"."Release",0)<>1 and "BEAS_QSFTMESSUNG"."PRUEFKZ" not i

SamplesOK

Edm.Int32

Database: (select count(*) from "BEAS_QSFTMESSUNG" where "BEAS_QSFTMESSUNG"."CHARGE_ID"="BEAS_QSFTHAUPT"."CHARGE_ID" and "BEAS_QSFTMESSUNG"."BELNR_ID"="BEAS_QSFTHAUPT"."BELNR_ID" and Coalesce("BEAS_QSFTMESSUNG"."Release",0)=1)

SamplesError

Edm.Int32

Database: (select count(*) from "BEAS_QSFTMESSUNG" where "BEAS_QSFTMESSUNG"."CHARGE_ID"="BEAS_QSFTHAUPT"."CHARGE_ID" and "BEAS_QSFTMESSUNG"."BELNR_ID"="BEAS_QSFTHAUPT"."BELNR_ID" and Coalesce("BEAS_QSFTMESSUNG"."Release",0)<>1 and "BEAS_QSFTMESSUNG"."PRUEFKZ" in ('

PrintStatus

Edm.Boolean

Database: case when "BEAS_QSFTHAUPT"."DRUCKKZ" = 'J' then 1 else 0 end

MaterialTransfer

Edm.Int32

Constraints:

no transfer needed=0

open=1

booked=2

 

Database: coalesce("BEAS_QSFTHAUPT"."MaterialTransfer",0)

Release

Edm.Boolean

Database: "BEAS_QSFTHAUPT"."Release"

ReleasePersonnelId

Edm.String(20)

Database: "BEAS_QSFTHAUPT"."ReleasePersId"

ReleasePersName

Edm.String(20)

Database: "BEAS_QSFTHAUPT"."ReleasePersName"

ReleaseStationId

Edm.String(20)

Database: "BEAS_QSFTHAUPT"."ReleaseStationId"

ReleaseDate

Edm.DateTimeOffset

Database: "BEAS_QSFTHAUPT"."ReleaseDate"

ValuationId

Edm.String(20)

Linked table: BEAS_QSVALUATION

Linked column: ValuationId

Database: "BEAS_QSFTHAUPT"."BEWERTUNG"

ValuationText

Edm.String(255)

Database: "BEAS_QSFTHAUPT"."BEWERTUNGINFO"

BlockageReasonId

Edm.String(20)

Linked table: BEAS_QSSPERRGRUND

Linked column: SPERRGRUNDID

Database: "BEAS_QSFTHAUPT"."SPERRGRUNDID"

BlockageReasonText

Edm.String(16000)

Database: "BEAS_QSFTHAUPT"."SPERRGRUND"

Closed

Edm.Boolean

Database: case when "BEAS_QSFTHAUPT"."ABGKZ" = 'J' then 1 else 0 end

CloseDate

Edm.DateTimeOffset

Database: "BEAS_QSFTHAUPT"."CloseOrderDate"

ClosePersonellName

Edm.String(50)

Database: "BEAS_QSFTHAUPT"."CloseOrderPersName"

Picture1

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."BILD1"

Picture2

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."BILD2"

Picture3

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."BILD3"

UDF1

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF1"

UDF2

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF2"

UDF3

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF3"

UDF4

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF4"

UDF5

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF5"

UDF6

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF6"

UDF7

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF7"

UDF8

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF8"

UDF9

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF9"

UDF10

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF10"

UDF11

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF11"

UDF12

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF12"

UDF13

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF13"

UDF14

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF14"

UDF15

Edm.String(100)

Database: "BEAS_QSFTHAUPT"."UDF15"

LastChangeDate

Edm.DateTimeOffset

Database: "BEAS_QSFTHAUPT"."ANDTSTAMP"

LastChangeUserId

Edm.String(20)

Primary key

Database: "BEAS_QSFTHAUPT"."ANDUSER"

 

Relations

Join to Entiy Object

Relation

Item

ItemCode

UoM

UoMCode=UoMStock

QCOrderSamples

DocEntry

QCOrderMeasurement

DocEntry

QCOrderAttachment

DocEntry

DocumentBatchSerial

BaseType=DocType,BaseDocEntry=DocEntry,BaseLineNumber=LineNumber

 

Functions

Function

Parameter

Description

GetInspectionPlan

Type/c,ItemCode/c,Version/c,CardCode/c,Quantity/n,WhsCode/c,Date/d


CreateQcOrderLockedBatches


Generte QC order for all batches, which locked and a Inspection plan is defined for this scenario

CreateQcOrder

Type/c,DocEntry/i,BaseDocEntry/i,BaseLineNumber/i,BaseLineNumber2/i

Create a QC order related to a document

 

Type:

F = Workorder routing position (Docentry=0, BaseX=Reference to the the Routing Position)

E = Work order BoM - PostIn Document (Docentry = PostIn Document, Base = Reference to the BoM Position)

 

For all other types please use CreateQcORderFromSAPDocument

 

Example: Create QC Order for a Routing Position

The DocEntry is always 0


get QCOrder/CreateQcOrder("F",0,1000,10,10 )

Note:

If you need QC order related to Issue/Receipt document, please use


get QCORder/CreateQcOrderFromSAPDocument

CreateQcOrderFromGoodsReceiptPO

DocEntry/i

Create a QC Order based on a SAP Goods Receipt PO for all lines, if a QC Inspection plan is defined for this items and related rules defined in configuration wizzard

 

Example:

QCOrder/CreateQcOrderFromGoodsReceiptPO(100) -> Create QC order for Purchase Order with DocEntry=100

 

CreateQcOrderFromSAPDocument

DocEntry/i,TableName/c

Create a QC Order based on a SAP Document for all lines, if a QC Inspection plan is defined for this items and related rules defined in configuration wizzard

 

Define the SAP Document by Table Name, example

from manual post in document


QCOrder/CreateQcOrderFromSAPDocment(100,"OIGE")

beas Script


declare bsl b
b.GET QCOrder/CreateQcOrderFromSAPDocment(100,"OIGE")

JBScript


let docentry=100;
let result=b.get ("QCOrder/CreateQcOrderFromSAPDocument(:docentry,'OIGE'") ;

Note: The system can generate more then one QC Document. The System don't return the created Document number

Note: if QC Document created by transaction notification, you must use the function


CreateQcOrderFromSAPDocumentDirect(DocEntry,Table )

CreateQcOrderFromSAPDocumentDirect

DocEntry/i,TableName/c

Same as CreateQcOrderFromSAPDocument

But create QC order always and ignore transaction notification settings.

CheckRelease

DocEntry/i

Check Messurements, Samples,

Release Samples, if all Measurements ok

Release Order, if all Samples released

Related to settings in QC Plan.

 

Return Status 200 if no error, otherwise 400 with Error message.

 


odata4/QCOrder/CheckRelease(1250)

ReleaseQcOrder

DocEntry/i

Check, if Release is possible and release the QC order

Note: Electonic Signature not checked. The front end must do this self.


odata4/QCOrder/ReleaseQcOrder(1408)

return only status 200 OK or 404 not ok

CloseQcOrder

DocEntry/i

Allow to close defined QC Order (DocEntry)


odata4/QCOrder/CloseQcOrder(1408)

return only status 200 OK or 404 not ok

 

CreateSample

DocEntry/i

Allow creation of new sample inside an existing QC order


odata4/QCOrder/CreateSample(1408)

Return Json


{
"DocEntry": [current DocEntry],
"LineNumber": [number of created Sample]
}

QCOrderBatches

DocEntry/i

This return all related batches from the QC order

this is working, if QC order created from SAP Document AND manually without any transaction

This return the array value with follow objects

ItemCode, SystemNumber, Status and Batch


get QCOrder/QCOrderBatches(18)

return follow JSON (example)


{
    "value": [
        {
            "ItemCode": "po_batchauto",
            "SystemNumber": 1011,
            "Status": "0",
            "Batch": "abc-1"
        },
        {
            "ItemCode": "po_batchauto",
            "SystemNumber": 1009,
            "Status": "0",
            "Batch": "abc-2"
        },
        {
            "ItemCode": "po_batchauto",
            "SystemNumber": 1010,
            "Status": "0",
            "Batch": "abc-3"
        }
    ]
}

TransferLoad

DocEntry/i

Load all items, batch. and serial numbers, which must transfered

(Beas: Transfer function)


get QCOrder/TransferLoad(1410)


{
    "value": [
        {
            "Quantity": 2,
            "ItemCode": "po_batchauto",
            "WhsCode": "01",
            "Version": "1",
            "DistNumber": "abc-2",
            "Bincode": "",
            "RFID": null,
            "RejectQuantity": 0,
            "TotalQuantity": 0,
            "OpenQuantity": 2,
            "SystemNumber": 1009,
            "GoodQuantity": 0
        },
        {
            "Quantity": 3,
            "ItemCode": "po_batchauto",
            "WhsCode": "01",
            "Version": "1",
            "DistNumber": "abc-3",
            "Bincode": "",
            "RFID": null,
            "RejectQuantity": 0,
            "TotalQuantity": 0,
            "OpenQuantity": 3,
            "SystemNumber": 1010,
            "GoodQuantity": 0
        }
	]
}

TransferGetWareHouse

DocEntry/i,Rejected/b

Return the target transfer warehouse related to rejected flag

 


GET QCOrder/TransferGetWareHouse(1413,false)

return follow properties


{
    "ToWhsCode": "SAP_BIN",
    "ToBinCode": "SAP_BIN-AREA_B",
	 "RuleId": "test",
    "Description": "test1 QC"
}

The system return the description of warehouse rule, if existing

If no rule found, the system return the default warehouse from the item and ToBinCode and Description is empty

 

 

Changeable fields (PUT)

Follow fields changeable

UDF1...UDF15, BlockageReasonId,BloackageText,ValuationId,ValuationText,iteminfo,Release,Closed

Example:

put QCOrder(1407)

{"BlockageReasonId":"WrongColor"}

 

Note:

Send parameter in correct order. First the Id and then the Text.

If you send an ID, the system insert the default Text information and with next property you can overwrite it

Example: Overwrite standard BlockageReason Text:

put QCOrder(1407)

{"BlockageReasonId":"WrongColor","BlockReasonText":"This is my own Text"}

 

Release and Closed:
Correct order is: Fill all other fields then Release and at end the Closed information.

 

hmtoggle_plus1Relation to linked Batch/Serial numbers

Relation DocumentBatchSerial

 

This allow to link to BatchNumber/SerialNumbers related to SAP Document

Only working, if QC order is linked to SAP Document

get all related BatchNumbers for QC Order 1392

 

For this we use the middle Object "DocumentBatchSerial", which return all linked Batch and Serial SystemNumbers.

 

get QCOrder?$select=DocumentBatchSerial/ItemCode,DocumentBatchSerial/SystemNumber,

   DocumentBatchSerial/BatchNumber/Batch&$filter=DocEntry eq 1392 and BaseType lt 'A'

 

Note:

This is not working, if the QC order was created manually without reference to a SAP document.

 

Good alternative: Use

get QCOrder/QCOrderBatches(DocEntry)

This function return all Batches. Not compatible to SerialNumbers.

 

hmtoggle_plus1QC Transfer

Manage transfer process

It is possible to

- create transfer,

- issue,

- move from on item to another item / Batch / bincode

- create Po Return docuemtn

 

Only possible for lines, which the QCOrder/TransferLoad() function will return

Primary key is the BatchNumber and BinCode

If all items booked, the system close automatically the transfer process

 

Load Transfer Lines

 

get QCOrder/TransferLoad(DocEntry)

This return all lines, which are open

 

qctransfer_load

 

To post the Transfer (all document types) you must send the lines in follow way

post QCOrder

{"transfer":{

 "DocEntry":1000,

 "PostingDate":...,

 "DocumentDate":...,

 "Remarks":"...",

 "Ref":"...",

 "DocumentLines": [

     {DistNumber":"...", "BinCode":"..","DocType":0-3,"Quantity":x,"Reijected":true/false,"ToQuantity":x,"ToItemCode","ToBinCode":"",ToDistNumber":"","ToWhsCode":""},{...}
       ]

}

 

Field

Mandatory

Description

DocEntry

x

QC order DocEntry

PostingDate


Posting Date / Tax Date

DocumentDate


Document Date

Remarks


Remarks / Notes

Document Lines

x

Object Array
Here you define the items, which you want to move

It's mandatory to send DocumentLines in correct order:

1. DistNumber

2. BinCode (if bin warehouse related)

3. All other

If other order is used, the system can work in wrong way or can return an error message

If you send other properties, the system return an error.

-> DistNumber

x

Distnumber/Batchnumber from Serial/Batch related item

-> BinCode

x

BinCode, if Bin managed warehouse. Beas/SAP/WMS Bin managed warehouse supported

-> DocType


Transaction type. 0=transfer, 1=issue,2=edit,3=poReturn
Default is transfer
qctransfer_type

-> Quantity

x

Transfer / Move / Issue quantity

-> ToQuantity,

-> ToItemCode

-> toVersion
-> ToBinCode
-> ToDistNumber
-> ToWhsCode


Target Item / Quantity / Warehouse

If not defined, the system use Standard

-> rejected


Booelan: true for rejected (bad) quantity and false for good quantity

 
It will return

{

"TransferDocEntry":x,

"TransferDocNumber":x,
"IssueDocEntry":x,
"IssueDocNumber":x,

"ReceiptDocEntry":x,

"ReceiptDocNumber":x,

"PoReturnDocEntry":x,

"PoReturnDocNumber":x

"CloseTransfer":true/false

}

Every entry only, if a document is created for this type.

Example: If only a transfer document was created, it return

{

"TransferDocEntry":x,

"TransferDocNumber":x,
"CloseTransfer":true

}

 

The System check, if all items transfered. If yes, it return"CloseTransfer":true otherwise false