Many customers need a function that allows them to transfer values from an Excel table to the SAP system. Up to now there has been no formally released interface for this.
For the Asset Accounting legacy data transfer, a module was written to transfer the Excel data using the clipboard of the Windows system by OLE (Object Linking and Embedding. This module is called ALSM_EXCEL_TO_INTERNAL_TABLE. The module was only designed for the requirements of the Asset Accounting legacy data transfer. This leads to some restrictions, including the following:
Read more…
SAP Note 520813 – FAQ: BAPIs for goods movements contains frequently asked questions/answers regarding ‘BAPIs for goods movements’. I just picked out some questions for your reference. For detail information, please visit SAP service marketplace.
Question:
Which function modules must be called after the BAPI is called to complete the posting once the material document has been created successfully? What should I do if there is an error?
Answer:
The BAPI returns a return table for the error handling, that is, if the posting is incorrect, this table contains an entry describing the cause of the error. The ‘caller’ is responsible for evaluating this table and for triggering the update that is dependent on this.
If the posting is correct (return table is initial), a ‘Commit Work’ must be carried out in order to complete the posting. To do this, call BAPI_TRANSACTION_COMMIT.
The Commit or rollback always applies to the current LUW (Logical Unit of Work). Therefore, you must make sure that it is carried out at the correct point in the source code. More information about this is available in the documentation for BAPI_TRANSACTION_COMMIT or …_ROLLBACK.
A detailed description is available in Note 457499.
Read more…
Application Area – ERP-PP
Description
Function module CS_BOM_EXPL_MAT_V2 is used for BOM explosion for a given material. It belongs to function group CSS4 – BOM explosions. This function module can explose multi-level BOM with a given validation date.
You need to specify necessary input parameters to call this function module, such as CAPID – App ID, DATUV – Validation date, MEHRS – Multi-level, MTNRV – Material number, STLAL – alternate, STLAN – BOM usage.
Some useful tables are also listed here.
TABLES: MARA, "Master Data
MAKT, "Matl Desc.
MARC, "Plant Data for Matl.
MAST, "Bom to material link
STKO, "Bom Header
STPO. "Bom Item
Read more…
Application Area – CRM,Solution Manager
Description
Function module CRM_ORDER_MAINTAIN is one of the most important function modules in SAP CRM and SAP Solution Manager business transactions processing. Other useful function modules are CRM_ORDER_READ and CRM_ORDER_SAVE.
The function module will call some underlying function modules to save the changes to database. The most important task of calling this function module is to maintain the input fields internal table. You can maintain every information belongs to the business transaction.
The input field structure contains several components. Field ref_guid represents the GUID of the changed structure. Ref_kind has several possible values. A for Administration Header, B for Administration Item, C for Header Extension, D for Item Extension. You also need to populate FIELD_NAMES internal tables to decide which fields in the destination structure needs to be changed.
Read more…
Application Area – BC
Overview
This post lists function modules related to data formatting and conversion.
Function Modules Detail – Data Formatting and Conversion
a) CONVERSION_EXIT_ALPHA_INPUT – ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes (’0′). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.
Example:
(Input field and output field are both eight characters in length)
1. ’1234 ‘ –> ’00001234′
2. ‘ABCD ‘ –> ‘ABCD ‘
3. ‘ 1234 ‘ –> ’00001234′
Read more…
Application Area – BC
Overview
In daily ABAP programming, we often need to use plenty of function modules. SAP doesn’t provide the detail API cookbook for these function modules. ABAPer always need to use their experience to use them freely. I try to list some common and useful fuction modules to my best and attach a short piece of description. For detail usage of these function modules, you can refer to the documentation as well as web resources. I plan to group the function modules to different functionalities, This post deals with the function module related to dynpro programming.
Function Modules Detail – Dynpro Programming
a) VIEW_MAINTENANCE_CALL – Call Extended Table Maintenance (View Maint) Highest Level like SM30.
b) DYNP_VALUES_READ – Read screen field values before PAI field transport. This function module reads screen field contents that are to be processed by the help modules.
c) DYNP_VALUES_UPDATE – Reset selected screen field contents. You can use this function module to reset selected help processor field contents in the corresponding screen fields. The module DYNP_GET_STEPL must first be called in strp-loop or table control to set the correct step-loop.
Read more…
Status is very important and useful in SAP. It is used to record current status of different business objects, such as sales order, quality notification and purchase order etc. It comprises user status and system status. The system status cannot be set by user. It is determined by system automatically. The user status can be set manually.
Status doesn’t just show the business transaction status, it can also be the trigger point of the workflow. For example, a workflow can be started according the status change.

Read more…
Long text is used in various components to store comments or additional text freely. It is stored in ITF (Interchange Text Format) format and comprises of text header and text lines.
The text header contains all administrative information on a long text. Below diagram shows some important fields in the text header.

Text name (TDNAME): Customer-defined name of a text. It can be a maximum of 70 characters in length.
Language (TDSPRAS): The language key is an abbreviation for the language of the object being processed.
Text ID (TDID): The text ID defines the various types of texts related to a text object. The text ID must be defined in table TTXID together with the text object.
Text Object (TDOBJECT): It contains the name of the text object to which the text is allocated. This object must be defined in table TTXOB.
Read more…
In the ABAP development, we always get the requirement to send emails outside with attachment. Below is the example to send email with a SAP shortcut as an attachment.
Read more…
SAP provides several function modules to send email to the external world. The interfaces of them are more or less the same, just with some minor difference.
Function Group: SOI1 – API Function Modules for Externals
Function Module:
SO_DOCUMENT_SEND_API1 – SAPoffice: Send new document with attachments using RFC
SO_NEW_DOCUMENT_SEND_API1 – SAPoffice: Send new document
SO_NEW_DOCUMENT_ATT_SEND_API1 - SAPoffice: Send new document with attachments using RFC
In the implementation, all above function modules will call another function module ‘SO_OBJECT_SEND’ to send email.
Differences among these function modules:
SO_DOCUMENT_SEND_API1 - In this FM u can specify the sender address. Means u can hardcode any ID and system will display that sender only irrespective of who is running the report.
SO_NEW_DOCUMENT_SEND_API1 – Through this system will pick sender based on from which id running the program. This function module also enables you to send a new document, which has not yet been created, internally and externally. During the send process the document is created, along with the attributes and content that is to be transferred.
SO_NEW_DOCUMENT_ATT_SEND_API1 - This function module enables you send a new document including any existing attachments. The document and the attachments are transferred in the same table. They are created when sent and can also be placed in the sender’s outbox.
Except these function modules, SAP provides a simplified one named HR_FBN_GENERATE_SEND_EMAIL. If you check the function module interface, you will find it is quite easy to use.
I will give some useful examples with actual scenario recently. But above function modules are more or less not state of the art and difficult to handle. Meanwhile, SAP introduced the BCS (Business Communication Services), a much more flexible and future-oriented OO attempt to Mail. We will discuss it later.