API RF SCE_OBJ_RE

  Version ACE : 1.4

Package : Standard

Sous-programme Basic : gnc_rf_cree_mvt_reception_egx

Fonctionnalité :SCE Mobile
Schémas d’entrée et de sortie : voir en fin de document.

Cette API permet de créer un mouvement de réception de stock.

API imbriquées : aucune.

Contraintes et limites de fonctionnement (hors périmètre)

RAS.

Paramétrage (PPE)

RAS.

Cas d'erreur

CODE DESCRIPTION
0 The logistic stock object is not found.
51 The reception line data is not found.
0 The logistic variant is not found.
0 The stock movement object is not created.
0 The EA header object is not found.
0 The EA type object is not found.
0 The function gnc_valid_mvtstk does not succeed.

Détail de l'API

If the input logistic stock object ID (idobjdec) is presented.

Read the logistic stock object data (LOBJSTK) with the input parameters (typtie, sigtie, idobjdec).

If the logistic stock object is not found, the API returns the error code 0.

Read reception line data (LREL) read with the input parameters (typdep, sigdep, numrec).

If the reception line data is not found, the API returns the error code 51.

For each reception line object found.

If (the input reception line number is equals to 0 (numligrec = 0) and the current product code is equal to the input product code (codpro)) or (the input reception line number is different to 0 (numligrec != 0) and the input reception line number is equal to the reception line number read (numligrec = LREL.numligrec)).

The reception line is considered as found.

Otherwise.

Read the next reception line object.

Preparation of the stock movement object to be created.

(Initialize the fields –

third-party type with the input third-party type (typtie),

third-party ID with the input third-party ID (sigtie),

movement sign with “E” (sensmvt = “E” – input direction),

movement type with “E” (typmvt = “E” – input type),

movement code with the reception line movement code (lcodmvt = LREL.lcodmvt),

status with “3” (status = “3” – addressed),

store code with the store code of the logistic stock object (lcodmag = LOBJSTK.lcodmag),

slot address with the slot address of the logistic stock object (adremp = LOBJSTK.adremp),

store type with 6 (typmag = 6),

stock type with 1 (typstock = "1")

physical company code with the physical company code of the logistic stock object (codsoc_phy = LOBJSTK. codsoc_phy),

product code with the input product code (codpro),

stock nature with the input stock nature (natstk),

container’s code level with the input container’s code level (codlncn),

customs stock with the customs stock of the reception line (flgdouane = LREL.flgdouane),

fifo date with the fifo date of the reception line (datfifo = LREL.datfifo),

entry date with the current date (datent),

creation date with the current date (datcre),

creation hour with the current hour (heucre)

creation user ID with current user ID (uticre = uti_cod),

reception number with the input reception number (numrec),

EA number with the EA number of the reception line (numea = LREL.numea),

reception line number with the reception line number of the reception line (numligrec = LREL.numligrec),

EA line number with the EA line number (numligea = LREL.numligea),

reception origin number with the origin number of the reception line (numorirec = LREL.numori),

batch ID with the reception number of the reception line (idbch = LREL.numrec),

comment number with the comment number of the reception line (numcom = LREL.numcom),

transmission flag with 0 (flgtrm = "0"),

serial number flag with 0 (flgnumser = "0"),

compaction flag with 0 (flgcompac = "0"),

stock edit label flag with 0 (flgetq = "0"),

validation action with 2 (vldaction = "2"),

container type with "PA" (cnttyp = "PA"),

container code with "01" (cntcod = "01"),

containing number with 1 (l_nbrcnt = 1),

(call the function gnc_vl_conversion to calculate the quantity of CU (qteunt))

(Read the logistic variant (PRL) with the input parameters (sigtie, typtie, codpro) and (codva1 = "00", cntdft = “O”, codlnst = “5”).

If the logistic variant does not exists the API returns the error code 0.)

container type level 5 with the container type level 5 of the logistic variant (cnttyp5 = PRL.cnttyp5),

container code level 5 with the container code level 5 of the logistic variant (cntcod5 = PRL.cntcod5),

container quantity of CU level 5 with container quantity of CU level 5 of the logistic variant (qteunt5 = PRL.qteunt5),

container type level 4 with the container type level 4 of the logistic variant (cnttyp4 = PRL.cnttyp4),

container code level 4 with the container code level 4 of the logistic variant (cntcod4 = PRL.cntcod4),

container quantity of CU level 4 with container quantity of CU level 4 of the logistic variant (qteunt4 = PRL.qteunt4),

container type level 3 with the container type level 3 of the logistic variant (cnttyp3 = PRL.cnttyp3),

container code level 3 with the container code level 3 of the logistic variant (cntcod3 = PRL.cntcod3),

container quantity of CU level 3 with container quantity of CU level 3 of the logistic variant (qteunt3 = PRL.qteunt3),

container type level 2 with the container type level 2 of the logistic variant (cnttyp2 = PRL.cnttyp2),

container code level 2 with the container code level 2 of the logistic variant (cntcod2 = PRL.cntcod2),

container quantity of CU level 2 with container quantity of CU level 2 of the logistic variant (qteunt2 = PRL.qteunt2),

container type level 1 with the container type level 1 of the logistic variant (cnttyp1 = PRL.cnttyp1),

container code level 1 with the container code level 1 of the logistic variant (cntcod1 = PRL.cntcod1),

container quantity of CU level 1 with container quantity of CU level 1 of the logistic variant (qteunt1 = PRL.qteunt1),

parent stock object ID with an empty string (idobjpere= ""),

origin stock object ID with the input logistic stock object ID (idobjori = idobjdec),

stock level code with "5" (codlnst = "5" pallet).)

Create the stock movement object.

If the operation does not succeed, the API returns the error code 0.

Read the EA header data (leae) with the input parameters (typdep, sigdep) and EA number equal to EA number of the reception line (numea = LREL.numea).

If the EA header object is not found, the API returns the error code 0.

Read the EA type data (ltea) with the input parameters (typdep, sigdep) and EA type equal to EA type of the EA header (typeea = LEAE.typeea).

If the EA type object is not found, the API returns the error code 0.

Call the function gnc_valid_mvtstk, as so to validate the created movement (for stock availability (LEAE.dispo) and found quantity of CU (qteunt)).

If the function gnc_valid_mvtstk does not succeed, the API returns the error code 0.

Return the code 1.

Paramètres en entrée

CODE DESCRIPTION TYPE OBL O/N
typtie Third-party type. Char(3) O
sigtie Third-party ID. Char(12) O
numrec Reception number. Number O
idobjdec Logistic stock object ID. Char(18) N
codpro Product code. Char(16) O
nbrcnt Container quantity of CU. Number O
cnttyp Container type. Char(2) O
cntcod Container code. Char(2) O
natstk Stock nature. Char(2) N
codlncn Container’s code level. Char(1) N
numligrec Reception line number. Number N

Paramètres en sortie

CODE DESCRIPTION FORMAT
ParamOut1 Third-party type. (typtie input parameter) Char(3)
ParamOut2 Third-party ID. (sigtie input parameter) Char(12)
ParamOut3 Reception number. (numrec input parameter) Number
ParamOut4 Logistic stock object ID. (idobjdec input parameter) Char(18)
ParamOut5 Product code. (codpro input parameter) Char(16)
ParamOut6 Container quantity of CU. Number
ParamOut7 Container type. (cnttyp input parameter) Char(2)
ParamOut8 Container code. (cntcod input parameter) Char(2)
ParamOut9 Stock nature. (natstk input parameter) Char(2)
ParamOut10 Stock movement ID (LMVTSTK.idmvt) of the created movement. Number
ParamOut11 Logistic stock object ID (LMVTSTK.idobj) of the created movement. Char(18)