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

Upgrade project steps


In our project we upgraded from ECC 6 EHP5 to EHP7 (unicode), we did in this sequence:
a) SPDD - done by Basis team at the time of basis changes for upgrade
b) SPAU - Mostly modified using Modification assistant. Some times we had to correct manually. Use Modif assistant - you can Insert/Replace code when needed. It's simple.
c) UCCHECK - done after Unicode installation by Basis -  We had to correct some programs and then tick 'Unicode enabled' for the programs and Acivate them.

Also, check below for steps (found in internet) - https://scn.sap.com/thread/3542865

   1. Unicode: This is done via UCCHECK transaction. You need to make all the programs (custom) unicode enable. For this you need to goto program attributes and check the box for unicode. Sometimes, after you enable unicode checking, some errors might occur, so you need to eliminate those.
     2. Obsolete FM: There might be some obsolete FMs in existing code (eg. WS_UPLOAD). So you need to replace those by new one (eg. GUI_UPLOAD)..
     3. Open dataset: Unfortunately I didn't get any chance to work upon these. Sorry.
     4. SPAU & SPDD: SPAU allows you to process Repository objects needing adjustment. But generally, ABAPers don't get chance to work upon these. PMs or TLs are preffered.     5. Conversion of script to smartforms: This totally depends on your customer, whether they want to convert all scripts to smartforms. Hope, you'll get some lists of scripts to convert. Just goto smartforms->utilities->migration->import sap script form. Might be you need to do some changes in program too for triggering this smartform properly.
     6. Enhancements: Depends on customer requirement. Might need to implement exits or BADIs as per requirement raised. Hope there will be hell lot of enhancements (I had to do a lot).