0

I have a recorded GuiXT script, When I run it, it produces a report of returned material on the desktop as "returns.XLSX". I have another script that I can run if the data from column A (returns.XLSX) is on the clipboard but that is a manual process. My question, is there a way use the data from one report for another report via GuiXT script?

// 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"
Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
mickNeill
  • 346
  • 5
  • 22

2 Answers2

1

In this case, it should work much better as follows:

...
// 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"

The variables V[myGrid.i.k] contain all the cells of the grid. Where i is a line number and k is a column number.

Regards, ScriptMan

ScriptMan
  • 1,580
  • 1
  • 9
  • 9
0

In a similar case I used the following:

. . .
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"
. . .

Regards, ScriptMan

ScriptMan
  • 1,580
  • 1
  • 9
  • 9
  • Any idea how to incorporate that into the script I just added? – mickNeill Oct 25 '17 at 12:13
  • I do not know the transaction unfortunately, but i could imagine that the required column A is not only present in Excel, but is already visible on screen. Is it so? If so, are the data on the screen in a grid? – ScriptMan Oct 26 '17 at 12:20
  • Yes, the data is in excel but can be present on the screen as well, yes it would be in a grid – mickNeill Oct 26 '17 at 12:33
  • OK, the data is displayed on the screen and you have marked the appropriate column. If you press the right mouse button at this moment, you will see the function = "TextCopy" in the context menu. Is it so? – ScriptMan Oct 26 '17 at 12:45
  • it does but when I click copy, it says not all the data has been copied – mickNeill Oct 26 '17 at 12:56