Wednesday, April 27, 2016

SPAU - Upgrade explained



Explanation of phase for SPAU

SPAU explained

The following week the DB will be converted to Unicode, now all SAP standard aspects should be OK, but any Z objects need review and processing with UCCHECK.

Unicode common issues


Monday, April 25, 2016

SLG1 Logging program


First go to SLG0 tcode, and setup Object 'ZCMS'

then put below code in your program 

   DATAls_log            TYPE BAL_S_LOG.  " CMS Logging
    DATAls_msg            TYPE BAL_S_MSG.
    DATAls_LOG_HANDLE     TYPE  BALLOGHNDL.
    DATAlt_LOG_HANDLE     TYPE BAL_T_LOGH.


    CLEAR ls_log.
    ls_log-object 'ZCMS'.
    ls_log-aluser sy-uname.
    ls_log-alprog sy-repid.

    CALL FUNCTION 'BAL_LOG_CREATE'
      EXPORTING
        I_S_LOG                 ls_log
      IMPORTING
        E_LOG_HANDLE            ls_log_handle
      EXCEPTIONS
        LOG_HEADER_INCONSISTENT 1
        OTHERS                  2.



        CLEARls_msg.
        ls_msg-msgty 'S'.
        ls_msg-msgid 'ZCRM'.
        ls_msg-msgno '000'.
        ls_msg-msgv1 'Process Type'.
        ls_msg-msgv2 ''.
        ls_msg-msgv3 lv_process_type.
        ls_msg-probclass 2.


        CALL FUNCTION 'BAL_LOG_MSG_ADD'
          EXPORTING
            I_LOG_HANDLE     ls_log_handle
            I_S_MSG          ls_msg
          EXCEPTIONS
            LOG_NOT_FOUND    1
            MSG_INCONSISTENT 2
            LOG_IS_FULL      3
            OTHERS           4.



    INSERT ls_log_handle INTO TABLE lt_log_handle.
    CALL FUNCTION 'BAL_DB_SAVE'
      EXPORTING
        I_CLIENT         SY-MANDT
        I_IN_UPDATE_TASK 'X'
        I_SAVE_ALL       'X'
        I_T_LOG_HANDLE   lt_log_handle
      EXCEPTIONS
        LOG_NOT_FOUND    1
        SAVE_NOT_ALLOWED 2
        NUMBERING_ERROR  3
        OTHERS           4.
    IF SY-SUBRC EQ 0.
      REFRESHlt_log_handle.
    ENDIF.

Thursday, April 21, 2016

Product history in CRM - Function Module

FM -  CRM_PRODUCT_HISTORY_GET  - Product history in CRM – good one – need to give product guid


COMM_PRODUCTH - Table for Product History

COMM_PRODUCT - Table for Product master - we can get Guid here 

Wednesday, April 13, 2016

Short Dumps - understanding values



Your 3 rows are, top to bottom: Human readable*, Hexidecimal high value, Hexidecimal low value. 

So for character values you can already read them. 

* Now for the tricky part. Numeric values are often 'packed' so they use less memory. Each number that is printed has hex values 30 - 39 (ASCII, for EBCDIC F0 - F9). A packed number of length 13 will have a length in your dump of 7, ( (13 + 1) / 2 ). The number 1234567890123 will have hex format: 
1357913 
246802x 

The part hex value 'x' is an sign indicator, (no sign, posative, negative). Sorry I do not know the ASCII vaues, EBCDIC values were F, C, D.

------------------------------------------

To read numeric values from ABAP Short dumps:

The value is saved in ASCII and Hexadecimal

Check Hexadecimal – In below screen shot – highlighted part
This value is split into 2 lines. You need to read highlighted below as 00025052517D – This value is actually equal to 250525.17- (negative – may be last ‘D’ represent –ve)




Monday, April 4, 2016

Transport User Roles PFCG

To Transport Roles – Go to PFCG tcode -> Give role -> Select Utilities -> Go to ‘Mass Transport’


Friday, April 1, 2016

SLG1 Application logging


First go to SLG0 tcode, and setup Object 'ZCMS'

then put below code in your program

Check if CL_EZLOG exists in system - If not, use other way of setting up logs in http://sapist.blogspot.co.uk/2016/04/slg1-logging-program.html


DATAlc_log TYPE REF TO CL_EZLOG.
  
* Start of CMS Logging
  CREATE OBJECT LC_LOG
    EXPORTING
      MSGOBJECT  'ZCMS'
      APPENDMODE '1'
      INTERNAL   'X'.



    CALL METHOD LC_LOG->ADDMSG
      EXPORTING
        MSGTY sy-msgty
        MSGID sy-msgid
        MSGNO sy-msgno
        MSGV1 sy-msgv1
        MSGV2 sy-msgv2
        MSGV3 sy-msgv3.




  CALL METHOD LC_LOG->SAVE
    EXCEPTIONS
      EMPTY  1
      FAILED 2
      others 3.

  FREE lc_log.


Now, you can see in SLG1 - messages if any

Post Upgrade - Unicode characters not printing

After Upgrade to EHP7- unicode  (from ECC 6 EHP5), we found that Unicode characters were not working when we print invoices. 

Solution:  Output device (Printer) need to be changed in SPAD tcode.  Go to Unicode Printer settings and select a Unicode device type. This will solve the problem