API RF RECHEMP

  Version ACE : 5.0-00

Package : Standard

Sous-programme Basic : depose_declarative

Nom de la gnc : gnc_rf_recherche_emp

Fonctionnalité :Déplacement déclaratif
Schémas d’entrée et de sortie : voir en fin de document.

Cette API permet de rechercher les emplacements compatibles pour le déplacement déclaratif.

API imbriquées : aucune.

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

RAS.

Paramétrage (PPE)

RAS.

Prototype de la fonction Basic

recherche_emplacement( p_sigtie, p_idobj, p_meme_produit, p_picking, p_magasin, p_niveau, p_adremp(6))

Messages en entrée

RECHEMP~p_sigtie~p_idobj~p_meme_produit~p_picking~p_magasin~p_niveau~

Messages en sortie

Retour~compteur~adremp1~ adremp2~ adremp3~ adremp4~ adremp5~ adremp6~

Valeurs restituées par l’API

VALEUR REMARQUE
1 OK
0 Erreur SQL

Processus, contrôles et règles de gestion

ETAPE DESCRIPTION DU PROCESSUS
  Construction de l’ordre SQL suivant les paramètres renseignés.
  Soumission de l’ordre SQL
  Retour du résultat.
Détail :

Look for input stock object’s product code (codpro).

(Read stock object data (LOBJSTK) with input parameters (sigtie, idobj, typtie =”DEP”).)

Looking for slot addresses corresponding to the following conditions.

(Read the slot addresses(EMP), which are not inventoried (flginv=’0’) and with the input parameter (‘sigtie’).

Add some conditions depending on the input parameters.

If the stock object is found.

The slot addresses should correspond to the stock object’s product.

Add the LOBJSTK table in the search.

Join the slot address table (EMP) with the stock object table (LOBJSTK) on company code (emp.codsoc = lobjstk.codsoc), third-party ID (emp.sigdep = lobjstk.sigtie) and the slot address (emp.codemp = lobjstk.adremp).

Search for stock objects (LOBJSTK) with a product code equal to the input object’s product code (codpro = lobjstk.codpro) and with an ‘available’ status (statut = ‘0’).

Otherwise.

The slot address should be not occupied.

(Not presented product code (emp.codpro = ' '), real occupation equal to zero (emp.occreel = 0), entry in progress occupation equal to zero (emp.occece = 0), full flag equal to zero (flgplein = '0')).

If the input ‘picking’ parameter is equal to ‘O’ (picking="O").

The slot address’s logistic store should be of picking type (emp.typmag = ‘3’).

Otherwise.

The slot address’s logistic store should be of reserve type (emp.typmag = ‘1’).

If the input store parameter is not empty (magasin != ‘’).

The slot address’s store code should be equal to the input store parameter (emp.lcodmag = magasin).

If the input level parameter is not empty (niveau != ‘’).

The slot address level address should correspond to the input level parameter (emp.adrniv = niveau).

The ‘possible allocation on the stock’ for the corresponding store should be different from ‘Deconsolidation’ (LMAG.alcstk <> ’E’).

Read the first slot address object.

If the slot address object is not found.

The API returns the error code 0.

Find the first six not blocked slot addresses:

For each slot address object found.

Looking for blocking code data (LCBQ) corresponding to blocking code of the current slot address object.

(Read the slot address’s blocking code object with the input parameters (sigtie) and (typtie = ‘DEP’ , codblc = emp.codblq))

If the slot address’s blocking code is found and the entry is forbidden for that code (entint != '0').

Read the next emplacement objects.

Otherwise:

The slot address is considered as found.

(Copy the slot address (codemp) to the output parameter.)

Read the next slot address object.

Erreurs possibles

CAUSE EFFET
Niveau saisie incorrect Erreur SQL
Magasin saisie incorrect Erreur SQL

Exemple(s) d’utilisation

retour_recherche_emplacement = recherche_emplacement(p_sigtie, p_idobj, w_meme_produit, w_picking, w_magasin , w_niveau ,w_adremp)

Autres remarques…

Attention : les emplacements retournés correspondent à ceux demandés par la recherche, et ne garantissent pas un résultat satisfaisant lors de la tentative de transfert.

Paramètres en entrée

NOM DU PARAMÈTRE TYPE FORMAT TAILLE OBL O/N REMARQUE
sigtie CHAR   12 O Nom du dépôt.
idobj CHAR   19 O Idobj à rechercher.
meme_produit CHAR

O/N

N par défaut.

1 N

Indicateur de recherche de l'emplacement affecté au produit correspondant à p_idobj.codpro.

Si cet indicateur est à "O", les emplacements pleins ne sont pas exclus pour le compactage.

picking CHAR

O/N

N par défaut.

1 N

Indicateur de recherche d'un emplacement picking:

  • ‘O’ = adresses d'emplacement du magasin picking,
  • Autre caractère = adresses d'emplacement du magasin Réserve.
magasin CHAR   3 N Nom du magasin auquel sera restreint la recherche. Par défaut, aucune restriction.
niveau CHAR   2 N Niveau auquel sera restreint la recherche. Par défaut, aucune restriction.

Paramètres en sortie

NOM DU PARAMÈTRE TYPE FORMAT TAILLE REMARQUE
ParamOut       Liste des adresses d'emplacements trouvés (jusqu'à 6 emplacements). Champ "EMP.codemp".
Retour CHAR   1 Code erreur. 1 : Ok 0 : KO
Compteur CHAR   1 Entre 0 et 6, nombre d’emplacement trouvé
Adremp1 CHAR   10 1er emplacement correspondant à la recherche
Adremp2 CHAR   10 2nd emplacement correspondant à la recherche
Adremp3 CHAR   10 3eme emplacement correspondant à la recherche
Adremp4 CHAR   10 4eme emplacement correspondant à la recherche
Adremp5 CHAR   10 5eme emplacement correspondant à la recherche
Adremp6 CHAR   10 6eme emplacement correspondant à la recherche