SAP R/3

How to call SMARTFORMS from ABAP/4

When you create the form by SMARTFORMS, system will automatically create the function module for called by ABAP/4. You can get this function module by apply function module "SSF_FUNCTION_MODULE_NAME" and send the form name. This function will return the function name for call SMARTFORMS that you created.

Example


DATA: smf_name TYPE TDSFNAME VALUE ’ZSMARTFORM01’,
fn_name TYPE RS38L_FNAM.
CALL FUNCTION ’SSF_FUNCTION_MODULE_NAME’
EXPORTING
FORMNAME = smf_name
IMPORTING
FM_NAME = fn_name.

How to Popup Confirm Message in ABAP/4

When you want to popup message to confirm action, you can apply function module "POPUP_TO_CONFIRM_WITH_MESSAGE". The function will return:

  • ’A’ - Yes
  • Others - No or Cancel

Example


CALL FUNCTION ’POPUP_TO_CONFIRM_WITH_MESSAGE’
EXPORTING
DIAGNOSETTEXT1 = ’Do you want save data?’
TEXTLINE1 = ’ ’
TITEL = ’Confirm message!’
IMPORTING
ANSWER = lv_answer.

Formatting Selection Screens in ABAP/4: Blank Lines, Underlines and Comments

  • Blank Lines

Example

SELECTION-SCREEN SKIP 3.
  • Underlines

Example

SELECTION-SCREEN ULINE.
SELECTION-SCREEN ULINE /1(20).
  • Comments

Example

Loop...Where & Loop...Check in ABAP/4

Loop...Where


LOOP AT itab where key = pa1.
...
...
...
ENDLOOP.

Loop...Check

LOOP AT itab.
CHECK itab-key = pa1.
...
...
...
ENDLOOP.
In above logic, Loop...Where is better than Loop...Check because Loop...Where verifys the specified condition internally.

Transaction Code for ABAP/4 Workbench (Often to use)

Transaction Code      Description
SMEN Dynamic Menu
SU55 User Menu
OLE OLE2 Demo
SOLE OLE2 Configuration
SOLI Load OLE2 Type Info
SOLO OLE2 Object Browser
SE91 Messages
SE92 System Log Messages
SD11 Data Moduler
SE09 Workbench Organizer
SE11 ABAP/4 Dictionary
SE16 Data Browser
SE30 Runtime Analysis
SE32 Text Elements
SE35 Dialog Modules
SE36 Logical Databases
SE37 Function Library
SE38 ABAP/4 Editor
SE39 Splitscreen Editor
SE41 Menu Painter
SE51 Screen Painter
SE61 Documentation
SE63 Short/Long Texts

SE80 Object Browser
SE84 Repository Infosts.
SQ07 ABAP/4 Query
SPAU Program Compare
SPDD Dictionary Compare
SQ01 Queries
SQ02 Function Areas
SQ03 User Groups
SCAT CATT Procedures
SLIN Extended Prog.

Date Operation in ABAP/4

The date variable in ABAP/4 have format "YYYYMMDD". If you want to get no. of year, month or day for the date, you can offset this variable.

Example


DATA: lv_date TYPE D VALUE sy-datum, "20050312
lv_year(4),
lv_month(2),
lv_day(2).

lv_year = lv_date(4). "2005
lv_month = lv_date+4(2). "03
lv_day = lv_date+6(2). "12

If you want to find next n day of the date, you can apply opration sign ’+’ to this point.

Example