Sap Source code

Hi All ,,
how to read SAP source code from an ABAP program? I would appreciate your prompt response.
Thanks

try this source code
DANGER WARNING
ABSOLUTELY NO WARRANTY
USE AT OWN RISK
COPYRIGHT DR. MARTIN ROGGE
UNAUTHORISED USE PROHIBITED
REPORT ZPTTMXFI LINE-SIZE 200 NO STANDARD PAGE HEADING.
TABLES: TRDIR, TADIR.
DATA: XDIR LIKE TRDIR,
      XOBJ LIKE TADIR,
      XREL LIKE SY-SAPRL,
      XLAN LIKE SY-LANGU.
DATA: BEGIN OF XSRC OCCURS 10,
        LINE(72),
      END OF XSRC.
DATA: BEGIN OF XTXT OCCURS 10.
        INCLUDE STRUCTURE TEXTPOOL.
DATA: END OF XTXT.
DATA: BEGIN OF PACK OCCURS 10,
        KEY(4),
        DATA(152),
      END OF PACK.
DATA: BEGIN OF FILENAME,
        PATH(40),
        FILE LIKE SY-REPID,
        SEP(1),
        EXT(3),
      END OF FILENAME.
DATA: TABIX TYPE I,
      LOCALFILE LIKE RLGRAP-FILENAME,
      IRDIR LIKE TRDIR OCCURS 100.
SELECTION-SCREEN BEGIN OF BLOCK 01 WITH FRAME TITLE TEXT-P01.
SELECT-OPTIONS: REPNAM FOR SY-REPID.
SELECTION-SCREEN END OF BLOCK 01.
SELECTION-SCREEN BEGIN OF BLOCK 02 WITH FRAME TITLE TEXT-P02.
PARAMETERS: PATH(40) DEFAULT 'C:\SAPGUI\',
            EXT(3)   DEFAULT 'TXT'.
SELECTION-SCREEN END OF BLOCK 02.
SELECTION-SCREEN BEGIN OF BLOCK 03 WITH FRAME TITLE TEXT-P03.
PARAMETERS: DOWNLD RADIOBUTTON GROUP ACT,
            UPLOAD RADIOBUTTON GROUP ACT.
SELECTION-SCREEN END OF BLOCK 03.
SELECTION-SCREEN BEGIN OF BLOCK 05 WITH FRAME TITLE TEXT-P05.
PARAMETERS: UPL_ADIR DEFAULT ' ' AS CHECKBOX,
            UPL_RDIR DEFAULT ' ' AS CHECKBOX,
            UPL_SRC  DEFAULT 'X' AS CHECKBOX,
            UPL_TXT  DEFAULT 'X' AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK 05.
SELECTION-SCREEN BEGIN OF BLOCK 04 WITH FRAME TITLE TEXT-P04.
PARAMETERS: DISP RADIOBUTTON GROUP SAFE,
            UPDT RADIOBUTTON GROUP SAFE,
            PASSWD LIKE SY-UNAME.
SELECTION-SCREEN END OF BLOCK 04.
END-OF-SELECTION.
safety parameters
  CHECK PASSWD EQ SY-UNAME.
  DESCRIBE TABLE REPNAM LINES TABIX.
  CHECK TABIX GT 0.
  IF UPLOAD IS INITIAL.
    SELECT * FROM TRDIR INTO TABLE IRDIR WHERE NAME IN REPNAM.
    LOOP AT IRDIR INTO XDIR.
      PERFORM GET USING XDIR-NAME.
      CHECK SY-SUBRC EQ 0.
      PERFORM PACK.
      IF DISP IS INITIAL.
        PERFORM DOWNLOAD USING XDIR-NAME.
      ELSE.
        PERFORM PRINT_FILE USING XDIR-NAME.
      ENDIF.
      SKIP.
      ULINE.
    ENDLOOP.
  ELSE.
    LOOP AT REPNAM WHERE OPTION EQ 'EQ'.
      PERFORM UPLOAD USING REPNAM-LOW.
      PERFORM UNPACK.
      PERFORM CHECK_STRUCTURES.
      CHECK SY-SUBRC EQ 0.
      IF DISP IS INITIAL.
        PERFORM PUT USING REPNAM-LOW.
      ELSE.
        PERFORM PRINT_STRUCTURES USING REPNAM-LOW.
      ENDIF.
      SKIP.
      ULINE.
    ENDLOOP.
  ENDIF.
      FORM GET                                                      *
FORM GET USING REPID LIKE SY-REPID.
  REFRESH XSRC.
  REFRESH XTXT.
  MOVE SY-SAPRL TO XREL.
  MOVE SY-LANGU TO XLAN.
move space to xdir.
  MOVE SPACE TO XOBJ.
select single * from trdir into xdir where name eq repid.
check sy-subrc eq 0.
  SELECT SINGLE * FROM TADIR INTO XOBJ WHERE PGMID    EQ 'R3TR'
                                         AND OBJECT   EQ 'PROG'
                                         AND OBJ_NAME EQ REPID.
  CHECK SY-SUBRC EQ 0.
  READ REPORT REPID INTO XSRC.
  READ TEXTPOOL REPID INTO XTXT LANGUAGE XLAN.
ENDFORM.
      FORM PUT                                                      *
FORM PUT USING REPID LIKE SY-REPID.
  IF NOT UPL_ADIR IS INITIAL.
    MODIFY TADIR FROM XOBJ.
  ENDIF.
  IF NOT UPL_RDIR IS INITIAL.
    MODIFY TRDIR FROM XDIR.
  ENDIF.
  IF NOT UPL_SRC IS INITIAL.
    INSERT REPORT REPID FROM XSRC STATE 'A'.
    DELETE REPORT REPID STATE 'I'.
  ENDIF.
  IF NOT UPL_TXT IS INITIAL.
    INSERT TEXTPOOL REPID FROM XTXT LANGUAGE XLAN STATE 'A'.
    DELETE TEXTPOOL REPID LANGUAGE '*' STATE 'I'.
  ENDIF.
ENDFORM.
      FORM PACK                                                     *
FORM PACK.
  REFRESH PACK.
  CLEAR PACK.
  PACK-KEY = 'REL'.
  MOVE XREL TO PACK-DATA.
  APPEND PACK.
  CLEAR PACK.
  PACK-KEY = 'LNG'.
  MOVE XLAN TO PACK-DATA.
  APPEND PACK.
  CLEAR PACK.
  PACK-KEY = 'DIR'.
  MOVE XDIR TO PACK-DATA.
  APPEND PACK.
  CLEAR PACK.
  PACK-KEY = 'OBJ'.
  MOVE XOBJ TO PACK-DATA.
  APPEND PACK.
  CLEAR PACK.
  PACK-KEY = 'SRC'.
  LOOP AT XSRC INTO PACK-DATA.
    APPEND PACK.
  ENDLOOP.
  LOOP AT XTXT.
    CLEAR PACK.
    PACK-KEY = 'TXT'.
    PACK-DATA+00(001) = XTXT-ID.
    PACK-DATA+01(008) = XTXT-KEY.
    PACK-DATA+10(010) = XTXT-LENGTH.
    PACK-DATA+20(132) = XTXT-ENTRY.
    APPEND PACK.
  ENDLOOP.
ENDFORM.
      FORM UNPACK                                                   *
FORM UNPACK.
  REFRESH XSRC.
  REFRESH XTXT.
move sy-saprl to xrel.
  MOVE 'XXX' TO XREL.
  MOVE SY-LANGU TO XLAN.
  MOVE SPACE TO XDIR.
  MOVE SPACE TO XOBJ.
  LOOP AT PACK WHERE KEY EQ 'REL'.
    XREL = PACK-DATA.
    EXIT.
  ENDLOOP.
  LOOP AT PACK WHERE KEY EQ 'LNG'.
    XLAN = PACK-DATA.
    EXIT.
  ENDLOOP.
  IF NOT UPL_RDIR IS INITIAL.
    LOOP AT PACK WHERE KEY EQ 'DIR'.
      XDIR = PACK-DATA.
      EXIT.
    ENDLOOP.
  ENDIF.
  IF NOT UPL_ADIR IS INITIAL.
    LOOP AT PACK WHERE KEY EQ 'OBJ'.
      XOBJ = PACK-DATA.
      EXIT.
    ENDLOOP.
  ENDIF.
  IF NOT UPL_SRC IS INITIAL.
    LOOP AT PACK WHERE KEY EQ 'SRC'.
      XSRC = PACK-DATA(72).
      APPEND XSRC.
    ENDLOOP.
  ENDIF.
  IF NOT UPL_TXT IS INITIAL.
    LOOP AT PACK WHERE KEY EQ 'TXT'.
      CLEAR XTXT.
      XTXT-ID     = PACK-DATA+00(001).
      XTXT-KEY    = PACK-DATA+01(008).
      XTXT-LENGTH = PACK-DATA+10(010).
      XTXT-ENTRY  = PACK-DATA+20(132).
      APPEND XTXT.
    ENDLOOP.
  ENDIF.
ENDFORM.
      FORM DOWNLOAD                                                 *
FORM DOWNLOAD USING REPID LIKE SY-REPID.
  FILENAME-PATH = PATH.
  FILENAME-FILE = REPID.
  FILENAME-SEP  = '.'.
  FILENAME-EXT  = EXT.
  CONDENSE FILENAME NO-GAPS.
  LOCALFILE = FILENAME.
  FORMAT INTENSIFIED ON.
  SKIP.
  WRITE: / '* downloading', FILENAME.
  CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
            FILENAME            = LOCALFILE
            FILETYPE            = 'ASC'
       TABLES
            DATA_TAB            = PACK
       EXCEPTIONS
            FILE_OPEN_ERROR     = 1
            FILE_WRITE_ERROR    = 2
            INVALID_FILESIZE    = 3
            INVALID_TABLE_WIDTH = 4
            INVALID_TYPE        = 5
            NO_BATCH            = 6
            UNKNOWN_ERROR       = 7
            OTHERS              = 8.
  WRITE: / '* download returncode', SY-SUBRC.
ENDFORM.
      FORM UPLOAD                                                   *
FORM UPLOAD USING REPID LIKE SY-REPID.
  REFRESH PACK.
  FILENAME-PATH = PATH.
  FILENAME-FILE = REPID.
  FILENAME-SEP  = '.'.
  FILENAME-EXT  = EXT.
  CONDENSE FILENAME NO-GAPS.
  LOCALFILE = FILENAME.
  FORMAT INTENSIFIED ON.
  SKIP.
  WRITE: / '* uploading', FILENAME.
  CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
            FILENAME            = LOCALFILE
            FILETYPE            = 'ASC'
       TABLES
            DATA_TAB            = PACK
       EXCEPTIONS
            CONVERSION_ERROR    = 1
            FILE_OPEN_ERROR     = 2
            FILE_READ_ERROR     = 3
            INVALID_TABLE_WIDTH = 4
            INVALID_TYPE        = 5
            NO_BATCH            = 6
            UNKNOWN_ERROR       = 7
            OTHERS              = 8.
  WRITE: / '* upload returncode', SY-SUBRC.
ENDFORM.
      FORM CHECK_STRUCTURES                                         *
FORM CHECK_STRUCTURES.
  IF NOT UPL_RDIR IS INITIAL.
    IF XDIR EQ SPACE.
      WRITE: / '* fatal error: no report directory entry'.
      SY-SUBRC = 1.
      EXIT.
    ENDIF.
  ENDIF.
  IF NOT UPL_ADIR IS INITIAL.
    IF XOBJ EQ SPACE.
      WRITE: / '* fatal error: no object directory'.
      SY-SUBRC = 2.
      EXIT.
    ENDIF.
  ENDIF.
  IF NOT UPL_SRC IS INITIAL.
    DESCRIBE TABLE XSRC LINES TABIX.
    IF TABIX LE 0.
      WRITE: / '* fatal error: no source code'.
      SY-SUBRC = 3.
      EXIT.
    ENDIF.
  ENDIF.
  IF NOT UPL_TXT IS INITIAL.
    DESCRIBE TABLE XTXT LINES TABIX.
    IF TABIX LE 0.
      WRITE: / '* fatal error: no text elements'.
      SY-SUBRC = 4.
      EXIT.
    ENDIF.
  ENDIF.
  IF XREL NE SY-SAPRL.
    IF ( UPL_ADIR IS INITIAL ) AND ( UPL_RDIR IS INITIAL ).
      WRITE: / '* warning: system release is', SY-SAPRL,
               'whereas source release is', XREL.
    ELSE.
      WRITE: / '* fatal error: system release is', SY-SAPRL,
               'whereas source release is', XREL.
      SY-SUBRC = 8.
      EXIT.
    ENDIF.
  ENDIF.
  IF NOT UPL_ADIR IS INITIAL.
    IF XOBJ-DEVCLASS EQ '$TMP' AND XOBJ-SRCSYSTEM NE SY-SYSID.
      WRITE: / '* info: changing source system to', SY-SYSID.
      XOBJ-SRCSYSTEM = SY-SYSID.
    ENDIF.
    IF XOBJ-MASTERLANG NE SY-LANGU.
      WRITE: / '* warning: changing master language to', SY-LANGU.
      XOBJ-MASTERLANG = SY-LANGU.
    ENDIF.
    IF XLAN NE SY-LANGU.
      WRITE: / '* warning: changing text language to', SY-LANGU.
      XLAN = SY-LANGU.
    ENDIF.
  ENDIF.
  IF XLAN NE SY-LANGU.
    WRITE: / '* warning: system language is', SY-LANGU,
             'whereas text language is', XLAN.
  ENDIF.
  SY-SUBRC = 0.
ENDFORM.
      FORM PRINT_STRUCTURES                                         *
FORM PRINT_STRUCTURES USING REPID LIKE SY-REPID.
  SKIP.
  WRITE: / '* displaying selected internal structures for', REPID.
  SKIP.
  FORMAT INTENSIFIED OFF.
  WRITE: /4 XREL.
  WRITE: /4 XLAN.
  IF NOT UPL_RDIR IS INITIAL.
    WRITE: /4 XDIR.
  ENDIF.
  IF NOT UPL_ADIR IS INITIAL.
    WRITE: /4 XOBJ.
  ENDIF.
  IF NOT UPL_SRC IS INITIAL.
    LOOP AT XSRC.
      WRITE: /4 XSRC.
    ENDLOOP.
  ENDIF.
  IF NOT UPL_TXT IS INITIAL.
    LOOP AT XTXT.
      WRITE: /4 XTXT-ID,
              6 XTXT-KEY,
             20 XTXT-LENGTH,
             24 XTXT-ENTRY.
    ENDLOOP.
  ENDIF.
  FORMAT INTENSIFIED ON.
ENDFORM.
      FORM PRINT_FILE                                               *
FORM PRINT_FILE USING REPID LIKE SY-REPID.
  SKIP.
  WRITE: / '* displaying file content for', REPID.
  SKIP.
  FORMAT INTENSIFIED OFF.
  LOOP AT PACK.
    WRITE: /4 PACK.
  ENDLOOP.
  FORMAT INTENSIFIED ON.
ENDFORM.

Similar Messages

  • Source code has syntax error in SAP PI7.1 Mapping Test

    HI All,
    IN SAP P7.1  created simple two data types, message types and Message Mapping with only 2 fields. While testing the mapping in Message Mapping it is giving the error as
    Source text of object Message Mapping: MM_Source_to_Target | http://abc.com has syntax errors:
    Source code has syntax error:
    I am able to activate the Datatypes and Message Types but not able to activate the Messge mapping.
    Please if any body faced the same problem please give the solution.
    One more thing is I am able to test the Message Mapping available in BASIS 7.1 Software Component objects. It is executing successfully...
    but otherthan this SWC it not working success fully.....
    Regards
    Sridhar Goli

    Hi David,
    please check the default trace. It may contain the entry:
    Error in compiling : java.io.IOException: Not enough space
    If that's the case, maybe there's too little space for the swap file/device.
    You should ensure that at least 2X (preferably 3X) of Heap (-Xmx) is configured as real swap
    Hope that helps.
    Regards,
    Gábor Klauzer

  • How to get the source code of  "com.sap.caf.eu.gp.example.tiimeoff.wd.creat

    Hi Frendz..
    I want to know how we can build a callable obj which have a two buttons those r Accept n Reject accordiing to the actions on these buttons flow should forward to next screen(approver ) r sent back to the sender(screen with reject).
    I gone thru the Leave process(Time-Off process) which is very suitable for my requirment but in this app there r using predefined CO(com.sap.caf.eu.gp.example.tiimeoff.wd.create).How we see the source code of this predefined CO.
    Thanks in Advance
    Regards
    Rajesh

    Hi,
    check [this|Re: Source of Time-off Request Project].
    Regards,
    Naga

  • How to find the source code of com.sap.caf.eu.gp.example.tiimeoff.wd.create

    Hi Frendz..
    I want to know how we can build a callable obj which have a two buttons those  r Accept n Reject accordiing to the actions on these buttons flow should forward to next screen(approver ) r sent back to the sender(screen with reject).
    I gone thru the Leave process(Time-Off process) which is very suitable for my requirment but in this app there r using predefined CO(com.sap.caf.eu.gp.example.tiimeoff.wd.create).How we see the source code of this predefined CO.
    Thanks in Advance
    Regards
    Rajesh

    not answered

  • Source code for SAP's search components

    Hello all!
    Does anyone know where I could find the source code to SAP's provided TREX search components?  I would like to copy and modify one slightly, and would prefer to use their code instead of developing it from scratch if I can help it.
    Thanks in advance for the help!
    Best regards,
    Fallon

    Hi,
    Which one do you need?
    The class names you can find under
    System Administration -> System Configuration -> Knowledge Management -> Content Management -> User Interface -> Mapping -> (advanced) -> Search Dialog Box Component.
    Most of them are in km.appl.ui.search_api.jar
    Best regards,
    Avishai Zamir

  • Where I can get SAP standard webdynpro application source code

    Dear Experts,
    Where can i get sap standard WebDynpro application source code, because i need to copy that source code and modify that according to my application.
    My scnario.
    Actually i need to develop Carloan WebDynpro application, but its similar ESS-> Travel Expenses->Plan my Travel Expense .. standard WebDynpro application model, so please any one suggest how to copy that source code means where can i get that source code, and when rebuilding time what type of problems facing..
    please anyone suggest
    appreciate if you help regarding this..

    Hai saradha ji,
    thank got i know you are the right person for solve my problame, because i study your blogs, please don't be leave this thred till the my problame solve,
    ok once i find  sca file what i want do steps.. please tell me..
    give me any document step by step.  i don't have FPM. i don't have market place ID, so i unable to download .
    please send related artical this mail id [email protected]
    first i search sca file in my development server once got file.. let you inform.
    sincerely

  • Download Source Code of SAP Fiori SRM - My Shopping cart application

    Hi Folks,
    Where i can download, source code of SAP Fiori - SRM My Shopping Cart application.
    If it is possible any one share or provide download path of sap fiori My Shopping cart application.
    Thanks in advance.
    -Cheers
    Ganesh Babu

    Thanks for your info.
    I have one more question, we do not have FIORI app landscape now, we are planning to get the Shopping Cart application from SAP then we will start the customizing by using the steps which are mentioned in above thread Link.
    Can you pls. share how to download the SAP FIORI - Shopping cart app (approval & my Shopping cart) then how to proceed with installing the app in ABAP app server & NW Gateway service.
    Regards
    Ganesh.

  • Which SAP table stores the ABAP program Source Code

    Hi All,
    Which SAP table stores the ABAP source code .
    Is it possible to retrieve the abap program code from database table
    wherein it is stored .
    Scenario :
    In our project SAP got decommissioned and SAP database is migrated to Oracle . As SAP is decomissioned , we are not able to access the SAP frontend . But we need a program code to service a request . Is it possible to retrieve the program code from the database
    which is migrated to oracle .
    Thanks
    Shikha

    This is an interesting question as the answer is may be different depending on your version.  For example, in new releases the table REPOSRC appears to hold a compress version of the course code in the DATA field, but you would need to be able to decompress it if trying to read this directly out of the DB.  I would assume that it uses gZip to do the compression, and there are ABAP utilities built in to do the compress/decompress.  Of course you can always read the source code by using the READ REPORT statement in any release, but of course this will not help you if you can not log on to your system.  Basically, if you system is corrupt for some reason, the best option is to restore from a backup.
    REgards,
    Rich Heilman

  • Source code for "Creating an Extended Web Dynpro Application"?

    Hello!
    I'm a rookie in the field of SAP Netweaver and I'm justing getting started with some tutorials. My problems with "Creating an Extended Web Dynpro Application" are to massive to be posted on this forum in this stage. What I want to have some help with is to find the source code for that tutorial so I can get som guidence from there.
    Following text is cut out of this page:
    http://help.sap.com/saphelp_nw70/helpdata/EN/5d/f42fef2eec724597a03b6bcc670c2c/frameset.htm
    Creating an Extended Web Dynpro Application
    You can download the Web Dynpro project for the current tutorial from the Software Developer Network SDN (http://sdn.sap.com -> Web Application Server -> Web Dynpro -> Sample Applications and Tutorials) in two versions: one skeleton version you can use for exercises and one final version (solution) for an immediate build, deployment and run on the Java engine of the SAP Web Application Server.
    How hard I try I can't find the specific source code on sdn.sap.com
    Does anyone have a clue where it is?
    Thanks!
    Best regards
    /Johan Månsson Lindströ

    Hi!
    I did what you said but I seem to miss the IDE folder. This is what it looks in my Explorer
    C: > Program Files > SAP > IDE > CE > eclipse > (no folder called "examples")
    I also did a search in this eclipse folder for "examples" but I did'nt find the example I'm looking for
    I am running a newer version of NWDS:
    SAP NetWeaver Developer Studio
    SAP NetWeaver 7.1 Composition Environment SP03 PAT0000
    Maybe that's why things don't look the same?

  • ABAP source code is written "by hand" or automatically?

    Hi all,
    I would like to modify the report "Open Items - Vendor Due Date Forecast" created by T. S_ALR_87012084. 
    With SE93 i found the name of the program RFKOFW00, which are referring to the T. S_ALR_87012084. T. S_ALR_87012084. (Parameter: D_SREPOVARI-REPORT = RFKOFW00) and with SE38 i have seen the ABAP source code of the program RFKOFW00.
    My questions are:
    1) The ABAP  source code of the program RFKOFW00 is written "by hand", or automatically by one of the SAP tools, for example Report Painter/Writer, SAP queryu2026..? It seems to me that it is written "by hand". Is this true?
    2) In general, how can i tell if a SAP ABAP program is written "by hand" or automatically by one of SAP tools? I know that one way to understand is that source code, written by hand is more clear.
    Is there a way to understand, more accurate, more secure?
    Thanks in advance
    Serena

    Hi ,
    if the code is automatically created, there will be a comment line in the beginning of the code which says
    Generated function module for ..........
    Please do not modify or copy this function module
    Regards

  • Upload and Download ABAP Source Code

    This is a program that I have had kicking around for a couple of years in various incarnations.
    Source Code Listing
    Report: ZKBPROGS *
    Function : Up/Download ABAP reports complete with texts *
    - this program does not update TRDIR with the *
    TRDIR entries that are in the program uploaded. Instead, *
    current users stats are used. *
    - this program allows selection of reports from a list or *
    a single report can be tuped in and uploaded *
    - this program also updates TADIR so that a development class*
    is assigned to the program *
    - this program checks to see if the program already has a *
    TRDIR entry, and if it does, warns the user *
    - this program will save/restore the program documenation too*
    REPORT ZKBPROGS
    NO STANDARD PAGE HEADING
    LINE-SIZE 255.
    Declare Database Objects *
    tables:
    DOKIL,
    TRDIR.
    Constants*
    CONSTANTS:
    MC_TRDIR_IDENTIFIER(72) TYPE C VALUE '%&%& RDIR',
    MC_REPORT_IDENTIFIER(72) TYPE C VALUE '%&%& REPO',
    MC_TEXT_IDENTIFIER(72) TYPE C VALUE '%&%& TEXP',
    MC_THEAD_IDENTIFIER(72) TYPE C VALUE '%&%& HEAD',
    MC_DOC_IDENTIFIER(72) TYPE C VALUE '%&%& DOKL',
    MC_TRDIR_SHORT(4) TYPE C VALUE 'RDIR',
    MC_REPORT_SHORT(4) TYPE C VALUE 'REPO',
    MC_TEXT_SHORT(4) TYPE C VALUE 'TEXP',
    MC_THEAD_SHORT(4) TYPE C VALUE 'HEAD',
    MC_DOC_SHORT(4) TYPE C VALUE 'DOKP'.
    Declare Module level data structures *
    DATA: BEGIN OF MTAB_PROGRAM_SOURCE OCCURS 0,
    LINE(72) TYPE C,
    END OF MTAB_PROGRAM_SOURCE.
    DATA: MTAB_PROGRAM_TRDIR LIKE TRDIR OCCURS 0 WITH HEADER LINE.
    DATA: MTAB_PROGRAM_TEXTS LIKE TEXTPOOL OCCURS 0 WITH HEADER LINE.
    DATA: MSTR_THEAD LIKE THEAD.
    DATA: BEGIN OF MTAB_PROGRAM_FILE OCCURS 0,
    LINE(275) TYPE C,
    END OF MTAB_PROGRAM_FILE.
    DATA: BEGIN OF MTAB_DIRECTORY OCCURS 0,
    NAME LIKE TRDIR-NAME,
    DESC(72) TYPE C,
    SAVENAME LIKE RLGRAP-FILENAME,
    END OF MTAB_DIRECTORY.
    DATA: BEGIN OF MTAB_PROGRAM_DOCUMENTATION OCCURS 0,
    LINE(255) TYPE C,
    END OF MTAB_PROGRAM_DOCUMENTATION.
    Selection Screen *
    *-- Options for upload/download of programs
    SELECTION-SCREEN BEGIN OF BLOCK FRM_OPTIONS WITH FRAME TITLE TEXT-UDL.
    PARAMETERS:
    RB_DOWN RADIOBUTTON GROUP UDL DEFAULT 'X'. " Download reports
    SELECTION-SCREEN BEGIN OF BLOCK FRM_TRDIR WITH FRAME TITLE TEXT-DIR.
    SELECT-OPTIONS:
    S_NAME FOR TRDIR-NAME, " Program Name
    S_SUBC FOR TRDIR-SUBC " Program Type
    DEFAULT 'F' OPTION EQ SIGN E," Exclude Functions by default
    S_CNAM FOR TRDIR-CNAM " Created by
    DEFAULT SY-UNAME,
    S_UNAM FOR TRDIR-UNAM, " Last Changed by
    S_CDAT FOR TRDIR-CDAT, " Creation date
    S_UDAT FOR TRDIR-UDAT. " Last update date
    SELECTION-SCREEN END OF BLOCK FRM_TRDIR.
    *-- Options for uploading programs
    PARAMETERS:
    RB_UP RADIOBUTTON GROUP UDL. " Upload reports
    SELECTION-SCREEN BEGIN OF BLOCK FRM_UPLOAD WITH FRAME TITLE TEXT-UPL.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(29) TEXT-SNG.
    PARAMETERS:
    RB_FILE RADIOBUTTON GROUP HOW DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 33(42) TEXT-FNA.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS:
    RB_LIST RADIOBUTTON GROUP HOW.
    SELECTION-SCREEN END OF BLOCK FRM_UPLOAD.
    SELECTION-SCREEN END OF BLOCK FRM_OPTIONS.
    *-- Options for up/downloading programs
    SELECTION-SCREEN BEGIN OF BLOCK FRM_FILEN WITH FRAME TITLE TEXT-FIL.
    PARAMETERS:
    RB_DOS RADIOBUTTON GROUP FIL DEFAULT 'X', " Save to local
    RB_UNIX RADIOBUTTON GROUP FIL, " Save to UNIX
    P_PATH LIKE RLGRAP-FILENAME " Path to save files to
    DEFAULT 'c:\temp\'.
    SELECTION-SCREEN END OF BLOCK FRM_FILEN.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-LOW.
    CALL FUNCTION 'F4_PROGRAM'
    EXPORTING
    OBJECT = S_NAME-LOW
    SUPPRESS_SELECTION = 'X'
    IMPORTING
    RESULT = S_NAME-LOW
    EXCEPTIONS
    OTHERS = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_NAME-HIGH.
    CALL FUNCTION 'F4_PROGRAM'
    EXPORTING
    OBJECT = S_NAME-HIGH
    SUPPRESS_SELECTION = 'X'
    IMPORTING
    RESULT = S_NAME-HIGH
    EXCEPTIONS
    OTHERS = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-LOW.
    PERFORM GET_NAME USING 'S_UNAM-LOW'
    CHANGING S_UNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_UNAM-HIGH.
    PERFORM GET_NAME USING 'S_UNAM-HIGH'
    CHANGING S_UNAM-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-LOW.
    PERFORM GET_NAME USING 'S_CNAM-LOW'
    CHANGING S_CNAM-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_CNAM-HIGH.
    PERFORM GET_NAME USING 'S_CNAM-HIGH'
    CHANGING S_CNAM-HIGH.
    TOP-OF-PAGE.
    IF RB_LIST = 'X'.
    FORMAT COLOR COL_HEADING.
    NEW-LINE.
    WRITE: AT 3 TEXT-H01,
    AT 15 TEXT-H03.
    FORMAT COLOR OFF.
    ENDIF.
    AT LINE-SELECTION.
    CHECK RB_LIST = 'X'. " only do in list mode
    READ LINE SY-CUROW FIELD VALUE MTAB_DIRECTORY-SAVENAME.
    *-- Read file into an internal table
    PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
    USING MTAB_DIRECTORY-SAVENAME.
    *-- Split table into TADIR entry, report lines, and report text
    PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
    MTAB_PROGRAM_SOURCE
    MTAB_PROGRAM_TEXTS
    MTAB_PROGRAM_DOCUMENTATION
    CHANGING TRDIR
    MSTR_THEAD.
    *-- Save all of the data
    PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
    MTAB_PROGRAM_TEXTS
    MTAB_PROGRAM_DOCUMENTATION
    USING TRDIR
    MSTR_THEAD.
    Start of processing *
    START-OF-SELECTION.
    FORMAT COLOR COL_NORMAL.
    IF RB_DOWN = 'X'.
    PERFORM DOWNLOAD_REPORTS.
    ELSEIF RB_UP = 'X'.
    PERFORM UPLOAD_REPORTS.
    ENDIF.
    END-OF-SELECTION.
    IF RB_DOWN = 'X'.
    CONCATENATE P_PATH
    'directory.txt'
    INTO P_PATH.
    PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_DIRECTORY
    USING P_PATH.
    ENDIF.
    FORM UPLOAD_REPORTS *
    FORM UPLOAD_REPORTS.
    *-- Can upload a reports entered in selection criteria or
    *-- select from a list. List can be from index.txt in same directory
    *-- (created by the download) or by reading the first line of each file
    *-- in the directory.
    IF RB_FILE = 'X'. " Upload single program from a file
    *-- Read file into an internal table
    PERFORM READ_REPORT_FROM_DISK TABLES MTAB_PROGRAM_FILE
    USING P_PATH.
    *-- Split table into TADIR entry, report lines, and report text
    PERFORM SPLIT_INCOMING_FILE TABLES MTAB_PROGRAM_FILE
    MTAB_PROGRAM_SOURCE
    MTAB_PROGRAM_TEXTS
    MTAB_PROGRAM_DOCUMENTATION
    CHANGING TRDIR
    MSTR_THEAD.
    *-- Save all of the data
    PERFORM INSERT_NEW_REPORT TABLES MTAB_PROGRAM_SOURCE
    MTAB_PROGRAM_TEXTS
    MTAB_PROGRAM_DOCUMENTATION
    USING TRDIR
    MSTR_THEAD.
    ELSEIF RB_LIST = 'X'. " Show list for user to choose from
    *-- get list of report names/descriptions from directory text
    CONCATENATE P_PATH
    'directory.txt'
    INTO P_PATH.
    PERFORM READ_REPORT_FROM_DISK TABLES MTAB_DIRECTORY
    USING P_PATH.
    SORT MTAB_DIRECTORY.
    *-- Write out list of report names/descriptions
    LOOP AT MTAB_DIRECTORY.
    WRITE:
    / MTAB_DIRECTORY-NAME UNDER TEXT-H01,
    MTAB_DIRECTORY-DESC UNDER TEXT-H03,
    MTAB_DIRECTORY-SAVENAME.
    ENDLOOP.
    *-- Process user selections for reports to upload.
    ENDIF.
    ENDFORM. " upload_reports
    FORM DOWNLOAD_REPORTS *
    From the user selections, get all programs that meet the *
    criteria, and save them in ftab_program_directory. *
    Also save the report to disk. *
    FORM DOWNLOAD_REPORTS.
    DATA:
    LC_FULL_FILENAME LIKE RLGRAP-FILENAME.
    *-- The table is put into an internal table because the program will
    *-- abend if multiple transfers to a dataset occur within a SELECT/
    *-- ENDSELCT (tested on 3.1H)
    SELECT * FROM TRDIR
    INTO TABLE MTAB_PROGRAM_TRDIR
    WHERE NAME IN S_NAME
    AND SUBC IN S_SUBC
    AND CNAM IN S_CNAM
    AND UNAM IN S_UNAM
    AND CDAT IN S_CDAT
    AND UDAT IN S_UDAT.
    LOOP AT MTAB_PROGRAM_TRDIR.
    *-- Clear out text and source code tables
    CLEAR:
    MTAB_PROGRAM_FILE,
    MTAB_PROGRAM_SOURCE,
    MTAB_PROGRAM_TEXTS,
    MTAB_PROGRAM_DOCUMENTATION.
    REFRESH:
    MTAB_PROGRAM_FILE,
    MTAB_PROGRAM_SOURCE,
    MTAB_PROGRAM_TEXTS,
    MTAB_PROGRAM_DOCUMENTATION.
    *-- Get the report
    READ REPORT MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_SOURCE.
    *-- Get the text for the report
    READ TEXTPOOL MTAB_PROGRAM_TRDIR-NAME INTO MTAB_PROGRAM_TEXTS.
    *-- Get the documentation for the report
    CLEAR DOKIL.
    SELECT * UP TO 1 ROWS FROM DOKIL
    WHERE ID = 'RE'
    AND OBJECT = MTAB_PROGRAM_TRDIR-NAME
    AND LANGU = SY-LANGU
    AND TYP = 'E'
    ORDER BY VERSION DESCENDING.
    ENDSELECT.
    *-- Documentation exists for this object
    IF SY-SUBRC = 0.
    CALL FUNCTION 'DOCU_READ'
    EXPORTING
    ID = DOKIL-ID
    LANGU = DOKIL-LANGU
    OBJECT = DOKIL-OBJECT
    TYP = DOKIL-TYP
    VERSION = DOKIL-VERSION
    IMPORTING
    HEAD = MSTR_THEAD
    TABLES
    LINE = MTAB_PROGRAM_DOCUMENTATION
    EXCEPTIONS
    OTHERS = 1.
    ENDIF.
    *-- Put the report code and texts into a single file
    *-- Put the identifier line in so that the start of the TRDIR line
    *-- is marked
    CONCATENATE MC_TRDIR_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    *-- Add the TRDIR line
    MTAB_PROGRAM_FILE-LINE = MTAB_PROGRAM_TRDIR.
    APPEND MTAB_PROGRAM_FILE.
    *-- Put the identifier line in so that the start of the report code
    *-- is marked
    CONCATENATE MC_REPORT_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    *-- Add the report code
    LOOP AT MTAB_PROGRAM_SOURCE.
    MTAB_PROGRAM_FILE = MTAB_PROGRAM_SOURCE.
    APPEND MTAB_PROGRAM_FILE.
    ENDLOOP.
    *-- Put the identifier line in so that the start of the report text
    *-- is marked
    CONCATENATE MC_TEXT_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    *-- Add the report texts
    LOOP AT MTAB_PROGRAM_TEXTS.
    MTAB_PROGRAM_FILE = MTAB_PROGRAM_TEXTS.
    APPEND MTAB_PROGRAM_FILE.
    ENDLOOP.
    *-- Put the identifier line in so that the start of the THEAD record
    *-- is marked
    CONCATENATE MC_THEAD_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    MTAB_PROGRAM_FILE = MSTR_THEAD.
    APPEND MTAB_PROGRAM_FILE.
    *-- Put the identifier line in so that the start of the report
    *-- documentation is marked
    CONCATENATE MC_DOC_IDENTIFIER
    MTAB_PROGRAM_TRDIR-NAME
    INTO MTAB_PROGRAM_FILE-LINE.
    APPEND MTAB_PROGRAM_FILE.
    *-- Add the report documentation
    LOOP AT MTAB_PROGRAM_DOCUMENTATION.
    MTAB_PROGRAM_FILE = MTAB_PROGRAM_DOCUMENTATION.
    APPEND MTAB_PROGRAM_FILE.
    ENDLOOP.
    *-- Make the fully pathed filename that report will be saved to
    CONCATENATE P_PATH
    MTAB_PROGRAM_TRDIR-NAME
    '.txt'
    INTO LC_FULL_FILENAME.
    PERFORM SAVE_TABLE_TO_FILE TABLES MTAB_PROGRAM_FILE
    USING LC_FULL_FILENAME.
    *-- Write out message with Program Name/Description
    READ TABLE MTAB_PROGRAM_TEXTS WITH KEY ID = 'R'.
    IF SY-SUBRC = 0.
    MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
    MTAB_DIRECTORY-DESC = MTAB_PROGRAM_TEXTS-ENTRY.
    MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
    APPEND MTAB_DIRECTORY.
    WRITE: / MTAB_PROGRAM_TRDIR-NAME,
    MTAB_PROGRAM_TEXTS-ENTRY(65) COLOR COL_HEADING.
    ELSE.
    MTAB_DIRECTORY-NAME = MTAB_PROGRAM_TRDIR-NAME.
    MTAB_DIRECTORY-DESC = 'No description available'.
    MTAB_DIRECTORY-SAVENAME = LC_FULL_FILENAME.
    APPEND MTAB_DIRECTORY.
    WRITE: / MTAB_PROGRAM_TRDIR-NAME.
    ENDIF.
    ENDLOOP.
    ENDFORM. " BUILD_PROGRAM_DIRECTORY
    FORM SAVE_TABLE_TO_FILE *
    --> FTAB_TABLE *
    --> F_FILENAME *
    FORM SAVE_TABLE_TO_FILE TABLES FTAB_TABLE
    USING F_FILENAME.
    IF RB_DOS = 'X'. " Save file to presentation server
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = F_FILENAME
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = FTAB_TABLE
    EXCEPTIONS
    OTHERS = 4.
    IF SY-SUBRC NE 0.
    WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
    F_FILENAME COLOR COL_NEGATIVE.
    ENDIF.
    ELSE. " Save file to application server
    OPEN DATASET F_FILENAME FOR OUTPUT IN TEXT MODE.
    IF SY-SUBRC = 0.
    LOOP AT FTAB_TABLE.
    TRANSFER FTAB_TABLE TO F_FILENAME.
    IF SY-SUBRC NE 0.
    WRITE: / 'Error writing record to file;' COLOR COL_NEGATIVE,
    F_FILENAME COLOR COL_NEGATIVE.
    ENDIF.
    ENDLOOP.
    ELSE.
    WRITE: / 'Error opening dataset' COLOR COL_NEGATIVE,
    F_FILENAME COLOR COL_NEGATIVE.
    ENDIF.
    ENDIF. " End RB_DOS
    ENDFORM. " SAVE_PROGRAM
    FORM READ_REPORT_FROM_DISK *
    Read report into internal table. Can read from local or *
    remote computer *
    FORM READ_REPORT_FROM_DISK TABLES FTAB_TABLE
    USING F_FILENAME.
    DATA:
    LC_MESSAGE(128) TYPE C.
    CLEAR FTAB_TABLE.
    REFRESH FTAB_TABLE.
    IF RB_DOS = 'X'.
    TRANSLATE F_FILENAME USING '/\'. " correct slash for Dos PC file
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    FILENAME = F_FILENAME
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = FTAB_TABLE
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TABLE_WIDTH = 4
    INVALID_TYPE = 5
    NO_BATCH = 6
    UNKNOWN_ERROR = 7
    OTHERS = 8.
    IF SY-SUBRC >< 0.
    WRITE: / 'Error reading file from local PC' COLOR COL_NEGATIVE.
    ENDIF.
    ELSEIF RB_UNIX = 'X'.
    TRANSLATE F_FILENAME USING '\/'. " correct slash for unix
    OPEN DATASET F_FILENAME FOR INPUT MESSAGE LC_MESSAGE IN TEXT MODE.
    IF SY-SUBRC = 0.
    DO.
    READ DATASET F_FILENAME INTO FTAB_TABLE.
    IF SY-SUBRC = 0.
    APPEND FTAB_TABLE.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET F_FILENAME.
    ELSE.
    WRITE: / 'Error reading file from remote computer'
    COLOR COL_NEGATIVE,
    / LC_MESSAGE,
    / F_FILENAME.
    SY-SUBRC = 4.
    ENDIF.
    ENDIF.
    ENDFORM. " READ_REPORT_FROM_DISK
    FORM SPLIT_INCOMING_FILE *
    --> FTAB_PROGRAM_FILE *
    --> FTAB_PROGRAM_SOURCE *
    --> ` *
    --> FTAB_PROGRAM_TEXTS *
    FORM SPLIT_INCOMING_FILE TABLES FTAB_PROGRAM_FILE
    STRUCTURE MTAB_PROGRAM_FILE
    FTAB_PROGRAM_SOURCE
    STRUCTURE MTAB_PROGRAM_SOURCE
    FTAB_PROGRAM_TEXTS
    STRUCTURE MTAB_PROGRAM_TEXTS
    FTAB_PROGRAM_DOCUMENTATION
    STRUCTURE MTAB_PROGRAM_DOCUMENTATION
    CHANGING FSTR_TRDIR
    FSTR_THEAD.
    DATA:
    LC_DATATYPE(4) TYPE C, " Type of data, REPO, TEXP, RDIR
    LC_PROGRAM_FILE LIKE MTAB_PROGRAM_FILE.
    LOOP AT FTAB_PROGRAM_FILE.
    LC_PROGRAM_FILE = FTAB_PROGRAM_FILE.
    CASE LC_PROGRAM_FILE(9).
    WHEN MC_TRDIR_IDENTIFIER.
    LC_DATATYPE = MC_TRDIR_SHORT.
    WHEN MC_REPORT_IDENTIFIER.
    LC_DATATYPE = MC_REPORT_SHORT.
    WHEN MC_TEXT_IDENTIFIER.
    LC_DATATYPE = MC_TEXT_SHORT.
    WHEN MC_DOC_IDENTIFIER.
    LC_DATATYPE = MC_DOC_SHORT.
    WHEN MC_THEAD_IDENTIFIER.
    LC_DATATYPE = MC_THEAD_SHORT.
    WHEN OTHERS. " Actual contents of report, trdir, or text
    CASE LC_DATATYPE.
    WHEN MC_TRDIR_SHORT.
    FSTR_TRDIR = FTAB_PROGRAM_FILE.
    WHEN MC_REPORT_SHORT.
    FTAB_PROGRAM_SOURCE = FTAB_PROGRAM_FILE.
    APPEND FTAB_PROGRAM_SOURCE.
    WHEN MC_TEXT_SHORT.
    FTAB_PROGRAM_TEXTS = FTAB_PROGRAM_FILE.
    APPEND FTAB_PROGRAM_TEXTS.
    WHEN MC_THEAD_SHORT.
    FSTR_THEAD = FTAB_PROGRAM_FILE.
    WHEN MC_DOC_SHORT.
    FTAB_PROGRAM_DOCUMENTATION = FTAB_PROGRAM_FILE.
    APPEND FTAB_PROGRAM_DOCUMENTATION.
    ENDCASE.
    ENDCASE.
    ENDLOOP.
    ENDFORM. " SPLIT_INCOMING_FILE
    FORM INSERT_NEW_REPORT*
    --> FTAB_PROGRAM_SOURCE *
    --> FTAB_PROGRAM_TEXTS *
    --> F_TRDIR *
    FORM INSERT_NEW_REPORT TABLES FTAB_PROGRAM_SOURCE
    STRUCTURE MTAB_PROGRAM_SOURCE
    FTAB_PROGRAM_TEXTS
    STRUCTURE MTAB_PROGRAM_TEXTS
    FTAB_PROGRAM_DOCUMENTATION
    STRUCTURE MTAB_PROGRAM_DOCUMENTATION
    USING FSTR_TRDIR LIKE TRDIR
    FSTR_THEAD LIKE MSTR_THEAD.
    DATA:
    LC_OBJ_NAME LIKE E071-OBJ_NAME,
    LC_LINE2(40) TYPE C,
    LC_ANSWER(1) TYPE C.
    *-- read trdir to see if the report already exists, if it does, prompt
    *-- user to overwrite or abort.
    SELECT SINGLE * FROM TRDIR WHERE NAME = FSTR_TRDIR-NAME.
    IF SY-SUBRC = 0. " Already exists
    CONCATENATE 'want to overwrite report'
    FSTR_TRDIR-NAME
    INTO LC_LINE2 SEPARATED BY SPACE.
    CONCATENATE LC_LINE2
    INTO LC_LINE2.
    CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
    EXPORTING
    DEFAULTOPTION = 'N'
    TEXTLINE1 = 'The selected report already exists, do you'
    TEXTLINE2 = LC_LINE2
    TITEL = 'Report already exists'
    CANCEL_DISPLAY = SPACE
    IMPORTING
    ANSWER = LC_ANSWER
    EXCEPTIONS
    OTHERS = 1.
    ELSE.
    LC_ANSWER = 'J'.
    ENDIF.
    IF LC_ANSWER = 'J'.
    *-- Create the TADIR entry. (TRDIR entry created by INSERT REPORT)
    LC_OBJ_NAME = TRDIR-NAME.
    CALL FUNCTION 'TR_TADIR_POPUP_ENTRY_E071'
    EXPORTING
    WI_E071_PGMID = 'R3TR'
    WI_E071_OBJECT = 'PROG'
    WI_E071_OBJ_NAME = LC_OBJ_NAME
    WI_TADIR_DEVCLASS = '$TMP'
    EXCEPTIONS
    EXIT = 3
    OTHERS = 4.
    IF SY-SUBRC = 0.
    *-- Create Report
    INSERT REPORT FSTR_TRDIR-NAME FROM FTAB_PROGRAM_SOURCE.
    *-- Create Texts
    INSERT TEXTPOOL FSTR_TRDIR-NAME FROM FTAB_PROGRAM_TEXTS
    LANGUAGE SY-LANGU.
    *-- Save Documentation
    CALL FUNCTION 'DOCU_UPDATE'
    EXPORTING
    HEAD = FSTR_THEAD
    STATE = 'A'
    TYP = 'E'
    VERSION = '1'
    TABLES
    LINE = FTAB_PROGRAM_DOCUMENTATION
    EXCEPTIONS
    OTHERS = 1.
    ELSE.
    WRITE: / 'Error updating the TADIR entry' COLOR COL_NEGATIVE,
    'Program' COLOR COL_NEGATIVE INTENSIFIED OFF,
    FSTR_TRDIR-NAME, 'was not loaded into SAP.'
    COLOR COL_NEGATIVE INTENSIFIED OFF.
    ENDIF.
    ELSE.
    WRITE: / FSTR_TRDIR-NAME COLOR COL_NEGATIVE,
    'was not uploaded into SAP. Action cancelled by user'
    COLOR COL_NEGATIVE INTENSIFIED OFF.
    ENDIF.
    ENDFORM. " INSERT_NEW_REPORT
    FORM GET_NAME *
    --> VALUE(F_FIELD) *
    --> F_NAME *
    FORM GET_NAME USING VALUE(F_FIELD)
    CHANGING F_NAME.
    DATA: LTAB_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
    LC_PROG LIKE D020S-PROG,
    LC_DNUM LIKE D020S-DNUM.
    TRANSLATE F_FIELD TO UPPER CASE.
    refresh ltab_fields.
    LTAB_FIELDS-FIELDNAME = F_FIELD.
    append ltab_fields.
    LC_PROG = SY-REPID .
    LC_DNUM = SY-DYNNR .
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    DYNAME = LC_PROG
    DYNUMB = LC_DNUM
    TABLES
    dynpfields = ltab_fields
    EXCEPTIONS
    OTHERS = 01.
    read table ltab_fields index 1.
    IF SY-SUBRC EQ 0.
    F_NAME = LTAB_FIELDS-FIELDVALUE.
    refresh ltab_fields.
    ENDIF.
    CALL FUNCTION 'F4_USER'
    EXPORTING
    OBJECT = F_NAME
    IMPORTING
    RESULT = F_NAME.
    ENDFORM. " GET_NAME
    Program Texts
    DIR File Download Options (File Selection)
    FIL File Options
    FNA Enter filename below (under File Options)
    H01 Prog Name
    H03 Program Description
    SNG Upload a single file
    UDL Upload to SAP/Download from SAP
    UPL File Upload Options
    R Backup/Restore program source code with texts
    P_PATH Path to save programs to
    RB_DOS Files on local computer
    RB_DOWN Download Programs
    RB_FILE Upload a single file
    RB_LIST Select program(s) from a list
    RB_UNIX Files on remote computer
    RB_UP Upload Programs to SAP
    S_CDAT Date Created
    S_CNAM Created by UserID
    S_NAME Program Name
    S_SUBC Program Type
    S_UDAT Date Changed
    S_UNAM Last Changed by UserID

    Hi
    you can use SAPLink for this
    http://code.google.com/p/saplink/
    Abhi

  • Web Dynpro JAVA developer attempting to unravel Environmental Compliance source code seeks guidance from EC NWDS Composition Environment specialist

    It frustrates me to have to ask for detailed instruction on this issue, but normal means of importing these Java-based EC software archives just aren't working in our NWDI system. We never moved our production WDJ applications to CE (like so many others we jumped straight from NW7.01 to NW7.3) but I'm doing my part to come up to speed on composition projects. No matter how we create the NWDI track and import the software archives and dependencies, we can't get to a state where we can successfully import a project (product?) from the Development Infrastructure into the Composite Explorer perspective.
    I need to know specifically how I, an experienced WDJ developer with no exposure to CE, can take the five .SCA files that contain Environmental Compliance 3.0 and get the project into my NWDS 7.31 workspace in a workable state, on my local system, without NWDI. Actual code modifications can wait for the moment, I just need to analyze the classes and EJB's to identify where we might want to make enhancements, and where/how to use the provided Enhancement Spots. I've followed the links, downloaded the .pdf's, read the online help, stepped thru the tutorials - I've done my due dilligence. It's common knowledge that Composition Environment is no longer recommended for new development, and as the EH&S programs are converted to WDA there are even fewer resources to look to.
    These specific types of pleas don't often return results, as I have learned over my years in this community, but nothing ventured-nothing gained, and I am no longer afraid of looking dumb or being scolded. I just need help.
    As always, points will be awarded.

    I agree in part Tobias.
    Because the source code is in the SCA within the src.zip file within each SDA.
    What does not exist within that SCA Standard is the SOURCEARCHIVES folder. In that folder should be a file (the extension .dcsa) for each DC (component) that SCA Standard.
    In short, yes it is possible to perform a reverse engineering...
    Just import the SCA Standard in NWDS.
    Note the name and type of all DCs, its dependencies and its public parts... yes, it's a lot of work, as there are many interdependent DCs.
    Done so, create a new workspace in NWDS and create a new SCA in DI (custom), inside it create all DCs with the same names and types (and dependencies)... identical to SCA Standard.
    And soon after, entering the SRC folder of each of these projects (DCs) and replace its contents with the contents of src.zip file that is contained within the SDA files within the SCA Standard.
    That done, we will have an SCA Custom with all representative of the SCA Standard DCs, but editable.
    I agree it is not nearly a good practice, or even that SAP indicate that this is done... however, it is possible yes.
    Att,
    Angelo

  • Where to find the source code for MenuTreeListPreviewLayoutController

    Dear All!
    I am desparately searching for the source code of the MenuTreeListPreviewLayoutController. I would like to
    implement a similar Layout Controller than the above mentioned one, but cannot find the code.
    Is anybody able to help me?
    Cheers and thanks in advance
    Ingo

    Hi Ingo,
    you should be able to find and decompile the class com.sapportals.wcm.rendering.layout.cm.MenuTreeListPreviewLayoutController in the JAR km.appl.ui.flex.control_core.jar. This JAR is located under ...<irj-root>\WEB-INF\portal\portalapps\com.sap.km.cm.ui.flex\private\lib
    Hope this helps,
    Robert
    PS: If you have problems to find it, gimme a mail and I'll send you the decompiled version.

  • How to get the source code of UI elements ?

    What is the way to get the source code of the elements used in qUnit Page for sap.m.List and all sap.m List Items ? I am looking to implement the same in my applications ?

    Hi Micheal,
    You can see the source code here for controls in sap.m.
    sap.m Explored
    Also for the link you provided, You can right click on the page and click on the View Page Source will show you the source code.
    Regards,
    KK

  • How to get the source code of a PRT application in the portal

    Hi!
    Does anybody know how to get the source code of a PRT application in the portal?
    Thanks in advance,
    Celso

    Celso,
    If its Java-based code have a look at the properties of an iView that belongs to the application in question and copy the value of the Code Link parameter e.g. 'com.sap.pct.hcm.rc_vacancyrequestov.default'.
    Search the Portal installation directory under /j233/cluster/server/ for a .par.bak file of the same name, removing .default from the codelink parameter
    e.g. com.sap.pct.hcm.rc_vacancyrequestov.par.bak
    Copt this locally and import into Netweaver Developer Studio. You will have to decompilte the class files with a decompiler such as DJ Decompiler or Cavaj (search with Google).
    Cheers,
    Steve

Maybe you are looking for

  • FCP to FCE(express)

    I have a movie done in FCP sitting on an IMAC computer. I am making a new movie using FC Express on a laptop. I want to take some of my clips from the FCP computer and incorporate them into the FCE new movie. I get error messages that seem to indicat

  • Screensaver for mobile.

    I have a movie clipe, it´s a sun-set, I wanna the sun set acording to the mobile´s clock, how do I do that ? but need to be in action script 1.0 , don´t know much about action script. anyone can help me ? Thanks Bruno

  • Trying to update a JTable w/ new info

    I've had some issue understanding the change events in the tutorial found here. http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#simple I've mostly gotten it, with the exception that my data does not change. I'm fairly certain it

  • Predictive text: a small annoyance (yeah, another one :-P)

    so, i did research for my issue, but the word that is being predictively changed is such a common one that i'm not getting any luck. is anyone else but me getting "A's" when you want to write "as"? the second i enter the "s" after the "a", the sugges

  • Is there any alternative to set serveroutput on

    without having to use the set serveroutput on can i make the results display using dbms_output.put_line.i have tried using dbms_output.enable on somebody's advise. begin dbms_output.enable; dbms_output.put_line('xyz'); end; but the above one is not d