DOS/BATCH_All practice set

*********************************************************************************
Test1
@echo off
echo Test1: pass parameters to the t1.bat batch file
call t1.bat "hello" "haha"

t1.bat
echo %1  (Print: "hello")
echo %2  (Print: "haha")
echo %0  (Print: t1.bat)
echo %19 (Print: "hello"9)
echo %29 (Print: "hello"9)
echo %09 (Print: "hello"9)
pause

************************
Test2
@echo off
echo Test2: display help information
help type

************************
Test3
@echo off
echo Test3: Type some commands into a specific "setupreg.reg" format file
echo hello world
echo Windows Registry Editor Version 5.00 > C:\Users\M3C\Desktop\BAT_test\setupreg.reg
echo "SourcePath"="D:\\Win2003\\">> C:\Users\M3C\Desktop\BAT_test\setupreg.reg
echo Test:append content to Test.txt > C:\Users\M3C\Desktop\BAT_test\t3.txt
echo append content to test.txt again >> C:\Users\M3C\Desktop\BAT_test\t3.txt

t3.txt
Test:append content to Test.txt 
append content to test.txt again 

************************
Test4
@echo off
echo Test4: Rem(::) command
echo Here is the descriotion.
Rem echo Here is the description.
@Rem Here is the descriptiom.
:: echo Here is the description.

************************
Test5
@echo off 
echo Test5: Goto (Goto label ":") and pause command
:begin  
copy C:\Users\M3C\Desktop\BAT_test\Test5\t5.txt C:\Users\M3C\Desktop\BAT_test
echo Here Test5 file t5.txt will be copied from folder Test to the current (BAT_test) folder.
pause
goto begin

************************
Test6
@echo off 
echo Test6: Call command (call [[Drive:][Path] FileName [BatchParameters]] [:label [arguments]] ) (Call another batch file)
echo Test6-1: Automatically generate a test6.bat file and add "%%1" "%%2" "%%3" to it, and then pass parameters to the t6.bat file.
echo echo %%1 > C:\Users\M3C\Desktop\BAT_test\t6.bat
echo echo %%2 >> C:\Users\M3C\Desktop\BAT_test\t6.bat
echo echo %%3 >> C:\Users\M3C\Desktop\BAT_test\t6.bat
echo pause >> C:\Users\M3C\Desktop\BAT_test\t6.bat
call test6.bat "T6" "TT6" "TTT6"

echo Test6-2: Call t6.bat in the specified directory and enter three arguments to it.
call C:\Users\M3C\Desktop\BAT_test\Test6\t6-2.bat "T62" "T623" "T6234"
call "%cd%\Test6\t6-2.bat" T62 T623 T6234
call="%cd%\Test6\t6-2.bat" T66 T666 T6666

echo Test6-3: Call t6.bat in the directory and enter three arguments to it.
call t6.bat "arg1" "arg2" "arg3"


t6-2.bat
echo %1 
echo %2 
echo %3 
pause 

************************
Test7
@echo off
echo Test7:Start command (Common Parameters of instrusion : MIN/SEPARATE/HIGH/REALTIME/WAIT)
echo Test7-1:Call t7.bat and enter 2 arguments to it, and minimize or maximize the window.
echo Notes: After "WAIT" is added, the instruction is execulted before the next one is executed.
start /MIN t7.bat arg1 arg2
start /WAIT /MAX t7_1.bat arg1 arg2

echo Test7-2:Call destination patch file, file path name empty format to double quotes.
start "" "C:\Users\M3C\Desktop\BAT_test\Test 7\Test7.txt" 
start C:\Users\M3C\Desktop\BAT_test\"Test 7"\Test7_1.txt
start "" "%cd%\Test 7\Test7_2.txt" 
start %cd%\"Test 7"\Test7_3.txt


t7.bat
echo %%If "exit" is added,the windows will close automatically after running.
echo %1
echo %2
pause
exit

t7_1.bat
echo %0
echo %1
echo %2
pause
exit

Test7.txt
Congratulation on learning the instruction!
start "" "C:\Users\M3C\Desktop\BAT_test\Test 7\Test7.txt" 

Test7_1.txt
Congratulation on learning the instruction!
start C:\Users\M3C\Desktop\BAT_test\"Test 7"\Test7_1.txt

Test7_2.txt
Congratulation on learning the instruction!
start "" "%cd%\Test 7\Test7_2.txt" 

Test7_3.txt
Congratulation on learning the instruction!
start %cd%\"Test 7"\Test7_2.txt


************************
Test8

@echo off

echo Test8-1: Enter two elements and use the if statement, If [not] "parameter" == "character string" 

set /p var1=Please enter an element1:
set /p var2=Please enter an element2:
if "%var1%" == "%var2%" echo The two elements of the input are identical
pause

set /p var3=Please enter an element3:
set /p var4=Please enter an element4:
if "%var3%" == "%var4%" (echo The two elements of the input are identical) else echo The two elements of the input are different
pause

set /p var3=Please enter an element5:
set /p var4=Please enter an element6:
if "%var3%" == "%var4%" (echo The two elements of the input are identical) else (echo The two elements of the input are different)
pause

rem if not "1" == "1" (echo true) else echo fail

***
echo Test8-2: if [not] exist [path\]FileName Command to be executed

echo Test for ifexist > "%cd%\ifexist.sys"
if exist "%cd%\ifexist.sys" type ifexist.sys
if exist "%cd%\ifexist.sys" echo True
if not exist "%cd%\ifexist.sys" (echo Fail) else echo Pass
rem if exist "%cd%\ifexist.sys" edit ifexist.sys
pause

***
echo Test8-3: if [not] errorlevel <number> Command to be executed

xCOPY %cd%\Test8-3\test8-3.txt %~dp0\
if errorlevel 1 (echo copy file fail) else if errorlevel 0 echo copy file pass.
pause

del "%cd%\test8-3.txt"
rem if errorleve 1 (echo Succeeded in deleting files) else if errorlevel 0 echo Failed to delete a file.
pause

***
echo Test8-4: if condition (An order executed on establishment) else (An order not to be executed immediately)

if 1==0 (echo Fale) else if 1==0 (echo Fale) else (echo 1=1)

if 1==0 (echo Fale) else if 1==0 (echo true) ^
else (echo 1=1)

pause

***
echo Test8-5: Comparison operator

echo EQU -Equal to ("==" is commonly used)
echo NEQ -Not Equal to (not "!=", There is use "if not 1==1" here)
echo LSS -Less than
echo LEQ -Less than or equal
echo GTR -greater than
echo GEQ -greater than or equal 

pause

***
test8-3.txt
test for if errorlevel


************************
Test9-1

@echo off

echo Test9-1: Choice /c:parameter (The element returns values 1,2,3...), for example: Choice defrag/mem/end or Yes/No.

Choice /c:dme
Choice /c:YN
Pause

***
Test9-2:

@echo off

echo Test9-2: "Choice /c:parameter " and "If errorlevel" are used together.

Choice /c:dme

if errorlevel 3 goto e
if errorlevel 2 goto m
if errorlevel 1 goto d
pause 
exit

:d
echo Your choice is 'defrag'
pause 
exit

:m
echo your choice is 'mem'
pause 
exit

:e 
echo your choice is 'end'
pause 
exit


************************
Test10
@echo off

echo Test10: For {%%variable} in (set) do command [command-parameters]
echo For /parameter %%variable in (set) do (command)
echo notes: "For" has D/L/R/F parameter
echo notes: Bat file in the variable before adding "%%" to the normal operation

***
echo Test10-1: For %%variable in (set) Do command [command-parameters]
echo notes: The file name containing the extension name ".XXX" is displayed in the current directory

for %%c in (*.bat*) do (echo %%c)
rem for %%t in (*.txt*) do (echo %%t)
rem for %%s in (*.reg*) do (start %%s)


************************
Test10-2.1

@echo off

echo Test10: For {%%variable} in (set) do command [command-parameters]
echo For /parameter %%variable in (set) do (command)
echo notes: "For" has D/L/R/F parameter
echo notes: Bat file in the variable before adding "%%" to the normal operation

******
echo Test10-2.2: For /d %variable in (set) Do command [command-parameters]
echo notes: Displays the names of directories containing "X" or "Y" in the current directory

for /d %%c in (*T*) do (echo %%c)

rem for /d %%c in (*c*) do (echo %%c)
rem for /d %%c in (*T*) do (cd "%%c)
rem for /d %%c in (*T*) do (start %cd%\%%c)


************************
Test10-3.1

@echo off

echo Test10: For {%%variable} in (set) do command [command-parameters]
echo For /parameter %%variable in (set) do (command)
echo notes: "For" has D/L/R/F parameter
echo notes: Bat file in the variable before adding "%%" to the normal operation

******
Test10-3.2
@echo off

echo Test10-3.2: For /R [[drive:]path] %variable in (set) Do command [command-parameters]
echo notes: Displays the file name containing the extension name ".XXX" in the current or specified directory

for /r C:\Users\M7O\Desktop\BAT_test\Test10-3 %%t in (*.txt*) do (echo %%t)
rem for /r C:\Users\M7O\Desktop\BAT_test\Test10-3 %%t in (*.txt) do (echo %%t)

rem for /r %%t in (.) do (echo %%t)
rem for /r %%t in (*.txt) do (echo %%t)
rem for /r C:\Users\M7O\Desktop\BAT_test %%t in (.) do (echo %%t)
rem for /r C:\Users\M7O\Desktop\BAT_test\Test10-3 %%t in (.) do (echo %%t)


************************
Test10-4.1

@echo off

echo Test10: For {%%variable} in (set) do command [command-parameters]
echo For /parameter %%variable in (set) do (command)
echo notes: "For" has D/L/R/F parameter
echo notes: Bat file in the variable before adding "%%" to the normal operation

******
Test10-4.2

@echo off

echo Test10-4.2: For /L %variable in (start,step,end) Do command [command-parameters]
echo notes: The following command produces the sequence 1,2,3,4,5

************************
Test10-5
@echo off

echo Test10: For {%%variable} in (set) do command [command-parameters]
echo For /parameter %%variable in (set) do (command)
echo notes: "For" has D/L/R/F parameter
echo notes: Bat file in the variable before adding "%%" to the normal operation

******
echo Test10-5.1: For /F ["options"] %variable in (file-set) Do command [command-parameters]
echo Test10-5.2: For /F ["options"] %variable in ("string") Do command [command-parameters]
echo Test10-5.3: For /F ["options"] %variable in (command) Do command [command-parameters]
echo notes: "options" has "eol/skip/delims/tokens/m-n/usebackq" paramerter
echo Notes: The following two command show the current year month day and actual


************************************************************************************************
:: ******************************************************************************
:: %cd% and %~dp0
:: 这两个变量都是用来表示当前目录,可使用时却大不相同,记录下
:: %cd%代表的是执行文件的当前目录,强调bat是在哪里启动的      ->盘符展开后是可改变的
:: %~dp0代表的是bat文件所在的文件目录,强调bat的文件位置     ->盘符展开后是不可改变的
:: 
:: 验证步骤如下:
:: 新建一个文件夹 cddp0,里面创建一份Test.bat文件
:: 然后在BAT_test文件夹创建一份 cddp0.bat 文件
:: 直接双击运行Test.bat文件
:: 直接双击运行 cddp0.bat 文件
:: 比较区别
:: ******************************************************************************

@echo off

start "" "%cd%\cddp0\Test.bat"
:: pause

:: start "" "%~dp0\cddp0\Test.bat"

************************************************************************************************
Notes:
1.https://author.baidu.com/home?from=bjh_article&app_id=1669257974205542

2.You can practice in conjunction with "DOS_BATCH_练习参考.7z" resource attachments.

<think>好的,我现在需要处理用户关于SAP事务代码/SCWM/DLV_PDI_BY_BATCH_ALL的查询。首先,用户想要了解这个事务代码的功能和使用方法。我记得在SAP的仓库管理模块(SCWM)中,很多事务代码与出库流程相关,特别是与批次管理相关的操作。 首先,我应该确认这个事务代码的具体用途。DLV开头的通常与交货相关,而PDI可能是指出库过程中的某个步骤,比如拣配、确认或过账。BY_BATCH_ALL可能涉及批次级别的处理。所以,初步判断这个事务代码可能用于批量处理基于批次的出库交货单。 接下来,我需要回忆这个事务码的标准操作流程。通常,这样的批量处理事务可能需要输入仓库号、选择条件(如批次号、产品、存储类型等),然后执行处理。可能需要检查后台配置是否支持批量处理,以及相关权限设置。 然后,用户可能需要知道具体的操作步骤,比如如何进入事务代码,输入哪些字段,执行后如何确认结果。此外,常见问题如权限不足、数据不匹配或系统报错如何处理也是需要考虑的。 我还需要确保回答的结构清晰,分点说明功能和步骤,并附上注意事项。同时,根据用户之前的示例,可能还需要生成相关问题,比如与其他事务代码的区别、配置方法或典型错误处理。 最后,验证信息的准确性,可能需要参考SAP官方文档或可靠资源,但由于无法直接查阅,需依赖已有知识确保正确性。如果有不确定的地方,应建议用户查阅官方资料或联系系统管理员。</think>### SAP事务代码 /SCWM/DLV_PDI_BY_BATCH_ALL 功能解析 #### 1. 核心功能 /SCWM/DLV_PDI_BY_BATCH_ALL 是SAP扩展仓库管理(EWM)中用于**批量处理基于批次的出库交货单**的事务代码,主要应用于: - 按批次属性(如生产日期、有效期)批量确认出库操作 - 支持跨多个存储类型的批次拣配 - 自动生成过账凭证和库存更新[^1] #### 2. 标准操作流程 ```abap 事务代码:/SCWM/DLV_PDI_BY_BATCH_ALL 步骤: 1. 输入仓库编号(必填) 2. 设置选择条件: - 批次号范围 - 产品主数据 - 出库交货单类型 - 存储类型/分区限制 3. 执行(F8)生成处理清单 4. 检查系统建议的分配策略 5. 确认处理(勾选后台处理选项) 6. 查看处理日志(VL06O可验证过账结果) ``` #### 3. 关键配置点 | 配置项 | 路径 | 作用 | |-----------------------|-----------------------------------|------------------------| | 批次策略分配 | SPRO > EWM > 出库流程 > 批次策略 | 定义批次选择规则 | | 后台处理参数文件 | /SCWM/CUSTOMIZING > 作业调度 | 设置批量处理资源分配 | #### 4. 常见问题处理 - **权限不足**:检查S_EWM_EXT角色中的/SCWM/DLV_PDI权限 - **批次不可用**:验证LS26N中的批次库存状态 - **库存不一致**:使用LT09调整库存或检查批次主数据
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值