TMG IN SAP ABAP | how to create tmg in sap abap | tmg events in sap abap | Table Maintenance Generator Events | SE11 tcode in sap

TMG IN SAP ABAP | how to create tmg in sap abap | tmg events in sap abap | tmg creation in sap abap | how to create tmg events in sap abap |events in tmg in sap abap

TMG IN SAP ABAP

TMG in SAP ABAP

TMG (Table Maintenance Generator) in SAP ABAP is a tool to generate table maintenance program to maintain table entries in sap, TMG in sap abap created by using transaction code SE11 and TMG events in sap abap call by SM30.

In SAP ABAP sometime abap consultant or a super user required to maintain table records by manual process to fulfill some requirements. in this case we will generate TMG in SAP ABAP or in data dictionary.

For Example: we have requirement to pass some specific entries or some specific commands like we want to pass tax rate or tax calculation in program in all scenario except nil gst case so we will create a TMG in SAP ABAP and pass that table into program codes and if entries found in table then tax rate and calculation will not pass. Please see the below piece of code in program logic to understand the scenario. Here Zcheck_uname is table with TMG and ZSD_PARAM is also table with TMG.

 SELECT SINGLE uname FROM  ZCHECK_UNAME INTO @DATA(lv_flag) WHERE uname = @sy-uname.
    IF lv_flag IS  INITIAL.
      IF SY-TCODE = ‘VF01’ OR SY-TCODE = ‘VF02’ OR SY-TCODE = ‘VF03’.

        DATA(IT_XVBRP) = XVBRP[].
IF IT_XVBRP IS NOT INITIAL.
        SELECT * FROM zsd_param INTO TABLE @DATA(it_tax_12) WHERE ZPROGRAM = ‘RV60AFZZ’
              AND FIELD1    = ‘BILLTAX_12’
              AND FIELD2   = ‘STEUC’
              AND VAL3    = ‘X’.
        SELECT * FROM zsd_param INTO TABLE @DATA(it_tax_5) WHERE ZPROGRAM = ‘RV60AFZZ’
              AND FIELD1    = ‘BILLTAX_5’
              AND FIELD2   = ‘STEUC’
              AND VAL3    = ‘X’.
            SELECT * FROM zsd_param INTO TABLE @DATA(it_tax_COND_TYPE) WHERE ZPROGRAM = ‘RV60AFZZ’
              AND FIELD1    = ‘BILLTAX’
              AND FIELD2   = ‘COND_TYPE’
              AND VAL3    = ‘X’.

        LOOP  AT XKOMV ASSIGNING FIELD-SYMBOL(<FS_KOMV>) WHERE KPOSN  NE ”.” XVBRP-POSNR “VBRP-POSNR

          READ TABLE IT_TAX_COND_TYPE INTO DATA(WA_COND_TYPE) WITH KEY  VAL1 = <FS_KOMV>-KSCHL.
        IF SY-SUBRC IS INITIAL.

          READ TABLE IT_XVBRP INTO DATA(WA_XVBRP) WITH KEY  POSNR = <FS_KOMV>-KPOSN.
          IF SY-SUBRC IS INITIAL.
            SELECT SINGLE steuc FROM marc
            INTO @DATA(lv_steuc)
                  WHERE matnr = @WA_Xvbrp-matnr
                  AND werks = @WA_Xvbrp-werks.


            READ TABLE it_tax_12  INTO DATA(WA_TAX_12) WITH KEY  VAL1 = LV_STEUC+0(4).
            IF SY-SUBRC IS INITIAL.

              CASE <FS_KOMV>-KSCHL.
              WHEN ‘JOIG’.
                IF ( <FS_KOMV>-KAWRT / WA_XVBRP-FKIMG ) LE 1000.
                  <FS_KOMV>-KBETR = ‘120.00’.
                  <FS_KOMV>-KWERT = ( <FS_KOMV>-KAWRT * 12 ) / 100.
                ENDIF.
              WHEN ‘JOCG’.
                IF ( <FS_KOMV>-KAWRT / WA_XVBRP-FKIMG ) LE 1000.
                  <FS_KOMV>-KBETR = ‘60.00’.
                  <FS_KOMV>-KWERT = ( <FS_KOMV>-KAWRT * 60 ) / 1000.
                ENDIF.
              WHEN ‘JOUG’.
                IF <FS_KOMV>-KBETR IS NOT INITIAL.
                  IF ( <FS_KOMV>-KAWRT / WA_XVBRP-FKIMG ) LE 1000.
                    <FS_KOMV>-KBETR = ‘60.00’.
                    <FS_KOMV>-KWERT = ( <FS_KOMV>-KAWRT * 60 ) / 1000.
                  ENDIF.
                ENDIF.
              WHEN ‘JOSG’.
                IF ( <FS_KOMV>-KAWRT / WA_XVBRP-FKIMG ) LE 1000.
                  <FS_KOMV>-KBETR = ‘60.00’.
                  <FS_KOMV>-KWERT = ( <FS_KOMV>-KAWRT * 60 ) / 1000.
                ENDIF.
              ENDCASE.
            ENDIF.


            READ TABLE it_tax_5  INTO DATA(WA_TAX_5) WITH KEY  VAL1 = LV_STEUC+0(2).
            IF SY-SUBRC IS NOT INITIAL .
              READ TABLE it_tax_5  INTO WA_TAX_5 WITH KEY  VAL1 = LV_STEUC+0(4).
            ENDIF.
            IF SY-SUBRC IS INITIAL.
              CASE <FS_KOMV>-KSCHL.
              WHEN ‘JOIG’.
                IF ( <FS_KOMV>-KAWRT / WA_XVBRP-FKIMG ) LE 1000.
                  <FS_KOMV>-KBETR = ‘50.00’.
                  <FS_KOMV>-KWERT = ( <FS_KOMV>-KAWRT * 5 ) / 100.
                ENDIF.
              WHEN ‘JOCG’.
                IF ( <FS_KOMV>-KAWRT / WA_XVBRP-FKIMG ) LE 1000.
                  <FS_KOMV>-KBETR = ‘25.00’.
                  <FS_KOMV>-KWERT = ( <FS_KOMV>-KAWRT * 25 ) / 1000.
                ENDIF.
              WHEN ‘JOUG’.
                IF <FS_KOMV>-KBETR IS NOT INITIAL.
                  IF ( <FS_KOMV>-KAWRT / WA_XVBRP-FKIMG ) LE 1000.
                    <FS_KOMV>-KBETR = ‘25.00’.
                    <FS_KOMV>-KWERT = ( <FS_KOMV>-KAWRT * 25 ) / 1000.
                  ENDIF.
                ENDIF.
              WHEN ‘JOSG’.
                IF ( <FS_KOMV>-KAWRT / WA_XVBRP-FKIMG ) LE 1000.
                  <FS_KOMV>-KBETR = ‘25.00’.
                  <FS_KOMV>-KWERT = ( <FS_KOMV>-KAWRT * 25 ) / 1000.
                ENDIF.
              ENDCASE.
            ENDIF.
          ENDIF.
          ENDIF.
        ENDLOOP.

      ENDIF.
      ENDIF.
    ENDIF.

Table Maintenance Generator Events: Create, Update and Delete

Table Maintenance generator events are Create, Update and Delete, and we all know about create update and delete. table maintenance generator events are called by transaction code SM30.

What is SAP Table Maintenance Generator?

TMG (Table Maintenance Generator) in SAP ABAP is a tool to generate table maintenance program to maintain table entries in sap, TMG in sap abap created by using transaction code SE11 and TMG events in sap abap call by SM30.

In SAP ABAP sometime abap consultant or a super user required to maintain table records by manual process to fulfill some requirements. in this case we will generate TMG in SAP ABAP or in data dictionary.

How to create Table Maintenance Generator?

To create Table Maintenance Generator in SAP ABAP please follow the below steps.

Step 1. Enter T-code SE11 (ABAP Dictionary) in command box.

SE11 tcode in sap
SE11 tcode in sap

Step 2. Now ABAP Dictionary initial screen will open here you have to enter table name and click on create button.

How to create Table Maintenance Generator
SE11

Step 3. Complete the process of table creation, after table creation process create TMG in table.

Table Maintenance Generator
Table Maintenance Generator
Table Maintenance Generator
Table Maintenance Generator

Step 4. Enter authorization group, function group and maint. screen no. after entering the detail click on create button your TMG will created.

Table Maintenance Generator
Table Maintenance Generator

FAQ

What is the T-code to create Table?

To create database table or data dictionary related element we will use Transaction code SE-11.

What is TMG?

TMG stands for table maintenance generator, TMG created because we want a table into maintenance mode. sometime user or technical requirement is to maintain a table a run the process accordingly.

What are the TMG events in SAP ABAP?

Create, update and delete are the main events of table maintenance generator.

Others Articles You Can Also Look :

Hope this article helps you to understand the process of TMG in Table.

2 thoughts on “TMG IN SAP ABAP | how to create tmg in sap abap | tmg events in sap abap | Table Maintenance Generator Events | SE11 tcode in sap”

Comments are closed.

%d bloggers like this: