Search This Blog

Wednesday, April 14, 2021

How to change released TR into Unreleased TR

 

How to change released TR into Unreleased TR




1. Go to SE38

2. execute the report RDDIT076




3. now, we will get the below screen which asks for TR/Tasks . give the released TR number and execute (F8)


4. Once executed, you will get the below window,


5. first we need to change the task to unreleased. double click on the task number. now, click on the pencil button to enter edit mode.then click on input help on the filed “Status”


6. change the status from “R” to “D” and save


7. now repeat the steps 5 and 6 for Transport request. finally the status column should be in “D” as shown in below.


8. now goto SE01 or SE09, type the TR number and check. it will be in modifiable state.

Friday, April 9, 2021

Using Collect and Append in SAP ABAP

 

Using Collect and Append in SAP ABAP





COLLECT : This keyword is used for summation purposes.. when you collect a record to an internal table, it will find that is the table already have any record with the same key values? If yes, then it will add all the numeric values of the new record to the existing record without changing the non numeric values. But, if there is no record with this key value, it will create a new record.

APPEND: This keyword will append the current contents of the table header or the structure to the end of the table as a new record.. This will not affect the any existing record of the table.

REPORT ZTEST.


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""  COLLECT STATEMENT
TYPES: BEGIN OF TY_DATA, "user defined type
       ID TYPE N ,
       NAME TYPE CHAR20,
       SALARY TYPE I,
      END OF TY_DATA.
DATA : ITAB TYPE TABLE OF TY_DATA. "internal table
DATA : WA TYPE TY_DATA. "work area

WA-ID = 1.
WA-NAME = 'EMP1'.
WA-SALARY = 5000.
COLLECT WA INTO ITAB. "collect
CLEAR WA.

WA-ID = 2.
WA-NAME = 'EMP2'.
WA-SALARY = 50000.
COLLECT WA INTO ITAB. "collect
CLEAR WA.

WA-ID = 1.
WA-NAME = 'EMP1'.
WA-SALARY = 15000.
COLLECT WA INTO ITAB. "collect
CLEAR WA.

LOOP AT ITAB INTO WA.
  WRITE:/ WA-ID, WA-NAME, WA-SALARY. "loop and display data
ENDLOOP.



"""""""""""""""""""""""""""""""""""""""               APPEND STATEMENT

REPORT ZTEST.
TYPES: BEGIN OF TY_DATA, "user defined type
       ID TYPE N ,
       NAME TYPE CHAR20,
       SALARY TYPE I,
      END OF TY_DATA.
DATA : ITAB TYPE TABLE OF TY_DATA. "internal table
DATA : WA TYPE TY_DATA. "work area

WA-ID = 1.
WA-NAME = 'Sapnuts'.
WA-SALARY = 5000.
COLLECT WA INTO ITAB. "collect
CLEAR WA.

WA-ID = 2.
WA-NAME = 'SAPabap'.
WA-SALARY = 50000.
COLLECT WA INTO ITAB. "collect
CLEAR WA.

WA-ID = 1.
WA-NAME = 'Sapnuts'.
WA-SALARY = 15000.
COLLECT WA INTO ITAB. "collect
CLEAR WA.

LOOP AT ITAB INTO WA.
  WRITE:/ WA-ID, WA-NAME, WA-SALARY. "loop and display data
ENDLOOP.



Thursday, April 8, 2021

How to use select option from table TVARVC

 

How to use select option from table TVARVC


Sample code below :


  TABLES: VBRK , TVARVC.
  DATA: LV_DATA   TYPE VBRK-FKART VALUE 'XYZ'.
  DATA: LR_DIR_RANGE TYPE RANGE OF CHAR50.
  SELECT SIGN
  OPTI
  LOW
  HIGH
  INTO TABLE LR_DIR_RANGE
  FROM TVARVC
  WHERE  NAME = 'ZSD_BLOCK_BILLING'  AND TYPE = 'S'.
  IF  ( LV_DATA IN LR_DIR_RANGE )  .
    MESSAGE:  'You are not authorized to create bills' TYPE 'I'.
  ELSE.
    WRITE: 'HI'.
  ENDIF.

Monday, April 5, 2021

TMG Events and Steps

 There are 39 events for TMG

  • 01 Before saving the data in the database
  • 02 After saving the data in the database
  • 03 Before deleting the data displayed
  • 04 After deleting the data displayed
  • 05 Creating a new entry
  • 06 After completely performing the function 'Get original'
  • 07 Before correcting the contents of a selected field
  • 08 After correcting the contents of a selected field
  • 09 After getting the original of an entry
  • 10 After creating the header entries for the change task (E071)
  • 11 After changing a key entry for the change task (E071K)
  • 12 After changing the key entries for the change task (E071K)
  • 13 Exit editing (exit main function module)
  • 14 After lock/unlock in the main function module
  • 15 Before retrieving deleted entries
  • 16 After retrieving deleted entries
  • 17 Do not use. Before print: Event 26
  • 18 After checking whether the data has changed
  • 19 After initializing global variables, field symbols, etc.
  • 20 After input in date subscreen (time-dep. tab./views)
  • 21 Fill hidden fields
  • 22 Go to long text maintenance for other languages
  • 23 Before calling address maintenance screen
  • 24 After restricting an entry (time-dep. tab./views)
  • 25 Individual authorization checks
  • 26 Before creating a list
  • 27 After creation or copying a GUID (not a key field)
  • 28 After entering a date restriction for time-dep. views
  • AA Instead of the standard data read routine
  • AB Instead of the standard database change routine
  • AC Instead of the standard 'Get original' routine
  • AD Instead of the standard RO field read routine
  • AE Instead of standard positioning coding
  • AF Instead of reading texts in other languages
  • AG Instead of 'Get original' for texts in other languages
  • AH Instead of DB change for texts in other languages
  • ST GUI menu main program name
  • AI Internal use only

STEPS :

STEPS FOR TMG EVENTS  :


1.  Create table in se11 and activate.

2.  Go to Utilities to select the Table maintenance generator.

3.  provide all required data for tmg.

4.  Go to envirnment -> Modification -> Events

5. To POP-UP the Information box “Do not make any changes (SAP data)”. Accept it.

6.  Click on new entries.

7.  from the pop-up window select the required event.

8.  Provide form routine name after that click on editor button.

9.  Select the new include and write your code as per event.

Wednesday, March 31, 2021

Delete internal table where select option is NE

 Delete internal table where select option is NE.



Delete itab where Fields NOT IN S_Field(Select option field)


ex.

 SELECT-OPTIONS: S_PLANT FOR MARC-WERKS.

  START-OF-SELECTION.



 DELETE ITAB WHERE NOT WERKS IN S_PLANT.



Saturday, March 27, 2021

Breakpoints and Breakpoint Statements

 Breakpoints and Breakpoint Statements


There are the following types of breakpoints 

The following restrictions apply:

  • Up to 30 session breakpoints, external breakpoints, and debugger breakpoints can be set.

  • A breakpoint is either active or inactive.

    Only active breakpoints take effect. Inactive breakpoints are ignored at runtime.


1. Session Break Point  

2. External Break Point 

3. Break point Statement


Session breakpoints 

you can set session breakpoints in the sap editor (se38) . This breakpoint valid for the same use same session.

External Breakpoints 

You can debug applications with external breakpoints, that use the RFC interface or HTTP protocol.

This Valid for only 2 hours.


Breakpoint Statement

This can be triggered by breakpoint statement.

BREAK-POINT.


Pages