Standard print button is inoperative in custom Report - printing

My customer has reported a problem that standard ''print'' button in Z-report which a developer wrote before is not working.
How can I enable the button?
MODULE user_command_0100 INPUT.
DATA: GS_STATUS TYPE SLIS_STATUS,
XS_STATUS LIKE GS_STATUS.
CASE sy-ucomm.
WHEN 'BACK' OR '%EX' OR 'RW'.
LEAVE TO SCREEN 0.
WHEN '&RNT'.
ENDCASE.
ENDMODULE.

Then button needs a usercommand assigned, which is then processed in pai. usually with a general form called get_ucomm (many developers call it similar). You also can issue /h in transaction field and then press the print-button. /h will trigger the debugger and You can inspect the report step by step.
That's all I can say without seeing the code. Hope this will help.

Which user command do you define in your GUI status?
If you have a standard list (what I expect when you write about a z-report), then you should define the command PRI to print the list:
If you define a screen (using the screen painter) or an ALV-Grid... then this solution will not help you.
If you don't know, what a GUI status is: Scan your source code for the command
SET PF-STATUS 'XXXX'.
Then double click on 'XXXX' and you should be directed to the status definition. There may by multiple status (and status with generic names).

I've seen your code and for the &RNT option there's no code to execute, so if the user wants to print the button will do nothing.
MODULE user_command_0100 INPUT.
DATA: GS_STATUS TYPE SLIS_STATUS,
XS_STATUS LIKE GS_STATUS.
CASE sy-ucomm.
WHEN 'BACK' OR '%EX' OR 'RW'.
LEAVE TO SCREEN 0.
WHEN '&RNT'.
" There's no code
ENDCASE.
ENDMODULE.
I've used the 'STANDARD' GUI Status from the function group 'KKBL' and '&RNT' is the code of the print button and that's why I think that is the print button you are refering in your program.
Can you post the GUI Status you are using please?

Related

How to use AppleScript or Lua to do an ALT + TAB after results on the Calculator.app

I use the Calculator.app, and after hitting the ENTER key, I would like it to automatically do an ALT + TAB to go to the previous App I was using: Excel or Firefox or Chrome, ... you name it.
I have the same question for just .lua, but if it can't be done with .lua I'd like to do it with AppleScript or with the Automator.
What's the hot key for TAB in .lua? hammerspoon?
UPDATE:
As user3439894 says, CMD + TAB works fine.
But in my end, the TAB is not released, therefore, I keeps on showing all the open apps. So, I tried to put a RETURN as of the documentation. I also tried ENTER , but non of them work.
hs.eventtap.keyStroke({"cmd"}, "tab")
hs.eventtap.keyStroke({"return"})
-- hs.eventtap.keyStroke({"enter"})
Assuming your are using this in conjunction of one of the answers I gave you back in mid November regarding Calculator, then the modified Lua code below works for me to switch to the previous application when pressing the enter key while in Calculator.
Example Lua code:
-- Create a hotkey used to trap the enter key and disable it.
-- It will then be enabled/disabled as Calculator is focused/unfocused
-- When enabled and the enter key is pressed it presses = then command C.
applicationCalculatorEnterHotkey = hs.hotkey.bind({}, "return", function()
-- Press the '=' key to finish the calculation.
hs.eventtap.keyStroke({}, "=")
-- Copy the result to the clipboard.
hs.eventtap.keyStroke({"cmd"}, "C")
-- Bring up the App Switcher.
hs.eventtap.keyStroke({"cmd"}, "tab")
-- Act on the selected App in the App Switcher.
-- This works in testing with Calculator, however
-- may not work in other applications.
hs.eventtap.keyStroke({}, "=")
end)
applicationCalculatorEnterHotkey:disable()
Notes:
I've added two hs.eventtap.keyStroke to the original code with comments.
Executing hs.eventtap.keyStroke({"cmd"}, "tab") in the Console Hammerspoon does automatically switch to the previous application without showing the App Switcher, however when used in the applicationCalculatorEnterHotkey function it shows the App Switcher as if ⌘-Tab has been pressed and the ⌘ key not released. This may be a bug, not sure as not enough testing/research into the issue was done as the obvious solution would be to follow up with programmatically pressing the enter key, however that can not be done from within the applicationCalculatorEnterHotkey function because it is already trapping the enter key in Calculator.
In this particular use case, however this is where hs.eventtap.keyStroke({}, "=") is used to act as if the enter key had been pressed again and is unique to Calculator.

Issue in pexpect when text wraps within session

I am working on a pexpect script that is running populating an output file name and then a prompt for the file's parameters.
The program that the script runs asks for Device: then Parameters: always on the same line.... so if the file path-name that is entered for Device is long, sometimes the Parameters prompt wraps to the next line.
My code looks like..
child.expect_exact('Device:')
child.sendline('/umcfiles/ftp_dir/ftp_peoplesoft/discount/AES_DISCOUNT_15010.TXT')
child.expect_exact('Parameters:')
This times out.. and here is what is in child.before
' /umcfiles/ftp_dir/ftp_peoplesoft/discount/AES_DISCOUNT_15010.TXT Param\r\neters: "RWSN" => '
so the expect fails... (a child.expect('Parameters:') also fails)
How can I ignore the \r\n if it is there, because depending on the length of the path/filename I am using it may not be there at all, or be in a different position.
Thanks!
Actually... I found a way to calculate how much is left on the given line, and dynamically set my expect to how much of the Parameter prompt should be visible... seems to be working
#look for end of line and fix how much of 'Parameters:' we look for in pexpect
dlen = 80-len('Device: /umcfiles/ftp_dir/ftp_peoplesoft/discount/AES_DISCOUNT_15010.TXT')
pstr='Parameters:'
if dlen > len(pstr):
dlen=len(pstr)
else:
dlen=dlen-3 #remove the /r/n
child.expect(pstr[0:dlen])

How to execute a native Inventor Command?

First post!!
The code (snippet listed below) compiles, builds, runs without any errors. MessageBox.Show("New Sketch") runs without an issue, but cd.Execute() does not appear to fire.
When I do a quick watch on 'cd.Execute()' the information displayed reflects that the correct command is being accessed, but nothing happens on screen.
As this is my very first addin to try and write, I'm pretty green behind the ears. I've done some extensive Googling, but apparently I'm googling the wrong terms.
Any assistance is appreciated!
Code Snippet:
Private Sub m_Sketch_OnNewSketch(DocumentObject As _Document,
Sketch As Sketch,
BeforeOrAfter As EventTimingEnum,
Context As NameValueMap,
ByRef HandlingCode As HandlingCodeEnum) _
Handles m_SketchEvent.OnNewSketch
Select Case BeforeOrAfter
Case EventTimingEnum.kBefore
Case EventTimingEnum.kAfter
Dim cd As ControlDefinition =
m_inventorApplication.CommandManager. _
ControlDefinitions.Item("SketchSliceGraphicsCmd")
cd.Execute()
MessageBox.Show("New Sketch")
Case EventTimingEnum.kAbort
End Select

Bind multiple actions to one key in lighttable

I'm using the vim plugin in lighttable.
When I'm in insert-mode and press ESC while a code completion window is shown, it closes that window but doesn't exit insert mode.
I'd like lighttable to do both at the same time when pressing ESC because I got so used to it in plain vim.
I've tried to bind ESC to both of those actions:
[:app "esc" [
:auto-complete.remove
:vim.send-key "esc"
]
]
But this doesn't work. Is this even possible? Is there another workaround for that problem?
You should be able to do this by adding the following to your user.keymap file:
[:editor "esc" :auto-complete.remove (:vim.send-key "<Esc>")]
But this isn't currently possible.
I created an issue for this on GitHub for the LT Vim plugin repo. 'Fixing' this is relatively minor change to CodeMirror upstream of LT. I'll update this answer again if any other progress is made.

VB6, ActiveReports, and Ricoh printers: Rotating the Page?

I have a BEAST of a program written in VB6. It uses ActiveReports to generate letters.
The reports are processed in a loop; with verbage-building loops and (a whole lotta) nested 'if' and 'case' statements. Fugly!
The reports are sent to the printer like such:
Function PrintIt(ltrobj as Object)
Set ltrobj = MyARdocument '(.Dsr file)
ltrobj.txtfield1 = strVerbage 'This string was populated somewhere else
ltrobj.Printer.DisplayProgressDialog = False
ltrobj.PrintReport False
End Function
Now here's the weird part: The pages physically come out of the printer rotated 90 degrees each iteration of the loop. What's even weirder -- this only happens for my VB6 application -- other Word documents, reports, batch jobs, whatever come out normal.
So the first page comes out like normal, the header first (pointing North). The second page comes out sideways (header pointing West). The third comes out of the printer like the first, the fourth comes out like the second, and on and on...
The printer: A Ricoh Aficio MP5000
I cannot find a setting on the printer, or a property in ActiveReports that controls this.
Any ideas, help, or a general direction would be greatly appreciated!
Thanks,
Jason
There is no "rotation" setting in ActiveReports. The closest things that might impact this would be the page size and orientation, but at worst I would expect them to flip back and forth not actually rotate the page. I would try to do a few things:
Trace the printer & page settings related to orientation and page size as report prints.
Try printing to another printer to see if it happens on all printers or just this one.
Preview the reports on screen and see if they're rotated in the preview or not (or export them to PDF with report.Export(...) ad see if they're rotated there).
To trace page settings you should do it in a couple places. One on the printer, and another on each page (or Canvas) in the report. There is also the ActiveReport.PrintWidth (the width of the report, not the pages) that may also be relevant. So just before printing each report try tracing out the following values:
report.PrintWidth
' the default settings for the report
report.PageSettings.TopMargin
report.PageSettings.RightMargin
report.PageSettings.BottomMargin
report.PageSettings.LeftMargin
' actual printer's current settings:
report.Printer.PaperSize
report.Printer.PaperHeight
report.Printer.PaperWidth
report.Printer.Orientation
' settings for a specific page:
for each page in report.Pages:
report.Pages(...).Width
report.Pages(...).Height
report.Pages(...).Orientation
BTW: ActiveReports COM Help is here.
If the preview/PDF test seems okay then I'd focus on the printer itself. Same for the print to another printer obviously. Otherwise, focus on ActiveReports settings.
Hope this helps
Scott Willeke
GrapeCity

Resources