Module pool programming query

Dear friends,
I have a problem in handling tabstrips in module pool programming.
the problem is when i go to next screen it gets initiated to the tab number which i have declared in the data part.
but the data in the screen remains intact.
after pressing the option in the status it gets initiated and then i have to click the particular tab to go the tab and to see the changes get affected.
how to solve this problem.
plz do the needful.
regards
samarendra

Hi,
You just need to create the screen........
PAI
*&  Include           MZDS_CRTSCREENI01
*&      Module  USER_COMMAND_0100  INPUT
*       text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
  WHEN 'BACK'.
    LEAVE TO SCREEN 0.
  WHEN 'SPFLI' OR 'SBOOK'.
     TAB1-ACTIVETAB = OK_CODE.
  WHEN 'EXIT'.
    LEAVE PROGRAM.
  WHEN 'CANCEL'.
    LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
PBO
*&  Include           MZDS_CRTSCREENO01
*&      Module  STATUS_0100  OUTPUT
*       text
MODULE STATUS_0100 OUTPUT.
  SET PF-STATUS 'BASE'.
  SET TITLEBAR 'TITLE'.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&      Module  CLEAR_OKCODE  OUTPUT
*       text
MODULE CLEAR_OKCODE OUTPUT.
CLEAR OK_CODE.
ENDMODULE.                 " CLEAR_OKCODE  OUTPUT
MODULE DISPLAY_DATA OUTPUT.
CASE 'X' .
   WHEN RBT-SPFLI.
    SELECT CITYFROM AIRPFROM CITYTO AIRPTO FROM SPFLI
    INTO CORRESPONDING FIELDS OF TABLE IT_SPFLI
    WHERE CARRID = SPFLI-CARRID
    AND CONNID = SPFLI-CONNID.
FLDATE = ' '.
BOOKNO = ' '.
CUSTNO = ' '.
LOOP AT IT_SPFLI.
   DEP_CITY = IT_SPFLI-CITYFROM.
   DEP_AIR = IT_SPFLI-AIRPFROM.
   DES_CITY = IT_SPFLI-CITYTO.
   DES_AIR = IT_SPFLI-AIRPTO.
ENDLOOP.
  WHEN RBT-SBOOK.
    SELECT SINGLE FLDATE BOOKID CUSTOMID FROM SBOOK
    INTO CORRESPONDING FIELDS OF IT_SBOOK
    WHERE CARRID = SPFLI-CARRID
    AND CONNID = SPFLI-CONNID.
   FLDATE = IT_SBOOK-FLDATE.
   BOOKNO = IT_SBOOK-BOOKID.
   CUSTNO = IT_SBOOK-CUSTOMID.
DEP_CITY = ' '.
DEP_AIR = ' '.
DES_CITY = ' '.
DES_AIR = ' '.
ENDCASE.
ENDMODULE.
*&      Module  CALL_DYNNR  OUTPUT
*       text
MODULE CALL_DYNNR OUTPUT.
CASE TAB1-ACTIVETAB.
  WHEN 'SPFLI'.
    DYNNR = 102.
  WHEN 'SBOOK'.
    DYNNR = 103.
  WHEN OTHERS.
    TAB1-ACTIVETAB = 'SPFLI'.
    DYNNR = 102.
ENDCASE.
ENDMODULE.                 " CALL_DYNNR  OUTPUT
*&      Module  DISPLAY_SFLIGHT  OUTPUT
*       text
MODULE DISPLAY_SFLIGHT OUTPUT.
SELECT CITYFROM AIRPFROM CITYTO AIRPTO FROM SPFLI
    INTO CORRESPONDING FIELDS OF TABLE IT_SPFLI
    WHERE CARRID = SPFLI-CARRID
    AND CONNID = SPFLI-CONNID.
CITY_FROM = IT_SPFLI-CITYFROM.
AIRP_FROM = IT_SPFLI-AIRPFROM.
CITY_TO = IT_SPFLI-CITYTO.
AIRP_TO = IT_SPFLI-AIRPTO.
ENDMODULE.                 " DISPLAY_SFLIGHT  OUTPUT
*&      Module  DISPLAY_SBOOK  OUTPUT
*       text
MODULE DISPLAY_SBOOK OUTPUT.
SELECT SINGLE FLDATE BOOKID CUSTOMID FROM SBOOK
    INTO CORRESPONDING FIELDS OF IT_SBOOK
    WHERE CARRID = SPFLI-CARRID
    AND CONNID = SPFLI-CONNID.
FL_DATE = IT_SBOOK-FLDATE.
BOOKID = IT_SBOOK-BOOKID.
CUSTOMID = IT_SBOOK-CUSTOMID.
ENDMODULE.                 " DISPLAY_SBOOK  OUTPUT
TOP INCLUDE
*& Include MZDS_CRTSCREENTOP                                 Module Pool      SAPMZDS_CRTSCREEN
PROGRAM  SAPMZDS_CRTSCREEN.
TABLES: SPFLI,SBOOK.
DATA: OK_CODE TYPE SYUCOMM.
CONTROLS TAB1 TYPE TABSTRIP.
DATA: BEGIN OF IT_SPFLI OCCURS 0,
      CITYFROM TYPE SPFLI-CITYFROM,
      AIRPFROM TYPE SPFLI-AIRPFROM,
      CITYTO TYPE SPFLI-CITYTO,
      AIRPTO TYPE SPFLI-AIRPTO,
  END OF IT_SPFLI.
DATA: IT_SBOOK TYPE SBOOK.
DATA: DYNNR TYPE SY-DYNNR.
DATA: DEP_CITY(20) TYPE C,
      DEP_AIR(20) TYPE C,
      DES_CITY(20) TYPE C,
      DES_AIR(20) TYPE C.
DATA: FLDATE(20) TYPE C,
      BOOKNO(20) TYPE C,
      CUSTNO(20) TYPE C.
DATA:CITY_FROM(20) TYPE C,
     AIRP_FROM(20) TYPE C,
     CITY_TO(20) TYPE C,
     AIRP_TO(20) TYPE C.
DATA: FL_DATE(20) TYPE C,
      BOOKID(20) TYPE C,
      CUSTOMID(20) TYPE C.
DATA: BEGIN OF RBT,
      SPFLI VALUE 'X',
      SBOOK,
      END OF RBT.
HTH
Regards,
Dhruv Shah

Similar Messages

  • Module pool program query

    Hi,
    I am working on module pool program.
    I want to calculate sum of two fields into a third field. I have written the same in PAI (using FIELD statement). But say if the user does not click on enter and directly clicks on SAVE button, the numeric fields lose their value.
    Alpha-numeric screen values are getting transported to abap program even if SAVE is directly clicked.
    Kindly help.

    Hi....
    Iam not able to understand your problem.
    Plz get back again...,post the problem clearly!!
    The problem might be solve with CLEAR statement.
    Thanks,
    Naveen Inuganti.

  • How to DOWNLOAD  a whole module pool program????

    Hi..
    can anybody tell me how to download a <b>whole module pool program</b> into my desktop with .sap extension???
    Actually i want to download a whole module pool program from a server so that i can upload the same program into another sap server instead of writing the whole code.
    Thanx in advance......

    the program is exits..
    i don't y it is not for ur.....
    i am sending d code for the same....
    create a program and check...
    *& Report  REPTRAN                                                     *
    *& This report allows to display and save complete programs and        *
    *& function modules.                                                   *
    *& This report was originally written by Frank Wolf, Xaption GmbH.     *
    *& Its original name was ZREPTRAN (see www.abaps.de).                  *
    REPORT  reptran LINE-SIZE 170      .
    TABLES: d010inc, trdir, eudb, title, d020t, trkey, tfdir, tmdir, tadir,
            seoclass,  seoclassdf, seoclassex, seoclasstx, seometarel,
            seocompo,  seocompodf, seocompoex, seocompotx, seoimplrel,
            seomapatt, seomapcls,  seoredef,   seofriends, seotypepls,
            seosubco,  seosubcodf, seosubcoex, seosubcotx.
    TYPES: abapline(255).
    TYPES: BEGIN OF ty_tit,
            code TYPE rsoldleng-title,
            text TYPE title-text_line,
           END OF ty_tit.
    TYPES: BEGIN OF ty_reptxt,
            id TYPE textpool-id,
            key TYPE textpool-key,
            entry TYPE textpool-entry,
            length(4) TYPE n,
           END OF ty_reptxt.
    TYPES: BEGIN OF ty_d020t,
            prog TYPE d020t-prog,
            dynr TYPE d020t-dynr,
            dtxt TYPE d020t-dtxt,
           END OF ty_d020t.
    TYPES: BEGIN OF dynp_rel_type,         "Dynpro-Releases
            rel(1),
            dot(1),
            version(2),
           END OF dynp_rel_type.
    TYPES: BEGIN OF ty_seocompodf_t.
            INCLUDE STRUCTURE seocmpkey.
    TYPES:  version TYPE seocompodf-version,
            alias TYPE seocompodf-alias,
            redefin TYPE seocompodf-redefin,
            exposure TYPE seocompodf-exposure,
            state TYPE seocompodf-state,
            editorder(4) TYPE n,
            locked TYPE seocompodf-locked,
            dispid(4) TYPE n.
            INCLUDE STRUCTURE seochange.
            INCLUDE STRUCTURE seomtdapx.
            INCLUDE STRUCTURE seoevtapx.
            INCLUDE STRUCTURE seotypapx.
    TYPES:  typtype TYPE seocompodf-typtype,
            type TYPE seocompodf-type,
            tableof TYPE seocompodf-tableof,
            srcrow1(4) TYPE n,
            srccolumn1(2) TYPE n,
            srcrow2(4) TYPE n,
            srccolumn2(2) TYPE n.
            INCLUDE STRUCTURE seocmpref.
    TYPES: END OF ty_seocompodf_t.
    TYPES: BEGIN OF ty_seosubcodf_t.
            INCLUDE STRUCTURE seoscokey.
    TYPES:  version TYPE seosubcodf-version,
            editorder(4) TYPE n,
            dispid(4) TYPE n.
            INCLUDE STRUCTURE seochange.
    TYPES:  pardecltyp TYPE seosubcodf-pardecltyp,
            parpasstyp TYPE seosubcodf-parpasstyp,
            typtype TYPE seosubcodf-typtype,
            type TYPE seosubcodf-type,
            tableof TYPE seosubcodf-tableof,
            srcrow1(4) TYPE n,
            srccolumn1(2) TYPE n,
            srcrow2(4) TYPE n,
            srccolumn2(2) TYPE n,
            parvalue TYPE seosubcodf-parvalue,
            paroptionl TYPE seosubcodf-paroptionl.
            INCLUDE STRUCTURE seoexcapx.
    TYPES: END OF ty_seosubcodf_t.
    Release bis 3.1
    *INCLUDE mseuxcom.
    DATA: eu_key TYPE rseu1_key.
        Titel
    DATA: tit    TYPE STANDARD TABLE OF ty_tit     WITH HEADER LINE.
    Release from 4.6
    DATA: fun4   TYPE STANDARD TABLE OF rsmpe_funt WITH HEADER LINE.
    DATA: ctx4   TYPE STANDARD TABLE OF rsmpe_ctx  WITH HEADER LINE.
    DATA: mtx4   TYPE STANDARD TABLE OF rsmpe_mnlt WITH HEADER LINE.
    DATA: men4   TYPE STANDARD TABLE OF rsmpe_men  WITH HEADER LINE.
    DATA: act4   TYPE STANDARD TABLE OF rsmpe_act  WITH HEADER LINE.
    DATA: doc4   TYPE STANDARD TABLE OF rsmpe_atrt WITH HEADER LINE.
    DATA: sta4   TYPE STANDARD TABLE OF rsmpe_stat WITH HEADER LINE.
    DATA: set4   TYPE STANDARD TABLE OF rsmpe_staf WITH HEADER LINE.
    DATA: pfk4   TYPE STANDARD TABLE OF rsmpe_pfk  WITH HEADER LINE.
    DATA: but4   TYPE STANDARD TABLE OF rsmpe_but  WITH HEADER LINE.
    DATA: tit4   TYPE STANDARD TABLE OF rsmpe_titt WITH HEADER LINE.
    DATA: stx4   TYPE STANDARD TABLE OF rsmptexts  WITH HEADER LINE.
    DATA: adm4   TYPE rsmpe_adm.
    Release from 4.6c
    DATA: biv46c TYPE STANDARD TABLE OF rsmpe_buts WITH HEADER LINE.
    DATA: reports    TYPE STANDARD TABLE OF trdir-name WITH HEADER LINE,
          reportname TYPE string.
    DATA: i_repsrc TYPE STANDARD TABLE OF abapline   WITH HEADER LINE.
    DATA: i_reptx  TYPE STANDARD TABLE OF textpool   WITH HEADER LINE.
    DATA: i_reptxt TYPE STANDARD TABLE OF ty_reptxt  WITH HEADER LINE.
    DATA: i_adm4 TYPE STANDARD TABLE OF rsmpe_adm    WITH HEADER LINE.
    DATA: i_tmd TYPE STANDARD TABLE OF tmdir.
    DATA: i_tfd TYPE STANDARD TABLE OF tfdir.
    DATA: i_cls TYPE STANDARD TABLE OF seoclass.
    DATA: i_cdf TYPE STANDARD TABLE OF seoclassdf.
    DATA: i_clx TYPE STANDARD TABLE OF seoclassex.
    DATA: i_clt TYPE STANDARD TABLE OF seoclasstx.
    DATA: i_cmr TYPE STANDARD TABLE OF seometarel.
    DATA: i_cmp TYPE STANDARD TABLE OF seocompo.
    DATA: i_cmd TYPE STANDARD TABLE OF seocompodf WITH HEADER LINE.
    DATA: i_cmd_t TYPE STANDARD TABLE OF ty_seocompodf_t WITH HEADER LINE.
    DATA: i_cmx TYPE STANDARD TABLE OF seocompoex.
    DATA: i_cmt TYPE STANDARD TABLE OF seocompotx.
    DATA: i_irl TYPE STANDARD TABLE OF seoimplrel.
    DATA: i_mat TYPE STANDARD TABLE OF seomapatt.
    DATA: i_mac TYPE STANDARD TABLE OF seomapcls.
    DATA: i_red TYPE STANDARD TABLE OF seoredef.
    DATA: i_frd TYPE STANDARD TABLE OF seofriends.
    DATA: i_tpl TYPE STANDARD TABLE OF seotypepls.
    DATA: i_sco TYPE STANDARD TABLE OF seosubco.
    DATA: i_scd TYPE STANDARD TABLE OF seosubcodf WITH HEADER LINE.
    DATA: i_scd_t TYPE STANDARD TABLE OF ty_seosubcodf_t WITH HEADER LINE.
    DATA: i_scx TYPE STANDARD TABLE OF seosubcoex.
    DATA: i_sct TYPE STANDARD TABLE OF seosubcotx.
    DATA: i_inc TYPE STANDARD TABLE OF d010inc-include WITH HEADER LINE.
    DATA: i_d020t TYPE STANDARD TABLE OF ty_d020t WITH HEADER LINE.
    DATA: hdr TYPE d020s,
          fld TYPE STANDARD TABLE OF d021s WITH HEADER LINE,
          src TYPE STANDARD TABLE OF d022s WITH HEADER LINE,
          mat TYPE STANDARD TABLE OF d023s WITH HEADER LINE.
    CONSTANTS:
               stars(64)          VALUE
                                                                "#EC NOTEXT
               comment1(64)       VALUE
    '*   THIS FILE IS GENERATED BY THE SCREEN PAINTER.              *',
                                                                "#EC NOTEXT
               comment2(64)       VALUE
    '*   NEVER CHANGE IT MANUALLY, PLEASE !                         *',
                                                                "#EC NOTEXT
               dynpro_text(8)     VALUE '%_DYNPRO',             "#EC NOTEXT
               header_text(8)     VALUE '%_HEADER',             "#EC NOTEXT
               params_text(8)     VALUE '%_PARAMS',             "#EC NOTEXT
               descript_text(13)  VALUE '%_DESCRIPTION',        "#EC NOTEXT
               fields_text(8)     VALUE '%_FIELDS',             "#EC NOTEXT
               kreuz(1)           VALUE 'x',                    "#EC NOTEXT
               flowlogic_text(11) VALUE '%_FLOWLOGIC'.          "#EC NOTEXT
    DATA: header_char TYPE scr_chhead.
    DATA: fields_char TYPE STANDARD TABLE OF scr_chfld WITH HEADER LINE.
    DATA: dynp_char TYPE STANDARD TABLE OF scr_chfld WITH HEADER LINE.
    DATA: prog_len     TYPE p.
    DATA: BEGIN OF dynp,
            prog TYPE d020s-prog,
            dnum TYPE d020s-dnum,
          END OF dynp.
    DATA:
        scrp_rel  TYPE dynp_rel_type VALUE '4.02'.  "Rel. Scrp. 4.02
          scrp_rel  TYPE dynp_rel_type VALUE '4.60'.  "Rel. Scrp. 4.6A
    DATA  dynp_rel  TYPE dynp_rel_type.    "akt. Rel. Dynpro
    DATA: dynpro_rel(4).
    DATA  status.
    DATA  prog_len_akt TYPE p.
    DATA  release.
    DATA  rows  LIKE sy-curow.
    DATA  lines LIKE sy-cucol.
    DATA: filename TYPE string.
    DATA: subrc LIKE sy-subrc.
    DATA: os(10).
    DATA: delux VALUE '/'.
    DATA: delwn VALUE '\'.
    DATA: delim.
    DATA: dirux(250) VALUE '-l>dir.tmp'.
    DATA: dirwn(250) VALUE '/Q /Cdir>dir.tmp'.
    DATA: command(250).
    DATA: shellux(250) VALUE 'bash'.
    DATA: shellwn(250) VALUE 'cmd.exe'.
    DATA: shell(250).
    DATA: file      TYPE rlgrap-filename.
    DATA: answer.
    DATA: incname   TYPE d010inc-include.
    DATA: repname   TYPE d010inc-include.
    DATA: rest1     TYPE d010inc-include.
    DATA: rest2     TYPE d010inc-include.
    DATA: kz_renam.
    DATA: classname TYPE seoclsname.
    DATA: classtype(2).
    DATA: offset  TYPE i.
    DATA: savepath(250).
    SELECT-OPTIONS:   report   FOR trdir-name.
    SELECTION-SCREEN: SKIP.
    SELECT-OPTIONS:   cnam     FOR trdir-cnam MATCHCODE OBJECT user_addr,
                      unam     FOR trdir-unam MATCHCODE OBJECT user_addr,
                      devclass FOR tadir-devclass,
                      subc     FOR trdir-subc,
                      rstat    FOR trdir-rstat,
                      cdat     FOR trdir-cdat,
                      udat   FOR trdir-udat.
    SELECTION-SCREEN: SKIP.
    PARAMETERS:       path(250).
    SELECTION-SCREEN: SKIP.
    PARAMETERS:       display  RADIOBUTTON GROUP func,
                      save     RADIOBUTTON GROUP func,
                      savedspl RADIOBUTTON GROUP func.
    SELECTION-SCREEN: SKIP.
    PARAMETERS:       codeonly AS CHECKBOX.
    SELECTION-SCREEN: SKIP.
    *PARAMETERS:       suffix(80) LOWER CASE.
    DATA:             suffix(80) TYPE c.
    LOAD-OF-PROGRAM.
      AUTHORITY-CHECK OBJECT 'S_DEVELOP'
          ID 'DEVCLASS' DUMMY
          ID 'OBJTYPE'  FIELD 'PROG'
          ID 'OBJNAME'  FIELD 'REPTRAN'
          ID 'PGROUP'   DUMMY
          ID 'ACTVT'    FIELD '03'.
      IF sy-subrc <> 0.
        MESSAGE e059(EU) WITH 'REPTRAN'.
      ENDIF.
    INITIALIZATION.
      GET PARAMETER ID 'REPTRAN_PATH' FIELD path.
      IF path IS INITIAL.
        path = 'C:\ABAPS\'.
      ENDIF.
      save = 'X'.
      codeonly = 'X'.
      CALL FUNCTION 'WS_QUERY'
           EXPORTING
              ENVIRONMENT    = ' '
              FILENAME       = ' '
                query          = 'OS'
              WINID          = ' '
           IMPORTING
                return         = os
           EXCEPTIONS
                inv_query      = 1
                no_batch       = 2
                frontend_error = 3
                OTHERS         = 4.
      IF sy-subrc = 0 AND
         ( os CS 'OS2' OR os CS 'DOS' OR os CS 'NT' ).
        delim = delwn.
        command = dirwn.
        shell = shellwn.
      ELSE.
        delim = delux.
        command = dirux.
        shell = shellux.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR path.
      GET CURSOR FIELD path VALUE path.
      filename = path.
      PERFORM fileselector.
    AT SELECTION-SCREEN.
      IF report[] IS INITIAL.
        IF NOT reports[] IS INITIAL.
          report = 'IEQ'.
          report-low = reports.
          APPEND report.
          MESSAGE i208(00)
             WITH 'Report/BSP application was also identified'(009).
        ELSE.
          MESSAGE e208(00)
             WITH 'Enter report or BSP application or enter path'(011).
        ENDIF.
      ENDIF.
    START-OF-SELECTION.
      offset = strlen( path ) - 1.
      IF path+offset(1) <> '\'.
        CONCATENATE path '\' INTO path.
      ENDIF.
      SET PARAMETER ID 'REPTRAN_PATH' FIELD path.
      FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF.
      eu_key-sprsl = sy-langu.
      IF NOT save     IS INITIAL OR
         NOT display  IS INITIAL OR
         NOT savedspl IS INITIAL.
      DOWNLOAD PROGRAMS
        SELECT name  FROM trdir
               INTO  TABLE reports
               WHERE name IN report
               AND   cnam IN cnam
               AND   unam IN unam
               AND   subc IN subc
               AND   rstat IN rstat
               AND   cdat IN cdat
               AND   udat IN udat.
        IF sy-subrc <> 0.
          LOOP AT report.
            CONCATENATE report(3) 'SAPL' report+3 INTO report.
            MODIFY report.
          ENDLOOP.
          SELECT name  FROM trdir
                 INTO  TABLE reports
                 WHERE name IN report
                 AND   cnam IN cnam
                 AND   unam IN unam
                 AND   subc IN subc
                 AND   rstat IN rstat
                 AND   cdat IN cdat
                 AND   udat IN udat.
        ENDIF.
        IF sy-subrc <> 0.
          MESSAGE i208(00)
             WITH 'The program/function name entered does not exist!'(082).
        ENDIF.
        LOOP AT reports.
    Check if report is in development class
          classtype = reports+30.
          IF reports(5) NE 'CL_O2'.
            IF classtype = 'CP'.
              tadir-obj_name = reports.
              SHIFT tadir-obj_name RIGHT DELETING TRAILING space.
              SHIFT tadir-obj_name RIGHT BY 2 PLACES.
              SHIFT tadir-obj_name RIGHT DELETING TRAILING '='.
              SHIFT tadir-obj_name LEFT DELETING LEADING space.
              SELECT SINGLE * FROM  tadir
                     WHERE  pgmid     = 'R3TR'
                     AND    object    = 'CLAS'
                     AND    obj_name  = tadir-obj_name
                     AND    devclass  IN devclass.
            ENDIF.
            IF classtype <> 'CP' OR sy-subrc <> 0.
              SELECT SINGLE * FROM  tadir
                     WHERE  pgmid     = 'R3TR'
                     AND    object    = 'PROG'
                     AND    obj_name  = reports
                     AND    devclass  IN devclass.
              IF sy-subrc <> 0.
                SELECT SINGLE * FROM  tadir
                       WHERE  pgmid     = 'R3TR'
                       AND    object    = 'FUGR'
                       AND    obj_name  = reports
                       AND    devclass  IN devclass.
              ENDIF.
              IF sy-subrc <> 0 AND
                 ( reports(4) = 'SAPL' OR reports(4) = 'sapl' ).
                reportname = reports+4.
                SELECT SINGLE * FROM  tadir
                       WHERE  pgmid     = 'R3TR'
                       AND    object    = 'FUGR'
                       AND    obj_name  = reportname
                       AND    devclass  IN devclass.
              ENDIF.
            ENDIF.
            IF sy-subrc <> 0.
              CONTINUE.
            ENDIF.
          ENDIF.
          reportname = reports.
          PERFORM makepath USING    reportname
                                    path
                           CHANGING savepath.
          PERFORM writeinfo  USING reportname
                                   savepath.
          REFRESH: i_repsrc, i_reptx, i_reptxt, i_inc,
                   sta4, ctx4, fun4, mtx4, doc4, tit4, men4, act4, but4,
                   pfk4, set4, stx4, biv46c,
                   i_d020t, i_adm4,
                   i_tmd, i_tfd, i_cls, i_cdf, i_clx, i_clt, i_cmr, i_cmp,
                   i_cmd, i_cmx, i_cmt, i_irl, i_mat, i_mac, i_red, i_frd,
                   i_tpl, i_sco, i_scd, i_scx, i_sct, i_cmd_t, i_scd_t.
          CLEAR: adm4.
          eu_key-name  = reports.
          READ REPORT reports INTO i_repsrc.
          IF codeonly <> 'X'.
            READ TEXTPOOL reports INTO i_reptx.
          ENDIF.
          LOOP AT i_reptx.
            MOVE-CORRESPONDING i_reptx TO i_reptxt.
            APPEND i_reptxt.
          ENDLOOP.
          IF NOT display  IS INITIAL OR
             NOT savedspl IS INITIAL.
            PERFORM show_rep.
          ENDIF.
          IF classtype = 'CP' OR classtype = 'IP'.
            classname = reports(30).
            TRANSLATE classname USING '= '.
            SELECT * FROM tmdir INTO TABLE i_tmd
                   WHERE classname = classname.
            SELECT * FROM seoclass   INTO TABLE i_cls
                   WHERE clsname = classname.
            SELECT * FROM seoclassdf INTO TABLE i_cdf
                   WHERE clsname = classname.
            SELECT * FROM seoclassex INTO TABLE i_clx
                   WHERE clsname = classname.
            SELECT * FROM seoclasstx INTO TABLE i_clt
                   WHERE clsname = classname.
            SELECT * FROM seometarel INTO TABLE i_cmr
                   WHERE clsname = classname.
            SELECT * FROM seocompo   INTO TABLE i_cmp
                   WHERE clsname = classname.
            SELECT * FROM seocompodf INTO TABLE i_cmd
                   WHERE clsname = classname.
            LOOP AT i_cmd.
              MOVE-CORRESPONDING i_cmd TO i_cmd_t.
              APPEND i_cmd_t.
            ENDLOOP.
            SELECT * FROM seocompoex INTO TABLE i_cmx
                   WHERE clsname = classname.
            SELECT * FROM seocompotx INTO TABLE i_cmt
                   WHERE clsname = classname.
            SELECT * FROM seoimplrel INTO TABLE i_irl
                   WHERE clsname = classname.
            SELECT * FROM seomapatt  INTO TABLE i_mat
                   WHERE clsname = classname.
            SELECT * FROM seomapcls  INTO TABLE i_mac
                   WHERE clsname = classname.
            SELECT * FROM seoredef   INTO TABLE i_red
                   WHERE clsname = classname.
            SELECT * FROM seofriends INTO TABLE i_frd
                   WHERE clsname = classname.
            SELECT * FROM seotypepls INTO TABLE i_tpl
                   WHERE clsname = classname.
            SELECT * FROM seosubco   INTO TABLE i_sco
                   WHERE clsname = classname.
            SELECT * FROM seosubcodf INTO TABLE i_scd
                   WHERE clsname = classname.
            LOOP AT i_scd.
              MOVE-CORRESPONDING i_scd TO i_scd_t.
              APPEND i_scd_t.
            ENDLOOP.
            SELECT * FROM seosubcoex INTO TABLE i_scx
                   WHERE clsname = classname.
            SELECT * FROM seosubcotx INTO TABLE i_sct
                   WHERE clsname = classname.
          ELSE.
            CLEAR classtype.
          ENDIF.
          IF codeonly <> 'X'.
            SELECT * FROM tfdir INTO TABLE i_tfd
                   WHERE pname = reports.
            CALL FUNCTION 'RS_CUA_INTERNAL_FETCH'
                 EXPORTING
                      program         = reports
                    LANGUAGE        =
                    STATE           = 'A'
                 IMPORTING
                      adm             = adm4
                    LANGU           =
                    AUTHOR          =
                    DATE            =
                    TIME            =
                    CAUTHOR         =
                    CDATE           =
                    CTIME           =
                    GDATE           =
                    GTIME           =
                 TABLES
                      sta             = sta4
                      fun             = fun4
                      men             = men4
                      mtx             = mtx4
                      act             = act4
                      but             = but4
                      pfk             = pfk4
                      set             = set4
                      doc             = doc4
                      tit             = tit4
                      biv             = biv46c
                 EXCEPTIONS
                      not_found       = 1
                      unknown_version = 2
                      OTHERS          = 3.
            SELECT ddnr text_line FROM title INTO TABLE tit
                   WHERE ddlanguage = eu_key-sprsl AND
                         progname   = eu_key-name.
            SELECT * FROM rsmptexts INTO TABLE stx4
                   WHERE progname   = eu_key-name AND
                         sprsl = eu_key-sprsl.
            SELECT prog dynr dtxt FROM d020t INTO TABLE i_d020t
                   WHERE prog = reports AND
                         NOT dtxt LIKE 'SEL_SCREEN%'.
          ENDIF.
          IF NOT classtype IS INITIAL.
            reports = classname.
          ENDIF.
          TRANSLATE reports TO LOWER CASE.
          TRANSLATE reports USING '/.'.
          IF NOT save     IS INITIAL OR
             NOT savedspl IS INITIAL.
            CONCATENATE savepath reports suffix '.txt' INTO filename.
            PERFORM download TABLES i_repsrc USING filename
                             'Source'(003).
            IF NOT i_reptxt[] IS INITIAL.
              CONCATENATE savepath reports suffix '_txt.txt' INTO filename.
              PERFORM download TABLES i_reptxt USING filename
                               'Text elements'(004).
            ENDIF.
          ENDIF.
          SELECT include FROM d010inc INTO TABLE i_inc
                 WHERE master = eu_key-name.
          DELETE i_inc WHERE table_line(1) = '<'.
          DELETE i_inc WHERE table_line(1) = '>'.
          DELETE i_inc WHERE table_line = 'DB__SSEL'.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_inc[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_inc.txt' INTO filename.
            PERFORM download TABLES i_inc USING filename
                             'Include List'(033).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_tmd[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_tmd.txt' INTO filename.
            PERFORM download TABLES i_tmd USING filename
                             'Methods List'(048).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cls[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cls.txt' INTO filename.
            PERFORM download TABLES i_cls USING filename
                             'Class Entry'(050).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cdf[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cdf.txt' INTO filename.
            PERFORM download TABLES i_cdf USING filename
                             'Class Definition'(051).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_clx[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_clx.txt' INTO filename.
            PERFORM download TABLES i_clx USING filename
                             'Class Remote Info'(052).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_clt[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_clt.txt' INTO filename.
            PERFORM download TABLES i_clt USING filename
                             'Class Description'(053).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cmr[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cmr.txt' INTO filename.
            PERFORM download TABLES i_cmr USING filename
                             'Class Meta Relations'(054).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cmp[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cmp.txt' INTO filename.
            PERFORM download TABLES i_cmp USING filename
                             'Class Components'(055).
          ENDIF.
          IF ( NOT save      IS INITIAL OR
               NOT savedspl  IS INITIAL ) AND
               NOT i_cmd_t[] IS INITIAL.
            CONCATENATE savepath reports suffix '_cmd.txt' INTO filename.
            PERFORM download TABLES i_cmd_t USING filename
                             'Class Components Definitions'(056).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cmx[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cmx.txt' INTO filename.
            PERFORM download TABLES i_cmx USING filename
                             'Class Components Remote Infos'(057).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_cmt[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_cmt.txt' INTO filename.
            PERFORM download TABLES i_cmt USING filename
                             'Class Components Descriptions'(058).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_irl[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_irl.txt' INTO filename.
            PERFORM download TABLES i_irl USING filename
                             'Class Components Relation Types'(059).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_mat[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_mat.txt' INTO filename.
            PERFORM download TABLES i_mat USING filename
                             'Class Mapping Attributes'(060).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_mac[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_mac.txt' INTO filename.
            PERFORM download TABLES i_mac USING filename
                             'Class Mapping Classes'(061).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_red[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_red.txt' INTO filename.
            PERFORM download TABLES i_red USING filename
                             'Class Redefinitions'(062).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_frd[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_frd.txt' INTO filename.
            PERFORM download TABLES i_frd USING filename
                             'Class Friends'(063).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_tpl[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_tpl.txt' INTO filename.
            PERFORM download TABLES i_tpl USING filename
                             'Class Type-Pools'(064).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_sco[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_sco.txt' INTO filename.
            PERFORM download TABLES i_sco USING filename
                             'Class Sub Components'(065).
          ENDIF.
          IF ( NOT save      IS INITIAL OR
               NOT savedspl  IS INITIAL ) AND
               NOT i_scd_t[] IS INITIAL.
            CONCATENATE savepath reports suffix '_scd.txt' INTO filename.
            PERFORM download TABLES i_scd_t USING filename
                             'Class Sub Components Definitions'(066).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_scx[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_scx.txt' INTO filename.
            PERFORM download TABLES i_scx USING filename
                             'Class Sub Components Remote Infos'(067).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_sct[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_sct.txt' INTO filename.
            PERFORM download TABLES i_sct USING filename
                             'Class Sub Components Descriptions'(068).
          ENDIF.
          IF ( NOT save     IS INITIAL OR
               NOT savedspl IS INITIAL ) AND
               NOT i_tfd[]  IS INITIAL.
            CONCATENATE savepath reports suffix '_tfd.txt' INTO filename.
            PERFORM download TABLES i_tfd USING filename
                             'Function List'(049).
          ENDIF.
          IF NOT i_inc[] IS INITIAL.
            LOOP AT i_inc.
              REFRESH: i_reptx, i_reptxt.
              READ REPORT i_inc INTO i_repsrc.
              IF codeonly <> 'X'.
                READ TEXTPOOL i_inc INTO i_reptx.
              ENDIF.
              LOOP AT i_reptx.
                MOVE-CORRESPONDING i_reptx TO i_reptxt.
                APPEND i_reptxt.
              ENDLOOP.
              IF NOT display IS INITIAL OR
                NOT savedspl IS INITIAL.
                PERFORM show_inc.
              ENDIF.
              TRANSLATE i_inc TO LOWER CASE.
              TRANSLATE i_inc USING '/.'.
              IF NOT save     IS INITIAL OR
                 NOT savedspl IS INITIAL.
                CONCATENATE savepath i_inc suffix '.txt' INTO filename.
                PERFORM download TABLES i_repsrc USING filename
                                 'Include Source'(032).
                IF NOT i_reptxt[] IS INITIAL.
                  CONCATENATE savepath i_inc suffix '_txt.txt'
                              INTO filename.
                  PERFORM download TABLES i_reptxt USING filename
                                   'Text elements'(004).
                ENDIF.
              ENDIF.
            ENDLOOP.
          ENDIF.
          IF NOT i_d020t[] IS INITIAL.
            LOOP AT i_d020t.
              IMPORT DYNPRO hdr fld src mat ID i_d020t.
              CALL FUNCTION 'RS_SCRP_UPGRADE_DYNPRO'
                   TABLES
                        f = fld
                        m = mat
                   CHANGING
                        h = hdr.
              IF src[] IS INITIAL.
                DELETE i_d020t.
                CONTINUE.
              ENDIF.
              CLEAR src.
              READ TABLE src INDEX 1.
              IF src-line CS 'Do not change'.
                DELETE i_d020t.
                CONTINUE.
              ENDIF.
              CALL FUNCTION 'RS_SCRP_GET_SCREEN_INFOS'
                   EXPORTING
                        dynnr                 = hdr-dnum
                        progname              = hdr-prog
                        with_fieldlist        = 'X'
                   IMPORTING
                        lines                 = lines
                        columns               = rows
                   TABLES
                        fieldlist             = fld
                   EXCEPTIONS
                        dynpro_does_not_exist = 01
                        no_field_list         = 02.
              hdr-bzmx = lines.
              hdr-bzbr = rows.
              IF NOT display  IS INITIAL OR
                 NOT savedspl IS INITIAL.
                PERFORM show_dyn.
              ENDIF.
              IF NOT save     IS INITIAL OR
                 NOT savedspl IS INITIAL.
                PERFORM dynpro_download.
              ENDIF.
            ENDLOOP.
            IF ( NOT save     IS INITIAL OR
                 NOT savedspl IS INITIAL ) AND
               NOT i_d020t[] IS INITIAL.
              CONCATENATE savepath reports suffix '_dyn.txt' INTO filename.
              PERFORM download TABLES i_d020t USING filename
                               'Dynpro List'(040).
            ENDIF.
          ENDIF.
          IF NOT save     IS INITIAL OR
             NOT savedspl IS INITIAL.
            IF NOT sta4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_sta.txt' INTO filename.
              PERFORM download TABLES sta4 USING filename
                               'GUI Status'(013).
            ENDIF.
            IF NOT ctx4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_ctx.txt' INTO filename.
              PERFORM download TABLES ctx4 USING filename
                               'Object Codes'(045).
            ENDIF.
            IF NOT fun4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_fun.txt' INTO filename.
              PERFORM download TABLES fun4 USING filename
                               'Function Texts'(014).
            ENDIF.
            IF NOT men4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_men.txt' INTO filename.
              PERFORM download TABLES men4 USING filename
                               'Menus'(015).
            ENDIF.
            IF NOT tit4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_sti.txt' INTO filename.
              PERFORM download TABLES tit4 USING filename
                               'Title Codes'(042).
            ENDIF.
            IF NOT mtx4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_mtx.txt' INTO filename.
              PERFORM download TABLES mtx4 USING filename
                               'Menu Texts'(016).
            ENDIF.
            IF NOT act4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_act.txt' INTO filename.
              PERFORM download TABLES act4 USING filename
                               'Menu Bars'(047).
            ENDIF.
            IF NOT but4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_but.txt' INTO filename.
              PERFORM download TABLES but4 USING filename
                               'Push Buttons'(018).
            ENDIF.
            IF NOT pfk4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_pfk.txt' INTO filename.
              PERFORM download TABLES pfk4 USING filename
                               'PF Keys'(019).
            ENDIF.
            IF NOT adm4 IS INITIAL.
              APPEND adm4 TO i_adm4.
              CONCATENATE savepath reports suffix '_adm.txt' INTO filename.
              PERFORM download TABLES i_adm4 USING filename
                               'Management Information'(043).
            ENDIF.
            IF NOT set4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_set.txt' INTO filename.
              PERFORM download TABLES set4 USING filename
                               'Function Sets'(020).
            ENDIF.
            IF NOT stx4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_stx.txt' INTO filename.
              PERFORM download TABLES stx4 USING filename
                               'Status Texts'(023).
            ENDIF.
            IF NOT doc4[] IS INITIAL.
              CONCATENATE savepath reports suffix '_doc.txt' INTO filename.
              PERFORM download TABLES doc4 USING filename
                               'Status Short Texts'(024).
            ENDIF.
            IF NOT biv46c[] IS INITIAL.
              CONCATENATE savepath reports suffix '_biv.txt' INTO filename.
              PERFORM download TABLES biv46c USING filename
                               'Invariant Functions'(048).
            ENDIF.
            IF NOT tit[] IS INITIAL.
              CONCATENATE savepath reports suffix '_tit.txt' INTO filename.
              PERFORM download TABLES tit USING filename
                               'Title Bars'(030).
            ENDIF.
          ENDIF.
          ULINE.
        ENDLOOP.
      ENDIF.
      REFRESH reports.
    *&      Form  DOWNLOAD
    FORM download TABLES   tabelle
                  USING    value(filename)
                           component.
      CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
              BIN_FILESIZE            = ' '
                filename                = filename
                filetype                = 'ASC'
         IMPORTING
              FILELENGTH              =
           TABLES
                data_tab                = tabelle
           EXCEPTIONS
                file_write_error        = 1
                no_batch                = 2
                gui_refuse_filetransfer = 3
                invalid_type            = 4
                OTHERS                  = 5.
    IF reports IS INITIAL.
       WRITE: / appls.
    ELSE.
       WRITE: / reports.
    ENDIF.
      WRITE: /(20) component.
      IF sy-subrc = 0.
        WRITE: 'successfully downloaded'(001).
        PERFORM getfilename USING    filename
                            CHANGING filename.
        WRITE: '->', filename.
      ELSE.
        WRITE: 'not downloaded,  RC ='(002), sy-subrc.
      ENDIF.
    ENDFORM.                                                    " DOWNLOAD
    *&      Form  FILESELECTOR
    FORM fileselector.
      DATA: repname(250).
      DATA: fdpos(2) TYPE p.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
              DEF_FILENAME     = ' '
                def_path         = path
                mask             = ',.txt,.txt.'
                mode             = 'O'
              TITLE            = ' '
           IMPORTING
                filename         = file
              RC               =
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
      subrc = sy-subrc.
      path = file.
      CLEAR: sy-fdpos, sy-subrc.
      fdpos = 1.
      WHILE sy-subrc = 0.
        fdpos = fdpos + sy-fdpos + 1.
        SEARCH path FOR delim STARTING AT fdpos.
      ENDWHILE.
      fdpos = fdpos - 1.
      path = path(fdpos).
      repname = file.
      CLEAR sy-subrc.
      WHILE sy-subrc = 0.
        SHIFT repname LEFT.
        SHIFT repname LEFT UP TO delim.
      ENDWHILE.
      SHIFT repname RIGHT UP TO '.'.
      SHIFT repname RIGHT.
      SHIFT repname LEFT DELETING LEADING space.
      TRANSLATE repname TO UPPER CASE.
      reports = repname.
      APPEND reports.
    ENDFORM.                               " FILESELECTOR
    *&      Form  LS
    FORM ls.
      TYPES: c80(80).
      DATA: dirtab TYPE STANDARD TABLE OF c80 WITH HEADER LINE.
      DATA: datei TYPE string.
      DATA: i LIKE sy-tabix.
      DATA: endtime LIKE sy-uzeit.
      CALL FUNCTION 'WS_EXECUTE'
           EXPORTING
              DOCUMENT       = ' '
                cd             = path
                commandline    = command
              INFORM         = ' '
                program        = shell
              STAT           = ' '
              WINID          = ' '
              OSMAC_SCRIPT   = ' '
              OSMAC_CREATOR  = ' '
              WIN16_EXT      = ' '
              EXEC_RC        = ' '
         IMPORTING
              RBUFF          =
           EXCEPTIONS
                frontend_error = 1
                no_batch       = 2
                prog_not_found = 3
                illegal_option = 4
                OTHERS         = 5.
      IF sy-subrc NE 0.
        MESSAGE e001(pc).
      Error when executing the WS program
      ENDIF.
      CONCATENATE path 'dir.tmp'  INTO datei.
      GET TIME.
      endtime = sy-uzeit + 3.
      WHILE sy-uzeit < endtime.
        GET TIME.
      ENDWHILE.
      CALL FUNCTION 'GUI_UPLOAD'
           EXPORTING
                filename                = datei
                filetype                = 'ASC'
         IMPORTING
              FILELENGTH              =
           TABLES
                data_tab                = dirtab
           EXCEPTIONS
                file_read_error         = 1
                no_batch                = 2
                gui_refuse_filetransfer = 3
                invalid_type            = 4
                OTHERS                  = 5.
      IF sy-subrc NE 0.
        MESSAGE e001(pc).
      Error when executing the WS program
      ENDIF.
      REFRESH reports.
      i = 1.
      DO.
        SEARCH dirtab FOR '.txt' STARTING AT i.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        READ TABLE dirtab INDEX sy-tabix.
        i = sy-tabix + 1.
        CHECK dirtab NS 'txt_.txt'.
        SHIFT dirtab LEFT UP TO space.
        SHIFT dirtab LEFT DELETING LEADING space.
        SHIFT dirtab LEFT UP TO space.
        SHIFT dirtab LEFT DELETING LEADING space.
        SHIFT dirtab LEFT UP TO space.
        SHIFT dirtab RIGHT UP TO '.'.
        SHIFT dirtab RIGHT.
        SHIFT dirtab LEFT DELETING LEADING space.
        IF NOT dirtab IS INITIAL.
          TRANSLATE dirtab TO LOWER CASE.
          APPEND dirtab TO reports.
        ENDIF.
      ENDDO.
      SORT reports.
      DELETE ADJACENT DUPLICATES FROM reports.
    ENDFORM.                                                    " LS
    *&      Form  SHOW_DYN
    FORM show_dyn.
    Printing Dynpro data
    Header for Dynpro
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Dynpro header', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      WRITE: / 'Program:',    30 hdr-prog, AT sy-linsz '',
             / 'Dynpro:',      30 hdr-dnum, AT sy-linsz '',
             / 'Follow-up dynpro:', 30 hdr-fnum, AT sy-linsz ''.
      ULINE.
    Print field list
      FORMAT COLOR COL_TOTAL.
      WRITE:  / 'Field list'  COLOR COL_TOTAL, AT sy-linsz ''.
      FORMAT COLOR COL_HEADING.
      WRITE:  / 'Field',
             25 'Line',
             30 'Column',
             37 'TYPE',
             42 'LOOPTyp',
             50 'DDIC',
             55 'FormByte', AT sy-linsz ''.
      CALL FUNCTION 'RS_SCRP_FIELDS_RAW_TO_CHAR'
           TABLES
                fields_int  = fld
                fields_char = fields_char
           EXCEPTIONS
                OTHERS      = 1.
      FORMAT COLOR COL_NORMAL.
      LOOP AT fields_char.
        WRITE: /(24) fields_char-feldname,
                  25 fields_char-line,
                  30 fields_char-coln,
                  37 fields_char-feldformat,
                  42 fields_char-looptype,
                  50 fields_char-inttyp,
                  55 fields_char-fmb1,
                  58 fields_char-fmb2.
      ENDLOOP.
      ULINE.
    Display logic
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Logic', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      LOOP AT src.
        WRITE: / src-line.
      ENDLOOP.
      ULINE.
      SKIP.
    Display matchcode data
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Matchcode data', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      LOOP AT mat.
        WRITE: /(80) mat.
      ENDLOOP.
      IF sy-subrc NE 0.
        WRITE / ' no matchcode files available ' COLOR COL_NEGATIVE.
      ENDIF.
      NEW-PAGE.
    ENDFORM.                                                    " SHOW_DYN
    *&      Form  SHOW_REP
    FORM show_rep.
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Program:', reports, AT sy-linsz ''.
      FORMAT COLOR COL_BACKGROUND.
      LOOP AT i_repsrc.
        WRITE: / i_repsrc.
      ENDLOOP.
      ULINE.
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Text elements for program:', reports, AT sy-linsz ''.
      FORMAT COLOR COL_HEADING.
      WRITE:  / 'Type',
              5 'Key',
             20 'Length',
             30 'Text', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      LOOP AT i_reptxt.
        WRITE: / i_reptxt-id,
               5 i_reptxt-key,
           20(4) i_reptxt-length,
          30(80) i_reptxt-entry.
      ENDLOOP.
      NEW-PAGE.
    ENDFORM.                                                    " SHOW_REP
    *&      Form  SHOW_INC
    FORM show_inc.
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Include:', i_inc, AT sy-linsz ''.
      FORMAT COLOR COL_BACKGROUND.
      LOOP AT i_repsrc.
        WRITE: / i_repsrc.
      ENDLOOP.
      ULINE.
      FORMAT COLOR COL_TOTAL.
      WRITE: / 'Text elements for include:', i_inc, AT sy-linsz ''.
      FORMAT COLOR COL_HEADING.
      WRITE:  / 'Type',
              5 'Key',
             20 'Length',
             30 'Text', AT sy-linsz ''.
      FORMAT COLOR COL_NORMAL.
      LOOP AT i_reptxt.
        WRITE: / i_reptxt-id,
               5 i_reptxt-key,
           20(4) i_reptxt-length,
          30(80) i_reptxt-entry.
      ENDLOOP.
      NEW-PAGE.
    ENDFORM.                                                    " SHOW_INC
    *&      Form  DYNPRO_DOWNLOAD
    &

  • Current time in module pool programming in text field

    Hello Friends,
    In module pool programming ther is a input output field for time i want the current system time should be displayed in that field and when user press saves tht time should get saved in the database tables.
    regards,
    Sunny

    Hi, sunny,
    If I understand your question correctly than I think that the following code will help you, you will have to write this code in the called program means where you are calling your screens.
    data: tf_rec_no(10). u201Ctf_rec_nou201D is the field name on your screen
    initialization.
    write: sy-uzeit to tf_rec_no.
    after this you can update db using this field.
    Replay if any problem or you have some different query.
    Kind Regards,
    Faisal.

  • How to delete the row in table control with respect to one field in module pool programming?

    Hi,
    Can I know the way to delete the row in table control with respect to one field in module pool programming
    Regards
    Darshan MS

    HI,
    I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
    I have written this code,
    module USER_COMMAND_9000 input.
    DATA OK_CODE TYPE SY-UCOMM.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
         WHEN 'DELETE'.
            LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
                APPEND LS_SOURCE TO LT_RESTORE.
                DELETE TABLE LT_SOURCE FROM LS_SOURCE.
                SOURCE-LINES = SOURCE-LINES - 1.
            ENDLOOP.
    But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
    So I thought of doing with respect to the field.

  • Getting error while calling a subscreen in  module pool program

    HI  ALL,
                         ACTUALLY I'M GETTING A SYNTAX ERROR WHILE I'M CALLING A SUBSCREEN
                       IN A MODULE POOL PROGRAM IN PAI MODULE
                       THE ERROR IS AS FOLLOW
                           "." or "ID ... FIELD ..." expected after "SUBSCREEN"
                        CAN ANYBODY PLS HELP ME.
    REGARDS
    ANDREWS

    HI MAX ,
                      THE CODE IS AS FOLLOWS:
    *& Report  ZTABSTRIP_PS
    REPORT  ZTABSTRIP_PS.
    type-pools : vrm.
    DATA:number1 type I,
         number2 type I,
         result  type I,
         ok_code like SY-UCOMM,
         employee1 type c,
         ABAP(19)    type c,
         SALES(19)  type c,
         HR(19)      type c,
         MM(19)     type  c,
    employee type c.
        emp type c.
    CONTROLS  tabstrip TYPE TABSTRIP.
    CALL SCREEN 100.
    call screen 110.
    call screen 130.
    call screen 120.
    call screen  140.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'STATUS'.
      SET TITLEBAR 'TITLE'.
      CASE OK_CODE.
        WHEN 'BACK' or 'EXIT' or 'DELETE'.
         leave program.
         WHEN 'SAVE'.
           MESSAGE 'please choose a valid function' TYPE 'I'.
       WHEN 'BACK'.
        leave PROGRAM.
    when  'EXIT' or 'DELETE'.
        leave to screen 0.
        WHEN 'SAVE'.
          MESSAGE 'please choose a valid function' TYPE 'I'.
    endcase.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
      when 'TAB1'.
    tabstrip-activetab = 'TAB1'.
       when 'TAB2'.
    tabstrip-activetab = 'TAB2'.
    result = number1 + number2.
       when 'TAB3'.
      tabstrip-activetab = 'TAB3'.
    SET TITLEBAR 'TITLE1'.
      when 'TAB4'.
        tabstrip-activetab = 'TAB4'.
       if employee = 'NEERAJ'.
         ABAP = 'NEERAJ'.
       elseif employee = 'UMESH'.
         SALES = 'UMESH'.
       ELSEIF employee = 'RAM'.
         HR = 'RAM'.
       elseif employee = 'ANIL'.
         MM = 'ANIL'.
         endif.
       employee = employee.
    WHEN 'BACK'.
        leave PROGRAM.
    when  'EXIT' or 'DELETE'.
        leave to screen 0.
        WHEN 'SAVE'.
          MESSAGE 'please choose a valid function' TYPE 'I'.
    ENDCASE.
       WHEN 'BACK' or 'EXIT' or 'DELETE'.
         leave program .
         WHEN 'SAVE'.
           MESSAGE 'please choose a valid function' TYPE 'I'.
    endcase.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0110  OUTPUT
          text
    **MODULE STATUS_0110 OUTPUT.
    SET PF-STATUS 'STATUS1'.
    SET TITLEBAR 'xxx'.
    **case ok_code.
    **WHEN 'back' or 'exit' or 'delete'.
        leave PROGRAM.
        WHEN 'save'.
          MESSAGE 'please choose a valid function ' TYPE 'W'.
    ENDCASE.
    **ENDMODULE.                 " STATUS_0110  OUTPUT
    *&      Module  USER_COMMAND_0110  INPUT
          text
    MODULE USER_COMMAND_0110 INPUT.
      number1 = number1.
      number2 = number2.
    CLEAR NUMBER1.
    CLEAR NUMBER2.
    REFRESH NUMBER1.
    REFRESH NUMBER2.
    ENDMODULE.                 " USER_COMMAND_0110  INPUT
    *&      Module  STATUS_0130  OUTPUT
          text
    MODULE STATUS_0130 OUTPUT.
    SET PF-STATUS 'STATUS2'.
    SET TITLEBAR 'xxx'.
    RESULT = number1 + number2.
    *CLEAR RESULT.
    REFRESH RESULT.
    ENDMODULE.                 " STATUS_0130  OUTPUT
    *&      Module  STATUS_0120  OUTPUT
          text
    MODULE STATUS_0120 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    DATA:  l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.
      l_value-key = '1'.
      l_value-text = 'ANIL'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '2'.
      l_value-text = 'RAM'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '3'.
      l_value-text = 'NEERAJ'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
      l_value-key = '4'.
      l_value-text = 'UMESH'.
      APPEND l_value TO li_list.
      CLEAR l_value.
    CLEAR li_list.
    l_name =  'employee'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          ID                    =  l_name
          VALUES                =  li_list
       EXCEPTIONS
         ID_ILLEGAL_NAME       = 1
         OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CLEAR li_list.
    ENDMODULE.                 " STATUS_0120  OUTPUT
    *&      Module  USER_COMMAND_0120  INPUT
          text
    MODULE USER_COMMAND_0120 INPUT.
    INCLUDING sy-repid '140'.
    employee1 = employee.
    IF employee1 CS 'NEERAJ'.
      call SUBSCREEN    sub4  .
      ABAP = 'NEERAJ'.
      CLEAR ABAP.
    ELSEIF employee1 CS 'UMESH'.
       call SUBSCREEN  sub4  .
        SALES = 'UMESH'.
        CLEAR SALES.
    elseif employee1 CS 'RAM'.
      call SUBSCREEN sub4 .
       HR = 'RAM'.
       CLEAR  HR.
    ELSEIF employee1 CS 'ANIL'.
       call SUBSCREEN sub4 .
       MM = 'ANIL'.
       CLEAR MM.
       endif.
    ENDMODULE.                 " USER_COMMAND_0120  INPUT
    *&      Module  STATUS_0140  OUTPUT
          text
    MODULE STATUS_0140 OUTPUT.
    *CASE OK_CODE.
       WHEN employee1  'NEERAJ'.
         screen-active = 1.
         ABAP = 'NEERAJ'.
       WHEN employee1 = 'UMESH'.
         screen-active = 1.
         SALES = 'UMESH'.
       WHEN employee1 = 'RAM'.
         screen-active = 1.
         HR = 'RAM'.
       WHEN employee1 = 'ANIL'.
         screen-active = 1.
         MM = 'ANIL'.
         endif.
    *ENDCASE.
    ENDMODULE.                 " STATUS_0140  OUTPUT

  • Can we use Initilization event in module pool program?

    Hi All,
    Can we use Initialization event in module pool program? If not why?
    Thanks In Advance!!!!!!!!!

    The runtime environment creates the INITIALIZATION event and calls the corresponding event block (if it has been defined in the ABAP program).
    http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb2d67358411d1829f0000e829fbfe/content.htm
    SEE THE ABOVE LINK...THINK IT WILL SOLVE ALL YOUR DOUBTS
    REGARDS
    RACHEL

  • Use of "Pool Table(s)" in Module Pool Program

    Hi,
    I often see/hear that Pool tables play an important role in Module Pool Programs.
    anybody please explain me how Pool tables are used in Module Pools?? => Did you look for any documentation?
    if possible with code snippets. =>NO.
    Thanks,
    Kranthi.
    Edited by: kishan P on Nov 14, 2010 7:23 PM

    Hi,
    I often see/hear that Pool tables play an important role in Module Pool Programs.
    anybody please explain me how Pool tables are used in Module Pools?? => Did you look for any documentation?
    if possible with code snippets. =>NO.
    Thanks,
    Kranthi.
    Edited by: kishan P on Nov 14, 2010 7:23 PM

  • How to call a "Z"module pool program in a "z"report

    Hi Guys,
    I have two reports .
    1. Report : uploads a tab delimited " .Txt1" file and update the "z1" table
        ".TXT1" : File contains 4 fields
    2. Module pool. :Uploads a a tab delimited " .Txt2" file and update another "z2" table
        ".TXT2" file contains  the 4 fileds of ".TXT1" and also 2 extra fields.
    I want to merge (call) the module pool program in the Report and perform the upload function using only one ".TXT" file.Please do guide me precisely .
    *Report:*
    REPORT zrswbgcs009 NO STANDARD PAGE HEADING MESSAGE-ID zwb
                         LINE-SIZE 185.
    TABLES:  zgcs_foc.      "FOC Parts Table
    *data count buffer
    DATA:    read_cnt(6)    TYPE p,        "Find read record
             update_cnt(6)  TYPE p,        "OK record
             error_cnt(6)   TYPE p.        "Error record
    *file buffer(FOC)
    DATA: BEGIN OF FOC_inrec  OCCURS  0,
            CUSTOMER(10),      "Customer
            PART_CODE(18),     "Parts Code
            REF_NO(35),        "Ref No.
            REF_DATE(10),      "Ref Date
            QTY(12),           "Parts Qty
            TEXT(100),         "Remark
          END OF FOC_inrec.
    *file buffer
    DATA: BEGIN OF inrec  OCCURS  0,
            CUSTOMER(10),      "Customer
            PART_CODE(18),     "Parts Code
            REF_NO(35),        "Ref No.
            REF_DATE(10),      "Ref Date
            QTY(12),           "Parts Qty
            PRICE(15),         "Parts Price
            WAERK(5),          "Parts Currency
            TEXT(100),         "Remark
          END OF inrec.
    DATA : v_file      LIKE rlgrap-filename.
    DATA gt_zgcs_foc LIKE zgcs_foc OCCURS 0 WITH HEADER LINE.
    DATA gs_zgcs_foc LIKE zgcs_foc.
    *File name ACCEPT--------------------------------------------------
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *Company code
    PARAMETERS:  p_comp LIKE zgcs_imei-company OBLIGATORY.
    PARAMETERS:  pcfile LIKE rlgrap-filename OBLIGATORY LOWER CASE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS: HQfile  RADIOBUTTON GROUP b2.
    SELECTION-SCREEN COMMENT 7(20)  text-101 FOR FIELD HQfile.
    SELECTION-SCREEN POSITION 31.
    PARAMETERS: SUBfile RADIOBUTTON GROUP b2.
    SELECTION-SCREEN COMMENT 37(20) text-102 FOR FIELD SUBfile.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN  END   OF BLOCK b1.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK box WITH FRAME.
    SELECTION-SCREEN: COMMENT /2(40) text-011, COMMENT  42(40) text-001,
                      ULINE,
                      COMMENT /2(40) text-012, COMMENT  42(40) text-002,
                      COMMENT /2(40) text-013, COMMENT  42(40) text-003,
                      COMMENT /2(40) text-014, COMMENT  42(40) text-004,
                      COMMENT /2(40) text-015, COMMENT  42(40) text-005,
                      COMMENT /2(40) text-016, COMMENT  42(40) text-006,
                      COMMENT /2(40) text-017, COMMENT  42(40) text-007,
                      COMMENT /2(40) text-018, COMMENT  42(40) text-008,
                                               COMMENT /42(40) text-009.
    SELECTION-SCREEN END OF BLOCK box.
    * -- AT SELECTION SCREEN ON
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pcfile.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = space
                def_path         = 'C:\'
                mask             = ',*.txt,*.TXT.'
                mode             = 'O'
                title            = ' '
           IMPORTING
                filename         = pcfile
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    *-----------------------------start--------------------------------
    START-OF-SELECTION.
      CLEAR: read_cnt, update_cnt, error_cnt.
      REFRESH gt_zgcs_foc.        CLEAR gs_zgcs_foc.
      PERFORM file_upload_from_pc.
      SORT gt_zgcs_foc.
      DELETE ADJACENT DUPLICATES FROM gt_zgcs_foc
             COMPARING COMPANY CUSTOMER PART_CODE REF_NO REF_DATE.
    *// customer code check
      DATA: LT_ZESTD LIKE ZESTD OCCURS 0 WITH HEADER LINE.
      IF NOT gt_zgcs_foc[] IS INITIAL.
        SELECT COMPANY CUSTOMER CURRENCY
          INTO CORRESPONDING FIELDS OF TABLE LT_ZESTD
          FROM ZESTD
           FOR ALL ENTRIES IN gt_zgcs_foc
         WHERE COMPANY  = gt_zgcs_foc-COMPANY
           AND CUSTOMER = gt_zgcs_foc-CUSTOMER.
      ENDIF.
      SORT LT_ZESTD BY COMPANY CUSTOMER.
    *// part code check
      DATA: LT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
      IF NOT gt_zgcs_foc[] IS INITIAL.
        SELECT *
          INTO TABLE LT_MARA
          FROM MARA
           FOR ALL ENTRIES IN gt_zgcs_foc
         WHERE MATNR = gt_zgcs_foc-PART_CODE.
      ENDIF.
      SORT LT_MARA BY MATNR.
      LOOP AT gt_zgcs_foc.
    *// customer code check
        READ TABLE LT_ZESTD WITH KEY
                COMPANY  = gt_zgcs_foc-COMPANY
                CUSTOMER = gt_zgcs_foc-CUSTOMER.
        IF SY-SUBRC <> 0.
          WRITE:/'Invalid Customer code ',
             gt_zgcs_foc-COMPANY, ' ',
             gt_zgcs_foc-CUSTOMER.
          STOP.
        ENDIF.
    *// part code check
        READ TABLE LT_MARA WITH KEY MATNR = gt_zgcs_foc-PART_CODE
          BINARY SEARCH.
        IF SY-SUBRC <> 0.
          WRITE:/ 'Invalid part code ', gt_zgcs_foc-PART_CODE.
          STOP.
        ENDIF.
    *// REF_NO
        TRANSLATE gt_zgcs_foc-REF_NO     TO UPPER CASE.
        SHIFT gt_zgcs_foc-REF_NO     LEFT DELETING LEADING SPACE.
        IF gt_zgcs_foc-REF_NO = SPACE.
          WRITE:/'Ref No. is blank'.
          STOP.
        ENDIF.
    *// REF_DATE
        IF gt_zgcs_foc-REF_DATE = 0.
          WRITE:/'Invalid Ref Date'.
          STOP.
        ENDIF.
    *// QTY
    *    IF gt_zgcs_foc-QTY CO ' 0123456789'.
    *    ELSE.
    *      WRITE:/ gt_zgcs_foc-QTY, ' Invalid Qty value'.
    *      STOP.
    *    ENDIF.
      ENDLOOP.
    * Insert/Update table
    *  MODIFY zgcs_foc FROM TABLE gt_zgcs_foc.
      INSERT zgcs_foc FROM TABLE gt_zgcs_foc.
      IF sy-subrc EQ 0.
        COMMIT WORK.
        DESCRIBE TABLE gt_zgcs_foc LINES update_cnt.
        error_cnt = read_cnt - update_cnt.
      ELSE.
        ROLLBACK WORK.
        error_cnt = read_cnt - update_cnt.
      ENDIF.
      ULINE.
      FORMAT COLOR 3.
      WRITE: / 'Read count                :', read_cnt.
      WRITE: / 'Insert/Update count       :', update_cnt.
      WRITE: / 'Error count               :', error_cnt.
      FORMAT COLOR OFF.
    *end-of-selection--------------------------------------------------
    END-OF-SELECTION.
    *&      Form FILE_UPLOAD_FROM_PC
    FORM file_upload_from_pc.
      IF pcfile IS INITIAL.
        WRITE: / 'SELECT UPLOAD FILE !'.
      ELSE.
        MOVE pcfile TO v_file.
    * HQ file upload
        IF HQfile EQ 'X'.
          CALL FUNCTION 'WS_UPLOAD'
               EXPORTING
                    filename                = v_file
                    filetype                = 'DAT'
               TABLES
                    data_tab                = FOC_inrec
               EXCEPTIONS
                    conversion_error        = 1
                    file_open_error         = 2
                    file_read_error         = 3
                    invalid_type            = 4
                    no_batch                = 5
                    unknown_error           = 6
                    invalid_table_width     = 7
                    gui_refuse_filetransfer = 8
                    customer_error          = 9
                    OTHERS                  = 10.
          IF sy-subrc <> 0.
            WRITE: / 'FILE UPLOAD                :', sy-subrc.
          ENDIF.
          LOOP AT FOC_inrec.
            ADD 1 TO read_cnt.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
                 exporting
                      input  = FOC_inrec-customer
                 importing
                      output = FOC_inrec-customer.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
                 exporting
                      input  = FOC_inrec-part_code
                 importing
                      output = FOC_inrec-part_code.
            MOVE-CORRESPONDING FOC_inrec TO gs_zgcs_foc.
            MOVE p_comp          TO gs_zgcs_foc-company.
            MOVE gs_zgcs_foc-qty TO gs_zgcs_foc-balan.
            MOVE sy-uname        TO gs_zgcs_foc-ERNAM.
            MOVE sy-datum        TO gs_zgcs_foc-ERDAT.
            MOVE sy-UZEIT        TO gs_zgcs_foc-ERZET.
    * Source(1:HQ,2:SUB,0:Etc)
            MOVE '1'             TO gs_zgcs_foc-source.
            APPEND gs_zgcs_foc TO gt_zgcs_foc.
          ENDLOOP.
    * SGE file upload
        ELSE.
          CALL FUNCTION 'WS_UPLOAD'
               EXPORTING
                    filename                = v_file
                    filetype                = 'DAT'
               TABLES
                    data_tab                = inrec
               EXCEPTIONS
                    conversion_error        = 1
                    file_open_error         = 2
                    file_read_error         = 3
                    invalid_type            = 4
                    no_batch                = 5
                    unknown_error           = 6
                    invalid_table_width     = 7
                    gui_refuse_filetransfer = 8
                    customer_error          = 9
                    OTHERS                  = 10.
          IF sy-subrc <> 0.
            WRITE: / 'FILE UPLOAD                :', sy-subrc.
          ENDIF.
          LOOP AT inrec.
            ADD 1 TO read_cnt.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
                 exporting
                      input  = inrec-customer
                 importing
                      output = inrec-customer.
            call function 'CONVERSION_EXIT_ALPHA_INPUT'
                 exporting
                      input  = FOC_inrec-part_code
                 importing
                      output = FOC_inrec-part_code.
            MOVE-CORRESPONDING inrec TO gs_zgcs_foc.
            MOVE p_comp          TO gs_zgcs_foc-company.
            MOVE gs_zgcs_foc-qty TO gs_zgcs_foc-balan.
            MOVE sy-uname        TO gs_zgcs_foc-ERNAM.
            MOVE sy-datum        TO gs_zgcs_foc-ERDAT.
            MOVE sy-UZEIT        TO gs_zgcs_foc-ERZET.
    * Source(1:HQ,2:SUB,0:Etc)
            MOVE '2'             TO gs_zgcs_foc-source.
            APPEND gs_zgcs_foc TO gt_zgcs_foc.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.
    *MODULE POOL::*
    *& Module Name      : Warranty Bill
    *& Sub-Module       : W/B
    *& Description      : Parts Q'ty Adjust(Sales & Warranty)
    *& Program Name     : ZRSWBP004
    *& History
    *& Date             Author            Reason
    *& 2007.05.08       Song, Ji-Hyun     Initial Coding     Req.by WH.Song
    *& Logic Process
    *  - CONDITIONS
    *    Company, Customer, Material
    *  - PROCESS
    *    Display,Insert,Update data in the T/B ZESP04
    REPORT  zrswbp004 NO STANDARD PAGE HEADING
                      MESSAGE-ID 00
                      LINE-SIZE  250
                      LINE-COUNT 50.
    *               G L O B A L    V A R I A B L E S                       *
    TABLES : zesp04.
    DATA : BEGIN OF itab_list OCCURS 0,
            company       LIKE zesp04-company,
            customer      LIKE zesp04-customer,
            material      LIKE zesp04-material,
            adj_date      LIKE zesp04-adj_date,
            adjust        LIKE zesp04-adjust,
            reason        LIKE zesp04-reason,
            reason_code   LIKE zesp04-reason_code,
            doc_no        LIKE zesp04-doc_no,
            in_date       LIKE zesp04-in_date,
            create_id     LIKE zesp04-create_id,
          END OF itab_list.
    DATA : itab_upload LIKE TABLE OF zesp04 WITH HEADER LINE.
    DATA : s_mode(10).
    DATA : table_name(10) VALUE 'ZESP04'.
    DATA : tot_cnt TYPE i.
    DATA : ref_flag(1).
    *               M A C R O    D E F I N E                               *
    DEFINE conversion_kunnr.
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
           exporting
                input  = &1
           importing
                output = &1.
    END-OF-DEFINITION.
    DEFINE conversion_material.
      call function 'CONVERSION_EXIT_MATN1_INPUT'
           exporting
                input  = &1
           importing
                output = &1.
    END-OF-DEFINITION.
    *               S E L E C T I O N   S C R E E N                        *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME  TITLE title1.
    PARAMETERS     : company LIKE zesp04-company MEMORY ID buk MODIF ID v1
                     OBLIGATORY.
    SELECT-OPTIONS : customer   FOR zesp04-customer MEMORY ID kun
                                                    MODIF ID v1.
    SELECT-OPTIONS : material   FOR zesp04-material MEMORY ID mat
                                                    MODIF ID v1.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 3.
    SELECTION-SCREEN COMMENT 3(12) text-002 MODIF ID v2.
    PARAMETERS : up_flag AS CHECKBOX MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(12) text-001 MODIF ID v2.
    PARAMETERS : p_fname(300) LOWER CASE MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME  TITLE title2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(53) text-003 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(10) text-004 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(12) text-005 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(12) text-006 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(15) text-007 MODIF ID v2.
    PARAMETERS : df1 TYPE c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN COMMENT 24(13) text-012 MODIF ID v2.
    PARAMETERS : df2 TYPE c RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN COMMENT 41(11) text-013 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(14) text-008 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(11) text-009 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(14) text-010 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(10) text-011 MODIF ID v2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b2.
    INCLUDE zrswbp004_pbo.
    INCLUDE zrswbp004_pai.
    INITIALIZATION.
      title1 = ' Parts Quantity Adjustment '.
      title2 = ' Text File Layout '.
    *            S T A R T   O F   S E L E C T I O N                       *
    TOP-OF-PAGE.
      PERFORM write_header.
    TOP-OF-PAGE DURING LINE-SELECTION.
      PERFORM write_header.
    START-OF-SELECTION.
      IF up_flag = 'X'.
        PERFORM upload_data.
      ELSE.
        PERFORM select_data.
        SET PF-STATUS 'PF01' EXCLUDING 'SAVE'.
        PERFORM display_data.
      ENDIF.
    AT USER-COMMAND.
      PERFORM user_command.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      PERFORM get_filename.
    *&      Form  SELECT_DATA
    *       Select Data for Display
    FORM select_data.
      SELECT * FROM (table_name)
        INTO CORRESPONDING FIELDS OF TABLE itab_list
       WHERE company = company
         AND customer IN customer
         AND material IN material.
      CHECK sy-subrc <> 0.
      WRITE: 'No data found with your option.'.
    ENDFORM.                    " SELECT_DATA
    *&      Form  DISPLAY_DATA
    *       Display Data following Condition
    FORM display_data.
      LOOP AT itab_list.
        FORMAT COLOR 2 INTENSIFIED.
        WRITE : / '|' NO-GAP.
        WRITE :  (07) itab_list-company    CENTERED   NO-GAP, '|' NO-GAP,
                 (10) itab_list-customer   CENTERED   NO-GAP, '|' NO-GAP,
                 (20) itab_list-material   CENTERED   NO-GAP, '|' NO-GAP,
                 (10) itab_list-adj_date   CENTERED   NO-GAP, '|' NO-GAP,
                 (15) itab_list-adjust  RIGHT-JUSTIFIED  NO-GAP, '|'
    NO-GAP,
                 (55) itab_list-reason LEFT-JUSTIFIED NO-GAP, '|' NO-GAP,
                 (11) itab_list-reason_code CENTERED  NO-GAP, '|' NO-GAP,
                 (10) itab_list-doc_no      CENTERED  NO-GAP, '|' NO-GAP,
                 (10) itab_list-in_date  CENTERED   NO-GAP, '|' NO-GAP,
                 (12) itab_list-create_id  CENTERED   NO-GAP, '|' NO-GAP.
        FORMAT INTENSIFIED OFF.
        HIDE itab_list.
      ENDLOOP.
      WRITE : / sy-uline(171).
    ENDFORM.                    " DISPLAY_DATA
    *&      Form  WRITE_HEADER
    *       Write Report Header
    FORM write_header.
      DATA : line(1024).
      CLEAR line WITH '-'.
      DESCRIBE TABLE itab_list LINES tot_cnt.
      FORMAT INTENSIFIED ON.
      WRITE : 15 'Parts Quantity Adjustment'.
      SKIP.
      WRITE : / 'Total Count : ', tot_cnt.
      WRITE : /.
      WRITE : (171) sy-uline.
      WRITE : / '|' NO-GAP.
      WRITE : (07) 'Company'  CENTERED   NO-GAP, '|' NO-GAP,
              (10) 'Customer' CENTERED   NO-GAP, '|' NO-GAP,
              (20) 'Material' CENTERED   NO-GAP, '|' NO-GAP,
              (10) 'Adj. Date' CENTERED   NO-GAP, '|' NO-GAP,
              (15) 'Adjust' CENTERED   NO-GAP, '|' NO-GAP,
              (55) 'Reason' CENTERED   NO-GAP, '|' NO-GAP,
              (11) 'Reason Code' CENTERED   NO-GAP, '|' NO-GAP,
              (10) 'Doc No' CENTERED   NO-GAP, '|' NO-GAP,
              (10) 'IN DATE' CENTERED   NO-GAP, '|' NO-GAP,
              (12) 'CREATE ID' CENTERED   NO-GAP, '|' NO-GAP.
      WRITE : /(171) sy-uline.
      FORMAT INTENSIFIED OFF.
    ENDFORM.                    " WRITE_HEADER
    *&      Form  UPLOAD_DATA
    *       Data Upload from File
    FORM upload_data.
      DATA : l_filename LIKE rlgrap-filename,
             temp_dateformat TYPE dateformat.
      IF df1 = 'X'.
        temp_dateformat = 'YYYY.MM.DD'.
      ELSE.
        temp_dateformat = 'DD.MM.YYYY'.
      ENDIF.
      MOVE p_fname TO l_filename.
      CHECK l_filename NE space.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                filename                = l_filename
                filetype                = 'DAT'
                dat_d_format            = temp_dateformat
           TABLES
                data_tab                = itab_list
           EXCEPTIONS
                conversion_error        = 1
                file_open_error         = 2
                file_read_error         = 3
                invalid_type            = 4
                no_batch                = 5
                unknown_error           = 6
                invalid_table_width     = 7
                gui_refuse_filetransfer = 8
                customer_error          = 9.
      IF sy-subrc NE 0.
        MESSAGE s000 WITH 'File upload is failed!'.
        STOP.
      ELSE.
        CLEAR : itab_upload, itab_upload[].
        LOOP AT itab_list.
          MOVE-CORRESPONDING itab_list TO itab_upload.
          conversion_kunnr    itab_upload-customer.
          conversion_material itab_upload-material.
          itab_upload-mandt     = sy-mandt.
          itab_upload-in_date   = sy-datum.
          itab_upload-create_id = sy-uname.
    *>>>>Insert by GSCHOI 2007.11.08
          IF itab_list-adj_date+0(6) NE sy-datum+0(6).
            MESSAGE i368 WITH 'Adjust month must same as current month!'.
            ROLLBACK WORK.
            STOP.
          ENDIF.
    *<<<<End
          APPEND itab_upload.
          INSERT INTO (table_name) VALUES itab_upload.
          IF sy-subrc EQ 0.
            CONTINUE.
          ELSEIF sy-subrc EQ 4.
            MESSAGE s368 WITH 'Duplicated Data Error!'.
            ROLLBACK WORK.
            STOP.
          ELSE.
            MESSAGE s368 WITH 'File Error!'.
            ROLLBACK WORK.
            STOP.
          ENDIF.
        ENDLOOP.
      ENDIF.
      IF sy-subrc EQ 0.
        MESSAGE s368 WITH 'Uploaded Successfully!'.
      ENDIF.
    ENDFORM.                    " UPLOAD_DATA
    *&      Form  USER_COMMAND
    *       User Command Execution in Screen 1000
    FORM user_command.
      MOVE-CORRESPONDING itab_list TO zesp04.
      CASE sy-ucomm.
        WHEN 'INSERT'.
          PERFORM insert_item.
        WHEN 'UPDATE'.
          PERFORM update_item.
        WHEN 'DISPLAY'.
          PERFORM display_item.
        WHEN 'REFRESH'.
          PERFORM refresh_list.
      ENDCASE.
      IF ref_flag = 'Y'.
        PERFORM refresh_list.
        CLEAR ref_flag.
      ENDIF.
    ENDFORM.                    " USER_COMMAND
    *&      Form  INSERT_ITEM
    *       When Clicking Insert Button
    FORM insert_item.
      CLEAR : s_mode.
      CLEAR : zesp04.
      s_mode = 'INSERT'.
      CALL SCREEN '100'.
    ENDFORM.                    " INSERT_ITEM
    *&      Form  UPDATE_ITEM
    *       When Clicking Update Button
    FORM update_item.
      CLEAR : s_mode.
      s_mode = 'UPDATE'.
      CALL SCREEN '100'.
    ENDFORM.                    " UPDATE_ITEM
    *&      Form  DISPLAY_ITEM
    *       When Clicking Display Button
    FORM display_item.
      CLEAR : s_mode.
      s_mode = 'DISPLAY'.
      CALL SCREEN '100'.
    ENDFORM.                    " DISPLAY_ITEM
    *&      Form  REFRESH_LIST
    *       When Clicking Refresh Button or Returning Display Screen
    FORM refresh_list.
      CLEAR : itab_list, itab_list[].
      PERFORM select_data.
      sy-lsind = sy-lsind - 1.
      PERFORM display_data.
    ENDFORM.                    " REFRESH_LIST
    *&      Form  GET_FILENAME
    *       Get Filename
    FORM get_filename.
      DATA: l_fname LIKE ibipparms-path .
      DATA : p_name LIKE sy-repid.
      p_name = sy-repid.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = p_name
                dynpro_number = sy-dynnr
                field_name    = ''
           IMPORTING
                file_name     = l_fname.
      p_fname = l_fname.
    ENDFORM.                    " GET_FILENAME
    Edited by: Matt on Nov 24, 2008 11:24 AM - surrounded the ABAP with  tags

    Hi,
        Use SUBMIT statement in your first Report zrswbgcs009 at the end, to call the Modulepool program zrswbp004.
    do a search in SDN you will get lot of threads on SUBMIT statement with selection screen.
    SUBMIT... [VIA SELECTION-SCREEN]
               [USING SELECTION-SET <var>]
               [WITH <sel> <criterion>]
               [WITH FREE SELECTIONS <freesel>]
               [WITH SELECTION-TABLE <rspar>].
    http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba51a35c111d1829f0000e829fbfe/content.htm
    Regards
    Bala Krishna

  • Calling a report from module pool program

    Hi all,
            I had a requirement where I need to call a report from the module pool program where in when we click REPORT button, it should display the report output in the another screen.
    Can we do by calling screen after pushing REPORT button. If so, where we should write that code ( In pbo or pai). Please give me an idea.
    Thanking you,
    Regards,
    Murali Krishna T

    Use submit syntax.
    Press F1 on submit, Donot use return statement with it.
    If so, where we should write that code ( In pbo or pai).
    Please understand about these two events before doing the requirement.

  • How to make a fld mandatory in module pool program?

    I need help on following 2 things
    I have module pool program created, in that many screen subscreens created.
    1.I want to make a field mandatory
    second one  is, I have a general tab and  data tab.
    General tab screen - 2101
    Data tab = 2102
    In general tab, I have edited the values (change mode), when change the values and try to save it,
    It is holding old value.but If i exucute the transaction once again, it is showing the changed value(new value)
    For ex: there is a date field  value is 03/08/2009
    If I change this to 03/09/2009 and press on Save button from the standard menu, still it is showing the  value 03/08/2009. but I execute this transaction once again it is showing the value as 03/09/2009
    I will be thankful if someone helps me here

    Hi Chitra,
    Go to the properties of the filed select program tab and say input required.
    then you will get the problem solved.
    For second one actually its saving but not displaying the saved value at the same time ,
    for this you write the select statement after saving , so that once save is execute m, select statement also will execute  and it will display the newly saved value.
    so after saving imdeatly u write the select statement.
    like case sy-ucomm.
    when 'SAVE'.
    insert ztable.
    select filed from z table.
    endcase.
    let me know if ur problem solved.
    Regards
    Rajendra

  • How to use one module pool program in another module pool programming?

    Hi
    I have one moodule pool program.
    In one of my screen i want to use some code which already developed in another module pool program.
    Is there any direct way for using one module pool programcode  in another module pool program.
    If there any approaches for this plz help me in this issue.

    Dear,
    If you want to use the code.
    first you can write your code in a subroutine in module pool program 1
    and then you can use it from module pool  program 2 by
    perform subroutine_name(program_name)
    using P_1
    changing C_1
    if you wan to use one module pool data into other module pool.
    so that is another requirement.

  • How to create Long Text in Module Pool Program

    Hi all,
    I want to develop a new module pool program and I want to use Long text screen in this program and also want this text will store in table.I never develop such type of module pool before.This long text will like sales order long text.Please let me know the steps how I can develop such type of program and how I save long text huge data in table.
    Thanks & Regards
    Nirmal

    Hai ,
    here you have to use custom control, for this
    DATA: line(256) TYPE c,
          text_tab LIKE STANDARD TABLE OF line,
          field LIKE line.
    1)  Create custom control in your screen
    2)   CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',   "--> (this is custom control name in screen)
                       editor    EXPORTING parent = container.
    3)  CALL METHOD editor->get_text_as_stream  "This method reads data from custom control , inserts into itab 'text_tab' 
             IMPORTING       
              text = text_tab.                                       "
          READ TABLE text_tab  INTO line INDEX 1. read the text into wa 'line'
    if you want more clarity , see  'ABAPDOCU' >ABAP USER DIALOGS>    COMPLEXSCREEN ELEMENTS-->  DEMO CUSTOM_CONTROL

  • How to take backup of an entire module pool program with code,screen,etc.

    Hi experts,
    I have some important data in the ides server for which i want to take backup of them.
    I have some question regarding the same.
    1.How to take backup/download of an entire module pool program with code,screen,etc.
    2.How can we take backup/download for a DB table with its structure?
    3.How can we take backup of a search help?
    Please give some suggestions abt the same.
    Regards,
    Ashesh.

    Hi,
    May be just for viewing, try downloading from SE80 transaction from the others option.
    Here just try issuing the print, it will generate the spool.
    Now using the spool, download to your desktop as required. It will have all the information regarding the attributes, fields, elements everything.
    The only issue is, may be you need to take all the screens separately.
    Regards,
    Santhosh.

  • How to validate the field values in module pool program?

    Hi Guys
         I am working with module pool programming.
         Here I want to validate the fields like below.
         with out filling all the fields if I click SAVE option it has to show a message that all fields has to be filled.  This can be done by checking all the fields individually.
         I think it can be done through <b>LOOP AT SCREEN ......ENDLOOP</b>. sequence.
         If it is possible, can anyone help me?

    You need to write the Module in between the CHAIN and ENDCHAIN statment in SE51
    If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
    CHAIN.
    FIELD: <f1>, <f 2>,...
    MODULE <mod1>.
    FIELD: <g1>, <g 2>,...
    MODULE <mod2>.
    ENDCHAIN.
    all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
    Look at the DEMO program DEMO_DYNPRO_FIELD_CHAIN.
    ashish

Maybe you are looking for

  • OA framework sample Search Page

    hi all I have created EO,VO and AM for creating a page that search the records from a table. I can see the search page proper but i am having below error while searching the record.(when i click the "Go" button). oracle.apps.fnd.framework.OAException

  • How do I take a date string, add "X" days to it, and display a new date?

    I have a date listed in a text string. I would like to convert it to a time stamp, and take a variable number of days, converted to seconds, added to the date, and displayed as a correct date. Example: 9/1/2011 adding 35 days is 10/6/2011. The trick

  • How to get the RGB Working Space from within a Filter Plug-In?

    Within my Filter Plug-In I need to access the image's icc profile data. I know this can be accomplished with the according data structure 'iCCprofileData'. But what if there is no profile assigned to the image? Then iCCprofileData is NULL and the def

  • Folio 9470m notebook with two monitors

    Hi all,  I want to use my Folio 9740m notebook with 3 independent display (Built-in display and two external monitor HP L1750). I tried to connect direct to notebook and docking station but it's not working. Only two displays are working at same time

  • Transport order

    WE have explored in our system that there is no scope of validation in the system that no duplicate bill passing can be done to transporter against each excise invoice *** challan . So we want a slolution which leads for creation of transport order a