SAP Public sector implementation notes and the difficulties faced during the implementation. It also has a detailed technical information that I'd like to share to the SAP development community.
Monday, December 18, 2006
Thursday, December 14, 2006
HTML control used as a web browser
1. Go to transaction SMW0





7. Then click on the glasses (to display), you can see the base page in a browser.
To enable the web browser, copy the following code into a new executable program:
*&---------------------------------------------------------------------*
*& Report ZNUT_WEB_BROWSER_NEW *
*&---------------------------------------------------------------------*
* Sample program to demonstrate the HTML Control be used as a WEB BROWSER
* Siva Thiagarajan
REPORT ZNUT_WEB_BROWSER_NEW.
INCLUDE
INCLUDE CNHTINCL.
DATA: H_HTML_CONTROL TYPE CNTL_HANDLE.
DATA: B_INIT TYPE C.
DATA: PROG_REPID LIKE SY-REPID.
DATA: FCODE LIKE SY-UCOMM.
DATA: URL(1024).
SET SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'TESTHTM1'.
SET TITLEBAR '001'.
IF B_INIT IS INITIAL.
CALL FUNCTION 'CONTROL_INIT'.
PROG_REPID = SY-REPID.
CALL FUNCTION 'HTMLCNTL_CREATE'
EXPORTING
OWNER_REPID = PROG_REPID
LINK_REPID = PROG_REPID
DYNNR = '0100'
CONTAINER = 'HTML_CONTAINER'
CHANGING
HANDLE = H_HTML_CONTROL.
B_INIT = 'x'.
CALL FUNCTION 'HTMLCNTL_INIT'
EXPORTING
H_CONTROL = H_HTML_CONTROL
REGISTER_EVENT_ON_NAVIGATE = 'x'
CB_FORM_NAVIGATE_COMPLETE = 'ON_CONTROL_EVENT'.
PERFORM LOAD_HOME_PAGE.
CALL FUNCTION 'CONTROL_FLUSH'.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
CASE FCODE.
WHEN 'BACK'.
IF NOT B_INIT IS INITIAL.
CALL FUNCTION 'HTMLCNTL_DESTROY'
CHANGING
H_CONTROL = H_HTML_CONTROL
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'CONTROL_FLUSH'.
ENDIF.
LEAVE PROGRAM.
WHEN 'HHOM'. " show the home page
CALL FUNCTION 'HTMLCNTL_GO_HOME'
EXPORTING
H_CONTROL = H_HTML_CONTROL.
CALL FUNCTION 'HTMLCNTL_GET_CURRENT_URL'
EXPORTING
H_CONTROL = H_HTML_CONTROL
IMPORTING
URL = URL.
WHEN 'HBAK'.
CALL FUNCTION 'HTMLCNTL_GO_BACK'
EXPORTING
H_CONTROL = H_HTML_CONTROL.
CALL FUNCTION 'HTMLCNTL_GET_CURRENT_URL'
EXPORTING
H_CONTROL = H_HTML_CONTROL
IMPORTING
URL = URL.
WHEN 'HFWD'.
CALL FUNCTION 'HTMLCNTL_GO_FORWARD'
EXPORTING
H_CONTROL = H_HTML_CONTROL.
CALL FUNCTION 'HTMLCNTL_GET_CURRENT_URL'
EXPORTING
H_CONTROL = H_HTML_CONTROL
IMPORTING
URL = URL.
WHEN 'HRFR'.
CALL FUNCTION 'HTMLCNTL_DO_REFRESH'
EXPORTING
H_CONTROL = H_HTML_CONTROL.
CALL FUNCTION 'HTMLCNTL_GET_CURRENT_URL'
EXPORTING
H_CONTROL = H_HTML_CONTROL
IMPORTING
URL = URL.
WHEN 'HNAV'.
CALL FUNCTION 'HTMLCNTL_SHOW_URL'
EXPORTING
H_CONTROL = H_HTML_CONTROL
URL = URL.
WHEN OTHERS.
CALL FUNCTION 'CONTROL_DISPATCH'
EXPORTING
FCODE = FCODE.
ENDCASE.
CLEAR FCODE.
ENDMODULE. " USER_COMMAND_0100 INPUT
* Callback form for the event 'NavigateComplete'
callback on_control_event.
CALL FUNCTION 'CONTROL_GET_EVENT_PARAM'
EXPORTING
H_CONTROL = H_HTML_CONTROL
PARAM_ID = 0
CHANGING
RETURN = URL.
endcallback.
* Homepage form
FORM LOAD_HOME_PAGE.
DATA: DOC_URL(80).
CALL FUNCTION 'HTMLCNTL_LOAD_HTML_DOCUMENT'
EXPORTING
H_CONTROL = H_HTML_CONTROL
DOCUMENT_ID = 'ZSIVA_BLOG'
IMPORTING
ASSIGNED_URL = DOC_URL
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC EQ 0.
CALL FUNCTION 'HTMLCNTL_SHOW_DATA'
EXPORTING
H_CONTROL = H_HTML_CONTROL
URL = DOC_URL.
ENDIF.
ENDFORM. " LOAD_HOME_PAGE
Fine print:
1. Please create a pf-status TESTHTM1




BDT Development - II
- Execute grants management BDT development transaction (GRANT_CUSTOMIZE)
- Grant Master BDT Customizing-> Screen layout and select ‘Field groups’(GMS2)


‘Field Group-> Fields’ folder option from the left column. Now enter your fields, for this example I have created some new entries which will be added as part of a new tab.



- Return to main BDT customizing screen and select ‘Views’(GMS3). Then click the ’New Entries’ button. In this example I've created a view called ZMG007 (Internal information ). The View is the important part of this development as majority of the development happens here in this place. The view is a logical collection of field group and is a screen by itself. You will have a screen developed which will have a PBO and PAI routines. In addition to that we will have three place holders in which we can have our own routined to perform the requiredtasks. They are:
(a) Before screen call-up
(b) Before Output
(c) After Entry








Return to main BDT customizing screen and select ‘Screen Sequence’(GMS6). Then select the screen sequence entry and double click on the Screen Sequence -> Screens folder option from the left column.


Execute transaction BUSP (click on option from main grant customizing menu), new screen will now appear as tab on grant master transaction ‘GMGRANT’

That's All!!!! As usual if in doubt, please post your comments.
Monday, November 06, 2006
Generic Object Services
Overview:
The business object and its related services can be linked using Generic object services. This is a very clean way of seeing thing right from the application which can be either master data or transactions. This document explains the ways to link the objects that are created in the customer name space. Most of the SAP’s standard services are pre built to perform this action.
When you publish the custom Business object using the function module ‘SWU_OBJECT_PUBLISH’ , a object service toolbox appears for the related business object in its business transaction.
The following services can be started in the toolbox,
Toolbox Entry | Submenu | Link to Description |
Create... | Create Attachment | Appending a PC Document to an Object |
Create Note | Creating a Note for an Object | |
Create External Document (URL) | Appending a Link to a Web Page | |
Store Business Document | Appending and Archiving a PC Document to an Object | |
Enter Bar Code | Assigning an Object the Bar Code of a Document | |
Attachment List | | Displaying Attachments |
Personal Note | | Creating a Personal Note for an Object |
Send Object with Note | Send Object with Note | Sending an Object with a Note |
Object Outbox | Displaying the Object Outbox | |
Display Relationships | | Displaying Relationships |
Workflow | Workflow Overview | Displaying Workflows for an Object |
Archived Workflows | ||
Start Workflow | Starting a Workflow for an Object | |
My Objects | Add to My Objects | Adding Object to your Favorites |
Subscribe/Cancel Object | Subscribing to Messages About Changes to an Object | |
Telephony | | Telephony |
Actions | | Activating PPF Actions |
In this example document, We will try to demonstrate the incoming and outgoing Idocs can be linked to the Business object and they can be viewed using the relationship service in the toolbox from within the application. The scenario here will be like theis:
The Idocs are created in a separate ALE distribution program and not in the same business transaction. The objective is to link the Idocs created in the separate program to its corresponding business object and should be made available in the relationship service.
The following steps are involved for linking the Idoc to its corresponding Business object.
For illustration let us link the outbound and inbound Idocs to the customized business object ‘Bank account’ (ZUNBANK).
Before linking the Idoc with the business object, the relationship service in the tool box appears disabled as below, meaning that the system cannot show or display the related service objects.
For Outbound Idoc:
Step 1: BDA4: Link the Idoc message type to the Business object type. In this example the message type, the idoc and the business objects are all in the customer name space.

The Idoc message type is linked to the object type.
Step 2:BD95: Define the ALE object type. This is just an object definition and link this to the master table and the key field.
Step 3: BD57: Define the link object type for the message type.
Step 4: BD59: Assignment of object type to message
Step 5: Execute the corresponding ALE distribution program and create the Idoc.
Now the relationship service in the toolbox is enabled.
The corresponding Idoc is displayed
For Inbound Idoc:
The inbound idoc linking is a little bit trickier than the outbound. In the case of the outbound, the file creation is in our hands and we can establish the linkage as we create and distribute the file, whereas in the inbound the same needs to be accomplished in the inbound function module. Though it is only a single step action, I’ll try to put in my next posting.
Thanks to my colleague Praveen Antony for his contributions for this document preparation.
Thursday, November 02, 2006
BDT development
Business Data Toolkit (BDT) is the new way of programming in SAP. This is available in IS-PS (public sector) solution and I guess this is available in some other IS solutions such as insurance etc., This is a concept in which SAP provides you all the development components with which you can build your own screens and fields and weave it nicely within the existing SAP application. This is available mostly for the master data maintenance.
Given this input, I'll try to explain the concept in which I understood. Every SAP transaction can be thought in abstract to have the following components:
1. Data element & Domains
2. Screen fields
3. Field grouping (functional set of fields)
4. Views (Combination of one or more field group)
5. Sections (Combination of one or more views)
6. Screen (Combination of one or more sections)
7. Transaction (With one or more screen in a pre determined sequence)
If this above concept is clear, then it is very easy to understand and can even start development using BDT. For those who do not have enough exposure to the Grants or other modules that have BDT, I’ll try to give an analogy using the customer master record.
In the customer master the fields that are in the KNA1 table are the data elements and domains. The screen fields are the same as the data element, but the screen needs to be built and the definition of the screen specific parameters was defined in SAP’s delivered screen itself. For example the customer name is the data element AD_NAME1 and the related screen field is ADDR1_DATA-NAME1 (Program SAPMF02D/Screen 7000)
The field grouping is the group of functionally related screen fields, which can be turned as Required, Optional or Hidden using the configuration. In this case it could be the set of fields that cover the Street address
The views can be Street address and the PO Box address together
And the Section may be the combination of Name, Search term, Street address and the PO Box address.
The screen could be the Address, Control Data, etc.,
The screen sequence is defined and the transaction XK01/02/03 is created.
With the same idea in mind SAP had given the same concept as a development tool. This eliminates the need of extending the SAP’s standard table by appending structure. And also it gives you the flexibility to append two dimensional objects such as tables as well.
Wednesday, November 01, 2006
interesting problem
Most of the trivial programming requiremets are such as GUI operations, MS office interface, etc., can be easily built using the standard functions and can be kept as a tool kit. This will obviously be a effective methadology, as you don't have to dig over and over for the most common jobs.
Let me start posting the ABAP routines, I've developed, which can be used in any implementation.
The first posting will be a reading Excel file from the presentation server. This upload will take care of the excel files which contain macros as well.
Try and let's know if you are having fun
*&---------------------------------------------------------------------*
*& Report ZZ_TEST_EXCEL_LOAD *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT ZZ_TEST_EXCEL_LOAD .
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
* At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
***********************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
***********************************************************************
* END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.
Thursday, October 05, 2006
Let's go to the business
SAP Public sector is not so different from others in majority of the aspects. The functional structure of the module makes it differ with the mainstream SAP solutions.
In IS-PS the existance of Funds Management (FM), rants Management (GM) and Budget control system (BCS) are the three major new areas that available in addition to the common logistics, FI, CO modules. Even HR can be very similar only if your organization is so unique as United Nations and whichhas its own est of rules and procedures. And SAP is also in the process of delivering UN specific HR module soon.
In the next coming days we can discuss more in detail on Funds andGrants module and also follow up on the Budget Control System. I'll try to give as much as functional background and technical information to make the reading easier.
Wednesday, October 04, 2006
My current assignment
We have a team of three functional members and a team of five ABAP programmers supporting this project. I'm very happy to work with this team as the members are so knowledgeable and bring in to the team a lot of value addition.
In the programming most of the concepts are new and we learned a lot along the implementation. I'll soon request my team members to share their valuable ideas.
Tuesday, October 03, 2006
About Me

I started my SAP career back in 1995 in India. And I assume, I'd have been the one of the first set of people who had an opportunity to learn and work on SAP. After my initial training in SAP for about one year, I came to US eying for a project and in all practical sense a real life experience.


My next project was at Phillips automotive electronics at Auburn, Indiana. This is a very small

My next stop was at Nash Finch Company at Edina, Minnesota. I was working for


Next assignment was at Maxtor Corporation at Longmont, Denver. I was working for Pricewater house (not PWC at that time!). I was taken as the team lead for the EDI team till the


I got in to my next project with Wicto Corporation as I got the interview done in India and flew in and joined the project after my one month vacation in India. I was in charge of all EDI

My next stop was to get in to a permanent position.