7.31.2008

FAQ, Hints, Tips and tricks in HR, Do & not to do (Warnings)

FAQ:

1. What exactly is an infotype? Why are infotypes only required in HR?

A. An infotype is a collection of logical and/or business-related characteristics of an object or person. I don't know exactly how to answer the second question but it is safe to say that items such as materials have similar structures that act like infotypes. The one outstanding difference that I really see is the concept of time constraints that infotypes use for interpreting data during a specified period.

2. List the HR Process

i) Hiring
ii) Transfer
iii) Promotions
iv) Leaving

3. We use clocking machine for recording employee clock-in/out. All the data is stored in a 'flat' file, which is supposed to be uploaded into SAP. When tried to pen
and read the flat file using OPEN DATASET and READ DATASET commands, the Sy-
subrc value returned is 8 and the error message 'the specified file not found' is
displayed. We checked the path and the file is in the correct location. What is missing?..........

3. We use clocking machine for recording employee clock-in/out. All the data is
stored in a 'flat' file, which is supposed to be uploaded into SAP. When tried to open
and read the flat file using OPEN DATASET and READ DATASET commands, the Sy-
subrc value returned is 8 and the error message 'the specified file not found' is
displayed. We checked the path and the file is in the correct location. What is missing?

A: Check the path once again. Check the upper and lower cases. Define you parameter file
name like filename-file extern. Depending on the place where the flat file resides, the
procedure varies. OPEN DATASET is used for upload of file from the host system. If your flat
(text) file is on the PC, you can use the function WS_UPLOAD that will upload your text file
into an internal table. This internal table data can be loaded into SAP. The syntax is as follows:
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = pcfile
IMPORTING
FILELENGTH = fileleng
TABLES
DATA_TAB = internal table name
Please note that you have to specify the pcfile of length 128.

4. What are the logical Databases that we use in the HR? And the difference between
them.

A.1. PCH: Organizational Data
2. PNP: For personnel Data
3. PAP: Application Data

5. We want to make a copy of an organizational structure from one plan variant to
another. This copy should include all assignments like purchasing groups to
organizational units made in PFOM. Can we do this?

A: Make sure that the plan number is established through the IMG. (And that it is not the
active plan.)
Go Human Resources -> Organizational Management Tools -> Plan version -> Copy.
It runs RHCOPL00. All or any portion of the plan maybe copied and manipulated and then
copied back in to the active plan.

6. What are the infotypes that you cannot enhance?

A. Infotype 0000 Single Screen, Time management Infotypes

7. We have a requirement to calculate leave entitlement at the anniversary year not
calendar year. The leaves have both paid and unpaid components. The paid
component is based on time worked. The unpaid component is based on years of
service. Leave taken is reduced from both entitlements depending on employee's
request. We are using a Schema based on TM04, which calls Cycles TS15, TS10. What
is the best way to handle this?

A: You can use field 'DAUER' for seniority based vacation entitlement in the VAC01->VAC99
features. Time worked is not part of the feature structure (PME03). However you may create
your own source code to make a decision on any field even if it does not belong to the feature
structure. Check feature VAC01.

8. What are the ways to process infotypes?

A. We can read an infotype using macros and provide and end provide commands

9. We have multiple ORGs as we have many subsidiaries of our Parent company.
These subsidiaries are defined as ORG and are assigned an ORG-ID. Within each ORG,
we have Divisions (e.g. Human Resources, Finance, and Materials etc.) and within
each division we have Departments (e.g. Payroll, Labor Relations, etc.). We plan to
use Personnel Development (PD). What is that we have to consider in this case?

A: You have to consider how the company wants to see its reports while designing the HR
organizational structure in PD. You have addressed the question: for headcount or regulatory
reports to which level does the company need to report, to the division, department, and
group or team level. You have to design the SAP organizational structure to support the
lowest level required. Lower the more levels of detail, the more maintenance required.

10. When you create an infotype it creates screens, on what basis it creates the
screen elements?

A. On the basis of the PS structure that we create while creating an infotype.


11. How can we configure the options for the Assgn Form. No. field on Infotype 210.
It is the alternate formula to assign tax field and we have been unable to locate the
table in the IMG to edit the options.

A: Options for the BSI Tax Formula cannot be configured.
Possible entries are available in BTXFORM, and they depend on the 'tax authority' (BTXAUTH)
and the 'tax type' (BTXTAXT). Use data dictionary to check existing entries. This data comes
from BSI. Tax calculations are done in the
BSI programs (via RFC from the USTAX function in the payroll schema).

12. How many types of screens are created while you create an infotype

A. 1. Single screen, 2. List Screen

13. We are using the US HR/PAYROLL module. We are able to create the entry to
credit the accrued payroll account. But our check writing process does not produce
any accounting entries when we create a paycheck or run our EFT process
(RFFOUS_T). Should RFFOUS_C produce an accounting entry to debit the payroll
payable account and credit the cash account?

A: RFFOCUS_C does not produce any accounting entries. During the FI/CO interface run, 559
wage types may be posted to your cash account

14. We have approximately 10000 zip codes. We want to relate the eligibility group
to the zip code. We do not want to create 20000 eligibility groups. Which is the best
way to configure basing eligibility for HMO's on zip codes?

A: Try to group the zip codes by the HMO's they belong to. Then create benefit groups and
programs for the unique combinations. You can create as many benefit groups as required
and use the employee zip code to select the benefit group the employee is eligible for. You
may also look at user exit 2.

15. We are using the PAI user exit in MP000800 screen 2000 to modify the BET01
field. After modifying the value, the value is not re displayed. However the updated
value is saved on commit. Why the value is not displayed after modification?

A: Yes. It is true. You may have to apply OSS

16. I have a requirement in which I have to display the free text associated with an
entry in infotype 0028. Until now I've just gone nuts debugging the code. Can you
please let me know how to do it?

A. Can you be more specific here? I have never used 0028 but in investigating a system with
PCC loaded, none of the subtypes have free text associated with them. Is it possible that you
are speaking of something attached via object services? If so I can give you code that will read
those items (hint: look at table SRRELROLES and SOOD). If it is not that then please tell me
which subtype you are looking at and what screen field the free text is in. I can give you the
answer at that point.

17. I have copied report HRBEN0074 and now I want to change the currently
displayed amount coverage from bi-weekly to monthly. How can I do that?

A. I assume you mean bi-weekly costs since coverage does have a biweekly or monthly
amount. A quick look at the program tells me that you would need to modify ALV_ITAB
around line 260 and change the field you wish to convert into the correct amount. The field
you are looking for is probably either ERCST or ACCST.

18. SAP doesn't allow two actions on the same day. There are occasions where a
person could be ending maternity leave and starting a career break on the same day.
Any suggestions on how to overcome this?

A. SAP cannot store two infotypes of time constraint 1 with the same subtype on the same
day, because the date delimitation is the same. One of the infotypes would be overwritten.
Because there are many occasions when an employee may experience multiple personnel
actions on the same day, SAP created "Additional Actions" (infotype 0302) to capture these
additional actions. This infotype cannot be maintained directly, but it is located for viewing at
the bottom of the Actions infotype (0000). To take advantage of this functionality, you need
to set it up using the following IMG path:
Personnel Management -> Personnel Administration -> Customizing Procedures -> Actions -
>Set up personnel actions
Activations "Additional Actions" should be activated for all personnel number ranges. This will
allow SAP to process multiple actions on the same day.


Tips:

1. EXAMPLE_PNP_GET_PAYROLL (report): Example program to read the payroll data using
the GET PAYROLL.
If you need to do a form to report wages and the data is stored in the PCL4 Cluster.
You can look at this example report or form that retrieves data from this cluster based on
several parameters that are entered when the report is executed online (like employee number
and tax year).

2. A small Program to retrieve the Cumulative data from the cluster

TABLES: PERNR,
PCL2.
*----------------------------------------------------------------------*
* INCLUDE ZHR_PCL2_CU_DATA - Payroll results. *
*----------------------------------------------------------------------*
* Data declarations for the IMPORT of database PCL2 for cluster RU. *
*----------------------------------------------------------------------*
DATA: CD_NEXT_SEQ TYPE I, "Next available seq number
CD_LAST_PAY TYPE D. "Last payroll run date
DATA: BEGIN OF OCD_VERSION.
INCLUDE STRUCTURE PC201. "Technical Version
*DATA: molga LIKE t001p-molga. "Country identifier
DATA: END OF OCD_VERSION.
DATA: BEGIN OF RGDIR OCCURS 100.
INCLUDE STRUCTURE PC261. "(For Export and Import of Payroll Res
DATA: END OF RGDIR.
* Key for database PCL2 cluster RU
DATA BEGIN OF RX_KEY.
INCLUDE STRUCTURE PC200. "Payroll Results Key
DATA: END OF RX_KEY.
* Country dependent
DATA: BEGIN OF RU-VERSION.
INCLUDE STRUCTURE PC201. "Technical Version
DATA: END OF RU-VERSION.
DATA: BEGIN OF ORU_VERSION.
INCLUDE STRUCTURE PC201. "Technical Version
DATA: END OF ORU_VERSION.
* Cumulated-result table
DATA: BEGIN OF CRT OCCURS 30.
INCLUDE STRUCTURE PC22Y. "Cumulated result table (USA)
DATA: END OF CRT.
GET PERNR.
IMPORT CD_VERSION TO OCD_VERSION
CD_LAST_PAY
CD_NEXT_SEQ
RGDIR
FROM DATABASE PCL2 (CU) ID PERNR-PERNR.
CHECK SY-SUBRC EQ 0.
* This is where you select the particular period you are searching. The
* selection will change based on what dates you are looking for.
LOOP AT RGDIR WHERE FPPER EQ P_PERIOD
AND INPER EQ P_PERIOD
AND (RUNDT GT Z_RUNDT
OR (RUNDT EQ Z_RUNDT
AND RUNTM GT Z_RUNTI ))
AND SRTZA = 'A'
AND PAYTY = ' '
AND VOID NE 'V'.
CHECK SY-SUBRC = 0.
MOVE PERNR-PERNR TO RX_KEY-PERNR.
MOVE RGDIR-SEQNR TO RX_KEY-SEQNO.
IMPORT RU-VERSION TO ORU-VERSION
CRT
FROM DATABASE PCL2(RU) ID RX_KEY.
CHECK SY_SUBRC = 0.
LOOP AT CRT.
Process crt data.
ENDLOOP.
ENDLOOP.

3.Any changes that are done to infotypes can be known by running the programming
RPUAUD00

When you execute this program and specify the employee code and infotype in the selection
screen, it gives us details of when the data was changed, who changed the data and what
data was changed in a particular infotype.

There are few standard infotypes like 0000, 0001, 0002 and few of your own created
infotypes starting with 9 (9XXX) for which you are able to see the log through this program.
But there are certain other infotypes like 0008, 0581 for which this log is not coming.
There are some configurations or customizing is to be done so that this log starts generating
for these infotypes and RPUADU00 can read it.

The IMG menu path is:

Personnel Management > Personnel Administration > Tools > Revision > Set up
change document

When you execute this node choose ’HR Documents - infotypes to be logged'
Add entries in this table to audit more infotypes.

Transaction class A is for HR master data, class B is for applicant data.

4. TEM - Deleting Business Events after Historically Recording

Assuming that one of your team users was testing in production After having a problem with
the automated correspondence The user created a business event, booked people into the
event, and then followed up on the event. Unfortunately, the user also historically recorded
the event.

If this happened, you need to delete the event because it will give the people which the user
booked credit for having

attended an invitation only type of leadership seminar.
Using report RHRHDL00 (menu path in 4.6C: Human Resources / Training and Event
Management / Tools / Database / Delete database records), you can delete data
records from the Personnel Planning Database.
Of course, be careful while making the selections for deletion and do a test run first

5. Change of Employee Position

During the course of a person employment, the employee may changes positions, cost
centers, or is moved to another subsidiary and the organizational assignment need to be
change.
Do take note that you cannot change the employee’s payroll area for a period for which the
employee’s payroll has already run. You can only change the payroll area at the end of the
payroll period.

In Personnel Actions, PA40: -
1. Input the Personnel Number
2. Select Organizational reassignment and click the execute button
3. Input the Start date for the reassignment
4. Click the save button and the Position Change screen will appear
5. Save your entries

6. Deleting personnel numbers in SAP HR

If you have some duplicated, personnel numbers on the system and the data is not
complete.

You try to delete these and get the message "record cannot be deleted (time constraint 1)".
The fastest and simplest way to delete employees is to use program RPUDELPN.
Either that or from PA30, click to Utilities -> Delete Personnel Number.

Certain infotypes have the time constraint set so that you cannot delete them which is why it
is giving you the message.

To avoid problems, use the above methods.

7. Find out the transaction codes used for SAP HR

Execute the program RPDTRA00 to list all HR Transactions



read more...

ALE - Updates

Here are few additional concepts which are broadly applicable to ALE and will help readers understand SAP’s integration services.

Listings are special filter object types, which are used to specify a selection criterion for distributing master data. Listings are based on the SAP Classification system. Lists are allocated to an LS using transaction SALE (from the ALE customizing guide) or Distribution Scenarios > Master Data Distribution > Distribution via Listings

Note: Listings are applicable only to Material, Customer, and Vendor master data.

Ports are a logical representation of the communication channels in SAP. R/3 defines four types of ports viz........

Ports are a logical representation of the communication channels in SAP. R/3 defines four types of ports viz. tRFC (transactional Remote Function Calls), File, R/2, and Internet. ALE can use all port types to distribute Idocs.

Process Codes are used in both ALE and EDI framework to identify the function module or API (Application Programming Interface) to be invoked for subsequent processing. Inbound as well as outbound interfaces use process code but for different purposes. Outbound process codes are stored in table TEDE1, while inbound process codes are stored in TEDE2.

Message control is a mechanism by which documents are output based on a selection criteria and requirements. This concept is applicable not only to EDI and ALE, but also to other output mediums (for example: print, fax). Message control determines the type of document, its timing, number, and the medium. NAST table stores output records.

The conditions (selection criteria and requirements) for creating an output message are stored in condition tables. Search mechanisms are used through access sequences, output processes, and requirements to determine whether an application document qualifies for output.

ALE provides powerful capabilities to capture changes occurring to master data using Change pointers. These R/3 objects mark changes to SAP master data. ALE configuration facilitates the relation between Change Document objects and change pointers. This feature can be used to keep two or more systems synchronized with respect to master data.

In conclusion, ALE is a simple add-on application that relies heavily on the customizable distribution scenario. Every time a data object (described in an ALE scenario) changes, an IDoc is triggered. Application Link and Enabling (ALE) is one of the most common and effective technologies available for distributed SAP systems.


read more...

ALE - Configuration

The essential entities involved in the ALE framework have been discussed above. We will now proceed with the configuration methodology for ALE implementation. The configuration is a multi-step approach. The steps can be categorized as follows (as depicted in figure 5):

Figure :MULTI-PHASE ALE CONFIGURATION

Understand and verify the need of business processes

The need of implementing ALE must be clear to you. For that you need to have all the details of the business requirements. These requirements will facilitate the implementation process and also ensuring its success.


Configure SAP user administration module (BASIS)

This step involves BASIS configuration of SAP system. The concept of the Logical System described above is applicable here. BASIS administration involves creation of logical systems (LS) for every prospective ALE-enabled client, followed by linking prospective clients to the Logical System using the respective servers.

Once the Logical Systems have been created, you create background users on the prospective clients – to be used by ALE. After this, choose Tools > Administration > Administration > Network > RFC destinations or enter transaction code SM59 to create RFC (Remote Function Call) destination for each client.

As a final step, create partner profiles for the sending system. A partner profile is an identifier for the sending system that is used for communicating messages. You will be using LS as it is used for ALE communications. Every partner profile used for ALE must be based on existing LS (created above).

ALE Functional Configuring in SAP

This configuration step allows the installation of core ALE features on which data transfer activity will be based. You need to create a Customer Distribution Model (CDM) first. The Customer Distribution Model acts as a repository of data that decides the flow of message types to Logical Systems (LS). There can be one to many messages flow to a Logical System and it can also happen vice-versa. You also need to enforce a selection criterion on the message (type) flowing to a Logical System. This is achieved by adding appropriate message types and filters to the CDM.

Now that the path of the message flows have been set, we can generate outbound partner profiles (similarly as we done for inbound profiles in step 2). Finally, you can distribute the CDM to the receiving systems followed by generating inbound partner profiles on each of the clients.

Testing and Implementing the ALE Configuration

After completing the setup of the ALE environment it needs to be thoroughly checked and tested with real time business processes and situations. The performance should be measured with varying degree of business transaction volumes. It is advisable to include negative and ‘unusual’ test scenarios as well.

Once testing is completed it can be implemented once it is signed off with the respective business owners.


read more...

What is Object Orientation?

In the past, information systems used to be defined primarily by their functionality: data and functions were kept separate and linked together by means of input and output relations.

The object-oriented approach, however, focuses on objects that represent abstract or concrete things of the real world. These objects are first defined by their character and their properties which are represented by their internal structure and their attributes (data). The behaviour of these objects is described by methods (functionality)

Objects form a capsule which combines the character to the respective behaviour. Objects should enable programmers to map a real problem and its proposed software solution on a one-to-one basis.

Typical objects in a business environment are, for example, ‘Customer’, ‘Order’, or ‘Invoice’. From Release 3.1 onwards, the Business Object Repository (BOR) of SAP Web Applicaton Server ABAP has contained examples of such objects. The BOR object model will be integrated into ABAP Objects in the next Release by migrating the BOR object types to the ABAP class library.

A comprehensive introduction to object orientation as a whole would go far beyond the limits of this introduction to ABAP Objects. This documentation introduces a selection of terms that are used universally in object orientation and also occur in ABAP Objects. In subsequent sections, it goes on to discuss in more detail how these terms are used in ABAP Objects. The end of this section contains a list of further reading, with a selection of titles about object orientation.
Objects

Objects are instances of classes. They contain data and provides services. The data forms the attributes of the object. The services are known as methods (also known as operations or functions). Typically, methods operate on private data (the attributes, or state of the object), which is only visible to the methods of the object. Thus the attributes of an object cannot be changed directly by the user, but only by the methods of the object. This guarantees the internal consistency of the object.
Classes

Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class. Each instance (object) of a class has a unique identity and its own set of values for its attributes.
Object References

In a program, you identify and address objects using unique object references. Object references allow you to access the attributes and methods of an object.

In object-oriented programming, objects usually have the following properties:
Encapsulation

Objects restrict the visibility of their resources (attributes and methods) to other users. Every object has an interface, which determines how other objects can interact with it. The implementation of the object is encapsulated, that is, invisible outside the object itself.
Inheritance

You can use an existing class to derive a new class. Derived classes inherit the data and methods of the superclass. However, they can overwrite existing methods, and also add new ones.
Polymorphism

Identical (identically-named) methods behave differently in different classes. In ABAP Objects, polymorphism is implemented by redefining methods during inheritance and by using constructs called interfaces.
Uses of Object Orientation

Below are some of the advantages of object-oriented programming:

· Complex software systems become easier to understand, since object-oriented structuring provides a closer representation of reality than other programming techniques.

· In a well-designed object-oriented system, it should be possible to implement changes at class level, without having to make alterations at other points in the system. This reduces the overall amount of maintenance required.

· Through polymorphism and inheritance, object-oriented programming allows you to reuse individual components.

· In an object-oriented system, the amount of work involved in revising and maintaining the system is reduced, since many problems can be detected and corrected in the design phase.

Achieving these goals requires:

· Object-oriented programming languages

Object-oriented programming techniques do not necessarily depend on object-oriented programming languages. However, the efficiency of object-oriented programming depends directly on how object-oriented language techniques are implemented in the system kernel.

· Object-oriented tools

Object-oriented tools allow you to create object-oriented programs in object-oriented languages. They allow you to model and store development objects and the relationships between them.

· Object-oriented modeling

The object-orientation modeling of a software system is the most important, most time-consuming, and most difficult requirement for attaining the above goals. Object-oriented design involves more than just object-oriented programming, and provides logical advantages that are independent of the actual implementation


read more...

7.30.2008

What is Software ESCROW?

Software escrow is one way of protecting you in certain types of projects when certain things go wrong.

When you contract out for software to be written for you, there are several decisions that are part of the process. One that's often overlooked is whether or not you get a copy of the source code when the project is done.

The source code is the collection of written instructions that the programmer actually writes to create a program. For many types of programs, the source code is then transformed into the "executable" that you actually run. For example "notepad.exe" is a executable program that comes with Windows. Somewhere back at Microsoft they keep the written instructions, or source code, that the programmers


Getting someone to write software for you can result in a wonderful, custom solution to your problem. It can also incur a significant amount of risk if things go wrong.

Software escrow is one way of protecting you in certain types of projects when certain things go wrong.

When you contract out for software to be written for you, there are several decisions that are part of the process. One that's often overlooked is whether or not you get a copy of the source code when the project is done.

The source code is the collection of written instructions that the programmer actually writes to create a program. For many types of programs, the source code is then transformed into the "executable" that you actually run. For example "notepad.exe" is a executable program that comes with Windows. Somewhere back at Microsoft they keep the written instructions, or source code, that the programmers used to create it.

Open source software projects make the source code publicly accessible. Anyone with enough knowledge can create the software executable using the source code. Closed source, or "proprietary" software is just the opposite ... the source code is not available publicly, only the executable. Companies use this approach to retain their intellectual property, and trade secrets.

When you contract with someone to write software for you one decision, implied or explicit, is whether the source code belongs exclusively to the developer, or whether you get a copy. If you do, you have the safety of being able to have someone else make changes or fix bugs in the future, but the developer is giving up some of his or her potential control of that software. If the developer retains the source code and you don't have access to it, then you are dependant on the developer for all future updates. Typically developers will charge more if you get the source code.

It's common to opt for the cheaper option, or to have the developer simply not give you the option.

So what happens if your developer goes out of business? What if all of the source code simply disappears?

That's where software or source code escrow comes into play.

As part of arranging for your software to be written, you and the developer can agree that a copy of the source code will be given to a neutral third party - an escrow agent. The agreement would then specify under which conditions that agent would be allowed to release the source code to you. For example one of the conditions might be the developer's bankruptcy or going out of business for other reasons. By using software escrow, the developer is protected as long as it makes sense for them to retain control, and you are protected should the developer disappear. (Naturally other conditions might trigger the release, but the developer's going out of business is a clear example.)

Software escrow is not fool proof. For example, what happens if the escrow agent goes away? And escrow typically adds some cost to your transaction.

But I think of it as an insurance policy.


read more...

7.26.2008

SAP Mail Example ABAP Code

REPORT ZTSAPMAIL.

DATA: X_OBJECT_TYPE LIKE SOOD-OBJTP.

DATA: BEGIN OF X_OBJECT_HD_CHANGE.

INCLUDE STRUCTURE SOOD1.

DATA: END OF X_OBJECT_HD_CHANGE.

DATA: BEGIN OF X_OBJCONT OCCURS 10.

INCLUDE STRUCTURE SOLI.

DATA: END OF X_OBJCONT.

DATA: BEGIN OF X_OBJHEAD OCCURS 0.

INCLUDE STRUCTURE SOLI.

DATA: END OF X_OBJHEAD.

DATA: BEGIN OF RAW_HEAD.

INCLUDE STRUCTURE SORH.

DATA: END OF RAW_HEAD.

DATA: BEGIN OF X_RECEIVERS OCCURS 0.

INCLUDE STRUCTURE SOOS1.

DATA: END OF X_RECEIVERS.

PARAMETERS: RECEIVER LIKE X_RECEIVERS-RECNAM. ” Name

*BUILD MESSAGE HEADER

MOVE ‘Sort field goes here’ TO X_OBJECT_HD_CHANGE-OBJSRT. ” Sort field

MOVE ‘Name of the object goes here’ TO X_OBJECT_HD_CHANGE-OBJNAM. ” Name

MOVE ‘Document title goes here’ TO X_OBJECT_HD_CHANGE-OBJDES. ” Title

MOVE ‘F’ TO X_OBJECT_HD_CHANGE-OBJSNS. ” Functional OBJECT

MOVE ‘E’ TO X_OBJECT_HD_CHANGE-OBJLA. ” Language

* Object type of the new document

MOVE ‘RAW’ TO X_OBJECT_TYPE.

CLEAR X_OBJCONT.

MOVE ‘Contents of mail’ TO X_OBJCONT-LINE.

APPEND X_OBJCONT.

CLEAR X_OBJCONT-LINE. APPEND X_OBJCONT.

MOVE ‘More contents’ TO X_OBJCONT-LINE.

APPEND X_OBJCONT.

MOVE ‘Still more contents’

to x_objcont-line.

APPEND X_OBJCONT.

MOVE ‘ ‘ TO X_OBJCONT-LINE.

APPEND X_OBJCONT.

* Specific header (Dependent on the object type, here RAW)

REFRESH X_OBJHEAD.

DESCRIBE TABLE X_OBJCONT LINES RAW_HEAD-RAWSIZ.

MOVE RAW_HEAD TO X_OBJHEAD.

APPEND X_OBJHEAD.

*RECEIVERS table

CLEAR X_RECEIVERS.

REFRESH X_RECEIVERS.

MOVE RECEIVER TO X_RECEIVERS-RECNAM. ” Name

MOVE ‘B’ TO X_RECEIVERS-RECESC. ” Receiver type

MOVE ‘X’ TO X_RECEIVERS-SNDCP. ” Send as a copy

MOVE ‘X’ TO X_RECEIVERS-SNDEX. ” EXPRESS DOCUMENT

APPEND X_RECEIVERS.

CALL FUNCTION ‘SO_OBJECT_SEND’

EXPORTING

* folder_id = ‘OUTBOX’

* forwarder = x_forwarder

* object_fl_change = x_object_fl_change

OBJECT_HD_CHANGE = X_OBJECT_HD_CHANGE

* object_id = x_object_id

OBJECT_TYPE = X_OBJECT_TYPE

OUTBOX_FLAG = ‘X’

OWNER = SY-UNAME

* store_flag = x_store_flag

* importing

* object_id_new = x_object_id_new

* sent_to_all = x_sent_to_all “May need to use

TABLES

OBJCONT = X_OBJCONT

OBJHEAD = X_OBJHEAD

* objpara = x_objpara

* objparb = x_objparb

RECEIVERS = X_RECEIVERS.

read more...

Understanding the UNIX shell script

Import Parameters Name and Description Field name Field function
Commandname Name of unix shell script or command to be executed by SAP Name of unix shell script to be invoked
Parameters The parameters to be sent to unix shell script ($1, $2 etc). Send parameters as a concatenated string separated by space and length not exceeding 128 characters We will be simulating this command using the FM from SAP system

Table Parameters Name and Description Field Name Field function
Exec_protocol (structure)Table to get messages from unix server after shell script is executed Length Length of the message from external program i.e unix
Message Log message from external program i.e unix

Export Parameters Name and Description Field name Field function
Status Contains the status of execution of external program Scheduling status of external program i.e unix

Once the above FM is invoked with the necessary parameters the unix program sendmail will send a mail to the inbox of the recipient in Microsoft.

The restriction on the parameter string length of 128 characters can be removed to make way for very long email addresses and subjects. Build the parameters into an internal table and download it as a file on the unix server. Instead of passing each parameter individually, pass the unix server path of this file as the parameter to the unix shell script (sndmail mentioned above). Modify the shell script to read every line of this parameter file as variables to be used in the shell script.


For Further Clarifications, Leave a Comment............

read more...