Mass Processing Application Log
Friday, December 3, 2010
Tuesday, August 24, 2010
Monday, July 19, 2010
System Debugging
System Debuggin is used to debug a system program. Debugger will skip this program if System Debugging is not turned on even though you had set the session breakpoint.
How to check the program is system program or not? Go to -> Attribute, Look for Program Status field, "S" represent System Program.
How to turn on System Debugging?
How to check the program is system program or not? Go to -> Attribute, Look for Program Status field, "S" represent System Program.
How to turn on System Debugging?
- Enter "/hs" instead of "/h" in Command Field.
- Go to System -> Utilities -> Debug System.
- In debugging session, before reaching the system program, go to Setting -> Display/Change Debugger Settings, and change the debugger setting
- In debugging session, before reaching the system program, go to Setting -> System Debugging On/Off.
Friday, June 25, 2010
Application Form: Create Link to other clients
During Unit Testing/ System Integration Testing period, it is advisable to create application form link in other clients instead of creating application for each and every client. Thus, changes in development client are reflected in other clients. (Please take note this is simple a link, no objects are copied).
You can specify the target client and existing active application form that you want to create link to.
Tuesday, June 22, 2010
FREE_SELECTIONS_EX_2_WHERE
This FM helps to construct WHERE conditions of a select statement. This is useful if you have the requirement to implement a dynamic select statement.
How to implement it?
You have to initiate Type Group RSDS by using TYPE-POOL keyword. After that, you need a internal table and structure of type RSDS_EXPR. This will store the expression of the selection:
RSDS_EXPR-TABLENAME -> Table Name
RSDS_EXPR-EXPR_TAB-> Itab stores the expressions
- RSDS_EXPR-EXPR_TAB-LOGOP -> Logical Operation ("AND", "OR", "NOT", only)
- RSDS_EXPR-EXPR_TAB-ARITY -> Priority of Logical Operation
- RSDS_EXPR-EXPR_TAB-FIELDNAME -> Table's field name for selection
- RSDS_EXPR-EXPR_TAB-OPTION -> Selection Option ("EQ", "BT", "CP", "GT", and etc.)
- RSDS_EXPR-EXPR_TAB-LOW -> Value - Low
- RSDS_EXPR-EXPR_TAB-HIGH -> Value - High
WHERE hvorg EQ '0600'
AND ( tvorg EQ '0010'
OR tvorg EQ '0011' )
AND augst EQ ''
AND augrd NE '05'.
RSDS_EXPR-EXPR_TAB shall be populated in this manner:
The result would be:
Monday, June 21, 2010
How to debug Background Job (Part 3)
1. During implement your code, Call FM 'C160_HOLD_FOR_DEBUG'.
2. Go to System -> User Profile -> Own Data or T-Code SU03.
3. Add a User Master Parameter ID, 'ESN' and flag it with 'X'. Data stored in Table USR05.
4. This FM will run a infinite loop now and you can debug via SM50.
2. Go to System -> User Profile -> Own Data or T-Code SU03.
3. Add a User Master Parameter ID, 'ESN' and flag it with 'X'. Data stored in Table USR05.
4. This FM will run a infinite loop now and you can debug via SM50.
Thursday, June 17, 2010
How to debug Background Job (Part 2)
1. Write an infinite loop in your code.
DATA: lv_infinite TYPE i.2. Then go to SM50, select the program and then go to:
WHILE lv_infinite EQ 0.
ENDWHILE.
Program/Session -> Program ->Debugging
Tuesday, June 15, 2010
How to debug Background Job (Part 1)
1. Go to SM37, choose the background job that you want to debug.
2. Enter 'JDBG' (Without '/') at Command Field.
Saturday, June 12, 2010
CRM_ORDER_READ
- When you have the BP Number, Get the HEADER_GUID and ITEM_GUID from CRMD_ORDER_INDEX table.
- Call FM 'CRM_ORDER_READ' and export these HEADER_GUID and ITEM_GUID to IT_HEADER_GUID and IT_ITEM_GUID.
- Set the calling mode to IV_MODE:
- A = Create
- B = Change
- C = Display
- D = Delete
- Export object name such as 'TEXTS', 'ORDERADM_H' and etc. to IT_REQUESTED_OBJECTS, this is important steps on the performance tuning.
- Import the results from the ET_
internal table, suchs as ET_TEXT, ET_ORDERADM_H, and etc.
Tuesday, June 1, 2010
ZUT_GET_LOCAL_TIME_BY_UNAME
LOGIC
----------------------------------------------------------------------
Purpose: Get Local Time according to the user's time zone, or time zone provided.
----------------------------------------------------------------------
SAMPLE CODE
----------------------------------------------------------------------
FUNCTION zut_get_local_time_by_uname.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IM_UNAME) TYPE SYUNAME OPTIONAL
*" REFERENCE(IM_TZONE) TYPE TZNZONE OPTIONAL
*" REFERENCE(IM_TIMESTAMP) TYPE TZNTIMESTP OPTIONAL
*" EXPORTING
*" REFERENCE(EX_LOCAL_DATE) TYPE SYSTDATLO
*" REFERENCE(EX_LOCAL_TIME) TYPE SYSTTIMLO
*" REFERENCE(EX_LOCAL_TIMESTAMP) TYPE TZNTIMESTP
*"----------------------------------------------------------------------
*--------------------------------------*
* DECLARATION *
*--------------------------------------*
DATA: lv_tzone LIKE ttzdata-tzone,
lv_timestamp TYPE ttzdata-timestamp.
*--------------------------------------*
* TIME ZONE PREPARATION *
*--------------------------------------*
IF im_uname IS NOT INITIAL.
SELECT SINGLE tzone
INTO lv_tzone
FROM usr02
WHERE bname EQ im_uname.
IF sy-subrc NE 0.
IF im_tzone IS NOT INITIAL.
lv_tzone = im_tzone.
ELSE.
lv_tzone = 'UTC'.
ENDIF.
----------------------------------------------------------------------
Purpose: Get Local Time according to the user's time zone, or time zone provided.
----------------------------------------------------------------------
- Get Time Zone
- IF im_uname is provided, get tzone from table usr02.
- ELSEIF im_tzone is provided, tzone = im_tzone.
- ELSE default tzone to 'UTC'
- Get Current Time Stamp
- IF im_timestamp is not provided, call FM 'TZ_UTC_SYSTEMCLOCK' => UTC timestamp
- Get Local Time
- Call FM 'TZ_GLOBAL_TO_LOCAL' to get local time.
SAMPLE CODE
----------------------------------------------------------------------
FUNCTION zut_get_local_time_by_uname.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IM_UNAME) TYPE SYUNAME OPTIONAL
*" REFERENCE(IM_TZONE) TYPE TZNZONE OPTIONAL
*" REFERENCE(IM_TIMESTAMP) TYPE TZNTIMESTP OPTIONAL
*" EXPORTING
*" REFERENCE(EX_LOCAL_DATE) TYPE SYSTDATLO
*" REFERENCE(EX_LOCAL_TIME) TYPE SYSTTIMLO
*" REFERENCE(EX_LOCAL_TIMESTAMP) TYPE TZNTIMESTP
*"----------------------------------------------------------------------
*--------------------------------------*
* DECLARATION *
*--------------------------------------*
DATA: lv_tzone LIKE ttzdata-tzone,
lv_timestamp TYPE ttzdata-timestamp.
*--------------------------------------*
* TIME ZONE PREPARATION *
*--------------------------------------*
IF im_uname IS NOT INITIAL.
SELECT SINGLE tzone
INTO lv_tzone
FROM usr02
WHERE bname EQ im_uname.
IF sy-subrc NE 0.
IF im_tzone IS NOT INITIAL.
lv_tzone = im_tzone.
ELSE.
lv_tzone = 'UTC'.
ENDIF.
ELSE.
IF lv_tzone IS INITIAL.
IF im_tzone IS NOT INITIAL.
lv_tzone = im_tzone.
ELSE.
lv_tzone = 'UTC'.
ENDIF.
ENDIF.
ENDIF.
ELSEIF im_tzone IS NOT INITIAL.
lv_tzone = im_tzone.
ELSE.
lv_tzone = 'UTC'.
ENDIF.
*--------------------------------------*
* TIMESTAMP PREPARATION *
*--------------------------------------*
IF im_timestamp IS NOT INITIAL.
lv_timestamp = im_timestamp.
ELSE.
CALL FUNCTION 'TZ_UTC_SYSTEMCLOCK'
IMPORTING
* UTC_DATE =
* UTC_TIME =
utc_timestamp = lv_timestamp
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
lv_timestamp = sy-datum.
lv_timestamp+8 = sy-uzeit.
ENDIF.
ENDIF.
*--------------------------------------*
* GET LOCAL TIME *
*--------------------------------------*
CALL FUNCTION 'TZ_GLOBAL_TO_LOCAL'
EXPORTING
* DATE_GLOBAL = '00000000'
timestamp_global = lv_timestamp
timezone = lv_tzone
* TIME_GLOBAL = '000000'
IMPORTING
date_local = ex_local_date
timestamp_local = ex_local_timestamp
time_local = ex_local_time
EXCEPTIONS
OTHERS = 4.
ENDFUNCTION.
IF lv_tzone IS INITIAL.
IF im_tzone IS NOT INITIAL.
lv_tzone = im_tzone.
ELSE.
lv_tzone = 'UTC'.
ENDIF.
ENDIF.
ENDIF.
ELSEIF im_tzone IS NOT INITIAL.
lv_tzone = im_tzone.
ELSE.
lv_tzone = 'UTC'.
ENDIF.
*--------------------------------------*
* TIMESTAMP PREPARATION *
*--------------------------------------*
IF im_timestamp IS NOT INITIAL.
lv_timestamp = im_timestamp.
ELSE.
CALL FUNCTION 'TZ_UTC_SYSTEMCLOCK'
IMPORTING
* UTC_DATE =
* UTC_TIME =
utc_timestamp = lv_timestamp
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
lv_timestamp = sy-datum.
lv_timestamp+8 = sy-uzeit.
ENDIF.
ENDIF.
*--------------------------------------*
* GET LOCAL TIME *
*--------------------------------------*
CALL FUNCTION 'TZ_GLOBAL_TO_LOCAL'
EXPORTING
* DATE_GLOBAL = '00000000'
timestamp_global = lv_timestamp
timezone = lv_tzone
* TIME_GLOBAL = '000000'
IMPORTING
date_local = ex_local_date
timestamp_local = ex_local_timestamp
time_local = ex_local_time
EXCEPTIONS
OTHERS = 4.
ENDFUNCTION.
Monday, April 26, 2010
Tips on ISU_FINDER - Part 1
X_FREE_EXPR - Table Name Allowed:
- EKUN_EXT
- BUT000
- FKKVKP1
- FKKVK
- EVER
- V_EHAU
- EVBS
- V_EANL
- EGPL
- V_EGER
- EABP
- ERDK
- SMORDER
- SMNOTIF
- TECHINST
- EUITRANS
- VBAK
Original Post : ISU_FINDER
Friday, April 23, 2010
Monday, March 8, 2010
Tuesday, March 2, 2010
Sunday, February 7, 2010
Saturday, February 6, 2010
Friday, February 5, 2010
Thursday, February 4, 2010
Wednesday, February 3, 2010
Tuesday, February 2, 2010
Monday, February 1, 2010
Pop Up Error Message
In most of the cases, we are using keyword Message to display desired message at the message area of status bar. However, in certain scenarios, these message will be overidden by other message at upper level of calling function module.
For instance, Program A calls Function Module B and it calls Function Module C, C raised an important exception but B either override it with other message or suppress the message. Thus, the user lost the important message from Function Module C.
One of the solution this kind of scenario would be displaying the message with pop up function module.
1. Getting the error message after calling function module
- Perform a select statement from table T100
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
DATA: lv_err_msg TYPE STRING.
SELECT SINGLE text FROM t100 INTO lv_err_msg
WHERE sprsl EQ sy-langu
AND arbgb EQ sy-msgid
AND msgnr EQ sy-msgno.
ENDIF.
OR
- Write the error message into a string data object.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
DATA: lv_err_msg TYPE STRING.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 INTO
lv_err_msg.
ENDIF.
2. Display the error message with pop up function module. Our recomendations in this scenario would be:
For instance, Program A calls Function Module B and it calls Function Module C, C raised an important exception but B either override it with other message or suppress the message. Thus, the user lost the important message from Function Module C.
One of the solution this kind of scenario would be displaying the message with pop up function module.
1. Getting the error message after calling function module
- Perform a select statement from table T100
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
DATA: lv_err_msg TYPE STRING.
SELECT SINGLE text FROM t100 INTO lv_err_msg
WHERE sprsl EQ sy-langu
AND arbgb EQ sy-msgid
AND msgnr EQ sy-msgno.
ENDIF.
OR
- Write the error message into a string data object.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
DATA: lv_err_msg TYPE STRING.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 INTO
lv_err_msg.
ENDIF.
2. Display the error message with pop up function module. Our recomendations in this scenario would be:
Thursday, January 28, 2010
POPUP_TO_CONFIRM
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
text_question =
* TEXT_BUTTON_1 = 'Ja'(001)
* ICON_BUTTON_1 = ' '
* TEXT_BUTTON_2 = 'Nein'(002)
* ICON_BUTTON_2 = ' '
* DEFAULT_BUTTON = '1'
* DISPLAY_CANCEL_BUTTON = 'X'
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
* IV_QUICKINFO_BUTTON_1 = ' '
* IV_QUICKINFO_BUTTON_2 = ' '
* IMPORTING
* ANSWER =
* TABLES
* PARAMETER =
* EXCEPTIONS
* TEXT_NOT_FOUND = 1
* OTHERS = 2
.
*------------------------------------------
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
text_question =
* TEXT_BUTTON_1 = 'Ja'(001)
* ICON_BUTTON_1 = ' '
* TEXT_BUTTON_2 = 'Nein'(002)
* ICON_BUTTON_2 = ' '
* DEFAULT_BUTTON = '1'
* DISPLAY_CANCEL_BUTTON = 'X'
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
* IV_QUICKINFO_BUTTON_1 = ' '
* IV_QUICKINFO_BUTTON_2 = ' '
* IMPORTING
* ANSWER =
* TABLES
* PARAMETER =
* EXCEPTIONS
* TEXT_NOT_FOUND = 1
* OTHERS = 2
.
*------------------------------------------
* EXPLANATION:
*------------------------------------------
1. TITLEBAR => Text to be displayed on the title bar of the modal dialog box.
2. DIAGNOSE_OBJECT => Diagnosis text (DOKHL-OBJECT). It must be created and maintained via T-Code SE61, document class equals to Dialog Text (DT).
3. TEXT_QUESTION => Text line to be displayed on Modal Dialog Box. Screen length is dynamically adjusted.
4. TEXT_BUTTON_1 => Text to be displayed on Button 1.
5. ICON_BUTTON_1 => Icon to be displayed on Button 1. (Any ICON-NAME)
6. TEXT_BUTTON_2 => Text to be displayed on Button 2.
7. ICON_BUTTON_2 => Icon to be displayed on Button 2. (Any ICON-NAME)
8. DEFAULT_BUTTON => Cursor Position
· '1' = Button 1
· Other values = Button 2
9. DISPLAY_CANCEL_BUTTON => 'X' or SPACE. ‘X’ to display cancel button
10.USERDEFINED_F1_HELP => Must be created and maintained via T-Code SE61 (DOKHL-OBJECT). This will create additional information button after Button 2 and before cancel button (if applicable).
11.START_COLUMN => x position of the modal dialog box
12.START_ROW => y position of the modal dialog box
13.POPUP_TYPE => Icon to be displayed at the left hand side of the modal dialog. Allowed value includes 'NO_ICON' or the icon name in the following list:
14.IV_QUICKINFO_BUTTON_1 => Quick Information Text to be displayed when cursor scrolled over button 1.
15.IV_QUICKINFO_BUTTON_2 => Quick Information Text to be displayed when cursor scrolled over button 2.
16.ANSWER => Result of the button pressed.
· 'A' = Cancel Button
· '1' = Button 1
· '2' = Button 2
17.PARAMETER => You can maintain parameter in the text. Parameter must be written in uppercase and enclosed with ampersands. For e.g. &AMOUNT& is written in the Diagnosis Text maintained in SE61. Then PARAMETER-PARAM = 'AMOUNT', PARAMETER-VALUE = '10.00'.
*------------------------------------------
* SCREEN SHOT:
*------------------------------------------
*------------------------------------------
* NOTE:
*------------------------------------------
Please refer to SAP sample program RSSPO120 for more information.
Subscribe to:
Posts (Atom)