我有一个录制的GuiXT脚本,当我运行它时,它会在桌面上生成一个返回材料的报告,作为“returns.XLSX”。我有另一个脚本,如果来自列A(returns.XLSX)的数据在剪贴板上但我是一个手动过程,我可以运行该脚本。我的问题是,有没有办法通过GuiXT脚本将一个报告中的数据用于另一个报告?
// SAP Easy Access
Screen SAPLSMTR_NAVIGATION.0100
Enter "/nZT9VSNUC_REP_RET"
// Returns Report
Screen ZT9VS_REP_RETURNS.1000
Enter "=%001" // Multiple selection
// Multiple Selection for Sales Organization
Screen SAPLALDB.3000
Set cell[Table,Single value,2] "CA30"
Enter "/8"
// Returns Report
Screen ZT9VS_REP_RETURNS.1000
Enter "=%001" // Multiple Selection (Active)
// Multiple Selection for Sales Organization
Screen SAPLALDB.3000
Enter "/8"
// Returns Report
Screen ZT9VS_REP_RETURNS.1000
Enter "=%005" // Multiple Selection (Active).2
// Multiple Selection for Sales Document Type
Screen SAPLALDB.3000
Enter "/16"
// Multiple Selection for Sales Document Type
Screen SAPLALDB.3000
Set cell[Table,Single value,1] "YBRE"
Enter
// Multiple Selection for Sales Document Type
Screen SAPLALDB.3000
Set cell[Table,Single value,2] "YBKL"
Set cell[Table,Single value,3] "YBG1"
Enter "/8"
// Returns Report
Screen ZT9VS_REP_RETURNS.1000
Set F[Created on] "&V[MYDATE]"
Set F[Created on to] "&V[END_DATE]"
Enter "/8" // Execute
// Returns Report
Screen SAPLSLVC_FULLSCREEN.0500
Enter "%_GS 0 1"
// Returns Report
Screen SAPLSLVC_FULLSCREEN.0500
Enter "/Menu=1,4,2" // Spreadsheet...
// Returns Report
Screen SAPLSLVC_FULLSCREEN.0500
Enter "/N"
答案 0 :(得分:1)
在这种情况下,它应该更好地工作如下:
...
// Returns Report
Screen ZT9VS_REP_RETURNS.1000
Set F[Created on] "&V[MYDATE]"
Set F[Created on to] "&V[END_DATE]"
Enter "/8" // Execute
//----------new----------------------------------------------
Screen SAPLSLVC_FULLSCREEN.0500
GetGridValues -prepare
Enter "/5" // Select All
Screen SAPLSLVC_FULLSCREEN.0500
GetGridValues selectedcells="myGrid" selectedrowcount="r"
Message "&V[r] rows selected" -statusline
Enter
//----------new----------------------------------------------
// Returns Report
Screen SAPLSLVC_FULLSCREEN.0500
Enter "%_GS 0 1"
// Returns Report
Screen SAPLSLVC_FULLSCREEN.0500
Enter "/Menu=1,4,2" // Spreadsheet...
// Returns Report
Screen SAPLSLVC_FULLSCREEN.0500
Enter "/N"
变量V [myGrid.i.k]包含网格的所有单元格。其中i是行号,k是列号。
此致 ScriptMan
答案 1 :(得分:0)
在类似的情况下,我使用了以下内容:
. . .
copytext totext="t1" -fromclipboard
copytext fromtext="t1" tofile="&V[MyDirectory]\clip.txt"
set V[l] 1
label next_Data
readfile "&V[MyDirectory]\clip.txt" Par1_&V[l] Par2_&V[l] Par3_&V[l] Par4_&V[l] Par5_&V[l] Par6_&V[l] Par7_&V[l] Par8_&V[l] Par9_&V[l] Par10_&V[l] Par11_&V[l] Par12_&V[l] Par13_&V[l] Par14_&V[l] Par15_&V[l] Par16_&V[l] Par17_&V[l] Par18_&V[l] Par19_&V[l] Par20_&V[l]
if not V[Par1_&V[l]]
goto end_Data
else
set V[l] "&V[l]" + 1
goto next_Data
endif
label end_Data
closefile "&V[MyDirectory]\clip.txt"
. . .
此致 ScriptMan