Tuesday, 28 February 2017

PRT for operation

Case 1 :
   AFKO-AUFPL = AFFH-AUFPL

Case 2 : Table
  MAPL , PLPO , PLAS , PLFH

Wednesday, 22 February 2017

VB For Application - Object Browser


1. Open Excel or Word.
2. Hold Alt + F11 for open Microsoft Visual Basic for Applications

3. Click button Object Browser.






ABAP OLE Programming for Excel


DATAh_excel TYPE ole2_object,        " Excel object
        h_mapl TYPE ole2_object,         " list of workbooks
        h_map TYPE ole2_object,          " workbook
        v_filename TYPE string VALUE 'C:\Users\phoonookan\Desktop\1111.xlsx'.

  CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
  SET PROPERTY OF h_excel  'Visible' 1.
  CALL METHOD OF h_excel 'Workbooks' h_mapl.
  CALL METHOD OF h_mapl 'Open' h_map
    EXPORTING
    #1 v_filename.

*CALL METHOD OF h_map 'PrintOut'.
  CALL METHOD OF h_map 'PrintPreview'.
  CALL METHOD OF h_mapl 'Close'.

Tuesday, 14 February 2017

MS word editor in Smartforms


Go to se38
Run RSCPSETEDITOR
     Check is SAPscript and Smart Form boxes Active.
     Uncheck is SAPscript and Smart Form boxes Inactive.
And click in Activate button.

Monday, 23 January 2017

Emphasize in ALV

Emphasize is a 4-char field where :
     - 1st char = C (color property)
     - 2nd char = color code (from 0 to 7)
          0 = background color
          1 = blue
          2 = gray
          3 = yellow
          4 = blue/gray
          5 = green
          6 = red
          7 = orange
     - 3rd char = intensified (0=off, 1=on)
     - 4th char = inverse display (0=off, 1=on)

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.