Category Archive Blog

EXPORT / IMPORT internal_table TO / FROM MEMORY ID

Export :


DATA : li_table_imported TYPE TABLE OF db_dable.

EXPORT my_table FROM li_table_imported TO MEMORY ID 'MEM_TAB'.

 

Import:


DATA : li_table_exported TYPE TABLE OF db_dable.

IMPORT my_table TO li_table_exported FROM MEMORY ID 'MEM_TAB'.

 

Clear:


 FREE MEMORY ID 'MEM_TAB'.

USER EXIT for sales order (VA01 / VA02)

Use forms in this include: MV45AFZZ.

Check also includes : MV45AFZA and MV45AFZB.

Read More

How to debug a background job ?

In SM37, type JDBG (like Job Debug in Background).

Read More

WBS elements and projects

Table for :

  • WBS elements : PRPS
  • WBS projects : PROJ.

Search tag: OTP

Get Material document in error (in COGI) with ABAP

To get material document in error, check table AFFW.

Read More

Status tables in SAP

Table JEST to see active and inactive status on objects.

Table TJ02 (and text table TJ02T) for internal status.

Table TJ30 (and text table TJ30T) for external status.

 
Example to change status with BAPI
Read More

Write special characters with ABAP

Use class : CL_ABAP_CHAR_UTILITIES.

Example, write a carriage return (Carriage Return and Line Feed) :


WRITE : 'Line 1', CL_ABAP_CHAR_UTILITIES=>CR_LF, 'Line 2'.

FM to check if executed in dialog mode

FM to check if Gui is active :


DATA : lw_gui_actif TYPE c.
  CALL FUNCTION 'GUI_IS_AVAILABLE'
    IMPORTING
      return = lw_gui_actif.

FM to check if code is executed in dialog mode :


DATA : lw_is_dialog TYPE xfeld.
CALL FUNCTION 'ZFM_CHECK_DIALOG_MODE'
  IMPORTING
    ew_is_dialog = lw_is_dialog.  " = X si en mode Dialog, vide sinon

Read More

Create an ALV with FM REUSE_ALV_GRID_DISPLAY

Abap code example to display an ALV with FM REUSE_ALV_GRID_DISPLAY.

Read More

Generate random string with ABAP

Use FM : GENERAL_GET_RANDOM_STRING.

Example :


  DATA : lw_guid TYPE string.

  CALL FUNCTION 'GENERAL_GET_RANDOM_STRING'
    EXPORTING
      number_chars  = 32
    IMPORTING
      random_string = lw_guid.