SAP/ABAP tips

  • How To Change a Customizing SAP Table to an Application Table
  • Trace BAPI/FM (performance)
  • How to Debug a Running Job
  • Activate &SAP_EDIT in SE16N
  • SE16SL - Field-Based Table and Value Search 
  • How to find a BADI to implement?
  • Working with exceptions
  • How can I execute a transaction under another user?
  • How to find a string in the ABAP codes?
  • How can I turn off MS word editor in Smartforms?
  • How to find the enhancement for the exit?
  • How to create a SAP parameter ID? (12.05..2021)
  • How to create a new number range?
  • How to create an archive object?
  • How to create an object for change documents?
  • How to Create Authorization Object and Object class in SAP Using SU21

How To Change a Customizing SAP Table to an Application Table

Current settings (Customizing activities whose corresponding Customizing objects are denoted accordingly) cannot be maintained in a test client that is 'not modifiable'. The system displays error message TK430: Client &1 has status 'not modifiable'

The transport connection for the view or table can be deactivated as follows:
  1. Call transaction SE54
  2. Enter the Customizing object (view or table)
  3. Select "Generated objects"
  4. Choose "Create/change"
  5. Select "no, or user, recording routine" in the bottom part of the screen
  6. Save the change
In the case of a view cluster, you can deactivate the transport link by switching it off for all related views or tables. Follow the steps below:
  1. Call transaction SOBJ
  2. Select "Display"
  3. Select "Position"
  4. In the field "Object", enter the Customizing object (View cluster) and the value "C" into the type field.
  5. Select the Customizing object and select "Piece list" in the navigation
  6. All views or tables contained in the view cluster are displayed. Deactivate the transport link for these views or tables as described above.
Now the corresponding Customizing object is no longer subject to the transport connection and is excluded from the changeability check. The change is active in all clients of the system.

When your transport moves to the test environment to test, you may still receive the error message “client not modifiable.” This is caused by the client not being set as a “Production” client in SCC4 and the “Current Settings” indicator. You can test this by having basis temporarily setting the client to “Production” or not. In production, it will not prompt for a transport.

Please, see the note 356483 - Customizing: Current settings in the test system for more details.

Trace BAPI/FM (performance)

Transaction SAT.

How to Debug a Running Job

  1. Set a breakpoint in the ABAP report that you want to debug.
  2. Create a background JOB in SM36 transaction and set a future start.
  3. In the SM37 transaction, put the cursor on the job line, type 'JDBG' in the command line ( no '/' ), and press enter.
  4. The JOB will start in debug mode.

Activate &SAP_EDIT in SE16N

Before implementing the SAP note 1420281, the program used to call a subroutine where it sets the variables GD-EDIT and GD-SAPEDIT to ‘X’ if the function code is &SAP_EDIT.

After implementing SAP note 1420281, the call to a subroutine is removed when the function code is &SAP_EDIT.

SE16SL - Field-Based Table and Value Search 

This transaction will search for any value you like in all tables in the entire system. Example, look for a Commodity text field in all tables:

How to find a BADI to implement?

  1. Go to the TCode SE24 and enter CL_EXITHANDLER as object type.
  2. In 'Display' mode, go to 'Methods' tab.
  3. Double click the method 'Get Instance' to display it source code.
  4. Set a breakpoint on 'CALL METHOD cl_exithandler=>get_class_name_by_interface'.
  5. Then run your transaction.
  6. The screen will stop at this method.
  7. Check the value of parameter 'EXIT_NAME'. It will show you the BADI for that transaction.

Working with exceptions

If it is not clear where the exception is raised, we can set a breakpoint at the exception itself and then get details in the debugger session:

How can I execute a transaction under another user?

Select Utilities Settings ABAP Editor Debugging
  • Select the radio button New Debugger.
  • In the Debugging External Requests
  • Select the User radio button..

How to find a string in the ABAP codes?

Use the program: RPR_ABAP_SOURCE_SCAN.

Smart and script forms 

How can I turn off MS word editor in Smartforms?

The popup about the missed object.

To define MSWord as the default editor for SAPscript / Smart Forms, Run the program RSCPSETEDITOR and Untick SAPscript and Smart Form boxes. Read SAP Note 742662.

How to find the enhancement for the exit?

MODACT Modifications
MODSAP SAP Enhancements

How to create a SAP parameter ID? (12.05..2021)

Go to SM30, enter “TPARA” in Table/View field and press “Maintain”.
Table USR05

How to create a new number range?

  • Setting the number range definition (SNRO)
  • Setting the number range object
  • Transporting the number range to other system
  • Implementing the number range in a program

Add it to the transport via the menu(!)

FM-s
 CALL FUNCTION 'NUMBER_RANGE_ENQUEUE'
  CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
      nr_range_nr        = p_rangeno
      object                  = p_rangeobj
  CALL FUNCTION 'NUMBER_RANGE_DEQUEUE'

How to create an archive object

Step 1: Go to transaction AOBJ-> Click on New Entries

Step 2: Provide the new object name as mentioned below :

Here ZCUSARCH is the name of the custom archiving object.

ZCUSARCH_WRITE and ZCUSARCH_DELETE are WRITE and DELETE programs of custom archiving object respectively. The code for the same is provided in the further steps.

Step 3: Click on the structure definition:

ZTESTARCH is the name of the table the entries of which we are going to archive.

If there are multiple tables which are linked then here we can specify the hierarchy by specifying the parent segment and segment.

Step 4: Click on the Tables from which you only delete.

Here in this section specify the list of tables for which the entries are to be deleted directly from the database when archiving is run. Tough specifying the table name here will not delete the entries directly from database. It has to be explicitly coded in the program to achieve this. But it is an indicator which states that for the tables mentioned in this section archiving is not required.

Step 5: Click on the customizing settings :->

Step 6: Create the Archive write program in SE38

How to create an object for change documents?

    How to Create Authorization Object and Object class in SAP Using SU21

    • Transaction SU21 is to create a class for authorization objects.
    • In the same transaction create an authorization object:

    Authorization field ACTVT. Save and set the permitted activities.

    How to check in the code?

    AUTHORITY-CHECK OBJECT 'S_CARRID'
    ID 'CARRID' FIELD carr
    ID 'ACTVT' FIELD '03'.

    IF sy-subrc <> 0.
    MESSAGE 'No authorization' TYPE 'E'.
    ENDIF.

    Comments