Aug 12 2010

Embedding paint.exe in SAP GUI transactions

Here is some code to embed the paint application into a GUI application. Tablet signatures, anyone? However, my preferred approach is using a Flex components in web dynpros - much slicker but you will need EP1 for NW.

report zzzzzzzz.

include ole2incl.

selection-screen begin of screen 1100.
selection-screen end of screen 1100.

*———————————————————————-*
* CLASS cl_paint DEFINITION
*———————————————————————-*
class cl_paint definition.

public section.

methods:
constructor,

on_close_document
for event on_close_document of i_oi_document_proxy
importing document_proxy has_changed.

private section.

data:
go_control type ref to i_oi_container_control,
go_proxy type ref to i_oi_document_proxy.

endclass. “cl_paint DEFINITION

*———————————————————————-*
* CLASS cl_paint IMPLEMENTATION
*———————————————————————-*
*
*———————————————————————-*
class cl_paint implementation.

method constructor.

data:
retcode type soi_ret_string.

*– Create the OLE control
call method c_oi_container_control_creator=>get_container_control
importing
control = go_control
retcode = retcode.
call method c_oi_errors=>raise_message
exporting
type = ‘E’.

*– Attach the OLE control to the screen container
call method go_control->init_control
exporting
r3_application_name = ‘Signature Pad’(000)
inplace_enabled = ‘X’
inplace_scroll_documents = ‘X’
parent = cl_gui_container=>screen0
register_on_close_event = ‘X’
register_on_custom_event = ‘X’
importing
retcode = retcode.
call method c_oi_errors=>raise_message
exporting
type = ‘E’.

*– Create a proxy to the Paint application in the OLE container
call method go_control->get_document_proxy
exporting
document_type = ‘Paint.Picture’
document_format = ‘OLE’
importing
document_proxy = go_proxy
retcode = retcode.
if retcode ne c_oi_errors=>ret_ok.
exit.
endif.

*– Create a new paint document
call method go_proxy->create_document
exporting
create_view_data = ‘X’
open_inplace = ‘X’
importing
retcode = retcode.
if retcode ne c_oi_errors=>ret_ok.
exit.
endif.

set handler me->on_close_document for go_proxy.

endmethod. “constructor

method on_close_document.

” Save the signature here

endmethod.

endclass. “cl_paint IMPLEMENTATION

start-of-selection.

data:
go_picture type ref to cl_paint.

create object go_picture.

call selection-screen 1100.


Aug 12 2010

How to print PDF forms from the SAP spooler

As of SAP Web Application Server 6.40, you can create a form in the new PDF-based form solution, which is integrated into the ABAP Workbench (SE80) and the SAP NetWeaver Developer Studio… more


Aug 12 2010

Text descriptions for object types

Where does SAP store the text for object descriptions in SE10 - TRE071X-OBJ_DESCRI ?

Not in a table. By analysing the search help SCTSOBJECT I found a form called GET_SYSTEM_TYPES in program SAPLTR_OBJECTS. Here all the object texts are hard coded and populated into an internal table with the KO100 structure.


Aug 12 2010

Connect SAP R/3 4.6C and SharePoint 2003 - Part III: Develope SharePoint Web Parts

In this tip, I will introduce how to implement the two SharePoint web parts after getting the SAP data via SAP proxy as last tip. I will only high light some key points. More SharePoint development knowledge please check Microsoft web site. There are two web parts. In the first web part, "Customer List" provider web part, It can return a customer list when users enter some search string in a text box. Then if users choose a customer from a dropdown list. Then it passes the Customer Number to the second web part, "Sales Orders/Items" web part. The second web part shows all sales items for a chosen customer. The first web part demonstrates how to get customer list via invoking RFC_Customer_Get function while the second web part demos about how to get sales items info via invoking a BAPI function called BAPI_SALESORDER_GETLIST.


Aug 12 2010

Use SQL2005 to Connect and Present SAP on SharePoint / Business Scorecard Manager — Part I

SQL 2005 is a Microsoft latest product. It provides a new way to access SAP data via new feature pack of.NET Provider for mySAP. The reports on SQL 2005 report server can be easily to display on another Microsoft product, SharePoint Portal Server or Windows SharePoint sites. And what’s more, after SAP data is extracted into SQL 2005 database, we can do more business intelligence work and then present drill through web tables on report server web sites / SharePoint pages, even to use analysis service result to build company KPIs and lastly use Microsoft Business Scorecard Manager 2005 to present KPIs in a visible way on SharePoint Pages.