Unbelievable ABAP oddity - SapScript related

Sappers,
I have officially come across the oddest ABAP problem that I have seen in 8 years.  I've spent 8+ hours trying every possible code variation to get around it but nothing works.
Here's the story in summary.
We have an invoice with shipping fields NAME1, NAME2, NAME3, and NAME4.  Under certain circumstances we need NAME1 to use a different field.
Our user-exit has worked perfectly since 2000 and is now acting odd after an upgrade to ERP6. 
If I print a specific invoice, I get (using example data)
COMPANY NAME
123 STREET ADDRESS
CITY NAME  ST  99999-0000
In the user exit the field NAME1 = 'COMPANY NAME'.  I need it to say 'ALTERNATE COMPANY NAME' which resides in table ADRC.  No problem, I pull that data into a variable and then overlay want is in the NAME1 var with what it in the ALT_NAME1 var so that NAME1 now says 'ALTERNATE COMPANY'.  Great, no problems.
Here's the weird part.  I don't expect you to believe me right off but please understand that I have gone through literally 50+ iterations to find out how to get around this behavior.
Printing the invoice ...  I get.
123 STREET ADDRESS
CITY NAME  ST  99999-0000
Whoops.  Where did ALTERNATE COMPANY go?  Let's try setting NAME1 to a hard-coded value like 'XXXXXXXXXX'.
Printing the invoice ...  I get.
XXXXXXXXXXX
123 STREET ADDRESS
CITY NAME  ST  99999-0000
Ok, we know the data element is getting through so why is the value 'ALTERNATE COMPANY' not making it to the form?  Let's try this...
Rather than use the value of 'ALTERNATE COMPANY' that came in from ADRC instead I hard code NAME1 = 'ALTERNATE COMPANY'.  A literal.
Printing the invoice ...  I get.
ALTERNATE COMPANY
123 STREET ADDRESS
CITY NAME  ST  99999-0000
What the?!  It prints the value when I hard code the value but not when the same value comes from the database?  True.  I have tried every manner of manipulation on the NAME1 variable with no change in the behavior.
Here's a really odd behavior.
CONCATENATE 'X' NAME1 'Y' INTO NAME1.
At this point NAME1's value is 'XALTERNATE COMPANYY'.
Printing the invoice ...  I get ... believe it ...
XY
123 STREET ADDRESS
CITY NAME  ST  99999-0000
If I compare the value 'ALTERNATE COMPANY' that came from ADRC against a varaible with the literal 'ALTERNATE COMPANY' they are the same length and the hex codes are exactly the same as they should be.  How in the name of all that is pure and good can ABAP print XY when the variable contains 'XALTERNATE COMPANYY'  ?!  Is this some kind of cruel unicode joke?
<< Removed >>
Thanks all,
Crew
Edited by: Rob Burbank on Apr 16, 2009 2:59 PM

My SapScript experience is not deep so I'm just going to show you the code from the invoice form.
/*  ENDIF.                                                         
/:  ADDRESS DELIVERY PARAGRAPH ZD                                  
/*    TITLE    &VBDKR-ANRED_WE&                                    
/:    NAME     &VBDKR-NAME1_WE&, &VBDKR-NAME2_WE&, &VBDKR-NAME3_WE&,
/:    STREET   &VBDKR-STRAS_WE&                                    
/:    POSTCODE &VBDKR-PSTLZ_WE&                                    
/:    CITY     &VBDKR-ORT01_WE&, &VBDKR-ORT02_WE&                  
/:    REGION   &VBDKR-REGIO_WE&                                    
/:    COUNTRY  &VBDKR-LAND1_WE&                                    
/:    FROMCOUNTRY &VBDKR-SLAND&                                    
/:  ENDADDRESS                                                     
The variables I'm working with in the user-exit are eventually dumped into some print program's VBDKR structure.  &VBDKR-NAME1_WE& is the field that I am affecting from the user-exit.  I have full control of that field from the user exit as descibed in my post.  If I poke in 'XXX' then 'XXX' makes it to &VBDKR-NAME1_WE& and prints.  If I poke in the value that came from a database (verfied to be present) then &VBDKR-NAME1_WE& prints nothing.  See my comment about concatenating a literal to the front and back of the database value.  Only the literals X and Y print from that whole string.  Something is definitely amiss.
Thanks,
Crew

Similar Messages

  • ABAP programing material related to BW.

    Hi Experts,
    Im new to BW/BI. Can anyone please tell me where I can find ABAP programing material related to BW.
    Thank in advance.

    I can also recommend my book [http://www.sap-hefte.de/katalog/hefte/titel/gp/titelID-1273]. It contains all the often used exits with practical examples, a long sample of the transformation and I received a lot of positive feedback. A second reworked edition that also contains the BPS and Integrated Planning is currently in work and will probably appear this fall.
    Best regards
    Dirk
    Edited by: Dirk Herzog on Jul 20, 2008 8:38 PM

  • FI Reports using ABAP and their Related Tables

    Hi can anyone tell me some of the commonly developed reports from FI using ABAP and their related Tables.
    Thank You

    You can find the details about the FI module here
    http://www.sap-img.com/sap-fi.htm
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • ABAP in SapScript : syntax, data types, ... ?

    Hello,
    Can someone tell me what are the biggest differences between regular ABAP and ABAP in SapScript? Like syntax rules, possible data types, and so on.
    Thanks!

    Ok, thanks for the answers.
    Just one more question
    Is it then also possible to create a SmartForm form (or Adobe Form) from within SapScript? I am looking for a workaround solution for correspondence in Training and Event Management. Only SapScript forms are possible, but if it is possible to create other forms with ABAP code in the SapScript, it could work, I think?

  • SAP ABAP HR ------career related question

    Hye friends ,
    Friends i have 2.5 years of experience in sap abap . My major developments are related to sap HR . i have 1 full life cycle completion of sap netweaver .
    No i wanna my carrier as a SAP BAP HR .
    But dear gurus from india  ,  who has experience more than 4 years  please suggest  me ..
    Is it right for my future to become as a SAP ABAP HR  or i should try for simple  SAP ABAP..
    <<removed_by_moderator>>
    Over all i am very confused related to my new search criteriaa ..wheather SAP ABA HR  or SAP ABAP.
    Thanks in advance For Your Reply
    Edited by: Vijay Babu Dudla on Jul 2, 2009 1:45 AM

    > No i wanna my carrier as a SAP BAP HR .
    @PK..it is not a New Technology but a New Airlines which was introduced by SAP .
    >But dear gurus from india , who has experience more than 4 years please suggest me ..
    @Siegfried.. the criteria to reply to this thread does not suit you.
                         1.Gurus from India only.
                         2.Only 4 yrs Experience
    >Over all i am very confused related to my new search criteriaa ..
    Yep,New Version of SDN has changed its Search functionality and there is a [lot of discussions|What happened to SCN search?; going on in [Suggestions & Comments|SCN Support; forum, have a look into it.
    > if a glass is half filled and half full .......try to see the full part ??
    again you missed out something here which made the confusion. half filled with air & half full of water  Brittania 50:50 right?.
    Cheers
    Andrew
    PS:Edited with a SIMPLE EDIT SW called @FUN  and copyrighted only for Coffee  Corner.Take it in the [right spirit|http://www.whiskymag.com/whisky/brand/glenfiddich/whisky651.html] .
    Edited by: Andrew J on Jul 3, 2009 9:35 AM

  • Pass pernr from employee search iView to abap webDynpro in Related Activity

    Hi All,
    I have seen many threads explaining how to pass pernr from employee search iView to custom ABAP webDynpro application in the "Employee profile" page. Also seen sap note 1112733.
    I am trying to launch custom ABAP webDynpro application from "Related Activities" view found in the employee information page in MSS.  I want to pass pernr selected from Employee Search iView to the ABAP webDynpro application in "Related Activities" view.
    In the ABAP webDynpro application, I am listening to the portal event (as per note 1112733) but the ABAP webDynpro can not catch the event.
    Anyone has passed pernr from employee search iView to the ABAP webDynpro application launched from "related activities" view?
    Regards
    Ashutosh

    Hi Ashutosh,
    can you tell me exactly what you did? I have the same issue.
    Thanks,
    Joeri

  • WD ABAP Iviews under Related Activities

    Hi,
    I am trying to include standard WD ABAP Iview under ESS in MSS under Team Workset. However it is not working the same way as WD Java Iviews does. Instaed of picking selected Employee's page, it is displaying Manager's page. I have also maintained PCD which starts with EXROLES. Still it is not working. I have been trying for Travel Request WD ABAP Iview.
    So could anybody please let me know as to how to resolve this.
    Thanks!

    Hi,
    In order to retrieve the selected pernr, you have to create a Web Dynpro Java iView, a resource and a service as explained in this topic : MSS - General Information - Related Activities Links persnr.
    1. create a Web Dynpro Java iView using the mss~hras RelatedActivitiesLauncherApp application then open the iView and indicate the name of the service corresponding to your Web Dynpro Abap application.
    2. create a new resource and indicate the id of the Web Dynpro Java iView (ROLES://portal_content...) in the URL of PCD page field
    3. create a new service (service type Web Dynpro Java) and link it to the resource you just created
    4. assign the new service to the subarea
    Regards,
    Pierre

  • Need OO ABAP technical terms relations

    Hi Experts,
        I am new to OO ABAP, i want to know some of the technical terms are related in OO ABAP.
    1. Class.
    2. Interface.
    3. Method.
    4. Object.
    5. Instance.
    6. Implementation class.
    7. Attributes.
    8. Events.
    9. Aliases.
    10. Parameters.
    11. Exceptions.
    12.Static method.
    I want to know how these are things are hierarchically linked to one another. Is there any block diagram to easily understand this concept. I have seen all these inside a class. Can give me some example.
    Thanks & Regards,
    Ravi.

    Hi,
    A very good WIki on ABAP object and a solution to all your doubts can be found
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/abap+objects
    If link doesn't open then simply select the Wiki link->ABAP DEVELOPMENT->ABAPOBJECTS
    This wiki is posted by Added by Marcelo Ramos so can be searched by his name also(if link doesn't work)
    Hope this wiki help you out in understanding the concepts .
    Pooja
    Edited by: Pooja Gupta on Mar 16, 2009 9:54 AM

  • SAP ABAP secure coding related training session

    Hi Experts,
    Do you know of any training or code jams provided by SAP for organizations related to SAP ABAP secure coding?

    Thanks Alex for your reply.
    The course and goals look perfect.
    But I was looking for something that could be arranged in my company's Mumbai(India) office.
    Can anyone help me with any classroom/virtual training or Code Jams related to secure ABAP programming.

  • How OO ABAP  & ABAP WEBDYNPROS  are Related??

    HI,
    i am new to WEBDYNPRO and shifting myself from OO ABAP  to  WEBDYNPRO IN ABAP.
    Kindly let me know how OO ABAP and webdynpro ARE INTERRELATED.(in terms of coding or in terms of environment)
    Regards,
    Dev

    Hi Dev,
    Welcome to ABAP Dynpro!
    Now I am 10 months old to ABAP Dynpro.I have explored a lot.Now you were asking about how much ABAP/OOPS one should know and topics one should know.
    In my view you should be aware with fundamental of OOABAP like
    class , methods , interfaces and static attribute.Being WD ABAP Dynpro guy you should be in position to use ABAP classes and methods in it.
    Just take case if you want to access element from node in context ...such code by wizard Appears ....
    DATA:
    zobj_bbp_ior_util TYPE REF TO zcl_bbp_ior_util,
    node_ztiornode TYPE REF TO if_wd_context_node,
    elem_ztiornode TYPE REF TO if_wd_context_element,
    stru_ztiornode TYPE zsior.
    navigate from <CONTEXT> to <ZTIORNODE> via lead selection
    node_ztiornode = wd_context->get_child_node( name = if_request_ior=>wdctx_ztiornode ).
    get element via lead selection
    elem_ztiornode = node_ztiornode->get_element( 1 ).
    now you should be in position to understand and make use of classes like
    ' wd_context' etc. .You should know what it does then you will use it method
    like get_child_no.
    Hope I have cleared you doubt.
    Cheers,
    Darshna.

  • Calling ABAP from SAPScript

    Hi ,
    I am facing some problem in calling a subroutine from Standard Text element (Txn SO10).
    I have done the following in a text element.
    /: DEFINE &GD_PREV_NAME& = ''
    /: PERFORM GET_PREV_NAME IN PROGRAM ZTEST
    /: USING &P0001-PERNR&
    /: USING &P0002-BEGDA&
    /: CHANGING &GD_PREV_NAME&
    /: ENDPERFORM
    In the ABAP ZTEST,
    FORM get_prev_name TABLES tabin  STRUCTURE itcsy
                              tabout STRUCTURE itcsy.
      DATA : ld_pernr LIKE pa0001-pernr.
      READ TABLE tabin WITH KEY name = 'P0001-PERNR'.
      IF sy-subrc = 0.
        ld_pernr = tabin-value.
      ENDIF.
    ENDFORM.
    I found in debugging that the both tables TABIN & TABOUT are empty in the FORM get_prev_name !!!!
    Can anyone hint on why the values are not passed to ABAP ??
    Many thanks in advance.
    Regards,
    Sandip.
    Ph : +44 121 683 2814.

    Hi Sandip,
    I guess the problem here might be that the values aren't getting flown.
    First try this (hardcoding and testing),
    /: DEFINE &GD_PREV_NAME& = ''
    /: PERFORM GET_PREV_NAME IN PROGRAM ZTEST
    /: USING '1000'
    /: USING '20050101'
    /: CHANGING &GD_PREV_NAME&
    /: ENDPERFORM
    if it works fine, then figure out whether the variables P0001-PERNR AND P0002-BEGDA are not null when passed. If not then try this
    /: DEFINE &GD_PREV_NAME& = ''
    /: PERFORM GET_PREV_NAME IN PROGRAM ZTEST
    /: USING &P0000-PERNR&
    /: USING &P0002-BEGDA&
    /: CHANGING &GD_PREV_NAME&
    /: ENDPERFORM
    ELSE TRY PA0000-PERNR AND PA0002-BEGDA
    Cheers,
    Sam.

  • ABAP-QUOTQTION-MM RELATED

    hi
          I have faced a problem in the field QUOTATION length whose maiximum length is 10 chars only.I want to have more than 10 chars ( nearly 40 chars) to enter.
    Table name  :  RM06E
    Field            :  ANFNR
    pl. respod soon
    Thanks in advance.

    i think u have to create reports like MB5B or MB51 (tcodes ).
    Regards
    Prabhu

  • ABAP  Report MM related questin

    what is the meaning of  <b>STOCK RECONCILLIATION</b> REPORT means according to <b>MM</b> flow  .
    WHAT IS THE PURPOSE TO CREATE THIS REPORT?

    i think u have to create reports like MB5B or MB51 (tcodes ).
    Regards
    Prabhu

  • Sapscript related question,

    Hi all,
    <b>
    /:   BOX XPOS  0 CH YPOS 0 LN WIDTH 72 CH HEIGHT 2 LN FRAME 10 TW         
    /:   BOX XPOS  0 CH YPOS 0 LN WIDTH 28 CH HEIGHT 32 LN FRAME 10 TW        
    /:   BOX XPOS 28 CH YPOS 0 LN WIDTH 12 CH HEIGHT 32 LN FRAME 10 TW        
    /:   BOX XPOS 40 CH YPOS 0 LN WIDTH 14 CH HEIGHT 32 LN FRAME 10 TW        
    /:   BOX XPOS  0 CH YPOS 0 LN WIDTH 72 CH HEIGHT 32 LN FRAME 10 TW        
    IB   ,,Marka/Marks,,Miktar/Quantity,,Fiyat/Price,,Mebla&#287;/Amount  
    </b>        
    The above box statements are written in the main window of the first page and main window starts from; Left: 4 ch, Upper 28 ln, Width: 74 ch, Height : 32 ln.
    At first print there is no problem about the box, it starts from the main boundaries, however when second page needed, the boxes are located at the top of the page, not window.
    There is just one page and it is first page, it uses it as needed.
    Thanks.

    see in first page it will print defaultly .......
    Are you writing it at the uppermost or the lowermost part with a text element..
    but when it is the upcoming page .....
    use /e ele before box and pass ele as parameter in write form
    You can use the POSITION and SIZE commands to set default parmeters for a box.
    Instead of:
    /: BOX XPOS '11.21' MM YPOS '5.31' MM HEIGHT '10' MM WIDTH '20' MM INTENSITY 10 FRAME 0 TW
    You can write:
    /: POSITION XORIGIN '11.21' YORIGIN '5.31' MM
    /: SIZE HEIGHT '2' MM WIDTH '76' MM
    /: BOX FRAME 10 TW INTENSITY 10
    This can be usefull if you gave several boxes that share the same parameters.
    If you want to set the position realtively to the window use POSITION WINDOW
    to set the position to the top/left start of the window. Then use POSITION
    to set the current position relatively to the start of the Window.
    Note that you uses "+" or "-" in the ORIGIN position to the set the position relatively.
    /: POSITION WINDOW
    /: POSITION XORIGIN '5' MM YORIGIN '10' MM
    the position is now 5 MM from the left and 10 MM from the top of the window
    NOTE: After using the position command you can move the current position
    realtively to the last used position
    /: POSITION XORIGIN '10' MM YORIGIN '20' MM
    Now the position will be X = 15 and Y = 30
    Drawing a line. You can draw a line by setting the Height or Weidth to 0
    and add a frane. E.g. a horizontal line:
    /: SIZE HEIGHT '0' MM WIDTH '200' MM
    /: BOX FRAME 10 TW XPOS '11.21' MM YPOS '14.81' MM INTENSITY 100
    You can check the &PAGE& variable, like this:
    /: IF &PAGE& = 1
    /: BOX on the first page
    /: ELSE
    /: BOX on the second page
    /: ENDIF
    reward points if helpful..........

  • Download/Upload ABAP Programs, screens, texts, etc

    Hi Experts,
    Is there any standard program or any tool by which we can download/ upload ABAP programs, sapscripts, Screens, text-elements, Webdynpro for ABAP applications to a local file????
    The Download to local server option in SE38 just gives a text copy of program without any screens, text eleemnts, etc which is not as per my requirement.
    Points will be rewarded.
    Regards,
    Mansi.

    use This
    REPORT  ZDOWNLOAD.
    *& Report  ZDOWNLAOD
                     I N F O R M A T I O N                            *
    Module             :
    FUNCTIONAL         :
    Developer          :
    Functional Spec#   :
    Date Of Creation   :
    Transport Request# :
    Program NAME       :
    Transaction Code   :
    DEVELOPMENT CLASS  :
    DESCRIPTION        :
                     Change History
    FUNCTIONAL         :
    Developer          :
    Functional Spec#   :
    Date Of Change     :
    Transport Request# :
    Change DESCRIPTION :
    *======================================================================================================================
    Direct Download Enterprise version 1.3.1.
    THIS SOFTWARE IS FOR PERSONAL USE ONLY.
    THIS PROGRAM IS FREEWARE AND IS PROVIDED ON AN AS-IS BASIS WITHOUT WARRANTY OF ANY KIND.
    THE PROVIDER SPECIFICALLY DISCLAIMS ANY OTHER WARRANTY, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY
    OR FITNESS FOR A PARTICULAR PURPOSE.
    IN NO EVENT SHALL THE PROVIDER BE LIABLE FOR ANY CONSEQUENTIAL, INDIRECT, SPECIAL OR INCIDENTAL DAMAGES, EVEN IF PROVIDER
    HAS BEEN ADVISED BY CLIENT OF THE POSSIBILITY OF SUCH POTENTIAL LOSS OR DAMAGE.
    CLIENT AGREES TO HOLD PROVIDER HARMLESS FROM AND AGAINST ANY AND ALL CLAIMS, LOSSES, LIABILITIES AND EXPENSES.  BY
    INSTALLING OR RUNNING THIS PROGRAM YOU ARE AGREEING TO THE TERMS AND CONDITONS STATED ABOVE.
    PROGRAM DESCRIPTION & USE
    Allows a user to download programs, Functions, DD definitions, etc to the presentation server.  This version searches
    recursively for nested includes and function modules, and allows you to download the resulting code as standard text
    or HTML web pages within a suitable directory structure.
    You can either search by object name, using wildcards if you wish, or a combination of Author and object name.  If
    you want all objects returned for a particular author then select the author name and choose the most suitable
    radiobutton.  All objects will be returned if the fields to the right hand side of the radiobutton are left completely
    blank.
    Compatible with R/3 Enterprise only, for older versions of SAP you will need Direct Download version 5.xx.
    This version removes the programming limitations imposed by developing across SAP releases 3 to 4.6.
    In order to be able to download files to the SAP server you must first set up a logical filepath within transaction
    'FILE', or use an existing one.  You must also create a external operating system command in SM69 called ZMKDIR. This
    will then be used to create any directories needed on the SAP server
    This program is intended to allow a person to keep a visual representation of a program for backup purposes only as
    has not been designed to allow programs to be uploaded to SAP systems.
    author          : E.G.Mellodew
    program cont
    SAP Tables
    TABLES: TRDIR, SEOCLASS, TFDIR, ENLFDIR, DD02L.
    Types
    text element structure
    TYPES: TTEXTTABLE LIKE TEXTPOOL.
    GUI titles
    TYPES: TGUITITLE LIKE D347T.
    Message classes
    TYPES: BEGIN OF TMESSAGE,
             ARBGB LIKE T100-ARBGB,
             STEXT LIKE T100A-STEXT,
             MSGNR LIKE T100-MSGNR,
             TEXT  LIKE T100-TEXT,
           END OF TMESSAGE.
    Screen flow.
    TYPES: BEGIN OF TSCREENFLOW,
             SCREEN LIKE D020S-DNUM,
             CODE LIKE D022S-LINE,
           END OF TSCREENFLOW.
    Holds a table\structure definition
    TYPES: BEGIN OF TDICTTABLESTRUCTURE,
             FIELDNAME LIKE DD03L-FIELDNAME,
             POSITION  LIKE DD03L-POSITION,
             KEYFLAG   LIKE DD03L-KEYFLAG,
             ROLLNAME  LIKE DD03L-ROLLNAME,
             DOMNAME   LIKE DD03L-DOMNAME,
             DATATYPE  LIKE DD03L-DATATYPE,
             LENG      LIKE DD03L-LENG,
             DDTEXT    LIKE DD04T-DDTEXT,
           END OF TDICTTABLESTRUCTURE.
    Holds a tables attributes + its definition
    TYPES: BEGIN OF TDICTTABLE,
             TABLENAME    LIKE DD03L-TABNAME,
             TABLETITLE   LIKE DD02T-DDTEXT,
             ISTRUCTURE TYPE TDICTTABLESTRUCTURE OCCURS 0,
           END OF TDICTTABLE.
    Include program names
    TYPES: BEGIN OF TINCLUDE,
             INCLUDENAME LIKE TRDIR-NAME,
             INCLUDETITLE LIKE TFTIT-STEXT,
           END OF TINCLUDE.
    Exception class texts
    TYPES: BEGIN OF TCONCEPT,
             CONSTNAME TYPE STRING,
             CONCEPT TYPE SOTR_CONC,
           END OF TCONCEPT.
    Method
    TYPES: BEGIN OF TMETHOD,
             CMPNAME LIKE VSEOMETHOD-CMPNAME,
             DESCRIPT LIKE VSEOMETHOD-DESCRIPT,
             EXPOSURE LIKE VSEOMETHOD-EXPOSURE,
             METHODKEY TYPE STRING,
           END OF TMETHOD.
    Class
    TYPES: BEGIN OF TCLASS,
             SCANNED(1),
             CLSNAME LIKE VSEOCLASS-CLSNAME,
             DESCRIPT LIKE VSEOCLASS-DESCRIPT,
             MSG_ID LIKE VSEOCLASS-MSG_ID,
             EXPOSURE LIKE VSEOCLASS-EXPOSURE,
             STATE LIKE VSEOCLASS-STATE,
             CLSFINAL LIKE VSEOCLASS-CLSFINAL,
             R3RELEASE LIKE VSEOCLASS-R3RELEASE,
             IMETHODS TYPE TMETHOD OCCURS 0,
             IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
             ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
             IMESSAGES TYPE TMESSAGE OCCURS 0,
             ICONCEPTS TYPE TCONCEPT OCCURS 0,
             TEXTELEMENTKEY TYPE STRING,
             PUBLICCLASSKEY TYPE STRING,
             PRIVATECLASSKEY TYPE STRING,
             PROTECTEDCLASSKEY TYPE STRING,
             TYPESCLASSKEY TYPE STRING,
             EXCEPTIONCLASS TYPE I,
           END OF TCLASS.
    function modules
    TYPES: BEGIN OF TFUNCTION,
             FUNCTIONNAME LIKE TFDIR-FUNCNAME,
             FUNCTIONGROUP LIKE ENLFDIR-AREA,
             INCLUDENUMBER LIKE TFDIR-INCLUDE,
             FUNCTIONMAININCLUDE LIKE TFDIR-FUNCNAME,
             FUNCTIONTITLE LIKE TFTIT-STEXT,
             TOPINCLUDENAME LIKE TFDIR-FUNCNAME,
             PROGNAME LIKE TFDIR-PNAME,
             PROGRAMLINKNAME LIKE TFDIR-PNAME,
             MESSAGECLASS LIKE T100-ARBGB,
             ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
             ISELECTIONTEXTS TYPE TTEXTTABLE OCCURS 0,
             IMESSAGES TYPE TMESSAGE OCCURS 0,
             IINCLUDES TYPE TINCLUDE OCCURS 0,
             IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
             IGUITITLE TYPE TGUITITLE OCCURS 0,
             ISCREENFLOW TYPE TSCREENFLOW OCCURS 0,
           END OF TFUNCTION.
    TYPES: BEGIN OF TPROGRAM,
             PROGNAME LIKE TRDIR-NAME,
             PROGRAMTITLE LIKE TFTIT-STEXT,
             SUBC LIKE TRDIR-SUBC,
             MESSAGECLASS LIKE T100-ARBGB,
             IMESSAGES TYPE TMESSAGE OCCURS 0,
             ITEXTELEMENTS TYPE TTEXTTABLE OCCURS 0,
             ISELECTIONTEXTS TYPE TTEXTTABLE OCCURS 0,
             IGUITITLE TYPE TGUITITLE OCCURS 0,
             ISCREENFLOW TYPE TSCREENFLOW OCCURS 0,
             IINCLUDES TYPE TINCLUDE OCCURS 0,
             IDICTSTRUCT TYPE TDICTTABLE OCCURS 0,
           END OF TPROGRAM.
    Internal tables
    Dictionary object
    DATA: IDICTIONARY TYPE STANDARD TABLE OF TDICTTABLE WITH HEADER LINE.
    Function modules.
    DATA: IFUNCTIONS TYPE STANDARD TABLE OF TFUNCTION WITH HEADER LINE.
    Tree display structure.
    DATA: ITREEDISPLAY TYPE STANDARD TABLE OF SNODETEXT WITH HEADER LINE.
    Message class data
    DATA: IMESSAGES TYPE STANDARD TABLE OF TMESSAGE WITH HEADER LINE.
    Holds a single message class an all of its messages
    DATA: ISINGLEMESSAGECLASS TYPE STANDARD TABLE OF TMESSAGE WITH HEADER LINE.
    Holds program related data
    DATA: IPROGRAMS TYPE STANDARD TABLE OF TPROGRAM WITH HEADER LINE.
    Classes
    DATA: ICLASSES TYPE STANDARD TABLE OF TCLASS WITH HEADER LINE.
    Table of paths created on the SAP server
    DATA: ISERVERPATHS TYPE STANDARD TABLE OF STRING WITH HEADER LINE.
    Table prototypes
    DATA: DUMIDICTSTRUCTURE TYPE STANDARD TABLE OF TDICTTABLESTRUCTURE.
    DATA: DUMITEXTTAB TYPE STANDARD TABLE OF TTEXTTABLE.
    DATA: DUMIINCLUDES TYPE STANDARD TABLE OF TINCLUDE.
    DATA: DUMIHTML TYPE STANDARD TABLE OF STRING.
    DATA: DUMIHEADER TYPE STANDARD TABLE OF STRING .
    DATA: DUMISCREEN TYPE STANDARD TABLE OF TSCREENFLOW .
    DATA: DUMIGUITITLE TYPE STANDARD TABLE OF TGUITITLE.
    DATA: DUMIMETHODS TYPE STANDARD TABLE OF TMETHOD.
    DATA: DUMICONCEPTS TYPE STANDARD TABLE OF TCONCEPT.
      Global objects
    DATA: OBJFILE TYPE REF TO CL_GUI_FRONTEND_SERVICES.
    DATA: OBJRUNTIMEERROR TYPE REF TO CX_ROOT.
    Constants
    CONSTANTS: VERSIONNO TYPE STRING VALUE '1.3.1'.
    CONSTANTS: TABLES TYPE STRING VALUE 'TABLES'.
    CONSTANTS: TABLE TYPE STRING VALUE 'TABLE'.
    CONSTANTS: LIKE TYPE STRING VALUE 'LIKE'.
    CONSTANTS: TYPE TYPE STRING VALUE 'TYPE'.
    CONSTANTS: TYPEREFTO TYPE STRING VALUE 'TYPE REF TO'.
    CONSTANTS: STRUCTURE TYPE STRING VALUE 'STRUCTURE'.
    CONSTANTS: LOWSTRUCTURE TYPE STRING VALUE 'structure'.
    CONSTANTS: OCCURS TYPE STRING VALUE 'OCCURS'.
    CONSTANTS: FUNCTION TYPE STRING VALUE 'FUNCTION'.
    CONSTANTS: CALLFUNCTION TYPE STRING VALUE ' CALL FUNCTION'.
    CONSTANTS: MESSAGE TYPE STRING  VALUE 'MESSAGE'.
    CONSTANTS: INCLUDE TYPE STRING VALUE 'INCLUDE'.
    CONSTANTS: LOWINCLUDE TYPE STRING VALUE 'include'.
    CONSTANTS: DESTINATION TYPE STRING VALUE 'DESTINATION'.
    CONSTANTS: IS_TABLE TYPE STRING VALUE 'T'.
    CONSTANTS: IS_PROGRAM TYPE STRING VALUE 'P'.
    CONSTANTS: IS_SCREEN TYPE STRING VALUE 'S'.
    CONSTANTS: IS_GUITITLE TYPE STRING VALUE 'G'.
    CONSTANTS: IS_DOCUMENTATION TYPE STRING VALUE 'D'.
    CONSTANTS: IS_MESSAGECLASS TYPE STRING VALUE 'MC'.
    CONSTANTS: IS_FUNCTION TYPE STRING VALUE 'F'.
    CONSTANTS: IS_CLASS TYPE STRING VALUE 'C'.
    CONSTANTS: IS_METHOD TYPE STRING VALUE 'M'.
    CONSTANTS: ASTERIX TYPE STRING VALUE '*'.
    CONSTANTS: COMMA TYPE STRING VALUE ','.
    CONSTANTS: PERIOD TYPE STRING VALUE '.'.
    CONSTANTS: DASH TYPE STRING VALUE '-'.
    CONSTANTS: TRUE TYPE I VALUE 1.
    CONSTANTS: FALSE TYPE I VALUE 0.
    CONSTANTS: LT TYPE STRING VALUE '&lt;'.
    CONSTANTS: GT TYPE STRING VALUE '&gt;'.
    CONSTANTS: UNIX TYPE STRING VALUE 'UNIX'.
    CONSTANTS: NON_UNIX TYPE STRING VALUE 'not UNIX'.
    CONSTANTS: BACKGROUND_COLOUR TYPE STRING VALUE '#FFFFE0'.
    CONSTANTS: COLOUR_WHITE TYPE STRING VALUE '#FFFFFF'.
    CONSTANTS: COLOUR_BLACK TYPE STRING VALUE '#000000'.
    CONSTANTS: COLOUR_YELLOW TYPE STRING VALUE '#FFFF00'.
    CONSTANTS: COMMENT_COLOUR TYPE STRING VALUE '#0000FF'.
    CONSTANTS: HTMLEXTENSION TYPE STRING VALUE 'html'.
    CONSTANTS: TEXTEXTENSION TYPE STRING VALUE 'txt'.
    Global variables
    DATA: STATUSBARMESSAGE(100).
    DATA: FORCEDEXIT TYPE I VALUE 0.
    DATA: STARTTIME LIKE SY-UZEIT.
    DATA: RUNTIME LIKE SY-UZEIT.
    DATA: DOWNLOADFILEEXTENSION TYPE STRING.
    DATA: DOWNLOADFOLDER TYPE STRING.
    DATA: SERVERSLASHSEPARATOR TYPE STRING.
    DATA: FRONTENDSLASHSEPARATOR TYPE STRING.
    DATA: SLASHSEPARATORTOUSE TYPE STRING.
    DATA: SERVERFILESYSTEM TYPE FILESYS_D.
    DATA: SERVERFOLDER TYPE STRING.
    DATA: FRONTENDOPSYSTEM TYPE STRING.
    DATA: SERVEROPSYSTEM TYPE STRING.
    DATA: CUSTOMERNAMESPACE TYPE STRING.
    RANGES: SOPROGRAMNAME FOR TRDIR-NAME.
    RANGES: SOAUTHOR FOR USR02-BNAME.
    RANGES: SOTABLENAMES FOR DD02L-TABNAME.
    RANGES: SOFUNCTIONNAME  FOR TFDIR-FUNCNAME.
    RANGES: SOCLASSNAME FOR VSEOCLASS-CLSNAME.
    RANGES: SOFUNCTIONGROUP FOR ENLFDIR-AREA.
    FIELD-SYMBOLS: <WADICTSTRUCT> TYPE TDICTTABLE.
    Selection screen declaration
    Author
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TBLOCK1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(23) TAUTH.
    PARAMETERS: PAUTH LIKE USR02-BNAME MEMORY ID MAUTH.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(36) TPMOD.
    PARAMETERS: PMOD AS CHECKBOX.
    SELECTION-SCREEN END OF LINE.
    Local objects
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(36) T$TMP.
    PARAMETERS: P$TMP AS CHECKBOX DEFAULT ''.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN: END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TBLOCK2.
    Tables
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: RTABLE RADIOBUTTON GROUP R1.
    SELECTION-SCREEN COMMENT 5(15) TRTABLE.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(15) TPTABLE.
    SELECT-OPTIONS: SOTABLE FOR DD02L-TABNAME.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(79) TTNOTE.
    SELECTION-SCREEN END OF LINE.
    Message classes
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: RMESS RADIOBUTTON GROUP R1.
    SELECTION-SCREEN COMMENT 5(18) TPMES.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(18) TMNAME.
    PARAMETERS: PMNAME LIKE T100-ARBGB MEMORY ID MMNAME.
    SELECTION-SCREEN END OF LINE.
    Function modules
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: RFUNC RADIOBUTTON GROUP R1.
    SELECTION-SCREEN COMMENT 5(30) TRFUNC.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(15) TPFNAME.
    SELECT-OPTIONS: SOFNAME FOR TFDIR-FUNCNAME.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(15) TFGROUP.
    SELECT-OPTIONS: SOFGROUP FOR ENLFDIR-AREA.
    SELECTION-SCREEN END OF LINE.
    Classes
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: RCLASS RADIOBUTTON GROUP R1.
    SELECTION-SCREEN COMMENT 5(30) TRCLASS.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(15) TPCNAME.
    SELECT-OPTIONS: SOCLASS FOR SEOCLASS-CLSNAME.
    SELECTION-SCREEN END OF LINE.
    Programs / includes
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: RPROG RADIOBUTTON GROUP R1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(18) TPROG.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(15) TRPNAME.
    SELECT-OPTIONS: SOPROG FOR TRDIR-NAME.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    Language
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(18) TMLANG.
    PARAMETERS: PMLANG LIKE T100-SPRSL DEFAULT 'EN'.
    SELECTION-SCREEN END OF LINE.
    Package
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(18) TPACK.
    PARAMETERS: PPACK LIKE TADIV-DEVCLASS MEMORY ID MPACK.
    SELECTION-SCREEN END OF LINE.
    Customer objects
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(27) TCUST.
    PARAMETERS: PCUST AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 32(25) TNRANGE.
    PARAMETERS: PCNAME TYPE NAMESPACE MEMORY ID MNAMESPACE.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN: END OF BLOCK B2.
    Additional things to download.
    SELECTION-SCREEN: BEGIN OF BLOCK B3 WITH FRAME TITLE TBLOCK3.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TPTEXT.
    PARAMETERS: PTEXT AS CHECKBOX DEFAULT 'X' MEMORY ID MTEXT.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TMESS.
    PARAMETERS: PMESS AS CHECKBOX DEFAULT 'X' MEMORY ID MMESS.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TPINC.
    PARAMETERS: PINC AS CHECKBOX DEFAULT 'X' MEMORY ID MINC.
    SELECTION-SCREEN COMMENT 40(20) TRECC.
    PARAMETERS: PRECI AS CHECKBOX DEFAULT 'X' MEMORY ID MRECI.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TPFUNC.
    PARAMETERS: PFUNC AS CHECKBOX DEFAULT 'X' MEMORY ID MFUNC.
    SELECTION-SCREEN COMMENT 40(20) TRECF.
    PARAMETERS: PRECF AS CHECKBOX DEFAULT 'X' MEMORY ID MRECF.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TDOC.
    PARAMETERS: PDOC AS CHECKBOX DEFAULT 'X' MEMORY ID MDOC.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TPSCR.
    PARAMETERS: PSCR AS CHECKBOX DEFAULT 'X' MEMORY ID MSCR.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TPDICT.
    PARAMETERS: PDICT AS CHECKBOX DEFAULT 'X' MEMORY ID MDICT.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TSORTT.
    PARAMETERS: PSORTT AS CHECKBOX DEFAULT ' ' MEMORY ID MSORTT.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN: END OF BLOCK B3.
    File details
    SELECTION-SCREEN: BEGIN OF BLOCK B4 WITH FRAME TITLE TBLOCK4.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) TPHTML.
    PARAMETERS: PHTML RADIOBUTTON GROUP G1 DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(29) TCOMM.
    PARAMETERS: PCOMM AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 5(29) TBACK.
    PARAMETERS: PBACK AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) TPTXT.
    PARAMETERS: PTXT RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    Download to SAP server
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(25) TSERV.
    PARAMETERS: PSERV RADIOBUTTON GROUP G2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 8(20) TSPATH.
    PARAMETERS: PLOGICAL LIKE FILENAME-FILEINTERN MEMORY ID MLOGICAL.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN COMMENT /28(60) TSDPATH.
    Download to PC
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(25) TPC.
    PARAMETERS: PPC RADIOBUTTON GROUP G2 DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 8(20) TPPATH.
    PARAMETERS: PFOLDER LIKE RLGRAP-FILENAME MEMORY ID MFOLDER.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN: END OF BLOCK B4.
    Display options
    SELECTION-SCREEN: BEGIN OF BLOCK B5 WITH FRAME TITLE TBLOCK5.
    Display final report
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TREP.
    PARAMETERS: PREP AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    Display progress messages
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) TPROMESS.
    PARAMETERS: PPROMESS AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN: END OF BLOCK B5.
    Display a directory picker window
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR PFOLDER.
      DATA: OBJFILE TYPE REF TO CL_GUI_FRONTEND_SERVICES.
      DATA: PICKEDFOLDER TYPE STRING.
      DATA: INITIALFOLDER TYPE STRING.
      IF SY-BATCH IS INITIAL.
        CREATE OBJECT OBJFILE.
        IF NOT PFOLDER IS INITIAL.
          INITIALFOLDER = PFOLDER.
        ELSE.
          OBJFILE->GET_TEMP_DIRECTORY( CHANGING TEMP_DIR = INITIALFOLDER
                                       EXCEPTIONS CNTL_ERROR = 1
                                                 ERROR_NO_GUI = 2
                                                 NOT_SUPPORTED_BY_GUI = 3 ).
        ENDIF.
        OBJFILE->DIRECTORY_BROWSE( EXPORTING INITIAL_FOLDER = INITIALFOLDER
                                   CHANGING SELECTED_FOLDER = PICKEDFOLDER
                                   EXCEPTIONS CNTL_ERROR = 1
                                              ERROR_NO_GUI = 2
                                              NOT_SUPPORTED_BY_GUI = 3 ).
        IF SY-SUBRC = 0.
          PFOLDER = PICKEDFOLDER.
        ELSE.
          WRITE: / 'An error has occured picking a folder'.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
      CASE 'X'.
        WHEN PPC.
          IF PFOLDER IS INITIAL.
          User must enter a path to save to
            MESSAGE E000(OO) WITH 'You must enter a file path'.
          ENDIF.
        WHEN PSERV.
          IF PLOGICAL IS INITIAL.
          User must enter a logical path to save to
            MESSAGE E000(OO) WITH 'You must enter a logical file name'.
          ENDIF.
      ENDCASE.
    AT SELECTION-SCREEN ON PLOGICAL.
      IF NOT PSERV IS INITIAL.
        CALL FUNCTION 'FILE_GET_NAME'
          EXPORTING
            LOGICAL_FILENAME = PLOGICAL
          IMPORTING
            FILE_NAME        = SERVERFOLDER
          EXCEPTIONS
            FILE_NOT_FOUND   = 1
            OTHERS           = 2.
        IF SY-SUBRC = 0.
          IF SERVERFOLDER IS INITIAL.
            MESSAGE E000(OO) WITH 'No file path returned from logical filename'.
          ELSE.
          Path to display on the selection screen
            TSDPATH = SERVERFOLDER.
          Remove the trailing slash off the path as the subroutine buildFilename will add an extra one
            SHIFT SERVERFOLDER RIGHT DELETING TRAILING SERVERSLASHSEPARATOR.
            SHIFT SERVERFOLDER LEFT DELETING LEADING SPACE.
          ENDIF.
        ELSE.
          MESSAGE E000(OO) WITH 'Logical filename does not exist'.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOPROG-LOW.
      CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
        EXPORTING
          OBJECT_TYPE           = 'PROG'
          OBJECT_NAME           = SOPROG-LOW
          SUPPRESS_SELECTION    = 'X'
          USE_ALV_GRID          = ''
          WITHOUT_PERSONAL_LIST = ''
        IMPORTING
          OBJECT_NAME_SELECTED  = SOPROG-LOW
        EXCEPTIONS
          CANCEL                = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOPROG-HIGH.
      CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
        EXPORTING
          OBJECT_TYPE           = 'PROG'
          OBJECT_NAME           = SOPROG-HIGH
          SUPPRESS_SELECTION    = 'X'
          USE_ALV_GRID          = ''
          WITHOUT_PERSONAL_LIST = ''
        IMPORTING
          OBJECT_NAME_SELECTED  = SOPROG-HIGH
        EXCEPTIONS
          CANCEL                = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOCLASS-LOW.
      CALL FUNCTION 'F4_DD_ALLTYPES'
        EXPORTING
          OBJECT               = SOCLASS-LOW
          SUPPRESS_SELECTION   = 'X'
          DISPLAY_ONLY         = ''
          ONLY_TYPES_FOR_CLIFS = 'X'
        IMPORTING
          RESULT               = SOCLASS-LOW.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOCLASS-HIGH.
      CALL FUNCTION 'F4_DD_ALLTYPES'
        EXPORTING
          OBJECT               = SOCLASS-HIGH
          SUPPRESS_SELECTION   = 'X'
          DISPLAY_ONLY         = ''
          ONLY_TYPES_FOR_CLIFS = 'X'
        IMPORTING
          RESULT               = SOCLASS-HIGH.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFNAME-LOW.
      CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
        EXPORTING
          OBJECT_TYPE           = 'FUNC'
          OBJECT_NAME           = SOFNAME-LOW
          SUPPRESS_SELECTION    = 'X'
          USE_ALV_GRID          = ''
          WITHOUT_PERSONAL_LIST = ''
        IMPORTING
          OBJECT_NAME_SELECTED  = SOFNAME-LOW
        EXCEPTIONS
          CANCEL                = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFNAME-HIGH.
      CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
        EXPORTING
          OBJECT_TYPE           = 'FUNC'
          OBJECT_NAME           = SOFNAME-HIGH
          SUPPRESS_SELECTION    = 'X'
          USE_ALV_GRID          = ''
          WITHOUT_PERSONAL_LIST = ''
        IMPORTING
          OBJECT_NAME_SELECTED  = SOFNAME-HIGH
        EXCEPTIONS
          CANCEL                = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFGROUP-LOW.
      CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
        EXPORTING
          OBJECT_TYPE           = 'FUGR'
          OBJECT_NAME           = SOFGROUP-LOW
          SUPPRESS_SELECTION    = 'X'
          USE_ALV_GRID          = ''
          WITHOUT_PERSONAL_LIST = ''
        IMPORTING
          OBJECT_NAME_SELECTED  = SOFGROUP-LOW
        EXCEPTIONS
          CANCEL                = 1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR SOFGROUP-HIGH.
      CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
        EXPORTING
          OBJECT_TYPE           = 'FUGR'
          OBJECT_NAME           = SOFGROUP-HIGH
          SUPPRESS_SELECTION    = 'X'
          USE_ALV_GRID          = ''
          WITHOUT_PERSONAL_LIST = ''
        IMPORTING
          OBJECT_NAME_SELECTED  = SOFGROUP-HIGH
        EXCEPTIONS
          CANCEL                = 1.
    initialisation
    INITIALIZATION.
    Parameter screen texts.
      TBLOCK1 = 'Author (Optional)'.
      T$TMP   = 'Programs only: include local objects'.
      TBLOCK2 = 'Objects to download'.
      TBLOCK3 = 'Additional downloads for programs, function modules and classes'.
      TBLOCK4 = 'Download parameters'.
      TBLOCK5 = 'Display options'.
      TAUTH   = 'Author name'.
      TPMOD   = 'Include programs modified by author'.
      TCUST   = 'Only customer objects'.
      TNRANGE = 'Alt customer name range'.
      TRTABLE = 'Tables / Structures'.
      TPTABLE = 'Table name'.
      TTNOTE  = 'Note: tables are stored under the username of the last person who modified them'.
      TRFUNC  = 'Function modules'.
      TPFNAME = 'Function name'.
      TFGROUP = 'Function group'.
      TRCLASS  = 'Classes'.
      TPCNAME = 'Class name'.
      TMESS   = 'Message class'.
      TMNAME  = 'Class name'.
      TMLANG  = 'Language'.
      TPROG   = 'Programs'.
      TRPNAME = 'Program name'.
      TPACK   = 'Package'.
      TPTXT   = 'Text document'.
      TPHTML  = 'HTML document'.
      TCOMM   = 'Highlight comments'.
      TBACK   = 'Include background colour'.
      TPTEXT  = 'Text elements'.
      TPINC   = 'Include programs'.
      TRECC   = 'Recursive search'.
      TPPATH  = 'File path'.
      TSPATH  = 'Logical file name'.
      TPMES   = 'Message classes'.
      TPFUNC  = 'Function modules'.
      TDOC    = 'Function module documentation'.
      TRECF   = 'Recursive search'.
      TPSCR   = 'Screens'.
      TPDICT  = 'Dictionary structures'.
      TSORTT  = 'Sort table fields alphabetically'.
      TSERV   = 'Download to server'.
      TPC     = 'Download to PC'.
      TREP    = 'Display download report'.
      TPROMESS  = 'Display progress messages'.
    Determine the frontend operating system type.
      IF SY-BATCH IS INITIAL.
        PERFORM DETERMINEFRONTENDOPSYSTEM USING FRONTENDSLASHSEPARATOR FRONTENDOPSYSTEM.
      ENDIF.
      PERFORM DETERMINESERVEROPSYSTEM USING SERVERSLASHSEPARATOR SERVERFILESYSTEM SERVEROPSYSTEM.
    Determine if the external command exists.  If it doesn't then disable the server input field
      PERFORM FINDEXTERNALCOMMAND.
    start-of-selection.
    START-OF-SELECTION.
      PERFORM CHECKCOMBOBOXES.
      PERFORM FILLSELECTIONRANGES.
      STARTTIME = SY-UZEIT.
    Don't display status messages if we are running in the background
      IF NOT SY-BATCH IS INITIAL.
        PPROMESS = ''.
      ENDIF.
    Fool the HTML routines to stop them hyperlinking anything with a space in them
      IF PCNAME IS INITIAL.
        CUSTOMERNAMESPACE  = '^'.
      ELSE.
        CUSTOMERNAMESPACE = PCNAME.
      ENDIF.
    Determine which operating slash and download directory to use
      CASE 'X'.
        WHEN PPC.
          SLASHSEPARATORTOUSE = FRONTENDSLASHSEPARATOR.
          DOWNLOADFOLDER = PFOLDER.
        WHEN PSERV.
          SLASHSEPARATORTOUSE = SERVERSLASHSEPARATOR.
          DOWNLOADFOLDER = SERVERFOLDER.
      ENDCASE.
    Main program flow.
      CASE 'X'.
      Select tables
        WHEN RTABLE.
          PERFORM RETRIEVETABLES USING IDICTIONARY[]
                                       SOTABLENAMES[]
                                       SOAUTHOR[].
      Select message classes tables
        WHEN RMESS.
          PERFORM RETRIEVEMESSAGECLASS USING IMESSAGES[]
                                             SOAUTHOR[]      "Author
                                             PMNAME          "Message class name
                                             PMLANG          "Message class language
                                             PMOD.           "Modified by author
      Select function modules
        WHEN RFUNC.
          PERFORM RETRIEVEFUNCTIONS USING SOFUNCTIONNAME[]   "Function name
                                          SOFUNCTIONGROUP[]  "Function group
                                          IFUNCTIONS[]       "Found functions
                                          SOAUTHOR[]         "Author
                                          PTEXT              "Get text elements
                                          PSCR               "Get screens
                                          PCUST              "Customer data only
                                          CUSTOMERNAMESPACE. "Customer name range
          LOOP AT IFUNCTIONS.
          Find Dict structures, messages, functions, includes etc.
            PERFORM SCANFORADDITIONALFUNCSTUFF USING IFUNCTIONS[]
                                                     PRECI                   "Search for includes recursively
                                                     PRECF                   "Search for functions recursively
                                                     PINC                    "Search for includes
                                                     PFUNC                   "Search for functions
                                                     PDICT                   "search for dictionary objects
                                                     PMESS                   "Search for messages
                                                     PCUST                   "Customer data only
                                                     CUSTOMERNAMESPACE.      "Customer name range
          ENDLOOP.
      Select Classes
        WHEN RCLASS.
          PERFORM RETRIEVECLASSES USING ICLASSES[]
                                        IFUNCTIONS[]
                                        SOCLASSNAME[]       "Class name
                                        SOAUTHOR[]          "Author
                                        CUSTOMERNAMESPACE   "Customer name range
                                        PMOD                "Also modified by author
                                        PCUST               "Customer object only
                                        PMESS               "Find messages
                                        PTEXT               "Text Elements
                                        PDICT               "Dictionary structures
                                        PFUNC               "Get functions
                                        PINC                "Get includes
                                        PRECF               "Search recursively for functions
                                        PRECI               "Search recursively for includes
                                        'X'                 "Search recursively for classes
                                        PMLANG.             "Language
          LOOP AT IFUNCTIONS.
          Find Dict structures, messages, functions, includes etc.
            PERFORM SCANFORADDITIONALFUNCSTUFF USING IFUNCTIONS[]
                                                     PRECI                   "Search for includes recursively
                                                     PRECF                   "Search for functions recursively
                                                     PINC                    "Search for includes
                                                     PFUNC                   "Search for functions
                                                     PDICT                   "search for dictionary objects
                                                     PMESS                   "Search for messages
                                                     PCUST                   "Customer data only
                                                     CUSTOMERNAMESPACE.      "Customer name range
          ENDLOOP.
      Select programs
        WHEN RPROG.
          PERFORM RETRIEVEPROGRAMS USING IPROGRAMS[]
                                         IFUNCTIONS[]
                                         SOPROGRAMNAME[]    "Program name
                                         SOAUTHOR[]         "Author
                                         CUSTOMERNAMESPACE  "Customer name range
                                         PMOD               "Also modified by author
                                         PCUST              "Customer object only
                                         PMESS              "Find messages
                                         PTEXT              "Text Elements
                                         PDICT              "Dictionay structures
                                         PFUNC              "Get functions
                                         PINC               "Get includes
                                         PSCR               "Get screens
                                         PRECF              "Search recursively for functions
                                         PRECI              "Search recursively for includes
                                         P$TMP              "local objects
                                         PPACK.             "Package
      ENDCASE.
    end-of-selection
    END-OF-SELECTION.
      IF FORCEDEXIT = 0.
      Set the file extension and output type of the file
        IF PTXT IS INITIAL.
          DOWNLOADFILEEXTENSION = HTMLEXTENSION.
        ELSE.
          DOWNLOADFILEEXTENSION = TEXTEXTENSION.
        ENDIF.
      Decide what to download
        CASE 'X'.
        Download tables
          WHEN RTABLE.
            IF NOT ( IDICTIONARY[] IS INITIAL ).
              PERFORM DOWNLOADDDSTRUCTURES USING IDICTIONARY[]
                                                 DOWNLOADFOLDER
                                                 HTMLEXTENSION
                                                 SPACE
                                                 PSORTT
                                                 SLASHSEPARATORTOUSE
                                                 PSERV
                                                 PPROMESS.
            Free up any memory used for caching HTML versions of tables
              LOOP AT IDICTIONARY.
                FREE MEMORY ID IDICTIONARY-TABLENAME.
              ENDLOOP.
            Display donwload report
              IF NOT PREP IS INITIAL.
                GET TIME.
                RUNTIME = SY-UZEIT - STARTTIME.
                PERFORM FILLTREENODETABLES USING IDICTIONARY[]
                                                 ITREEDISPLAY[]
                                                 RUNTIME.
              ENDIF.
              CLEAR IDICTIONARY[].
            ENDIF.
        Download message class
          WHEN RMESS.
            IF NOT ( IMESSAGES[] IS INITIAL ).
              SORT IMESSAGES ASCENDING BY ARBGB MSGNR.
              LOOP AT IMESSAGES.
                APPEND IMESSAGES TO ISINGLEMESSAGECLASS.
                AT END OF ARBGB.
                  PERFORM DOWNLOADMESSAGECLASS USING ISINGLEMESSAGECLASS[]
                                                     IMESSAGES-ARBGB
                                                     DOWNLOADFOLDER
                                                     DOWNLOADFILEEXTENSION
                                                     PHTML
                                                     SPACE
                                                     PCOMM
                                                     CUSTOMERNAMESPACE
                                                     PINC
                                                     PDICT
                                                     PMESS
                                                     SLASHSEPARATORTOUSE
                                                     PSERV
                                                     PPROMESS.
                  CLEAR ISINGLEMESSAGECLASS[].
                ENDAT.
              ENDLOOP.
            Display download report
              IF NOT PREP IS INITIAL.
                GET TIME.
                RUNTIME = SY-UZEIT - STARTTIME.
                PERFORM FILLTREENODEMESSAGES USING IMESSAGES[]
                                                   ITREEDISPLAY[]
                                                   RUNTIME.
              ENDIF.
              CLEAR IMESSAGES[].
            ENDIF.
        Download functions
          WHEN RFUNC.
            IF NOT ( IFUNCTIONS[] IS INITIAL ).
              PERFORM DOWNLOADFUNCTIONS USING IFUNCTIONS[]
                                              DOWNLOADFOLDER
                                              DOWNLOADFILEEXTENSION
                                              SPACE
                                              PDOC
                                              PHTML
                                              PCOMM
          

Maybe you are looking for

  • FCP Memory issue on a new MBP

    I just bought a new 17" macbook pro with 4gb of ram. It's only a few days old. I'm having an issue with final cut pro 6 while trying to render or compress a file. Over the course of a few minutes, It transfers all of my memory from free to inactive m

  • After installing Radeon Graphics drivers on Windows 8 Flash player and Adobe Flash Pro didn't re-ins

    Hi, On a Windows 8 Pro desktop I recently installed Flash Pro and it seemed to work great.   Also Flash Player was working great as well.  But I noticed on Adobe  Photoshop CS6 that the 3d controls were not working.  So I installed the the Radeon Gra

  • PO Line Item Number not filled in BSEG Table

    HI, While posting to goods receipt through MIGO FI documents are generated. For these  FI documents ,  in BSEG table the corresponding  PO line item numbers (EBELP )are not getting filled up, How can they be filled. can it be done through any standar

  • Hyperlinks in e-mails do not work

    Example when I get e-mail in Outlook with a link to verfiy a new website registration click the link does nothing. I have not changed anything in Outlook. Only recent changes was the Firefox sharing AddOn

  • Corruption problem with iPod

    okay, so I have a strange corruption problem with my iPod: no matter now many times I attempt to restore, nothing seems to happen. How do I fix this? NOTE: Whenever I attempt to play it, my iPod is always displaying the following message: Connect to