How To Check If A Number Contains Decimal Points

In this tutorial I want to teach you how to find out if there’s a decimal point in a number.

Earlier, I need this logic to change the decimal symbol from ‘.’ to ‘,’ because I want to pass the values into an Excel Worksheet.

DATA: lv_char(10) type c value ’27.500′.

find ’.’ in lv_char.

if sy-subrc = 0.
REPLACE ’.’ IN lv_char  WITH ’,’.
ENDIF.

Using Events In ALV List

In today’s tutorial you will learn how to use events in your ALV list report. E.G. You can have a click able link on your column that could leads user to show the data details.

Click here to download the tutorial.

ALV Automatic Refresh

In this tutorial you will learn how to create an automatic refresh in your ALV list, this function will be very useful in creating a report that needs to display up to date data from the SAP database.

Click here to download the tutorial.

Function Modules In SAP

FUNCTION MODULES: SAP function modules are procedures with interfaces that are defined in Function groups. R/3 system consists of a number of predefined function modules , besides we can create our own function modules to reuse any specific functionality in our programs. We can define function modules from simple calculations to complex reports in SAP.

Function group : Function groups act as containers for function modules. A group of related function modules can be defined under one Function Group. We can assign our newly defined function module to an existing function group or can define our own function group. Function groups are o f program type F . Function modules that are in the same function group share global data of the group.

1) Importing parameter : These are export parameters that has to be supplied with data to the function module. They have to be supplied with data unless they are flagged as optional. We cannot change these parameter values in the function module. We have another type called changing parameters for them.

2) Exporting parameters : The calling program receive result as export paramaters from the function module.

3) Changing : Changing parameters performs both the functions like importing and exporting data to and from the function module. The supplied variable can be changed in the function module and returned to the calling program.

4) Tables : Table parameters are especially used to pass internal tables. They also function like changing parameters. They have to be supplied with values unless they are marked as optional.

5) Exceptions: Exceptions are for handling situations where in which normal execution of program becomes difficult. For example if there are not entries in the table TAB1 that meet the selection criteria. We need NOT_FOUND exception for this.

SELECT * FROM MARA INTO TABLE I_MARA WHERE MATNR = mat1.
IF SY-SUBRC NE 0.
MESSAGE E007(AT) RAISING NOT_FOUND.
ENDIF.

6) Source code : The coding between FUNCTION and ENDFUNCTION STATEMENT is called the source code of the function module.

7) SELECT * FROM SPFLI INTO TABLE ITAB WHERE CARRID = ID.
IF SY-SUBRC NE 0.
MESSAGE E007(AT) RAISING NOT_FOUND.
ENDIF.

SAP Table Maintenance Display

In previous tutorial, you’ve learned how to create table maintenance generator by using TCODE SE54, today you will learn how to create the table display that utilizes TCODE SM30 to maintain the table values.

1. Execute TCODE SE93.

Enter the TCODE name, start with Z or Y.

Choose “Transaction with parameters (Parameter transaction).

Click “OK”

03112010-sm30-00

2. Now you need to fill in these values:

Default Values For:

-Transaction: SM30

-Check “Skip Initial Screen”

Classification:

-Check “Inherit GUI attributes”

Default Values:

VIEWNAME -> Transparent Table Name

UPDATE -> X

See below picture for reference.

SM30

SM30

03112010-sm30-02

3. Click the Save button.

4. Execute the TCODE you just created. Now you can maintain the tables values, such as Adding new entries, delete row.

03112010-sm30-04jpg

Table Maintenance Generator in SAP

Today I want to teach you how to create table maintenance generator in SAP, if you never heard about table maintenance generator, it’s actually used to maintain table values by using TCODE SE54 and after you create the table maintenance then you can display the values by using SM30.

Follow these steps to create table maintenance generator.

1. Execute TCODE SE54.

2. Enter the table name. Select “Generated Objects.” Click Create.

02112010-tmg-01

3. Click “Yes

02112010-tmg-02

4. Now enter these following settings, just like shown in pictures below.

02112010-tmg-03

5. Select “Generated Objects > Create“.

02112010-tmg-04

Table Relationship In SAP

Today I want to teach you how to find SAP table relationships, this is very useful for functional analyst to make a good program specification and also it can help ABAPer to look at the table relationships also.

The TCODE we’ll be using is SE11.

1. EXECUTE TCODE SE11 and enter the table name that you want to look at the relationship, in this tutorial I want to see table relationships between table EQUZ and ILOA, so I just type in the EQUZ table name and click on the display button.

22102010-tablerell-01

2. Click on the “Graphic” button on the toolbar.

22102010-tablerell-02

3. Next you will see the table relationship diagram, try to find the link between EQUZ table and the ILOA table and double click the link.

22102010-tablerell-03

4. Now you can see that these two tables EQUZ and ILOA is linked by ILOAN key. It’s pretty handy right?

22102010-tablerell-04