Friday, April 20, 2012

Implementing Tabstrips through selection screen

*&---------------------------------------------------------------------*
REPORT  ztabstrip1
       
NO STANDARD PAGE HEADING.
*---------------------------------------------------------------------*
*   Selection screen
*---------------------------------------------------------------------
*Three subscreens 101, 102 and 103 are created.

SELECTION-
SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
SELECTION-
SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS
p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'  USER-COMMAND check,
p_rad2 
RADIOBUTTON GROUP grp1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-
SCREEN END OF SCREEN 101.

SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
SELECTION-
SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_char1(5TYPE c.
SELECTION-
SCREEN END OF BLOCK b2.
SELECTION-
SCREEN END OF SCREEN 102

SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.
SELECTION-
SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_char2(5TYPE c.
SELECTION-
SCREEN END OF BLOCK b3.
SELECTION-
SCREEN END OF SCREEN 103.

*Three tabs are created and one subscreen is assigned to each tab

SELECTION-SCREEN BEGIN OF TABBED BLOCK one FOR 20 LINES.
*Tab 1
SELECTION-
SCREEN TAB (15) name1 USER-COMMAND ucomm1
DEFAULT SCREEN 101.
*Tab 2
SELECTION-
SCREEN TAB (17) name2 USER-COMMAND ucomm2
DEFAULT SCREEN 102.
*Tab 3
SELECTION-
SCREEN TAB (17) name3 USER-COMMAND ucomm3
DEFAULT SCREEN 103.
SELECTION-
SCREEN END OF BLOCK one.





*---------------------------------------------------------------------*
* Initialization
*---------------------------------------------------------------------
*Initialize the name of each tab
INITIALIZATION.
  name1 = 'Tab 1'.
  name2 = 
'Tab 2'.
  name3 = 
'Tab 3'.

*---------------------------------------------------------------------*
*   AT SELECTION-SCREEN
*---------------------------------------------------------------------
*When the second radio button is selected, Tab 3 is hidden
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    
IF p_rad2 = 'X'.
      
IF screen-name = 'NAME3'.
        
screen-invisible = '1'.
        
MODIFY SCREEN.
      
ENDIF.
    
ENDIF.
  
ENDLOOP. 

When module pool programs are not preferred, but a tab strip is required, the above approach can be used. Each subscreen can be designed as per requirement, with parameters, radio buttons, text, etc.

Production system entries after moving the transport request - erroneous

Production system entries  after moving the transport request  - erroneous

Analysis :-  Some transport requests created in DEV and moved till Quality only  ,  not moved to Production.    Table entries in  DEV and QUA  and PRD  should be same always.


Consequence :-  Production environment badly hit  and   high priority calls received.

Customizing  the  table entries  in the  function modules :-


1.       We receive  CR / SR  to   customize some entries  in  functional modules like SD/MM/FI etc.
2.       Check the table  which is going to be effected because of making changes
3.       We have to check  the Development,  Quality  and  Production  and ensure that  the respective  table in all clients have  same number of entries.
4.       Then make changes in Development and move to Quality  ,  UAT  and  then to Production.


This is very important because  if the entries are not similar in Development and  Production,  then  production will be badly hit  as   someone had done changes in  Development and  moved till quality only  and   not taken to  Production for some reason or the  other.

Thursday, April 19, 2012

Values of SY-SUBRC on different ABAP statements

SY-SUBRC is a return code, set by the following ABAP statements.As a rule, if SY-SUBRC = 0, the statement was executed successfully.
1. ASSIGN sets SY-SUBRC to 0 if the field symbol assignment was possible, otherwise to 4.
2. AUTHORITY-CHECK sets SY-SUBRC to 0 if the user has the required authorization, otherwise to 4, 8, 12, 16, 24, 28, 32, or 36 depending on the cause of the authorization failure.
3. CALL DIALOG with USING sets SY-SUBRC to 0 if the processing is successful, otherwise to a value other than 0.
4. CALL FUNCTION sets SY-SUBRC in accordance with the defined exception handling.
5. CALL METHOD sets SY-SUBRC in accordance with the defined exception handling.
6. CALL SELECTION-SCREEN sets SY-SUBRC to 0 if the user chooses Enter or Execute, and 4 if the user chooses Cancel.
7. CALL TRANSACTION with USING sets SY-SUBRC to 0 if the processing is successful, otherwise to a value other than 0.
8. CATCH SYSTEM-EXCEPTIONS sets SY-SUBRC after the ENDCATCH statement if a system exception occurs. The value is set in the program.
9. COMMIT WORK sets SY-SUBRC to 0. COMMIT WORK AND WAIT sets SY-SUBRC to 0 if the update is successful, otherwise to a value other than 0.
10. COMMUNICATION INIT DESTINATION ... RETURNCODE sets SY-SUBRC as specified.
11. CONCATENATE sets SY-SUBRC to 0 if the result fits into the target variable, otherwise to 4.
12. CREATE OBJECT sets SY-SUBRC if the exceptions of the instance constructor are handled in the program.
13. CREATE OBJECT in OLE2 sets SY-SUBRC to 0 if an external object could be created, otherwise to 1, 2, or 3, depending on the cause.
14. DELETE sets SY-SUBRC to 0 if the operation is successful, otherwise to 4 or another value other than 0, depending on the cause.
15. DEMAND ... MESSAGES INTO sets SY-SUBRC to 0 if the message table is empty, otherwise to a value other than 0.
16. DESCRIBE LIST sets SY-SUBRC to 0 if the line or list exists, otherwise to 4 or 8.
17. EXEC SQL - ENDEXEC sets SY-SUBRC to 0 in nearly all cases. It does, however, set SYSUBRC to 4 if no entry is read in a FETCH statement.
18. FETCH sets SY-SUBRC to 0 if at least one line was read, otherwise to 4.
19. GENERATE SUBROUTINE POOL sets SY-SUBRC to 0 if the generation was successful, otherwise to 8.
20. GET CURSOR sets SY-SUBRC to 0 if the cursor is correctly positioned, otherwise to 4.
21. GET PARAMETER sets SY-SUBRC to 0 if a corresponding value exists in SAP memory, otherwise to 4.
22. IMPORT sets SY-SUBRC to 0 if the import is successful, otherwise to 4.
23. INSERT sets SY-SUBRC to 0 if the operation is successful, otherwise to 4.
24. LOAD REPORT sets SY-SUBRC to 0 if the operation is successful, otherwise to 4 or 8 depending on the cause of the error.
25. LOOP sets SY-SUBRC to 0 if there is at least one pass through the extract. Otherwise, it is set to a value other than 0.
26. LOOP AT sets SY-SUBRC to 0 if there is at least one loop pass through the internal table, otherwise to 4.
27. MODIFY sets SY-SUBRC to 0 if the operation is successful, otherwise to 4.
28. MODIFY LINE sets SY-SUBRC to 0 if a line in the list was changed, otherwise it sets it to a value other than 0.
29. MODIFY sets SY-SUBRC to 0 if the operation is successful, otherwise to 4.




30. OLE2 Automation, executed successfully, otherwise 1, 2, 3, or 4, depending on the cause of the error.
31. OPEN DATASET sets SY-SUBRC to 0 if the file could be opened, otherwise to 8.
32. Open SQL statements set SY-SUBRC to 0 if the operation is successful, otherwise to a value other than 0.
33. OVERLAY sets SY-SUBRC to 0 if at least one character is overlaid, otherwise to 4.
34. READ DATASET sets SY-SUBRC to 0 if the read operation was successful, otherwise to 4 or 8, depending on the cause of the error.
35. READ LINE sets SY-SUBRC to 0 if a list line exists, otherwise to a value other than 0.
36. READ TABLE sets SY-SUBRC to 0 if table lines are found, otherwise to 2, 4, or 8, depending on the context and cause of the error.
37. REPLACE sets SY-SUBRC to 0 if the search string was replaced, otherwise to a value other than 0.
38. SCROLL sets SY-SUBRC to 0 if the scrolling within the list was successful, otherwise to 4 or 8, depending on the cause.
39. SEARCH sets SY-SUBRC to 0 if the search string was found, otherwise to 4.
40. SELECT sets SY-SUBRC to 0 if at least one line was read, otherwise to 4, or possibly 8 in SELECT SINGLE FOR UPDATE.
41. SET COUNTRY sets SY-SUBRC if the country code exists in table T005X, otherwise to 4.
42. SET BIT sets SY-SUBRC to 0 if the bit could be set, otherwise to a value other than 0.
43. SET TITLEBAR sets SY-SUBRC to 0 if the title exists, otherwise to 4.
44. SHIFT ... UP TO sets SY-SUBRC to 0 if the position could be found within the string, otherwise to 4.
45. SPLIT sets SY-SUBRC to 0 if the sizes of the target fields are adequate, otherwise to 4.
46. UPDATE sets SY-SUBRC to 0 if the operation is successful, otherwise to 4.
47. WRITE ... TO sets SY-SUBRC to 0 if the assignment is successful, otherwise to 4.