Search code examples
abapsap-erpdynpro

double click to forward output to transaction


I have made a program which outputs a list of equipment numbers using WRITE. The transaction IE03 lets the user input an equipment number, execute, and then displays a whole bunch of information on that piece of equipment.

What I would like to do is be able to double click on one of the numbers my program outputs, and then have the data display that IE03 would offer.

How do I integrate my custom program with the standard display functions?


Solution

  • Use the advice which gave vwegert, or:

    REPORT  ztest.
    
    CONSTANTS:
      gc_equpment_view_tcode TYPE sytcode VALUE 'IE03'.
    
    DATA:
          gt_eqkt TYPE TABLE OF eqkt,
          gs_eqkt TYPE eqkt.
    
    START-OF-SELECTION.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_eqkt FROM eqkt
      JOIN equi ON ( equi~equnr EQ eqkt~equnr ) UP TO 10 ROWS
      WHERE eqkt~spras EQ sy-langu.
    
    END-OF-SELECTION.
      LOOP AT gt_eqkt INTO gs_eqkt.
        WRITE: / gs_eqkt-equnr, gs_eqkt-eqktx.
        HIDE: gs_eqkt-equnr.
      ENDLOOP.
    
    
    AT LINE-SELECTION. 
      CALL FUNCTION 'AUTHORITY_CHECK_TCODE' " check S_TCODE auth. object
        EXPORTING
          tcode  = gc_equpment_view_tcode
        EXCEPTIONS
          ok     = 1
          not_ok = 2
          OTHERS = 3.
      IF sy-subrc EQ 1.
        SET PARAMETER ID 'EQN' FIELD gs_eqkt-equnr.
        "check I_TCODE auth. object (see IE03 definition)
        CALL TRANSACTION gc_equpment_view_tcode AND SKIP FIRST SCREEN.
      ENDIF.