SAP - Transaction Notification

 
Vista:

Transaction Notification

Publicado por bianca juarez (1 intervención) el 26/08/2014 23:42:58
Muy buenos días ocupo ver si nos pueden ayudar en un bloqueo bueno realmente a ver si el código en esta bien estructurado o que le hace falta .

Se trata de vincular los artículos con su respectivo cliente en el movimiento de ENTREGAS.

Cada uno de los clientes tienen un respectivo cardcode que es lo que estamos tomando en cuenta en el código y todos sus artículos inician con un numero en específico con respecto a su cliente

Ejemplo :

Cardcode ---MET0011 ---------SANMINA-SCI RSP DE MEXICO S.A. DE C.V. ---------------Sus artículos comienzan con -------------150

Este es el código que tenemos hasta el momento.



IF @object_type in(15) and @transaction_type in('A,U') /*se elige su tipo de objeto y que las transacciones seran al momento de actualizar o crear*/





BEGIN

declare @1 varchar (100)/* se guardara en codigo del cliente*/

declare @2 varchar (100) /* se guardara en codigo del articulo*/

declare @error1 int =0 /*validara si enta dentro del case */



select @1 = ODLN.CardCode from ODLN where @list_of_cols_val_tab_del = ODLN.CardName /*guardara lo que esta actualmente en el archivo que se esta creando */

select @2 = DLN1.ItemCode from DLN1 where @list_of_cols_val_tab_del = DLN1.DocEntry

/*guardara lo que esta actualmente en el archivo que se esta creando */



select @error1 =

CASE

when @1='MET0006' and @2 not like '058%%' then 1/*segun sea el caso de la informacion que guardan los select de arriba validamos cada uno de los clientes para si no cumple la condiccion que me marque el error */

when @1='PLA0010' and @2 not like '012%%' then 1

when @1='PLA0007' and @2 not like '070%%' then 1

when @1='MET0015' and @2 not like '140%%' then 1

when @1='MET0011' and @2 not like '150%%' then 1

when @1='PLA0008' and @2 not like '302%%' then 1

when @1='MET0012' and @2 not like '455%%' then 1

when @1='PLA0009' and @2 not like '513%%' then 1

when @1='MET0008' and @2 not like '684%%' then 1

when @1='PLA0011' and @2 not like '710%%' then 1

when @1='MET0007' and @2 not like '728%%' then 1

when @1='MET0009' and @2 not like '765%%' then 1

when @1='PLA0005' and @2 not like '768%%' then 1

when @1='MET0010' and @2 not like '776%%' then 1

when @1='PLA0013' and @2 not like '778%%' then 1

when @1='PLA0006' and @2 not like '784%%' then 1

when @1='PLA0017' and @2 not like '787%%' then 1

when @1='PLA0001' and @2 not like '789%%' then 1

when @1='PLA0002' and @2 not like '791%%' then 1

when @1='MET0003' and @2 not like '797%%' then 1

when @1='MET0005' and @2 not like '798%%' then 1

when @1='MET0002' and @2 not like '799%%' then 1

when @1='PLA0014' and @2 not like '801%%' then 1

when @1='MET0016' and @2 not like '802%%' then 1

when @1='PLA0016' and @2 not like '803%%' then 1

when @1='MET0017' and @2 not like '804%%' then 1

when @1='MET0022' and @2 not like '805%%' then 1

when @1='MET0024' and @2 not like '806%%' then 1

when @1='MET0025' and @2 not like '807%%' then 1

when @1='MET0020' and @2 not like '808%%' then 1

when @1='MET0028' and @2 not like '011%%' then 1

when @1='MET0029' and @2 not like '010%%' then 1

end

if @error1=1

begin

set @error = 2

set @error_message = 'BIOS'

end



END
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder