关键词不能为空

当前您在: 主页 > 英语 >

classicSAP B1控制不允许超量转储方案

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-01-21 14:54
tags:

偷-classic

2021年1月21日发(作者:中顾委)
控制不允许超量转储方案


1.

2.

3.

4.


整理允许物料超量转储的物料
MPQ

excel


物料主数据
OITM
,新建字段
U_T022
是否允许超量转储,
Y
代表允许,
N
代表不允许

在数据库中导入临时表
MPQ
,即:将
Excel
表按照固定格式导入数据库 ,形成数据表

在数据库中,将
OITM
中将所有物料的的
U_T022,update

Y
,默认不允许超量转储

先查询
OITM
中对应物料的
U_T022
的值

Select de, t0.U_T022 ,de, from oitm t0 inner
join mpq t1 on de =de

再将
OITM
中对应物料的
U_T022
字段更新为
Y
Update
t0
set
t0.U_T022='Y'
from
oitm
t0
inner
join
mpq
t1
on
de=de
where de=de


5.

控制不允许超量发货的物料,若超量或超过指定的值不允许保存(合并)



--------------------
库存转储的数量不能大于对应转储请求的数量!( 合并控制)
-------------------------
IF

@object_type

=

'67'

and

@transaction_type

=
'A'

begin


declare

@linenum4

int


declare

@N

int

select

@linenum4

=

max
(
linenum
)

from

WTR1

where

docentry

=

@list_of_cols_val_tab_del


set

@N

=
0
while

@N

<

=

@linenum4

begin

declare

@baseentry2

int

declare

@baseline2

int
declare

@totalqtytr1

numeric
(
19
,2
)
---
转储总数量

declare

@quantitytq1

numeric
(
19
,2
)
---
库存转储请求数量

declare

@csb3

numeric
(
19
,
2
)
declare

@MPQ

int

-------
取转储单行表,基础凭证号,基础行号

select

@baseentry2

=

baseentry
,
@baseline2

=

baseline

from

WTR1

where

docentry

=

@list_of_cols_val_tab_del

and

linenum

=

@N

---
取相同基础凭证号,基础凭证行号的该物料的转储总计数量

select

@totalqtytr1

=

sum
(
t0
.
Quantity
)

from

WTR1

t0

INNER

JOIN

oitm

T1

ON

T0
.
itemcode

=

T1
.
itemcode

where

t0
.
BaseEntry

=

@baseentry2

and

t0
.
BaseLine

=

@baseline2


and

t0
.
LineStatus
=
'O'

and

t0
.
Quantity

>
'0'
----
取库存转储请求行中,该行物料的请求数量

select

@quantitytq1

=

T0
.
quantity

from

WTQ1

T0

INNER

JOIN

oitm

T1

ON

T0
.
itemcode

=

T1
.
itemcode

where

T0
.
docentry

=

@baseentry2

and

T0
.
linenum

=

@baseline2


----
取库存转储请求行中,该行物料的
MPQ
select

@MPQ

=
t4
.
MPQ

from

WTR1

t0

INNER

JOIN

oitm

T1

ON

T0
.
itemcode

=

T1
.
itemcode

inner

join

MPQ

T4

on

t0
.
ItemCode
=
t4
.
itemcode
where

t0
.
BaseEntry

=

@baseentry2

and

t0
.
BaseLine

=

@baseline2


if

isnull
(
@MPQ
,
0
)>
0

begin

if

ISNULL
(

@quantitytq1
,
0
)%
@MPQ

>=
1

begin

if
(
isnull
(
@totalqtytr1
,
0
)

>
isnull
(((
cast
(
I SNULL
(

@quantitytq1
,
0
)/
@MPQ

as

int
)+
1
)*

@MPQ

),
0
)

)


begin

select

@error

=
1


select

@error_message

=

N'

'< br>+
cast
((
@N
+
1
)

as

varchar
(
3
))+
N'

'
+
N'--'
+


N'
物料的 累计转储数量
'
+
convert
(
varchar
(20
),
@totalqtytr1
)+


'
,不能超过该物料的
MPQ
数量
'
+
convert(
varchar
(
20
),
@MPQ
)+
' !'


end

end


if

ISNULL
(

@quantitytq1
,
0
)%
@MPQ

<
1

begin

if
(
isnull
(
@totalqtytr1
,
0
)

>
isnull
(((
cast
(
I SNULL
(

@quantitytq1
,
0
)/
@MPQ

as

int
))*

@MPQ

),
0
)

)


begin

select

@error

=
1


select

@error_message

=

N'

'< br>+
cast
((
@N
+
1
)

as

varchar
(
3
))+
N'

'
+
N'--'
+


N'
物料的 累计转储数量
'
+
convert
(
varchar
(20
),
@totalqtytr1
)+


'
,不能超过该物料的
MPQ
数量
'
+
convert(
varchar
(
20
),
@MPQ
)+
' !'


end

end

end

if

isnull
(
@MPQ
,
0
)<=
0

begin

if

isnull
(
@totalqtytr1
,
0
)>
ISNULL
(

@quantitytq1
,
0
)

begin


select

@error

=
1


select

@error_message

=
N'

'
+
cast
((
@N
+
1< br>)

as

varchar
(
3
))+N'

'
+
N'--'
+


N'
物料的累计转储数量
'
+
convert
(
varc har
(
20
),
@totalqtytr1
)+


'
不能大于该物料行的库存转储请求数量
'
+
con vert
(
varchar
(
20
),
@quantity tq1
)+
'!'


end

end

set

@N
=

@N

+
1

end

end
不合并,分开控制


-------------- -
库存转储的数量不能大于对应转储请求的数量

IF
(
@object_type
=
'67'

AND

@transaction_type

IN

(
'A'
))
BEGIN
if

EXISTS(
select
1

from

WTR1

t0

inner

join

(
select

WTQ1
.DocEntry
,
WTQ1
.
LineNum
,
SU M
(
WTQ1
.
Quantity
)

请求数量








from

WTQ1
















group

by

WTQ1
.
Doc Entry
,
WTQ1
.
LineNum
)
t1

on

t0
.
BaseEntry
=
t1
.
DocEntry

and

t0
.
BaseL ine
=
t1
.
LineNum


left

join

(
select
< br>WTR1
.
BaseEntry
,
WTR1
.
Bas eLine
,
SUM
(
WTR1
.
Quantity
)

已转数量








from

WTR1







where

WTR1
.
DocE ntry
<>
@list_of_cols_val_tab_del

and

WTR1
.
LineStatus
=
'O'

and

WTR1
.
Quantity

>
'0'

















group

by

WTR1
.
BaseEntr y
,
WTR1
.
BaseLine

)

T2

on

t0
.
BaseEntry
=
T2
.
BaseEntry

and



t0
.
BaseLine
=
T2
.
BaseLine


inner

join

OITM

t3

on

t0
.
ItemCode

=
t3
.
ItemCode



where

t0
.
LineStatus
=
'O'

/* and ty >'0' */

and

t0
.
Doc Entry
=
@list_of_cols_val_tab_del

and

t0
.
Quantity
+
isnull
(
t2
.
已转数

,
0
)>
t1
.
请求数量


and

(
t3
.
U_T022

=
'N'

or

isnull
(
t3
.
U_T022,
''
)

=
''

)


)






begin




SET

@error

=
1
SET

@error_ message
=
'
库存转储的数量不能大于对应转储请求的数量!
'
SELECT

@error
,
@error_message
end

偷-classic


偷-classic


偷-classic


偷-classic


偷-classic


偷-classic


偷-classic


偷-classic



本文更新与2021-01-21 14:54,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/544625.html

SAP B1控制不允许超量转储方案的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文