Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

User exit for IH11 tcode for adding extra fields in the output

Former Member
0 Likes
2,571

Hi,

I want add the extra fields in the output of IH11 tcode in sap abap.Is there any user exit or need find the any implicity enhancement.

Please let me know .

Regards,

Shilpa Reddy.

Hi,

I want add the extra fields in the output of IH11 tcode in sap abap.Is there any user exit or need find the any implicity enhancement.

Please let me know .

Regards,

Shilpa Reddy.

11 REPLIES 11
Read only

former_member219850
Participant
0 Likes
2,487

Use this report to find user exit for any tcode.

REPORT ZUSEREXIT.

tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.

         tables : tstct.

data : jtab like tadir occurs 0 with header line.

data : field1(30).

data : v_devclass like tadir-devclass.

parameters : p_tcode like tstc-tcode obligatory.

select single * from tstc where tcode eq p_tcode.

if sy-subrc eq 0.

   select single * from tadir where pgmid = 'R3TR'

                    and object = 'PROG'

                    and obj_name = tstc-pgmna.

   move : tadir-devclass to v_devclass.

      if sy-subrc ne 0.

         select single * from trdir where name = tstc-pgmna.

         if trdir-subc eq 'F'.

            select single * from tfdir where pname = tstc-pgmna.

            select single * from enlfdir where funcname =

            tfdir-funcname.

            select single * from tadir where pgmid = 'R3TR'

                               and object = 'FUGR'

                               and obj_name eq enlfdir-area.

            move : tadir-devclass to v_devclass.

          endif.

       endif.

       select * from tadir into table jtab

                     where pgmid = 'R3TR'

                       and object = 'SMOD'

                       and devclass = v_devclass.

        select single * from tstct where sprsl eq sy-langu and

                                         tcode eq p_tcode.

        format color col_positive intensified off.

        write:/(19) 'Transaction Code - ',

             20(20) p_tcode,

             45(50) tstct-ttext.

                    skip.

        if not jtab[] is initial.

           write:/(95) sy-uline.

           format color col_heading intensified on.

           write:/1 sy-vline,

                  2 'Exit Name',

                 21 sy-vline ,

                 22 'Description',

                 95 sy-vline.

           write:/(95) sy-uline.

           loop at jtab.

              select single * from modsapt

                     where sprsl = sy-langu and

                            name = jtab-obj_name.

                   format color col_normal intensified off.

                   write:/1 sy-vline,

                          2 jtab-obj_name hotspot on,

                         21 sy-vline ,

                         22 modsapt-modtext,

                         95 sy-vline.

           endloop.

           write:/(95) sy-uline.

           describe table jtab.

           skip.

           format color col_total intensified on.

           write:/ 'No of Exits:' , sy-tfill.

        else.

           format color col_negative intensified on.

           write:/(95) 'No User Exit exists'.

        endif.

      else.

          format color col_negative intensified on.

          write:/(95) 'Transaction Code Does Not Exist'.

      endif.

at line-selection.

   get cursor field field1.

   check field1(4) eq 'JTAB'.

   set parameter id 'MON' field sy-lisel+1(10).

   call transaction 'SMOD' and skip first   screen.

Read only

rajkumarnarasimman
Active Contributor
0 Likes
2,487

Hi Shilpa,

If you want to add new fields to ALV output, you have to make sure the following things

  • Field need to be added to structure
  • Field catalog should be maintained
  • Some values we need to assign to that field in internal table

The final table points to structure OBJECT_TAB. Add the new fields in the structure OBJECT_TAB using implicit enhancement as shown below.

Final Internal Table is printing using REUSE_ALV_GRID_DISPLAY/REUSE_ALV_LIST_DISPLAY

Structure at where implicit enhancement is possible to add new fields

IH11 is a report program, using implicit enhancement concept, we can fill the field catalog; also assign the values to the newly added fields in final internal table OBJECT_TAB.

Then you can find the new fields with value in ALV Output. Hope it works.

Regards

Rajkumar Narasimman

Read only

0 Likes
2,487

Thanks for your reply Rajkumar.

I can add the fields here. Then where i need to fill the added fields.

Means in which loop statement i need to fill these fields.

Regards,

Shilpa.

Read only

0 Likes
2,487

Hi Shilpa,

Find any enhancements points are possible before append statement. But in most of the case in standard, we won't get like this.

Before calling REUSE_ALV_GRID_DISPLAY, we need to fill the values for the newly added columns. The Function  REUSE_ALV_GRID_DISPLAY/REUSE_ALV_LIST_DISPLAY is written in some subroutine, at the beginning you may find some enhancement points in there, we can modify the values of final internal table using field symbol concept.


LOOP AT OBJECT_TAB ASSIGING <FS_OBJECT>.

<FS_OBJECT>-FIELD1 = 'NEW_VALUE'.

ENDLOOP.

Regards

Rajkumar Narasimman

Read only

0 Likes
2,487

And Where i need to maintain the fieldcatalog.?

Regards,

Shilpa

Read only

0 Likes
2,487

Hi..

  In the same place, at where you are changing the internal table value, you can maintain the field catalog too..

Regards

Rajkumar Narasimman

Read only

0 Likes
2,487

Thanks Rajkumar.

And last question is where i need to write select query and in which loop i need to call the read statement.Please mention the screenshots if possible.It is very help to me ...

Regards,

Shilpa Reddy.

Read only

0 Likes
2,484

Hi Shilpa,

Normally in Customize code, the following sections 

  • Fetching from database table using Select statement,
  • Data filling into internal table using Read and append statement ,
  • Field catalog and display the value in ALV

all the above will maintain separately, we write codes separately.

But the difference in standard program, we are using inside implicit enhancement , we are going to write all the above section code in the same place.

Please find the enhancement point in Program RIIFL020 in Subroutine SELECTION_L.  Consider the bottom enhancement point which is at the end of subroutine SELECTION_L as shown in the screenshot.

Write the Select, Read and fill the field catalog inside the implicit enhancement itself.

Hope it will work.


Regards


Rajkumar Narasimman

Read only

0 Likes
2,484

Hi Rajkumar,

If done the changes, these changes will effect any other functionality?

Means i am going to change standard program,so that's why i am asking?

Please let me know.

Regards,

Shilpa

Read only

0 Likes
2,484

Hi Shilpa,

Most of the standard programs are written for reusability. So the standard code may call from any program using the following

  • Call Transanction
  • Submit report etc.,

So, during enhancement, we use to mention the condition based on which T-code the code should execute like below.


IF sy-tcode = 'IH11'.

"Enhancement code.

ENDIF.

Regards

Rajkumar Narasimman

Read only

0 Likes
2,484

Thnaks a lot Rajkumar