SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Search Screen Elements



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming
View previous topic :: View next topic  
Author Message
vga
Мастер
Мастер


Age: 195
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Thu Jul 26, 2012 2:35 pm    Post subject: Search Screen Elements Reply with quote

Code:
REPORT  z_show_screen.
TABLES: d020s, d021t.

DATA: BEGIN OF lt_output OCCURS 0,
      dnum TYPE d020s-dnum,
      prog TYPE d020s-prog,
      fnam TYPE d021s-fnam,
      END OF lt_output.

DATA:
h_import LIKE d020s,
lt_d020s LIKE d020s OCCURS 0 WITH HEADER LINE,
lt_d022s LIKE d022s OCCURS 0 WITH HEADER LINE,
lt_d021s LIKE d021s OCCURS 0 WITH HEADER LINE,
lt_d023s LIKE d023s OCCURS 0 WITH HEADER LINE.

SELECT-OPTIONS: so_prog FOR d020s-prog,
                so_dnum FOR d020s-dnum.
PARAMETERS:     p_fldn TYPE d021t-fldn.

START-OF-SELECTION.


  SELECT * FROM d020s INTO TABLE lt_d020s
    WHERE prog IN so_prog
      AND dnum IN so_dnum.

  SORT lt_d020s BY prog dnum.
  DELETE ADJACENT DUPLICATES FROM lt_d020s COMPARING prog dnum.

  LOOP AT lt_d020s.

    CALL FUNCTION 'RS_SCREEN_IMPORT'
      EXPORTING
        dynnr        = lt_d020s-dnum
        progname     = lt_d020s-prog
        wanted_mode  = 'SHOW'
      IMPORTING
        h_import     = h_import
      TABLES
        e_g          = lt_d022s
        f_g          = lt_d021s
        m_g          = lt_d023s
      EXCEPTIONS
        not_executed = 1
        not_found    = 2
        OTHERS       = 3.

    LOOP AT lt_d021s.
      IF lt_d021s-fnam = p_fldn.
        lt_output-dnum = lt_d020s-dnum.
        lt_output-prog = lt_d020s-prog.
        lt_output-fnam = lt_d021s-fnam.
        COLLECT lt_output.
      ENDIF.
    ENDLOOP.

  ENDLOOP.

  LOOP AT lt_output.
    WRITE: / lt_output-dnum, lt_output-prog, lt_output-fnam(50).
  ENDLOOP.

_________________
Молитва - это запрос разработчику на изменение кода программы.
Back to top
View user's profile Send private message Blog Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Dialog Programming All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.