0

我有一个录制的 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"
4

2 回答 2

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.ik] 包含网格的所有单元格。其中 i 是行号,k 是列号。

问候, ScriptMan

于 2017-10-27T09:02:37.267 回答
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

于 2017-10-25T10:00:16.180 回答