天天看點

SAP Form print tool

Sent: Thursday, October 30, 2008 8:05 PM

By using the test tool, we can:

directly trigger the form printing without doing lengthy steps in portal work center or in ESI_BO_TEST_TOOL. Save a lot of time in badi debugging.

download the PDF and XML data file locally, without getting them from debugging.

if there is something wrong with form output, tool can report the exact error location. If we do output in the portal and something goes wrong, we get nothing but 500 error.

How to use the tool

SE38, run report Z_FORM_PRINT, Select BO proxy name, BO_ID,printer code , template code and template group code, and select the PDF and XML data file folder. In this example I want to print DeliveryNote 1.

Then just click F8, and the real printing will be triggered.

SAP Form print tool

You can get the pdf and xml file stored in your local laptop, and the form is printed by the printer.

SAP Form print tool

If you are interesting in the tool implementation, you can refer to followings:

FORM_TOOL~GET_OUTPUT_CONTROL_REQUEST:

implementation: association from hosting BO to CNTL_OUTPUT_REQUEST, then the ControlledOutputRequest.Root will be generated by BOPF automatically.

FORM_TOOL=>GET_OUTPUT_PRINT_ITEM:

implementation: execute action REFRESH_DEF_OR, which will trigger output parameter service to retrieve the output parametersets, which in turn will trigger PAF, message is assembled in this step.

FORM_TOOL=>SET_PRINTER:

implementation: change printer settings in ControlledOutputRequest.Item

FORM_TOOL=>PRINT

implementation: trigger real print action.

這個tool是我經過以前一段時間閱讀OM和AP的代碼之後用業餘時間寫的,能夠自動觸發整個process agent framework 和form output的操作,是以能夠觸發我們badi裡的斷點,把生成的PDF和XML儲存到本地,同時在SPOOL裡面能看見output ID,在列印機處拿到打出來的form. 主要的logic都跑通了,如果覺得确實有些價值的話,我可以把它改成支援所有的form output,effort也不大.最初寫的目的主要還是練習ABAP和進一步熟悉OM 代碼.