Storage Disappeared! Sort of...

Hello all,
I'm running a single host instance of VDI3.0 on a Sun Fire x2200. The storage backend is a Unified Storage 7110. I recently updated the 7110 to the latest firmware version - after which, VDI tells me that my storage is unresponsive. The system shows me as having no storage whatsoever, but yet I am typing this forum post from a virtual machine that was booted and running from the "missing" storage pool.
As a result of this madness, I am unable to import and boot any new virtual machines. I attempted to add a new storage backend to the system, and when I put in the credentials of the 7110, it does not present the system with a certificate. I can, however, ssh directly into the storage from the VDI provider host.
I appreciate any insight, because I am totally at a loss on this one.
Thanks,
Bob Prendergast

Hi Bob.
I suppose you use the 2009.Q2.0.0 version of the 7110 software? The SSH ciphers offered by the SSHD of that release have not a single match in the ciphers list of the SSH client of VDI 3, therefore all SSH connections fail. This issue is currently fixed for the upcoming VDI 3 patch to be released end of this month.
If you are really in the urgent need of a workaround - and I can't emphasize enough that this workaround isn't even sanity tested yet, so apply it on your own peril - you can download the 1.41 version of the jsch library from http://prdownloads.sourceforge.net/jsch/jsch-0.1.41.jar?download. Shutdown the VDI service on every VDI host ("cacaoadm stop --force"), replace old library at /opt/SUNWvda/lib/jsch-0.1.39.jar with the new one (you need to rename the new library to match the name of the old library) and restart the VDI services again ("cacaoadm start").
~Thomas

Similar Messages

  • Storage problem - unused storage disappeared

    Hi,
    I have a problem with the storage of my hard drive.
    The Notebook is a Lenovo 3000 N200 (0769-B3G) and my OS is Windows Vista Home Premium.
    I'm having the original hard drive of this notebook with around 112 GB. This hard drive is split in 2 partitions. The first is 6,42 GB and contains the Lenovo recovery data and the second is 105,37 GB.
    Now my Notebook informs me, that my hard drive storage is almost full (unused: 34,6 MB). I sum up the used storage of all folders. In addition to that I've installed an application named "TreeSize" to check the used storage. My calculation and the result of the program is around 55 GB. That means that 50 GB are unused. I don't understand that and I would like to ask, what is the problem and where could I get my unused storage?!
    Maybe someone knows this problem and could help me :/
    kind regards,
    krixxie
    PS: I am administrator of this Notebook.
    Message Edited by krixxie on 10-13-2008 06:13 AM
    Solved!
    Go to Solution.

    found it!!!!!!
    right pal think i have found it how to stop your backups
    D/B (double click) on the orange lenovo care on your desk top
    you will get a menu come up
    click on data protection and recovery
    then a side menu appears
    click on 'back up data'
    then a box appears
    D/B click on 'preferences' button
    and the box will open up another box which is seperated into
    four sections
    un tab(no tick in box)  'schedule your back ups'
    then click apply and ok.
    no more scheduled back ups.
    but if this is the case,you will need to check which of the backups you need to keep.
    i kept the very first one on the list.
    check first how many backups your system has done,then you can work out
    the Gb useage.
    i hope i am correct in stating the above.

  • CC storage disappeared

    I usually save to CC storage but I just lost the option to do that, it is no longer in my save to pull down or in my open pull down. where are my files?

    Your files should be available from the browser at https://creative.adobe.com/files once signed in with your Adobe ID.
    On your local computer the files should be in the Creative Cloud Files folder.

  • What's with disk errors that disappear, sort of?

    1. MB started running slow. Activity monitor showed high CPU use when nothing was running.
    2. Ran Disk Utility and it reported unfixable errors. Suggested wiping, reinstalling o/s and restoring from Time Machine
    3. MB would then not boot.
    4. Time passed with MB turned off. Could not get an appointment at the Genius Bar.
    5. Ran TechTool hardware diagnostic that reported problems on the hard disk
    6. Booted holding Command+R
    7. Boot succeeded. (Ran a Time Machine backup to capture the latest.)
    8. Shutdown and restarted
    9. Succeeded
    10. Shut down and booted from Recovery Partition
    11. Ran disk utility diagnostic.
    12. No Verify errors, no Permission errors.
    13. Ran TechTool again. Volumne Structure test failed.
    14. TechTool said Volume Structure Rebuild could not be completed.
    15. Rebooted normally with no problem.
    What the @%#$ is going on?

    You might want to run the Apple hardware test to see what it says: http://support.apple.com/kb/HT1509
    Download Smart Utility from http://www.volitans-software.com/smart_utility.php and see what it says about the health of the drive. It will also give you visibility to the SMART sensor values.
    The preceding two steps are to try and verify that the hardware is in good shape. Sometimes, though, if a drive is sick, it can show differing symptoms. How old is your MBP?

  • Networked Drive Disappeared, Sort of

    I have a G4 networked to a router via ethernet cable. Also on the network is an external hard drive. For some reason, the hard drive appears in Finder (as "Share"), but the contents of the drive now seem to be blank, even though I have happily accessed and used this drive with the Mac previously. However, if I click the drive and "get info," the info tells me the size of the drive, etc. I have tried applications other than Finder (e.g., Word) but the folders on the networked drive do not show up. I have a couple of PCs also on the network and they read the external drive and access it just fine. Clearly the Mac is accessing the drive, but not showing me what's in it. Help!
    Thanks in advance!
    Steve
    Mac G4 Mac OS X (10.2.x) 1 Ghz 1.75 Gig RAM
    Mac G4 Mac OS X (10.2.x) 1 Ghz 1.75 Gig RAM

    Just found another thread. Appears it is Google Drive. I will check when I get home tonight.
    Thanks anyway!

  • Using ipod as storage

    Hello all
    someone told me that i can use my ipod for storage - as sort of disk-on-key, i.e downloading pictures from my camera to ipod for storage.
    is it true? can anybody tell me how it's done?
    thanks for all,
    M.

    Yes you can use your iPod as a storage drive.
    http://support.apple.com/kb/HT1478?viewlocale=en_US
    However, with the newer iPods you can't download photos from your camera directly to an iPod. The iPod camera connector is not compatible with the classic.

  • Images "Disappear" When Moving a Project But Really They'r e Just Invisible

    Last night I imported 442 images into a new project. I rated them, and edited about 40-50. This morning I moved the project within the same library. When I did so, all the images disappeared, sort of. The project appeared empty. I let it sit a couple of minutes, and undid the move to no effect.
    I checked to see if a filter was blocking the images but it was not the problem. I checked the Project properties and it showed the images were all there (plus, I use referenced files and I hadn't deleted the CF card so worst case scenario I had all my originals). Also, when I displayed all the projects in a browser view window, the project showed up and I could sweep through all the thumbnails in the project browser. But again, if I selected the project and tried to see the images in either the browser, viewer, or split view, nothing showed up. No thumbnails, no file names, no empty thumbnails, nothing. The photos were sort of invisible.
    I "solved" the issue by moving an image - any image - from another project into the problem project. Suddenly that photo and all the other images, were visible. Removing the random image did not recreate the problem.
    Since I no longer have the problem I'm posting for 2 reasons: (1) to publish the problem and my fix in case anybody gets the same problem, and (2) to see if anybody knows what caused this and if there is a more direct fix than my weird indirect fix. Thanks.

    I have had the same thing happen consistently. I import images into a default project. Then when I move the project into an organizational folder... all the images disappear. After a couple of panics, I have now realized that if I stay calm, close Aperture, then open it again, the pictures are all present. Quite a pain in the butt, but at least there is a work around. Albeit a bit scary .
    Best,
    Jim

  • Using function to sort

    I added a function to a report that used a stored procedure.
    The function queries a table that was not in the stored procedure.
    Can I sort using this function? If not, how can I get the report in
    the correct order using a field from the new table?
    Thanks

    Thanks Edger for your reply, The structure is mentioned below
       Types:                   BEGIN OF ty_f4,
                          txt TYPE char7,
                          END OF ty_f4,
    mt_input_f4 TYPE STANDARD TABLE OF ty_f4.
    i concatenated the quarter and year value to the txt fied of the structure.
    Gernally in place of f0001 text the Window title displays. It is first time i am countering and cant able to figure out why it is coming.
    if disappearing sort funtionality is not possible i just want to change the text f0001 to some other values.Please reply if it is possible.

  • Menus disappear

    Using FireFox ESR 17.011.
    This just started recently. When opening a menu from the menu toolbar, the menu pane will open and initially display the menu options, but will disappear, sort of. It is almost like it is putting the menu into the background because there is a faint outline of the menu option box and if I click in an area where a list item is, that item will open.
    Initially, this was just an annoyance, now it is a hindrance.
    Steps to resolve:
    1. Restarted in Safe mode - all menus work as expected.
    2. Disabled ALL addons - menus still do NOT work
    3. Reset FireFox - menus still do not work
    4. Uninstalled/Reinstalled - menus still do not work
    On the reinstall, I did not delete all of my content and settings. I will need to export my personal data first before I can do a new clean install. I would rather not do this as there is obviously an issue here.
    From what I was able to find online, the steps reproduced should have helped resolve this issue, they have not.
    What I would like to do, is reset FireFox back to default, removing any and all addons, but retaining my personal information (bookmarks, passwords, etc...).

    big parts of oracle's cororate applications seem to be certified by oracle to work with the firefox 24 esr release: https://blogs.oracle.com/stevenChan/entry/firefox_24_certified_with_oracle
    i have no idea if the JD Edwards one falls into this category though, and i also don't think it is mozilla's task to support third-party apps that hook into the browser (there are countless ones) but it's rather the other way round...

  • Sort by Count in SQ01

    Hi Guru's First time posting so be gentle !!
    In SQ01 does anyone know how to sort by the count or is there a formula which can be used in a complex calculation to return a number of records which has been repeated.
    for example the number of times a material appears in a storage type sorted in descending order by the count of the material.
    Thank you for your time to look.
    Edited by: GTHURK on Jul 12, 2010 5:57 PM
    Edited by: GTHURK on Jul 12, 2010 5:58 PM

    Hi George,
    Did you ever find a solution to this?  I appreciate it was a long time ago.
    Regards,
    Stephen

  • N97 E: / Mass Memory disappeared!

    I have recently purchased an N97 and it's worked fine, up to now.
    A few days ago i turned it on, only to find that all of my photos and music were missing.
    So I plugged the N97 into my PC to see where they had gone and my E: folder has gone.
    The 32GB isn't on a memory card? There wasn't any memory card in the box when i purchased it, and besides, it was showing the 32GB mass storage up until a few days ago.
    http://i443.photobucket.com/albums/qq157/frithleeds/n97.png
    As you can see in the above link, there is no E: folder present.
    How can I get the mass storage folder back?
    Many thanks.

    The 32gb mass storage is built into the phone and not a removable memory card. I have never heard of the mass storage disappearing and so don't know what to suggest. Resetting may work if it is software related but it could be a hardware problem as well, which unfortunately we can't help you with. Best thing to do is probably to send it to your local Nokia Point so they can check it out properly.
     You can find your nearest Nokia Care Point at:
    For UK
    http://www.nokia.co.uk/A4228006
    For Europe:
    http://europe.nokia.com/A4388379
    For Asia-Pacific
    http://www.nokia-asia.com/A4416070
    Elsewhere:
    http://www.nokia.com select your country, go to the support section, then select repair. 

  • Using sort variables

    Hi All:
    I am new in LE topics and I would like to ask you what is the use or principal functionality of the sort variables within storage bins as part of warehouse management?
    Thanks for your help
    Regards.

    Hi,
    You can use this field to help in Storage space optimization. I am copying SAP Help here.
    Define Sort Sequence for Putaways (Cross-line Stock Putaway)
    If you do not want the SAP system to carry out the search for a suitable storage bin according to the numerically ascending
    sequence of storage bins, you can influence the sequence of storage bin allocation using this cross-line putaway method. 
    With cross-line putaway, you can prevent the danger of one-sided loading into the warehouse and, at the same time, have the
    putaways carried out efficiently.
    You can set up cross-line stock putaway for the putaway strategies empty bin and pallets. You can also set up cross-line stock
    putaway for storage types with the putaway strategies addition to existing stock or bulk storage, since the system searches for
    an empty bin if the search for a bin for addition to existing stock is unsuccessful.
    Default settings
    In the SAP standard system, sample entries are preset for warehouse number 001 and storage type 001.
    SAP Recommendation
    If you wish to use the "Cross-line putaway" strategy, you must activate the strategy before adding the storage bins. If you
    activate this strategy after bins have been created, the control fields and indicators for existing storage bins will not be filled properly.
    If you must change the cross-line putaway method for storage types in which storage bins have already been created,
    you must change the affected storage bins using the "multiple processing" function.
    Actions
    1. For all storage types for which you wish to set the cross-line placement strategy, set the sequence of the storage bin number
    positions so that the index can be created.
    2. If you want to change the sequence of the number positions of the storage bins for index creation in a storage type where the
    storage bins have already been generated, you must change the affected storage bins (sort field) afterwards using the "multiple
    processing" function.
    You will find this option in the Warehouse Management menu Master data -> Storage bin -> Change -> Several storage bins.

  • Regarding bapi

    hi all,
      i am getting a flat file from application server .i have to do some validations and i am passing these values to bapi structure to create Purchase requisition(PR).but it is not creating any PR.
    i am sending my code to u pls go through  that .and tell me where i have to change it
    report   zlpr_inb_str_create
              no standard page heading
              line-size 250
              message-id zl_msg.
                      TYPES  DECLARATION                                 *
    types:begin of ty_data,
           sc_code     type t001l-lgort,    "School Code
           course      type ltext,          "Course
           stock_item  type matnr,          "Stocked Item Number
           quantity    type char5,          "Requisition Quantity
           ac_info     type char20,         "Accounting Information
           fincode     type bp_geber,       "Fund
           fkber       type fkber   ,       "Functional Area
           kostl       type kostl   ,       "Cost Center
           saknr       type saknr   ,       "G/L Account Number
           gsber       type gsber   ,       "Business Area
        end of ty_data.
    types:begin of ty_log ,
         sc_code       type t001l-lgort,     "School Code
         course        type ltext,           "Course
         stock_item    type matnr,           "Stocked Item Number
         quantity      type char5,           "Requisition Quantity
         ac_info       type char20,          "Accounting Information
         s_date        type sy-datum,        "System Date
         s_time        type sy-uzeit,        "System Time
         err_msg       type char100,         "Error Message
         end of ty_log.
    types:begin of ty_mara,
            matnr       type mara-matnr,                            "Material code
            ac_info(20) type c,
          end of ty_mara.
    types:begin of ty_lgort,
          lgort type t001l-lgort,                                   "Storage Location
          ac_info(20) type c,
          end of ty_lgort.
    types:begin of ty_fincode,
          fincode type fmfincode-fincode,                             "SAP Fund
          end of ty_fincode      .
    types:begin of ty_fkber,
          fkber type tfkb-fkber,                                     "SAP Function Area
          end of ty_fkber      .
    types:begin of ty_kostl,
          kostl type csks-kostl,                                     "SAP Cost Center
          end of ty_kostl      .
    types:begin of ty_saknr,
          saknr type ska1-saknr,                                     "SAP GL Account
          end of ty_saknr      .
    types:begin of ty_gsber,
         gsber type tgsb-gsber,                                      "SAP Business Area
         end of ty_gsber      .
                      VARIABLES DECLARATION                              *
    data: g_fincode      type  bp_geber,                              "Fund
          g_fkber        type  fkber   ,                              "Functional Area
          g_kostl        type  kostl   ,                              "Cost Center
          g_saknr        type  saknr   ,                              "G/L Account Number
          g_gsber        type  gsber   ,                              "Business Area
          g_itmcnt       type  i       ,                              "Count for item lines
          g_err          type  c       .                              "For error messages
                      INTERNAL TABLES DECLARATION                        *
    data:it_data    type standard table of ty_data with header line,
         it_dynsel  type table of dselc with header line,
         it_dynval  type table of dval,
         it_log     type standard table of ty_log,                    "Error log
         it_mara    type standard table of ty_mara,                   "Material Number
         it_lgort   type standard table of ty_lgort,                  "Storage Location
         it_fincode type standard table of ty_fincode,                "Fund
         it_fkber   type standard table of ty_fkber,                  "Functional Area
         it_kostl   type standard table of ty_kostl,                  "Cost Center
         it_saknr   type standard table of ty_saknr,                  "G/L Account Number
         it_gsber   type standard table of ty_gsber.                  "Bussiness Area
                      WORK AREA DECLARATION                              *
    data: wa_data    type ty_data,
          wa_string  type string,
          wa_log     type ty_log,                                     "Error Log
          wa_mara    type ty_mara,                                    "Material Number
          wa_lgort   type ty_lgort,                                   "Storage Location
          wa_fincode type ty_fincode,                                 "Fund
          wa_fkber   type ty_fkber,                                   "Functional Area
          wa_kostl   type ty_kostl,                                   "Cost Center
          wa_saknr   type ty_saknr,                                   "G/L Account Number
          wa_gsber   type ty_gsber,                                   "Bussiness Area
          wa_helpinf type help_info.
        INTERNAL TABLES DECLARATION FOR PASSING VALUES IN BAPI           *
    data : it_item     type standard table of bapiebanc,            "Item Data
           it_atasg    type standard table of bapiebkn,             "Account Assignment Data for Item
           it_ittxt    type standard table of bapiebantx,           "Text for Item
           it_return   type standard table of bapireturn,           "Return Messages
           g_reqstno   type bapiebanc-preq_no.                      "Purchase Requisition Number
    data : wa_bapiebanc  type bapiebanc,
           wa_bapiebkn   type bapiebkn ,
           wa_bapiebantx type bapiebantx,
           wa_return     type bapireturn.
                      CONSTANTS                                          *
    constants: c_program      type ztcca_pgmconst value 'ZLPR_INB_STR_CREATE', "program Name
               c_field1       type ztcca_pgmconst value 'Z_STR_CREATE',
               c_msg          type char41 value 'No Valid Records to Process in the file',
               c_module       type char2 value 'PR',
               c_dev_type     type zcca_dev_type value 'INT',
               c_movement     type zcca_movement value 'I',
               c_object_id    type char25  value 'PR_INB_0001',
               c_dlmtr        type c value '|',                              "For Deliminator
               c_fldname(10)  type c value 'FILEINTERN',                     "For File name FM
               c_dyflname(19) type c value 'FILENAME-FILEINTERN',            "For File name FM
               c_fname(8)     type c value 'FILENAME',                       "For file name FM
               c_prog(8)      type c value 'RSSYSTDB',                       "For file name FM
               c_chktable(10) type c value 'FILENAMECI',                     "For file name FM
               c_dynpro(4)    type c value '1000',                           "For File name FM
               c_dynprofld(6) type c value 'P_FILE',                         "For File name FM
               c_call(1)      type c value 'T',                              "For File name FM
               c_spras        type c value 'E',                              "For File name FM
               c_obj(1)       type c value 'F',                              "For File name FM
               c_pov(1)       type c value 'N',                              "For File name FM
               c_currow(1)    type c value '3',                              "For File name FM
               c_curcol(2)    type c value '35',                             "For File name FM
               c_sydyn(1)     type c value 'S',                              "For File name FM
               c_pr_type(4)   type c value 'ZUB',                            "For PR Type
               c_item_cat(1)  type c value 'U',                              "For Item Category
               c_ac_asign(1)  type c value 'K',                              "For Cost Center
               c_pur_grp(1)   type c value 'H',                              "For Purchasing Group
               c_pur_org(4)   type c value 'DCPS',                           "For Purchasing Organisation
               c_gl_ac(4)     type c value 'CABE',
               c_unit(2)      type c value  'EA',                            "For Unit Of Measure
               c_r_plant(4)   type c value '1000' ,                          "For Requesting Plant
               c_10(2)        type c value '10',
               c_3000(4)      type c value '3000',                           "For Supplying Plant
               c_90(2)        type c value '90',
               c_ok(1)        type c value 'X',
               c_i(1)         type c value 'I',
               c_eq(2)        type c value 'EQ',
               c_flag(1)      type c value 'X'   ,
               c_x(1)         type c value 'X'   ,
               c_coma(1)        type c value ','   ,
               c_00(2)        type c value '00'  ,
               c_0000(4)      type c value '0000'  ,
               c_one          type i value 1       ,
               c_98           type i value 98       .
        AT SELECTION-SCREEN                                             *
    *-- selection screen declarations
    selection-screen begin of block b_source with frame title text-008.
    parameters: p_file  type localfile .                                        "Source file name
    parameters:rb_phy   radiobutton group path user-command ucmd default 'X',   "Physical path
               rb_logic     radiobutton group path .                            "Logical path
    selection-screen end of block b_source.
        AT SELECTION-SCREEN ON  VALUE-REQUEST                           *
    at selection-screen on value-request for p_file.
    *--Get the value help for the application server .
      perform get_value_help.
        AT SELECTION-SCREEN ON  INPUT FILE                              *
    at selection-screen on p_file.
    *--Validate the physical file path of application server
      perform validate_file_path using p_file.
        START-OF-SELECTION EVENT                                        *
    start-of-selection.
    *--To get source file data from application server
      perform get_file_data.
    *-- Validate input file data
      perform validate_data.
    *-- Post STR / PR in SAP
      perform create_str.
    *--To display the processing log
    PERFORM display_log.
    *--- Display Default Application server file path on selection screen
      perform default_app_server_file.
    *&      Form  VALIDATE_FILE_PATH
          Validate physical file path for application server
    form validate_file_path using p_app_file.
      data:   l_app_fname type sldstring, "APPLICATION FILE NAME
              l_test type sldagtst.       "TEST INDICATOR
      move p_app_file to l_app_fname.
      if rb_phy = 'X'.
        if p_file ne space.
    *CHECK WHETHER FILE EXIST IN THE APPLICATION SERVER
          call function 'SLDAG_CHECK_FILE_EXISTENCE'
            exporting
              fq_file_name = l_app_fname
            importing
              exists       = l_test.
          if l_test is initial.
            message i023.   "File not found.
          endif.
        endif.
      endif.
      clear l_test.
    endform.                    " VALIDATE_FILE_PATH
    *&      Form  GET_VALUE_HELP
          Get the help for the file name
    form get_value_help .
      if rb_phy = 'X'.
        call function '/SAPDMC/LSM_F4_SERVER_FILE'
          exporting
            directory        = '.'
          importing
            serverfile       = p_file
          exceptions
            canceled_by_user = 1
            others           = 2.
        if sy-subrc <> 0.
          message i023.                        "File not found
        endif.
      elseif rb_logic = c_ok.
        clear: wa_helpinf,
               it_dynsel,
               it_dynval.
        refresh: it_dynsel,
                 it_dynval.
    Set the parameters before invoking the FM
    for browsing the logical filename
        wa_helpinf-call         = c_call.
        wa_helpinf-object       = c_obj.
        wa_helpinf-program      = c_prog.
        wa_helpinf-dynpro       = c_dynpro.
        wa_helpinf-tabname      = c_fname.
        wa_helpinf-fieldname    = c_fldname.
        wa_helpinf-spras        = sy-langu.
        wa_helpinf-title        = sy-title.
        wa_helpinf-dynprofld    = c_dynprofld.
        wa_helpinf-checktable   = c_chktable.
        wa_helpinf-checkfield   = c_fldname.
        wa_helpinf-report       = sy-cprog.
        wa_helpinf-pov          = c_pov.
        wa_helpinf-curow        = c_currow.
        wa_helpinf-cucol        = c_curcol.
        wa_helpinf-sy_dyn       = c_sydyn.
        wa_helpinf-dynpprog     = sy-cprog.
        it_dynsel-fldname   = c_fldname.
        it_dynsel-dyfldname = c_dyflname.
        append it_dynsel.
    Call the FM to display the help for the logical filenames
        call function 'HELP_START'
          exporting
            help_infos   = wa_helpinf
          tables
            dynpselect   = it_dynsel
            dynpvaluetab = it_dynval.
      endif.
    endform.                    " GET_VALUE_HELP
    *&      Form  get_file_data
          text
    form get_file_data .
    *--Open the file and move data into table it_data
      open dataset p_file for input in text mode encoding default.
      if ( sy-subrc ne 0 ).
        message e002 with c_msg.
      endif.
      while sy-subrc = 0.
        read dataset p_file into wa_string.
        if sy-subrc = 0.
    split the string into table structure
          split wa_string at '|' into: wa_data-sc_code               "School Code
                                       wa_data-course                "Course
                                       wa_data-stock_item            "Stock Item Number
                                       wa_data-quantity              "Quantity
                                       wa_data-ac_info.              "Accounting Information
    Convert Stock Item number ( Material number )
          call function 'CONVERSION_EXIT_MATN1_INPUT'
            exporting
              input        = wa_data-stock_item                     "Stock Item Number
            importing
              output       = wa_data-stock_item                     "Stock Item Number
            exceptions
              length_error = 1
              others       = 2.
          if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          endif.
    Get SAP fields from accounting information string
          wa_data-gsber   = wa_data-ac_info+12(4).                       " validate to sap bussiness area
          concatenate  wa_data-ac_info+1(3) c_00   into wa_data-fincode. "validate to Sap fund
          concatenate  wa_data-ac_info4(4) c_00 wa_data-ac_info8(4) c_0000
                                                   into wa_data-fkber.    "Validate Functional Area
          concatenate  wa_data-ac_info+12(4) c_00  into wa_data-kostl.    "Validate Cost Center
          concatenate  wa_data-ac_info+16(4) c_00  into wa_data-saknr.    "validate to Sap GL Account
    *-- Convert Cost center into internal format
          call function 'CONVERSION_EXIT_ALPHA_INPUT'
            exporting
              input  = wa_data-kostl
            importing
              output = wa_data-kostl.
    *-- Convert G/L Account into internal format
          call function 'CONVERSION_EXIT_ALPHA_INPUT'
            exporting
              input  = wa_data-saknr
            importing
              output = wa_data-saknr.
          append wa_data to it_data.
        endif.
      endwhile.
      close dataset p_file.
      if ( sy-subrc ne 0 ).
        message e005.
      endif.
      sort it_data ascending   by sc_code .
    endform.                    " GET_FILE_DATA
    *&      Form  validate_data                                            *
          text                                                           *
    form validate_data .
    *-- If input file contains data, create STR in SAP
      if ( it_data[] is initial ).
    Error message
      message e002.
      endif.
    Extract material data for validation
      select matnr                                                   "Material Number
             from mara
             into table it_mara
             for all entries in it_data
             where matnr = it_data-stock_item.
    Extract Storage location data for validation
      select lgort                                                   "Storage Location
             from t001l
             into table it_lgort
             for all entries in it_data
             where werks =    c_3000 and
                   lgort = it_data-sc_code.
    Extract SAP Fund IDs
      select fincode                                                 "Fund
             from  fmfincode
             into table  it_fincode
             for all entries in it_data
             where  fikrs = c_pur_org
               and  fincode = it_data-fincode.
    Extract SAP Function Area
      select fkber                                                   "Functional Area
             from  tfkb
             into table    it_fkber
             for all entries in it_data
             where fkber = it_data-fkber.
    Extract SAP Cost Center
      select kostl                                                   "Cost Center
             from csks
             into table it_kostl
             for all entries in it_data
             where kokrs =  c_pur_org
             and kostl =  it_data-kostl
             and datbi >= sy-datum
             and datab <= sy-datum.
    Extract SAP G/L Account
      select saknr                                                   "G/L Account Number
             from ska1
             into table   it_saknr
             for all entries in it_data
             where ktopl =  c_gl_ac
               and saknr =  it_data-saknr.
    Extract SAP Business Area
      select gsber                                                   "Bussiness Area
             from tgsb
             into  table    it_gsber
             for all entries in it_data
             where gsber = it_data-gsber.
    Validate uploaded material and storage location data
      sort   it_mara    by matnr.                                    "Material Number
      sort   it_lgort   by lgort.                                    "Storage Location
      sort   it_fincode by fincode.                                  "Fund
      sort   it_fkber   by fkber.                                    "Functional Area
      sort   it_kostl   by kostl.                                    "Cost Center
      sort   it_saknr   by saknr.                                    "G/L Account Number
      sort   it_gsber   by gsber.                                    "Bussiness Area
      loop at it_data into wa_data.
    Validate Material number
        read table it_mara into wa_mara with key matnr = wa_data-stock_item
                                            binary search.
        if sy-subrc ne 0.
          perform update_error_log using wa_data
                                         text-001.
        endif.
    Validate Storage location ( School Code )
        read table it_lgort into wa_lgort with key lgort = wa_data-sc_code.
        if sy-subrc ne 0.
          perform update_error_log using wa_data
                                         text-002.
        endif.
    Validate  Sap fund
        read table it_fincode into wa_fincode with key  fincode = it_data-fincode
                                      binary search.
        if sy-subrc ne 0.
          perform update_error_log using wa_data
                                         text-003.
        endif.
    Validate  Functional Area
        read table   it_fkber into wa_fkber with key fkber = it_data-fkber
                                        binary search.
        if sy-subrc ne 0.
          perform update_error_log using wa_data
                                         text-004.
        endif.
    Validate  Cost Center
        read table it_kostl into wa_kostl with key kostl = it_data-kostl
                                        binary search.
        if sy-subrc ne 0.
          perform update_error_log using wa_data
                                         text-005.
        endif.
    Validate G/L Account Number
        read table   it_saknr into wa_saknr with key saknr = it_data-saknr
                                        binary search.
        if sy-subrc ne 0.
          perform update_error_log using wa_data
                                         text-006.
        endif.
    Validate to Bussiness  Area
        read table    it_gsber  into wa_gsber with key gsber = it_data-gsber
                                        binary search.
        if sy-subrc ne 0.
          perform update_error_log using wa_data
                                         text-007.
        endif.
      endloop.
    endform.                    " VALIDATE_DATA
    *&      Form  REQUISITION_CREATE
          text
    -->  p1        text
    <--  p2        text
    form requisition_create .
      if c_flag ne c_x.
        call function 'BAPI_REQUISITION_CREATE'
    exporting
        SKIP_ITEMS_WITH_ERROR                =
       automatic_source                        =    c_x
         importing
           number                              =    g_reqstno
          tables
           requisition_items                   =    it_item
           requisition_account_assignment      =    it_atasg
           requisition_item_text               =    it_ittxt
           REQUISITION_LIMITS                =
           REQUISITION_CONTRACT_LIMITS       =
           REQUISITION_SERVICES              =
           REQUISITION_SRV_ACCASS_VALUES     =
           return                              =    it_return.
           REQUISITION_SERVICES_TEXT         =
           REQUISITION_ADDRDELIVERY          =
           EXTENSIONIN                       =
        if g_reqstno is not initial.
          call function 'BAPI_TRANSACTION_COMMIT'
           exporting
             wait   =     c_x
      IMPORTING
        RETURN        =
        endif.
        read table it_return into wa_return with key type = 'E'.
        if sy-subrc eq 0.
          write: / wa_return-message.
        else.
          write: / g_reqstno.
        endif.
      endif.
    endform.                    " REQUISITION_CREATE
    *&      Form  display_log
          text
    WRITE: text-011,p_file.
    LOOP AT it_log INTO wa_log.
       WRITE : /  wa_log-sc_code, wa_log-stock_item, wa_log-quantity, sy-datum, sy-uzeit, wa_log-err_msg.
    ENDLOOP.
    *ENDFORM.                    " DISPLAY_LOG
    *&      Form  UPDATE_ERROR_LOG
          text
         -->P_WA_DATA  text
         -->P_TEXT_001  text
    To display Error Message
    form update_error_log  using    p_data     type  ty_data
                                    p_errmsg.
      clear : wa_log.
    *CONCATENATE wa_log-sc_code wa_log-course wa_log-stock_item   wa_log-quantity   wa_log-ac_info into g_err SEPARATED BY c_coma.
      wa_log-sc_code       = p_data-sc_code.                        "School Code
      wa_log-course        = p_data-course.                         "Course
      wa_log-stock_item    = p_data-stock_item.                     "Stock Item Number
      wa_log-quantity      = p_data-quantity.                       "Quantity
      wa_log-ac_info       = p_data-ac_info.                        "Account Information
      wa_log-err_msg       = p_errmsg.                                 "Error Message
      concatenate wa_log-sc_code wa_log-course wa_log-stock_item   wa_log-quantity
                                      wa_log-ac_info into g_err separated by c_coma.
      append wa_log to it_log.
    endform.                    " UPDATE_ERROR_LOG
    *&      Form  CREATE_STR
          text
    -->  p1        text
    <--  p2        text
    form create_str .
      sort it_data by sc_code.
      loop at it_data into wa_data.
        clear : wa_bapiebanc, wa_bapiebkn, wa_bapiebantx.
        at new sc_code.
          refresh : it_item,it_atasg,it_ittxt.
          clear   : g_itmcnt.
        endat.
    *-- Count of Item lines per school code
        g_itmcnt = g_itmcnt + c_one.
        wa_bapiebanc-doc_type    = c_pr_type.                  "purchase requisition documentation type
        wa_bapiebanc-item_cat    = c_item_cat.                 "ITEM CATEGORY
        wa_bapiebanc-acctasscat  = c_ac_asign.                 "Account Assignment Category
        wa_bapiebanc-material    = wa_data-stock_item.         "Material number
        wa_bapiebanc-suppl_plnt  = c_3000.                     "supplying plant
        wa_bapiebanc-pur_group   = c_pur_grp.                  "purchase Group
        wa_bapiebanc-purch_org   = c_pur_org.                  "Purchase Organisation
        wa_bapiebanc-unit        = c_unit.                     "Unit of measure
        wa_bapiebanc-plant       = c_r_plant.                 "receiving plant
        wa_bapiebanc-deliv_date  = sy-datum + 7.               "Delivary date
        append wa_bapiebanc to it_item.
        wa_bapiebkn-fund      =  it_data-fincode.              "SAP Fund
        wa_bapiebkn-func_area =  it_data-fkber.                "Functional Area
        wa_bapiebkn-bus_area  =  it_data-gsber .               "Business Area
        wa_bapiebkn-cost_ctr  =  it_data-kostl.                "Cost Center
        wa_bapiebkn-g_l_acct  =  it_data-saknr .               "G/L Account
        append wa_bapiebkn to   it_atasg .
        wa_bapiebantx-text_line =  wa_data-course.
        append wa_bapiebantx to it_ittxt.
    *-- If item line count per school code is 98, call BAPI to create STR/PR
        if ( g_itmcnt = c_98 ).
          perform requisition_create.
          refresh : it_item,it_atasg,it_ittxt.
          clear   : g_itmcnt.
          continue.
        endif.
    *-- At end of school code, call BAPI to create STR/PR
        at end of sc_code.
          perform requisition_create.
        endat.
      endloop.
    endform.                    " CREATE_STR
    *&      Form  DEFAULT_APP_SERVER_FILE
          text
    -->  p1        text
    <--  p2        text
    form default_app_server_file .
      call function 'ZCCA_DEFAULT_APP_SERVER_FILE'
        exporting
         module               = c_module
         dev_type             = c_dev_type
         movement             = c_movement
          object_id            = c_object_id
      FILE_EXTENSION       = 'TXT'
       importing
         serverfile           = p_file .
      concatenate p_file c_object_id '_' sy-datum sy-uzeit into
                                                          p_file.
    endform.                    " DEFAULT_APP_SERVER_FILE

    wa_bapiebanc-doc_type = c_pr_type. "purchase requisition documentation type
    wa_bapiebanc-item_cat = c_item_cat. "ITEM CATEGORY
    wa_bapiebanc-acctasscat = c_ac_asign. "Account Assignment Category
    wa_bapiebanc-material = wa_data-stock_item. "Material number
    wa_bapiebanc-suppl_plnt = c_3000. "supplying plant
    wa_bapiebanc-pur_group = c_pur_grp. "purchase Group
    wa_bapiebanc-purch_org = c_pur_org. "Purchase Organisation
    wa_bapiebanc-unit = c_unit. "Unit of measure
    wa_bapiebanc-plant = c_r_plant. "receiving plant
    wa_bapiebanc-deliv_date = sy-datum + 7. "Delivary date
    ***************************************************8
    here pass wa_bapiebanc-CREATE_IND= '1'.
    append wa_bapiebanc to it_item.
    note
    Short Text
         Creation Indicator (Purchase Requisition/Schedule Lines)
    Definition
         Shows whether the purchase requisition or delivery schedule line was
         created manually or automatically (e.g. as a result of the requirements
         planning process).
         In the case of delivery schedules created under scheduling agreements,
         if schedule lines with different creation indicators are consolidated to
         form a release schedule line, the creation indicator remains "blank".

  • ABAP programming standards for SELECT...ORDER BY....

    I recently saw a set of programming standards that stated it was better not to use an ORDER BY clause on a SELECT statement. Instead SELECT into an internal table and use SORT. The actual statement was....."In most cases it is preferable to do the sorting within the ABAP program instead of on the database server.  That means: fill the internal table via a SELECT statement and then sort via the SORT statement instead of coding a SELECT u2026 ORDER BY.  The sorting of large amounts of data on the database server affects the performance of all users on the system, whereas the sorting within the ABAP program u2018onlyu2019 affects the application server.  However, if an index exists on the table that can be used for the sorting then the SELECT u2026 ORDER BY doesnu2019t cause any undue strains on the system."
    I think this is no longer correct particularily with regards to Systemi/iSeries which we normally run in 2 tier mode.
    What are people opinion on this?

    Peter,
    the correct answer for DB2 on IBM i is "it depends". To implement "ORDER BY", the optimizer has basically these choices:
    - If an index with the columns of the "ORDER BY" clause exists, the database can access the data through this index, which returns them in the desired order. However, the data needs to be fetched row by row, so for each returned row you need one I/O request.
    - If such an index does not exist, the database can choose to perform a sequential read into a temporary storage and sort the temporary result set before returning the data to the caller. This is basically the same as reading the data into an internal table and let ABAP do the sort. Even if an index exist, reading the whole table into memory and sorting it there may be faster, because on a sequential read, the database can execute a "blocked" fetch rather than many individual I/O operations. You may see this if the table is relatively small.
    - If such an index does not exist, the database could also choose to create a temporary index and access the data through the temporary index. For the first execution, you don't gain much, but subsequent executions may perform much better. However, after an IPL you loose all temporary indexes, so the index needs to be built again on the first execution after the IPL.
    If you code your ABAP to read the table sequentially and sort it in memory, you are forcing the second implementation. If you code ABAP with the ORDER BY in the SELECT statement, you allow the database optimizer to choose the best possible implementation depending on the size of the table, the size of the result set, and the available indexes.
    If your table is relatively large but the result set (based on the WHERE clause) is relatively small, make sure to have an index that combines the WHERE clause elements returning only one value with the ORDER BY clause elements.
    For example, if you have a query like:
    SELECT * FROM T
    WHERE A = ? AND B = ? AND C IN (?, ?, ?)
    ORDER BY D, E
    you should have an index over columns A, B, D, and E for the best possible performance. A and B in the index can be used to limit the result set without any influence on the sort order D, E, but C cannot.
    Kind regards,
    Christian Bartels.

  • Problem i  report

    hi SDNs,
    i have problem with my report..
    thing is : in my selection-screen, there are screen elements like : werks, storage location, budat, material...etc.,
    if i give matnr,werks ,lgort, and date : the report is giving correct result. where as if i don't give storage location the output is giving less records...
    where could be the problem? can any one help me out??
    its very urgent...
    thanking you,
    Ramakrishna S

    hi all,
    my report:
    in this <b>zmmr_stockdetails_variables</b>  is include. this is after this code:
    INCLUDE: DATA DECLARATION / SELECTION-SCREEN / INITIALIZATION / SCREEN EVENTS
    include zmmr_stockdetails_variables .
    START-OF-SELECTION
    start-of-selection.
      perform fr_start_of_selection.
    *&      Form  fr_start_of_selection
    form fr_start_of_selection .
      data:   lt_doc   type  tt_doc,
              lt_ser03 type  tt_ser03,
              lt_objk  type  tt_objk,
              lt_final type  tt_final,
              lt_ftp   type  tt_ftp,
              lt_equi  type  tt_equi,
              lt_doc_temp type tt_doc_temp.
      perform fr_get_material_doc_data changing lt_doc
                                                lt_doc_temp
                                                lt_ser03
                                                lt_objk
                                                lt_equi.
      if ( lt_doc[] is not initial ) and ( lt_objk[] is not initial ).
        perform fr_final_output_data using    lt_objk
                                              lt_doc
                                              lt_doc_temp
                                     changing lt_final
                                              lt_ftp.
      endif.
      if p_ftp = 'X' and ( lt_ftp is not initial ).
    *--Send data to FTP
        perform ftp_data using lt_ftp.
      elseif ( lt_final is not initial ).
    *--Display data in ALV with SUBTOTAL
        perform fr_display_data using lt_final.
      elseif ( lt_final is initial ).
    *--Display NO DATA
        perform fr_display_no_data .
      endif.
    endform.                    " fr_start_of_selection
    *&      Form  fr_get_material_doc_data
    form fr_get_material_doc_data  changing lt_doc      type tt_doc
                                            lt_doc_temp type tt_doc_temp
                                            lt_ser03    type tt_ser03
                                            lt_objk     type tt_objk
                                            lt_equi     type tt_equi.
      data : lw_doc    type tw_doc,
             lw_doc_temp type tw_doc_temp,
             lw_ser03  type tw_ser03,
             lw_objk   type tw_objk,
             lw_objk1  type tw_objk,
             lt_objk1  type tt_objk,
             lw_equi   type tw_equi.
      if p_ftp = 'X'.
        if s_cpudt is initial.
          s_cpudt-sign = 'I'.
          s_cpudt-option = 'EQ'.
          s_cpudt-low = sy-datum - 1.
          append s_cpudt.
        endif.
      endif.
    IF s_lgort[] IS NOT INITIAL.
       SELECT  a~mblnr
               a~mjahr
               a~zeile
               a~bwart
               a~matnr
               a~werks
               a~lgort
               a~shkzg
               a~bwtar
               a~ebeln
               a~ps_psp_pnr
               b~budat
               a~equnr                                         "MOD-001
          FROM mseg AS a JOIN mkpf AS b
          ON  amblnr = bmblnr AND
              amjahr = bmjahr
          INTO TABLE lt_doc
          WHERE a~matnr IN s_matnr AND
                a~sobkz IN s_sobkz AND
                a~werks EQ p_werks AND
                a~lgort IN s_lgort AND
                a~bwtar IN s_bwtar AND
                b~budat IN s_budat AND
                b~cpudt IN s_cpudt AND
                a~bwart IN s_bwart .
    ELSE.
      select  a~mblnr
              a~mjahr
              a~zeile
              a~bwart
              a~matnr
              a~werks
              a~lgort
              a~shkzg
              a~bwtar
              a~ebeln
              a~ps_psp_pnr
              b~budat
              a~equnr                                           "MOD-001
         from mseg as a join mkpf as b
         on  amblnr = bmblnr and
             amjahr = bmjahr
         into table lt_doc
         where a~matnr in s_matnr and
               a~sobkz in s_sobkz and
               a~werks eq p_werks and
               a~lgort in s_lgort and
               a~bwtar in s_bwtar and
               b~budat in s_budat and
               b~cpudt in s_cpudt and
               a~bwart in s_bwart .
    ENDIF.
      if ( lt_doc[] is not initial ).
        select obknr
               mblnr
               mjahr
               zeile
               bwart
               datum
               uzeit
               anzsn
               werk
               lagerort
          from ser03
          into table lt_ser03
          for all entries in lt_doc
          where mblnr = lt_doc-mblnr    and
                mjahr = lt_doc-mjahr    and
                zeile = lt_doc-zeile    and
                werk  = lt_doc-werks    and
                lagerort = lt_doc-lgort .
      endif.
      if ( lt_ser03[] is not initial ).
        select obknr
               equnr
               sernr
               matnr
          from objk
          into table lt_objk1
          for all entries in lt_ser03
          where obknr = lt_ser03-obknr and
                matnr in s_matnr.
      endif.
      if ( lt_objk1[] is not initial ).
        select  equnr from equi
                into table lt_equi
                for all entries in lt_objk1
                where equnr = lt_objk1-equnr and
                      matnr = lt_objk1-matnr and
                      eqtyp in s_eqtyp.
      endif.
      sort lt_objk1 by obknr equnr.
      sort lt_equi  by equnr.
    *-Append all data to OBJK for the EQNR
      loop at lt_objk1 into lw_objk1.
        read table  lt_equi into lw_equi with key equnr = lw_objk1-equnr.
        if sy-subrc eq 0.
          append lw_objk1 to lt_objk.
          clear: lw_objk1, lw_equi.
        endif.
      endloop.
    *-Modify LT_DOC with Object list number(OBKNR) from SER03
      loop at lt_ser03 into lw_ser03.
        read table lt_doc into lw_doc with key  mblnr = lw_ser03-mblnr
                                                zeile = lw_ser03-zeile
                                                mjahr = lw_ser03-mjahr.
        if ( sy-subrc = 0 ) and ( lw_ser03-obknr is not initial ).
          lw_doc-obknr = lw_ser03-obknr.
          lw_doc-datum = lw_ser03-datum.
          lw_doc-uzeit = lw_ser03-uzeit.
          modify lt_doc from lw_doc transporting obknr datum uzeit where mblnr = lw_ser03-mblnr and
                                                                         zeile = lw_ser03-zeile and
                                                                         mjahr = lw_ser03-mjahr."#EC *
        endif.
        clear: lw_doc, lw_ser03.
      endloop.
    *-Modify LT_DOC_TEMP with (MBLNR / SERNR / BWART / TIME ) from SER03
      sort lt_objk by obknr.
      loop at lt_objk into lw_objk.
        read table lt_ser03 into lw_ser03 with key obknr = lw_objk-obknr.
        if ( sy-subrc = 0 ) .
          lw_doc_temp-mblnr = lw_ser03-mblnr.
          lw_doc_temp-mjahr = lw_ser03-mjahr.
          lw_doc_temp-sernr = lw_objk-sernr.
          lw_doc_temp-bwart = lw_ser03-bwart.
          lw_doc_temp-datum = lw_ser03-datum.
          lw_doc_temp-uzeit = lw_ser03-uzeit.
          lw_doc_temp-werk  = lw_ser03-werk.
          lw_doc_temp-plant = lw_ser03-lagerort.
          append lw_doc_temp to lt_doc_temp .
          clear: lw_doc_temp, lw_ser03, lw_objk .
        endif.
      endloop.
      sort lt_doc_temp by sernr.
    *--If EXTRA entries deleted as per LATEST DOC, then Comment this below line.
      delete adjacent duplicates from lt_doc_temp comparing sernr.
    *--End of - If EXTRA entries deleted as per LATEST DOC, then Comment this line.
    *Delete itab where OBKNR is initial.
      delete lt_doc[] where obknr = ' '.
      sort lt_doc[] by matnr werks.
      loop at lt_doc into lw_doc.
        if ( lw_doc-werks is not initial ).
          select name1
                 up to 1 rows
                 into lw_doc-name1
                 from t001w
                 where werks = lw_doc-werks.
          endselect.
        endif.
        if ( lw_doc-matnr is not initial ).
          select maktx
                 up to 1 rows
                 into lw_doc-maktx
                 from makt
                 where matnr = lw_doc-matnr.
          endselect.
        endif.
        if ( lw_doc-werks is not initial ) and
           ( lw_doc-lgort is not initial ).
          select agency
                 up to 1 rows
                 into lw_doc-agency
                 from zcrmtosap
                 where werks = lw_doc-werks and
                       lgort = lw_doc-lgort.
          endselect.
        endif.
        if ( lw_doc-name1 is not initial ) or ( lw_doc-maktx is not initial ) or
           ( lw_doc-agency is not initial ).
          modify lt_doc from lw_doc transporting name1 maktx agency ."#EC *
        endif.
        clear: lw_doc.
      endloop.
      sort lt_objk[] by obknr equnr.
    endform.                    " fr_get_data_from_mseg
    *&      Form  fr_final_output_data
    form fr_final_output_data using    lt_objk  type tt_objk
                                       lt_doc   type tt_doc
                                       lt_doc_temp type tt_doc_temp
                             changing  lt_final type tt_final
                                       lt_ftp   type tt_ftp.
      data :   lw_doc         type tw_doc,
               lw_doc_temp    type tw_doc_temp,
               lw_objk        type tw_objk,
               lw_final       type tw_final,
               lt_final_temp  type tt_final,
               lw_ftp         type tw_ftp,
               lf_mblnr       type mblnr,
               lf_sernr       type gernr,
               lf_final_sernr type gernr,
               lf_final_matnr type matnr,
               lf_doc_sernr   type gernr,
               lf_doc_matnr   type matnr,
               lf_bwart       type bwart,
               lf_count       type i,
               lf_mjahr       type mjahr,
               lf_maktx       type maktx,
               lf_budat       type budat,
               lf_uzeit       type uzeit,
               lf_ebeln       type bstnr,
               lf_werks       type werks_d,
               lf_name1       type name1,
               lf_lgort       type lgort_d,
               lf_shkzg       type shkzg,
               lf_agency      type sgtxt,
               lf_zeile       type mblpo,
               lf_obknr       type objknr,
               lf_bwtar       type bwtar,
               lf_psp         type ps_psp_pnr.
      sort lt_doc[]  by obknr.
      sort lt_objk[] by obknr.
    *-append FINAL table with all fields from OBJK / SER03 tables
      loop at lt_objk into lw_objk.
        read table lt_doc into lw_doc with key obknr = lw_objk-obknr.
        if sy-subrc = 0.
          lw_final-matnr       =    lw_doc-matnr.
          lw_final-sernr       =    lw_objk-sernr.
          lw_final-budat       =    lw_doc-budat.
          lw_final-uzeit       =    lw_doc-uzeit.
          lw_final-ebeln       =    lw_doc-ebeln.
          lw_final-werks       =    lw_doc-werks.
          lw_final-lgort       =    lw_doc-lgort.
          lw_final-mblnr       =    lw_doc-mblnr.
          lw_final-zeile       =    lw_doc-zeile.
          lw_final-obknr       =    lw_objk-obknr.
          lw_final-bwtar       =    lw_doc-bwtar.
          lw_final-ps_psp_pnr  =    lw_doc-ps_psp_pnr.
          lw_final-name1       =    lw_doc-name1.
          lw_final-maktx       =    lw_doc-maktx.
          lw_final-agency      =    lw_doc-agency.
          lw_final-bwart       =    lw_doc-bwart.
          lw_final-count       =    '1'.
          append lw_final to lt_final.
          clear: lw_final, lw_doc.
        endif.
      endloop.
    *-Modify FINAL table with Year / Debit-Credit Indicator
      if ( lt_final[] is not initial ) .
        loop at lt_final into lw_final.
          read table lt_doc into lw_doc with key mblnr = lw_final-mblnr
                                                 zeile = lw_final-zeile.
          if sy-subrc = 0.
            lw_final-mjahr = lw_doc-mjahr.
            lw_final-shkzg = lw_doc-shkzg.
            if ( lw_final-mjahr is not initial ) or ( lw_final-shkzg is not initial ).
              modify lt_final from lw_final transporting mjahr shkzg.
            endif.
            clear: lw_final, lw_doc.
          endif.
        endloop.
    *-Modify lt_doc FROM final table w.r.t ESN number
        loop at lt_doc into lw_doc.
          read table lt_final into lw_final with key mblnr = lw_doc-mblnr.
          if sy-subrc = 0.
            lw_doc-sernr = lw_final-sernr.
            if ( lw_doc-sernr is not initial ).
              modify lt_doc from lw_doc transporting sernr.
            endif.
            clear: lw_doc, lw_final.
          endif.
        endloop.
    *--Remove Preceding ZEROS from SERNR of LT_FINAL
        loop at lt_final into lw_final.
          clear: lf_final_sernr.
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = lw_final-sernr
            importing
              output = lf_final_sernr.
          if ( lf_final_sernr is not initial ).
            lw_final-sernr = lf_final_sernr.
            modify lt_final from lw_final transporting sernr.
            clear: lw_final-sernr.
          endif.
    *--Remove Preceding ZEROS from MATNR of LT_FINAL
          clear: lf_final_matnr.
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = lw_final-matnr
            importing
              output = lf_final_matnr.
          if ( lf_final_matnr is not initial ).
            lw_final-matnr = lf_final_matnr.
            modify lt_final from lw_final transporting matnr.
            clear: lw_final-matnr.
          endif.
        endloop.
    *--Remove Preceding ZEROS from SERNR of LT_DOC
        loop at lt_doc into lw_doc.
          clear: lf_doc_sernr.
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = lw_doc-sernr
            importing
              output = lf_doc_sernr.
          if ( lf_doc_sernr is not initial ).
            lw_doc-sernr = lf_doc_sernr .
            modify lt_doc from lw_doc transporting sernr.
            clear: lw_doc-sernr.
          endif.
    *--Remove Preceding ZEROS from MATNR of LT_DOC
          clear: lf_doc_matnr.
          call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
            exporting
              input  = lw_doc-matnr
            importing
              output = lf_doc_matnr.
          if ( lf_doc_matnr is not initial ).
            lw_doc-matnr = lf_doc_matnr.
            modify lt_doc from lw_doc transporting matnr.
            clear: lw_doc-matnr.
          endif.
        endloop.
    *For given ESN select the first Material Document (Latest Document) from the sorted list,
    *check for the Movement type of that document and if the Movement type falls in any of
    *the following then remove the ESN and its Material Documents.
    *Movement types for which ESN needs to be deleted: 102,201,221,261,351,502,562,601,Y52,Z52
    *Consider the Debit / Credit Indicator (MSEG_SHKZG)= 'S' (ignore H) for the following
    *Movement Types. 311, 312, 313, 314, 352, 411, 412, 415, 416.
        sort lt_final[] descending by shkzg sernr budat uzeit  mblnr." MOD-01
        sort lt_doc[]   by bwart.
        loop at lt_final into lw_final.
          lf_sernr = lw_final-sernr.
          lf_mblnr = lw_final-mblnr.
          lf_budat = lw_final-budat.
          lf_uzeit = lw_final-uzeit.
          lf_ebeln = lw_final-ebeln.
          lf_werks = lw_final-werks.
          lf_name1 = lw_final-name1.
          lf_lgort = lw_final-lgort.
          lf_shkzg = lw_final-shkzg.
          lf_agency = lw_final-agency.
          lf_zeile = lw_final-zeile.
          lf_obknr = lw_final-obknr.
          lf_bwart = lw_final-bwart.
          lf_bwtar = lw_final-bwtar.
          lf_psp   = lw_final-ps_psp_pnr.
          lf_count = lw_final-count.
    *-For given ESN select the first Material Document (Latest Document)
          at new sernr.
            read table lt_doc into lw_doc with key mblnr = lf_mblnr
                                                   lgort = lf_lgort.
            if sy-subrc = 0.
              move lf_mblnr to lw_final-mblnr.
              move lf_sernr to lw_final-sernr.
              move lf_budat to lw_final-budat.
              move lf_uzeit to lw_final-uzeit.
              move lf_ebeln to lw_final-ebeln.
              move lf_werks to lw_final-werks.
              move lf_name1 to lw_final-name1.
              move lf_lgort to lw_final-lgort.
              move lf_shkzg to lw_final-shkzg.
              move lf_agency to lw_final-agency.
              move lf_zeile to lw_final-zeile.
              move lf_obknr to lw_final-obknr.
              move lf_bwart to lw_final-bwart.
              move lf_bwtar to lw_final-bwtar.
              move lf_psp   to lw_final-ps_psp_pnr.
              move lf_count to lw_final-count.
              append lw_final to lt_final_temp.
              clear: lw_final, lf_mblnr, lf_sernr, lf_budat, lf_ebeln, lf_werks, lf_name1, lf_shkzg,
                     lf_lgort, lf_agency, lf_zeile, lf_obknr, lf_bwart, lf_bwtar, lf_psp, lf_count.
            endif.
          endat.
        endloop.
        refresh: lt_final[].
        lt_final[] = lt_final_temp[].
        refresh: lt_final_temp[].
        if ( lt_final[] is not initial ) .
          sort lt_final[] by bwart.
    *Movement types for which ESN needs to be deleted: 102,201,221,261,351,502,562,601,Y52,Z52
          delete lt_final[] where ( ( bwart = '102' ) or ( bwart = '201' ) or ( bwart = '221' ) or
                                    ( bwart = '261' ) or ( bwart = '351' ) or ( bwart = '452' ) or
                                    ( bwart = '502' ) or ( bwart = '562' ) or ( bwart = '601' ) or
                                    ( bwart = 'Y52' ) or ( bwart = 'Z52' ) ).
          if ( lt_final[] is not initial ) .
    *Consider the Debit / Credit Indicator (MSEG_SHKZG)= 'S' (ignore H) for the following
    *Movement Types. 311, 312, 313, 314, 352, 411, 412, 415, 416.
            sort lt_final[] by bwart shkzg.
            delete lt_final[] where ( bwart = '311' and shkzg = 'H' ) or
                                    ( bwart = '312' and shkzg = 'H' ) or
                                    ( bwart = '313' and shkzg = 'H' ) or
                                    ( bwart = '314' and shkzg = 'H' ) or
                                    ( bwart = '352' and shkzg = 'H' ) or
                                    ( bwart = '411' and shkzg = 'H' ) or
                                    ( bwart = '412' and shkzg = 'H' ) or
                                    ( bwart = '415' and shkzg = 'H' ) or
                                    ( bwart = '416' and shkzg = 'H' ).
          endif.
        endif.
    *==================================================================================================
    *START OF MOD-01
    *Delete EXTRA entries, when the SAME ESN number is appearing for different MBLNR / Storage Location.
        sort lt_final by budat descending.
        sort lt_final by sernr .
        delete adjacent duplicates from lt_final comparing sernr.
        loop at lt_final into lw_final.
          clear lf_final_sernr.
          call function 'CONVERSION_EXIT_ALPHA_INPUT'
            exporting
              input  = lw_final-sernr
            importing
              output = lf_final_sernr.
          clear : lf_lgort, lf_werks.
          select  b_werk
                 into lf_werks
                 from eqbs
                 where equnr = lf_final_sernr .
            if sy-subrc = 0 .
            if ( lf_werks ne p_werks ).
              delete lt_final.
              endif.
            endif.
          endselect.
          if sy-subrc <> 0.
            delete lt_final.
          endif.
        endloop.
        if s_lgort[] is not initial.
          loop at lt_final into lw_final.
            clear lf_lgort.
            select b_lager
                   into lf_lgort
                   from eqbs
                   where equnr = lf_final_sernr .
              if ( lf_lgort not in s_lgort ) .
                delete lt_final.
              endif.
            endselect.
            if sy-subrc <> 0.
              delete lt_final.
            endif.
          endloop.
        endif.
        if s_budat[] is not initial.
          delete lt_final where budat not in s_budat.
        endif.
    *END OF MOD-01
    *============================================================================
        loop at lt_final into lw_final.
          concatenate lw_final-matnr ',' into lw_ftp-matnr.
          concatenate lw_final-sernr ',' into lw_ftp-sernr.
          concatenate lw_final-budat ',' into lw_ftp-budat.
          concatenate lw_final-ebeln ',' into lw_ftp-ebeln.
          concatenate lw_final-werks ',' into lw_ftp-werks.
          concatenate lw_final-lgort ',' into lw_ftp-lgort.
          concatenate lw_final-mblnr ',' into lw_ftp-mblnr.
          concatenate lw_final-bwtar ',' into lw_ftp-bwtar.
          concatenate lw_final-bwart ',' into lw_ftp-bwart.
          call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
            exporting
              input  = lw_final-ps_psp_pnr
            importing
              output = lw_ftp-ps_psp_pnr.
          concatenate lw_final-name1  ',' into lw_ftp-name1.
          concatenate lw_final-maktx  ',' into lw_ftp-maktx.
          concatenate lw_final-agency ',' into lw_ftp-agency.
          append lw_ftp to lt_ftp.
          x = x + 1.
          clear: lw_ftp, lw_final .
        endloop.
        sort lt_final[] descending by budat.
      endif.
    endform.                    " fr_final_output_data
    *&      Form  display_data
    form fr_display_data using lt_final type tt_final .
      data: lt_fieldcat type slis_t_fieldcat_alv.
      gf_repid = sy-repid.
      perform e01_fieldcat_init  changing lt_fieldcat[].
      perform eventtab_build     changing gt_events.
      perform e04_comment_build  using gt_list_top_of_page[].
      perform display_report     using lt_final
                                       lt_fieldcat.
    endform.                    " display_data
    *&      Form  e01_fieldcat_init
    form e01_fieldcat_init changing lt_fieldcat type slis_t_fieldcat_alv.
      data: ls_fieldcat type slis_fieldcat_alv,
            ls_sort     type slis_sortinfo_alv.                 "#EC *
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'MATNR'.
      ls_fieldcat-ref_fieldname  = 'MATNR'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'EKPO'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '1'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'MAKTX'.
      ls_fieldcat-ref_fieldname  = 'MAKTX'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'MAKT'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '2'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'SERNR'.
      ls_fieldcat-ref_fieldname  = 'SERNR'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'OBJK'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '3'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'BUDAT'.
      ls_fieldcat-ref_fieldname  = 'BUDAT'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'MKPF'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '4'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'EBELN'.
      ls_fieldcat-ref_fieldname  = 'EBELN'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'EKPO'.
      ls_fieldcat-key            = ' '.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '5'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'WERKS'.
      ls_fieldcat-ref_fieldname  = 'WERKS'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'MSEG'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '6'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'LGORT'.
      ls_fieldcat-ref_fieldname  = 'LGORT'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'MSEG'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '7'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'NAME1'.
      ls_fieldcat-ref_fieldname  = 'NAME1'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'T001W'.
      ls_fieldcat-seltext_l      = 'Plant Desc'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '8'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'AGENCY'.
      ls_fieldcat-ref_fieldname  = 'AGENCY'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'ZCRMTOSAP'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '9'.
      ls_fieldcat-seltext_l      = 'Dealer code'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'MBLNR'.
      ls_fieldcat-ref_fieldname  = 'MBLNR'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'MSEG'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '10'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'BWART'.
      ls_fieldcat-ref_fieldname  = 'BWART'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'MSEG'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '11'.
      ls_fieldcat-seltext_l      = 'Movement Type'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'BWTAR'.
      ls_fieldcat-ref_fieldname  = 'BWTAR'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'MSEG'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '12'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'PS_PSP_PNR'.
      ls_fieldcat-ref_fieldname  = 'PS_PSP_PNR'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-ref_tabname    = 'MSEG'.
      ls_fieldcat-no_out         = ' '.
      ls_fieldcat-col_pos        = '13'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname      = 'COUNT'.
      ls_fieldcat-tabname        = 'LT_FINAL'.
      ls_fieldcat-do_sum = 'X'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_sort.
      ls_sort-fieldname         = 'LGORT'.
      ls_sort-tabname           = 'LT_FINAL'.
      ls_sort-subtot            = 'X'.
      append ls_sort to gt_sort.
    endform.                    "E01_FIELDCAT_INIT
    *&      Form  e04_comment_build
    form e04_comment_build using e04_lt_top_of_page type slis_t_listheader.
      data : v_time(10) type c,                                 "#EC *
             ls_line type slis_listheader,
             v_text(50) type c,
             v_date_low(10)  type c,
             v_date_high(10)  type c.
      write s_budat-low to v_date_low.
      write s_budat-high to v_date_high.
      if v_date_low = '00.00.0000'.
        v_date_low = '01.01.0000'.
      endif.
      if v_date_high = '00.00.0000'.
        v_date_high = '31.12.9999'.
      endif.
      if s_eqtyp = 'IEQC' or s_eqtyp = 'IEQD'.
        concatenate 'RCV Stocks between' v_date_low 'and' v_date_high
        into v_text separated by space.
      elseif s_eqtyp = 'IEQE' or s_eqtyp = 'IEQF'.
        concatenate 'ESN Stocks between' v_date_low 'and' v_date_high
        into v_text separated by space.
      else.
        concatenate 'Stocks between' v_date_low 'and' v_date_high
         into v_text separated by space.
      endif.
      clear ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = v_text.
      append ls_line to e04_lt_top_of_page.
    endform.                    " e04_comment_build
          FORM TOP_OF_PAGE                                              *
    form top_of_page.                                           "#EC CALLED
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary = gt_list_top_of_page.
    endform   .                    "TOP_OF_PAGE
    *&      Form  display_report
    form display_report using lt_final    type tt_final
                              lt_fieldcat type slis_t_fieldcat_alv.
      data: lw_fieldcatalog  type slis_fieldcat_alv,
            lf_tabix type sy-tabix.
      loop at lt_fieldcat into lw_fieldcatalog.
        lf_tabix = sy-tabix.
        if lw_fieldcatalog-fieldname = 'LGORT'.
          lw_fieldcatalog-do_sum     = 'X'.
    X_fieldcatalog-CHECKBOX   = 'X'.
    X_FIELDCATALOG-INPUT      = 'X'.
        endif.
        modify lt_fieldcat  from lw_fieldcatalog index lf_tabix.
      endloop.
    POPULATE LAYOUT STRUCTURE
      gs_layout-subtotals_text = 'TOTAL'.
      gs_layout-totals_text    = 'GRAND TOTAL'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_background_id         = 'ALV_BACKGROUND'
          i_callback_program      = gf_repid
         i_callback_pf_status_set = 'PF_STATUS'
          i_callback_user_command = 'USER_COMMAND'
          i_structure_name        = 'ITAB_FINAL'
          is_layout               = gs_layout
          it_fieldcat             = lt_fieldcat[]
          it_special_groups       = gt_sp_group[]
          it_sort                 = gt_sort[]
          it_filter               = gt_filter[]
          i_save                  = gf_save
          is_variant              = gf_variant
          it_events               = gt_events[]
          is_print                = gs_print
          it_alv_graphics         = gt_alv_graphics[]
          it_excluding            = gt_excluding
        tables
          t_outtab                = lt_final.
    endform.                    " display_report
    *&      Form  USER_COMMAND
    form user_command using g_ucomm type sy-ucomm
                            g_field type slis_selfield.         "#EC *
      case g_ucomm.
        when '&IC1'.
          message e009(zmmabap).
      endcase.
    endform.                    "USER_COMMAND
    *&      Form  eventtab_build
    form eventtab_build changing lt_events type slis_t_event.
      constants:
      gc_formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
        exporting
          i_list_type = 0
        importing
          et_events   = lt_events.
      read table lt_events with key name = slis_ev_top_of_page
      into ls_event.
      if sy-subrc = 0.
        move gc_formname_top_of_page to ls_event-form.
        append ls_event to lt_events.
      endif.
    endform.                    "eventtab_build
    *&      Form  ftp_data
          text
    form ftp_data using lt_ftp type tt_ftp.
      data: e_file type rlgrap-filename,                        "#EC *
          duser(64) TYPE c VALUE 'biftp',
          dpwd(64) TYPE c VALUE 'biftp',
          dhost(64) TYPE c VALUE '172.17.7.70',
            dfile(256) type c, " VALUE 'FWP_Stocks.txt',
            dest type rfcdes-rfcdest value 'SAPFTP'.
      concatenate 'FWP_Data_' s_budat-low '_' s_budat-high '.txt' into dfile.
      data:   dhdl type i,
              blob_length type i,
              mi_key type i value 26101957,
              mi_pwd_len type i,
              mi_handle type i,                                 "#EC *
              lf_fnam_sour type gf_fnam_sour,
              lf_p_mail type gf_p_mail,
              lf_msg type gf_msg,
              lf_command type gf_command.
    *download the file..
    IF IT_FTP[] IS NOT INITIAL.
      call 'AB_RFC_X_SCRAMBLE_STRING'
             id 'SOURCE' field dpwd id 'KEY' field mi_key
             id 'SCR' field 'X' id 'DESTINATION' field dpwd
             id 'DSTLEN' field mi_pwd_len.
      call function 'FTP_CONNECT'
        exporting
          user            = duser
          password        = dpwd
          host            = dhost
          rfc_destination = dest
        importing
          handle          = dhdl.
      blob_length = x * 208.
      call function 'FTP_R3_TO_SERVER'
        exporting
          handle         = dhdl
          fname          = dfile
          blob_length    = blob_length
          character_mode = ' '
        tables
          blob           = lt_ftp
        exceptions
          tcpip_error    = 1
          command_error  = 2
          data_error     = 3
          others         = 4.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
        with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
        lf_fnam_sour = x.
        lf_p_mail = '[email protected]'.
        concatenate text-013 lf_fnam_sour lf_msg into lf_msg separated by space.
        concatenate 'echo "' lf_msg '" | mailx -s "SAP feed file is placed on ftp"'
        into lf_command.
        concatenate lf_command lf_p_mail into lf_command separated by space.
        condense lf_command.
        perform uxcmd using lf_command.
        write : 'FTP DONE ) !!! '.
       ENDIF.
    Disconnect
        call function 'FTP_DISCONNECT'
          exporting
            handle = dhdl.
      endif.
      clear : lf_fnam_sour ,
              lf_p_mail ,
              lf_msg ,
              lf_command .
    endform.                    " ftp_data
    *&      Form  uxcmd
    form uxcmd  using  p_command.                               "#EC *
      "issue UNIX wa_command by calling system function.
      data: begin of itab occurs 0,                             "#EC *
             line(255),
            end of itab.
      call 'SYSTEM' id 'COMMAND' field  p_command
                    id 'TAB'     field  itab-sys.
    endform.                    " uxcmd
    *&      Form  fr_display_no_data
    form fr_display_no_data .
      skip 1.
      write: /2  'No relevant data Exists for the following Selection.'.
    endform.                    " fr_display_no_data
    <b>
    include zmmr_stockdetails_variables .
    ***************************************</b>
    TYPE POOLS
    type-pools: slis.
    STRUCTURES
    types:  begin of tw_doc,      "MSEG
             mblnr type mblnr,
             mjahr type mjahr,
             zeile type mblpo,
             bwart type bwart,
             matnr type matnr,
             werks type werks_d,
             lgort type lgort_d,
             shkzg type shkzg,
             bwtar type bwtar_d,
             ebeln type bstnr,
             ps_psp_pnr type ps_psp_pnr,
             budat type budat,
             equnr type equnr,
             sernr type gernr,
             obknr type objknr,
             datum type datum,
             uzeit type uzeit,
             name1 type name1,
             maktx type maktx,
             agency type sgtxt,
            end of tw_doc,
            tt_doc type standard table of tw_doc,
            begin of tw_doc_temp,      "MSEG
             mblnr type mblnr,
             mjahr type mjahr,
             sernr type gernr,
             bwart type bwart,
             datum type datum,
             uzeit type uzeit,
             werk  type werks_d,
             plant type lgort_d,
            end of tw_doc_temp,
            tt_doc_temp type standard table of tw_doc_temp,
            begin of tw_ser03,                                  "SER03
              obknr type objknr,
              mblnr type mblnr,
              mjahr type mjahr,
              zeile type mblpo,
              bwart type bwart,
              datum type datum,
              uzeit type uzeit,
              anzsn type anzsn,
              werk  type werks_d,
              lagerort type lgort_d,
            end of tw_ser03,
            tt_ser03 type standard table of tw_ser03,
            begin of tw_objk ,        "OBJK
              obknr type objknr,
              equnr type equnr,
              sernr type gernr,
              matnr type matnr,
            end of tw_objk,
            tt_objk type standard table of tw_objk,
            begin of tw_equi,          "EQUI
              equnr type equnr,
            end of tw_equi,
            tt_equi type standard table of tw_equi,
            begin of tw_final ,
              equnr type equnr, "-------change
              matnr type matnr,
              mjahr type mjahr,
              maktx type maktx,
              sernr type gernr,
              budat type budat,
              uzeit type uzeit,
              ebeln type bstnr,
              werks type werks_d,
              name1 type name1,
              lgort type lgort_d,
              shkzg type shkzg,
              agency type sgtxt,
              mblnr type mblnr,
              zeile type mblpo,
              obknr type objknr,
              bwart type bwart,
              bwtar type bwtar_d,
              ps_psp_pnr type ps_psp_pnr,
              count type i,
            end of tw_final,
            tt_final type standard table of tw_final,

Maybe you are looking for