Tuesday, 16 August 2016

ABAP performance tuning for Nested Loop


SORT itab1 BY F1.
SORT itab2 BY F1.

LOOP AT itab1.
    
READ TABLE itab2 TRANSPORTING NO FIELDS 
    WITH KEY matnr itab1-F1 BINARY SEARCH.
    
IF sy-subrc <> 0.
      
CONTINUE.
    
ENDIF.
    v_indx 
sy-tabix.
    
LOOP AT itab2 FROM v_indx.
      
IF itab1-F1 <> itab2-F1.
        
EXIT.
      
ENDIF.
         
    ENDLOOP.

ENDLOOP.

Thursday, 2 July 2015

Spilt stream text

 

Use Class

CL_ABAP_CHAR_UTILITIES

Ex.

SPLIT v_remark at CL_ABAP_CHAR_UTILITIES=>CR_LF
into TABLE it_tmp.

Wednesday, 1 July 2015

Get Resolution Screen

 
DATA: lref_consumer type ref to cl_gui_props_consumer,

ls_metric_factors type cntl_metric_factors.
lref_consumer = cl_gui_props_consumer=>create_consumer( ).
ls_metric_factors = lref_consumer->get_metric_factors( ).
WRITE: ls_metric_factors-screen-x,

  ls_metric_factors-screen-y.

Wednesday, 27 May 2015

Read text on binary mode

TYPES: BEGIN OF ty_stxl,
          tdname TYPE stxl-tdname,
          clustr TYPE stxl-clustr,
          clustd TYPE stxl-clustd,
  srtf2  TYPE stxl-srtf2,
END OF ty_stxl.
DATA:  t_stxl TYPE STANDARD TABLE OF ty_stxl.
FIELD-SYMBOLS: <stxl> TYPE ty_stxl.
* compressed text data without text name
TYPES: BEGIN OF ty_stxl_raw,
          clustr TYPE stxl-clustr,
          clustd TYPE stxl-clustd,
END OF ty_stxl_raw.
DATA:  t_stxl_raw TYPE STANDARD TABLE OF ty_stxl_raw.
DATA:  w_stxl_raw TYPE ty_stxl_raw.
* decompressed text
DATA:  t_tline TYPE STANDARD TABLE OF tline.
FIELD-SYMBOLS: <tline> TYPE tline.
DATA: t_stxh TYPE STANDARD TABLE OF stxh,
       w_stxh TYPE stxh.
DATA rtname TYPE RANGE OF  stxl-tdname WITH HEADER LINE.


rtname-sign = 'I'. rtname-option = 'EQ'.
rtname-low = '210N501678550000000500000005'.
APPEND rtname.
rtname-low = '210N501785510000000200000002'.
APPEND rtname.
SELECT tdname clustr clustd  srtf2
INTO TABLE t_stxl
FROM stxl
" PACKAGE SIZE 3000
WHERE tdname in rtname AND tdspras = 'E'.
SORT t_stxl  BY srtf2.
CLEAR: t_stxl_raw[], t_tline[].
LOOP AT rtname.
write /  rtname-low.
LOOP AT t_stxl ASSIGNING <stxl> WHERE tdname  =  rtname-low.
*   decompress text
    w_stxl_raw-clustr = <stxl>-clustr.
    w_stxl_raw-clustd = <stxl>-clustd.
APPEND w_stxl_raw TO t_stxl_raw.
ENDLOOP.
IMPORT tline = t_tline FROM INTERNAL TABLE t_stxl_raw.
*  access text lines for further processing
LOOP AT t_tline ASSIGNING <tline>.
WRITE: / <tline>-tdline.
ENDLOOP.
uline.
ENDLOOP.
FREE t_stxl.

Wednesday, 20 May 2015

User ZLOGON2

 

Table : ZBCPROGPWD

image

1. Click View Maintenance.

2. Click Edit  image

image

3. Delete Report key and Click gen on Users.

4. Click Hash for encoding and Click Save.