Category Archive Blog

Insert an image in Selection-screen

Have a look on program : RSDEMO_CUSTOM_CONTROL. to insert an image in Dynpro (not selection screen)

To add image on selection-screen

check the code below :

Read More

Table type for VBELN field

This post just to save time, instead of doing where-used on VBELN field…

Type table of VBELN: 
TT_VBELN => TABLE_LINE
MDS_SALES_KEY_TAB => Champ VBELN (type VBELN_VA)

Type range of VBELN: WTYSC_VBELN_RANGES_TAB

Search tag : type de table

Check range values from a domain

⚠️ This code works only if range values are restricted to Include Equal (I EQ) and domain values are not range of values.

Example of calling code :


  DATA : lv_wrong_value TYPE domvalue_l.
  
  PERFORM f_check_range_val_from_domain USING 'MTART'
                                              s_mtart[]
                                              CHANGING lv_wrong_value.
  IF lv_wrong_value IS NOT INITIAL.
    SET CURSOR FIELD 'S_MTART-LOW' ##NO_TEXT.
    MESSAGE i001(zz) WITH lv_wrong_value DISPLAY LIKE 'E'.
    " Material type &1 is not valid
  ENDIF.

Read More

Table type for MATNR field

This post just to save time, instead of doing where-used on MATNR field…

Type table of MATNR : TABLE_MATNR => TABLE_LINE

Type range of MATNR : RANGE_T_MATNR

Search tag : type de table

QM – Meaning of field STEUERKZ

Field STEUERKZ can be found in QM tables like QPMK.
It is divided into 30 charcacters. It corresponds to fields into structure QMKST.

Check this post to have the meaning of each position : https://blogs.sap.com/2013/08/05/control-indicators-in-qpmk-and-storage-in-field-qpmk-steuerkz/

Details:

Read More

Conversion exit to manage percentages

To set percentage value, displayed with the char. %, when you want to store only the number, you can use conversion exit.

Here I made the choice to store the number as a string, otherwise, default value is 0 and in my case, 0% is different from empty value.

Read More

Upload file with UTF8 or ANSi encoding

EDIT : Warning, solution below will work only if there is an accentuated caracter in first line.

Wrong encoding format file is a reccurent issue, especially when working on Windows.
If you don’t want to impose to end used an encoding format for text files, you can use the code below.

Read More

Sapscript – Center an include text

Let’s say we have a paragraph to center text declared as CS, to use this paragraph on an include text, add PARAGRAPH <paragraph name> at the end of INCLUDE TEXT declaration :


INCLUDE Z_SO10_TEXT OBJECT TEXT ID ST LANGUAGE FR PARAGRAPH CS