Preload flag

Hello Experts..
I am fairly new to HANA and so my question might seem pretty naive. Nevertheless here goes..
I read in one of the HANA related documents related to save point, backup restore etc... that tables can be configured to be 'preload'. So that after a restart, tables with the 'preload' flag set will be loaded with data first. And then depending on what table is called next, the data is loaded. How do we set the 'preload' flag in from the IMCS?
Please let me know. Thanks in advance.
Regards,
Prince

Hi Prince,
The answer to your question is deeply hidden in the [SQL Reference Guide|https://service.sap.com/~sapidb/011000358700000604922011], section ALTER TABLE
--Juergen

Similar Messages

  • How to prevent the insertion of rollover code when using a template

    Hi there
    I am designing a site in Dreamweaver using templates. These templates use rollover images. The code that DW uses for the rollover I have abstracted out into a separate javascript file, which is linked to in the header. Further, I am using window.onload() to call the preloader instead of the <body> onload event. All this works fine.
    The problem is that every time I make a change to the template, DW re-inserts the rollover code into the head of the HTML file, and reinserts the preloader code into the <body> tag.
    Now, I have found a solution to the <body> tag problem by changing the preload flag from 1 to 0 in the link created; it seems that DW uses this flag as in indication of whether to insert the onload code into the boday tag.  So that part is fixed.
    But I can't find any way to keep DW from inserting the unecessary and redundant rollover code into the head of the generated HTML files.  Is there a way I can prevent this from happening?
    ...Mike  

    Just don't externalize your js until the very last step before publishing.
    You can let the dev team know about this here -
    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • Whats up with the Preloader?

    Im having trouble compiling my Preloader properly?
    This is what ive done:
    1) Unzipped StrobeMediaPlayback_1.5-full.zip to a folder called SMP
    2) Loaded Preloader and StrobeMediaPlayer projects into FlashBuilder
    Changed Config::Logging false for both projects
    3) Changed the path for OSMF.swc to SMP\src\framework\OSMF\bin\OSMF.swc for both projects
    4) In the StrobeMediaPlayer Project I navigated to:
         src > org.osmf > player > configuration and modified JavaScriptBridge.as and added to line 237
         exposeProperty(strobeMediaPlayback.configuration, "hdAvailable", true);
         src > org.osmf > player > configuration and modified PlayerConfiguration.as and added to line 131
         public var hdAvailable:String = "false";
    5) In Preloader Project I modified Preloader.as and added some custom business rules and created a new parameters object to inject a new src file on the fly as well as inject a new parameter called hdAvailable.
    6) Built StrobeMediaPlayer Project
    7) Built Preloader Project
    When I navigated to SMP\src\samples\preloader\bin and inspect the contents I find:
    Preloader.html
    Preloader.swf
    swfobject
    I click on Preloader.html and the swf runs okay.
    But when I copy the three files to a another location say to my desktop, the swf does not load.  I just get the background color showing.  Why is that?
    Shouldn't I be able to copy the Preloader.swf to wherever I like and have it just run ... ?
    Regards,
    Rob

    Hi Siliviu,
    > Usually, SMP and the preloader are compiled with the default build flag -use-network=true. This will prevent access to the local file system.
    Okay thanks.
    I uploaded to my webserver:
    - Preloader.swf (357kb)
    - SwfObject.js
    - Preloader.html
    And everything worked correctly :-)
    Where or how do I set -use-network=true??
    I tried this in my compile arguments:
    -define CONFIG::LOGGING false -define CONFIG::FLASH_10_1 true -use-network=false
    but it didn't work? Is my declaration correct Siliviu?
    Regards,
    Rob

  • Preloading SWFs

    I have a project which, due to the large number of PNG files,
    I have broken up into several smaller SWFs. I have so far
    successfully managed to get them all to play in sequence using the
    Load External Movieclip behaviour on the last frame of
    each, so that it starts playing the first SWF and then
    successively loads the next and then the next.
    Now the problem: this project is NOT for playback on the
    Internet, but rather will be used as a presentation. So I assumed
    that using the Load External Movieclip would give smooth playback
    as I don't have to take bandwidth into account.
    However, each time a new Movieclip has to load, there is a
    lag... if it is playing off a CD-ROM, the CD starts spinning again,
    if it is on the local hard drive the lag is less but still
    noticeable.
    So how can I avoid this? Do I need to make a preloader for
    this? Or can I put some ActionScript in the first movie which will
    preload all the subsequent SWFs without needing to make a
    preloader/progress bar?
    And please in any answers, be as obtuse as possible... I'm
    very, very new with AS!
    Cheers
    Rabaab

    "Rabaab_m" <[email protected]> wrote in
    message news:e4kf2b$hh$[email protected]..
    > However, each time a new Movieclip has to load, there is
    a lag... if it is
    > playing off a CD-ROM, the CD starts spinning again, if
    it is on the local hard
    > drive the lag is less but still noticeable.
    >
    > So how can I avoid this? Do I need to make a preloader
    for this? Or can I
    > put some ActionScript in the first movie which will
    preload all the subsequent
    > SWFs without needing to make a preloader/progress bar?
    >
    > And please in any answers, be as obtuse as possible...
    I'm very, very new with
    > AS!
    >
    > Cheers
    > Rabaab
    Under those conditions you can load everything right in the
    beginning and just wait for everything to load up. That puts all
    the
    loading lag up front in one lump without spreading the lag
    through the whole presentation. Since it's loading locally you
    don't
    have to worry about the wait.
    Since you would be loading everything, you don't want
    everything to show, just parts of it. To do that you can either set
    visibility to off for movieclips that you load into or
    position out of view or the option that I like.. Make all the
    external swfs
    have a blank frame 1 and a stop command. When you want to
    hide them, move them to frame 1. When you want to show them, move
    them
    to frame 2 and play. Each swf can have it's own preloader
    that does nothing more than set a flag variable to notify the main
    swf
    that it is loaded.
    Details if you need it.
    tralfaz

  • Problem with Preloader in my Flash AS2 Game

    I have been using this tutorial to make a preloader:
    http://www.republicofcode.com/tutori.../preloader_bc/
    I have run into one problem though.
    When I simulate the download, it just shows the background color of the game while it loads, and when it finished loading, it shows the loading screen fully loaded. I have followed the tutorial exactly, except added my file names into the AS2 code.
    Here is the ActionScript in Frame 1 I have for the preloader:
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    stopAndGoto(1);
    preloaderBar._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    loaderTxt.text=Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";
    Any hints or answers to what i'm doing wrong?
    Thanks, MrA615.

    Your description of what you've done and the code you show does not match what the tutorial says to do and what code to use... (there is no stopAndGoTo() function in Flash).
    Right-click the second frame on the upper layer labeled Actions and select Actions. Copy and paste the code below to make our preloader functional.
    if (_root.getBytesTotal() != _root.getBytesLoaded()){
    gotoAndPlay(1);
    bar_mc._xscale=(_root.getBytesLoaded()/_root.getBytesTotal())*100;
    loader_txt.text=Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";

  • How to get flagged messages in to tasks or alternatively view another users to do list.

    If someone could just help me out I would be extremely appreciative.
    2 of us work in one mail box together called admin. when one of us is away we like to use the flags to create follow ups for each other on certain email items.
    Firstly, I can only see my main accounts to do list
    Secondly, when I flag a contact / message / anything in fact, in any mailbox it only appears in their respective to do lists and not in their tasks. Thus I cannot see what I have flagged for them at a glance as I can not find a way to view other peoples
    to do list. i.e. neither of us can see any of the flags in the shared mailbox we use (admin) unless we log in under a different profile, which is troublesome as it takes way to long to switch back and forth.
    I presently use colour categories to delegate who is currently in charge of answering certain emails and use custom flags to note what we are waiting for in particular to a certain email and then mark a tick when it has been dealt with. Simple system but
    not currently working in full due to the follow up flags not appearing in tasks.
    This also affects my task synching on my mobile where once again it only shows what is in tasks... i.e stuff I have physically typed in outlook rather than flagged content; mails, contacts etc.
    Any ideas how to get the follow up flags appearing in tasks or an ability to see other peoples to do lists... the first is more preferable but I will take what I can.
    Kindest Regards
    Woody

    Just add the 'admin' mailbox as additional account in Outlook, as opposed to additional mailbox (i.e. don't add it from Accounts Settings -> More settings -> Advanced, but from File -> Add account instead).
    It will then show flagged items and tasks from all accounts in the 'To-do' list.

  • Creation of PO item without Flag IR_IND

    Hi Experts,
    I need a soloution for the following problem. We have the necessary creating puchase order items with value 0. In this case, the purchase order get the status "Held". The reason is the flag IR_IND. I had try to delete the flag in BADI "BBP_DOC_CHANGE_BADI" but at this time the flag is not set.
    Thank you in advance.
    Best regards
    Dirk

    Hi Dirk,
    You can actually use the BADI BBP_CREATE_PO_BACK to change the flag value before filling the PO Craetion BAPI interface parameters
    Sangeeta

  • Derive found flag in SQL with where clause using TABLE(CAST function

    Dear All,
    Stored procedure listEmployees
    ==========================
    CREATE OR REPLACE TYPE STRING_ARRAY AS VARRAY(8000) OF VARCHAR2(15);
    empIdList STRING_ARRAY
    countriesList STRING_ARRAY
    SELECT EMP_ID, EMP_COUNTRY, EMP_NAME, FOUND_FLAG_
    FROM EMPLOYEE WHERE
    EMP_ID IN
    (SELECT * FROM TABLE(CAST(empIdList AS STRING_ARRAY))
    AND EMP_COUNTRY IN
    (SELECT * FROM TABLE(CAST(countriesList AS STRING_ARRAY))
    =================
    I have a stored procedure which lists the employees using above simple query.
    Here I am using table CAST function to find the list of employees in one go
    instead of looping through each and every employee
    Everything fine until requirements forced me to get the FOUND_FLAG as well.
    Now I wanted derive the FOUND_FLAG by using rownum, rowid, decode functions
    but I was not successful
    Can you please suggest if there is any intelligent way to say weather the
    row is found for given parameters in the where clause?
    If not I may have to loop through each set of empIdList, countriesList
    and find the values individually just to set a flag. In this approach I can’t use
    the TABLE CAST function which is efficient I suppose.
    Note that query STRING_ARRAY is an VARRAY. It is very big in size and this procedure
    suppose to handle large sets of data.
    Thanks In advance
    Regards
    Charan
    Edited by: kmcharan on 03-Dec-2009 09:55
    Edited by: kmcharan on 03-Dec-2009 09:55

    If your query returns results, you have found them... so your "FOUND" flag might be a constant,...

  • Flag de NFe impressa no monitor

    Bom dia!
    Pessoal,
    ao analisar os campos do monitor, verifiquei que o campo Imprimida fica em branco, mesmo que a nota ja tenha sido impressa.
    Verifiquei que esse campo fica na tabela j_1bnfe_active e não é o mesmo campo que esta na J_1BNFDOC-PRINTD.
    Portanto depois de ser autorizada e impressa, ao consultar a nota na J1B3N é possivel ver o flag assinalado, enquanto no monitor fica em branco.
    Alguem ja passou por essa situação?
    Porque esse campo não é atualizado.
    Estou usando a 6.0 SP. Ja apliquei todas as notas com xx-csc-br-nfe que estavam disponiveis na SAP. Portanto acho que o sistema está no ultimo nivel de atualização.
    Agradeço imensamente qualquer dica ou informação sobre esse assunto.
    Att
    Márcia Verro

    Boa tarde!
    Fernando
    inclui o comando conforme sua orientação. Veja codigo abaixo.
    Mas não funcionou.
    O monitor ainda não mostra que a nota foi impressa.
    Esse flag não deveria ser atualizado no mesmo momento em que o flag da J_1BNFDOC é atualizado?
    grata
    Márcia Verro
    METHOD if_ex_cl_nfe_print~call_rsnast00.
      DATA vl_prnter TYPE RSPONAME.
      IF      i_active-code EQ '100'.         "NF-e autorizada
        AND i_active-printd IS INITIAL     "só imprimir automaticamente se ainda não foi impressa
        AND i_active-cancel IS INITIAL     "não faz sentido imprimir autom. se ela foi cancelada
        AND i_active-conting_s IS INITIAL. "não faz sentido imprimir autom. se ela foi alternada p/conting.
        "pois deverá ser cancelada
        SELECT SINGLE prnter
          INTO vl_prnter
          FROM j_1bb2
          WHERE bukrs = i_active-bukrs
            AND branch = i_active-branch
            AND form = i_active-form.
        IF vl_prnter IS INITIAL.
          vl_prnter = 'LOCL'.
        ENDIF.
        CALL FUNCTION 'J_1BNFE_CALL_RSNAST00'
          EXPORTING
            i_active   = i_active
            i_printer  = vl_prnter
          EXCEPTIONS
            no_printer = 1
            OTHERS     = 3.
        COMMIT WORK.
        IF sy-subrc <> 0.
          CALL FUNCTION 'J_1B_NFE_ERROR_PROTOKOLL'
            EXPORTING
              i_docnum = i_active-docnum.
        ENDIF.
      ENDIF.

  • HSDIO conditionally fetch hardware compare sample errors (script trigger to flag whether or not to wait for software trigger)

    I am moderately new to Labview and definitely new to the HSDIO platform, so my apologies if this is either impossible or silly!
    I am working on a system that consists of multiple PXI-6548 modules that are synchronized using T-CLK and I am using hardware compare.  The issue I have is that I need to be able to capture ALL the failing sample error locations from the hardware compare fetch VI... By ALL I mean potentially many, many more fails than the 4094 sample error depth present on the modules.
    My strategy has been to break up a large waveform into several subsets that are no larger than 4094 samples (to guarantee that I can't overflow the error FIFO) and then fetch the errors for each block.  After the fetch is complete I send a software reference trigger that is subsequently exported to a scriptTrigger that tells the hardware it is OK to proceed (I do this because my fetch routine is in a while loop and Labview says that the "repeated capbility has not yet been defined" if I try to use a software script trigger in a loop).
    This works fine, but it is also conceivable that I could have 0 errors in 4094 samples.  In such a case what I would like to do is to skip the fetching of the hardware compare errors (since there aren't any) and immediately begin the generation of the next block of the waveform.  That is, skip the time where I have to wait for a software trigger.
    I tried to do this by exporting the sample error event to a PFI and looping that PFI back in to generate a script trigger.  What I thought would happen was that the script trigger would get asserted (and stay asserted) if there was ever a sample error in a block, then I could clear the script trigger in my script.  However, in debug I ended up exporting this script trigger back out again and saw that it was only lasting for a few hundred nanoseconds (in a case where there was only 1 injected sample error)... The sample error event shows up as a 1-sample wide pulse.
    So, my question is this:  is there a way to set a flag to indicate that at least one sample error occurred in a given block  that will persist until I clear it in my script?  What I want to do is below...
    generate wfmA subset (0, 4094)
    if scriptTrigger1
      clear scriptTrigger1
      wait until scriptTrigger0
    end 
    clear scriptTrigger0
    generate wfmA subset (4094, 4094)
    I want scriptTrigger1 to be asserted only if there was a sample error in any block of 4094 and it needs to stay asserted until it is cleared in the script.  scriptTrigger0 is the software trigger that will be sent only if a fetch is performed.  Again, the goal being that if there were no sample errors in a block, the waiting for scriptTrigger0 will not occur.
    I am probably going about it all wrong (obviously since it doesn't work), so any help would be much appreciated!

    Please disregard most of my previous post... after some more debug work today I have been able to achieve the desired effect at slower frequencies.  I did straighten out my script too:
    generate wfmA
    if scriptTrigger1
      clear scriptTrigger0
      wait until scriptTrigger0
    end if
    generate wfmA
    scriptTrigger1 = sample error event flag
    scriptTrigger0 = software trigger (finished fetching error backlog in SW)
    However, I am still having a related issue.
    I am exporting the Sample Error Event to a PFI line, looping that back in on another PFI line, and having the incoming version of the Sample Error Event generate a script trigger.  My stimulus has a single injected sample error for debug. For additional debug I am exporting the script trigger to yet another PFI; I have the sample error event PFI and the script trigger PFI hooked up to a scope.
    If I run the sample clock rate less than ~133MHz everything works... I can see the sample error event pulse high for one clock period and the script trigger stays around until it is consumed by my script's if statement.
    Once I go faster than that I am seeing that the script trigger catches the sample error event occasionally.  The faster I go, the less often it is caught.  If I widen out the error to be 2 samples wide then it will work every time even at 200MHz.
    I have tried PFI0-3 and the PXI lines as the output terminal for the sample error event and they all have the same result (this implies the load from the scope isn't the cause).
    I don't know what else to try?  I can't over sample my waveform because I need to run a true 200MHz. I don't see anything that would give me any other control over the sample error event in terms of its pulsewidth or how to export it directly to a script trigger instead of how I'm doing it.
    Any other ideas?

  • Help with a preloader in AS3

    Hi,
    I upload a website and I have problems with the preloader did it in AS3. It starts after two or three minutes. I have a MC with an animation of 100 frames and the dynamic text of the percent. The preloader is located in the 1 frame to the 10, I mean, first frame with the actions and the other three layers (text, MC and background) with a lenght of 10. The movie has 525 frames. Here is the code:
    stop();
    addEventListener(Event.ENTER_FRAME, lodeando);
    function lodeando(event:Event):void
              var bytesTotales = stage.loaderInfo.bytesTotal;
              var bytesCargados = stage.loaderInfo.bytesLoaded;
              var porcentaje = Math.round(bytesCargados * 100 / bytesTotales);
              textoPorcentaje.text = porcentaje + "% Cargados";
              cargaAnimada_mc.gotoAndStop(porcentaje);
              if (bytesCargados == bytesTotales)
                        removeEventListener(Event.ENTER_FRAME, lodeando);
                        gotoAndPlay(2);
                        textoPorcentaje.text = "";
                        removeChild(textoPorcentaje);
                        removeChild(cargaAnimada_mc);
    Please, Could you help me?.

    These screen captures show the library of the movie. As you can see I export the most of them. However I have doubts about if I must convert to symbol the graphics. I have the preloader in the "presentación" folder without any exportation.
    Please, Could you correct the website?. Please, tell me an e-mail address and I send you the website via WeTransfer.

  • When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....

    When I try open a .pdf file my Adobe Reader 11 only allows the download / save opening the related window and don't show me both options 1) open with ... and 2) save as.... probably someone flagged the choise... always perform this way ....
    Could some one give help and let me know where I can probably find the settings option that allows me to change and switch to previous situation where it was possible to decide time to time how to proceed either opening the file or saving it ??
    Thanks in advance
    David

    What is your operating system?
    Open a PDF from where?  If online, in what browser?

  • Reporting Flag is not visible in the manage screen

    Hi BI Experts, Good morning.
    We load the inventory data daily in the night time which is delta load.
    5 days back, we got 0 records and the request is in red.Then i rerun the infopackage manually and got the total records in to the cube.
    From that day onwards its running successfully.
    Yesterday i deleted the bad request from infocube.
    But the Reporting flag is not visible.
    Today i didnot get the records.
    Please can anyone tell me the process.
    Thanks in advance.
    Regards
    Anjali

    Hi Nagesh,
    Still i am not getting reporting flag.
    I tried what did u say.
    And today i did not get the records. Infopackages didnot run. It shows in red.
    I tried to run it manually but it gives error.
    The error message is:
    Short text
        An exception occurred that was not caught.
    What happened?
        The exception 'CX_RSR_X_MESSAGE' was raised, but it was not caught anywhere
         along
        the call hierarchy.
        Since exceptions represent error situations and this error was not
        adequately responded to, the running ABAP program 'SAPLRRMS' has to be
        terminated.
    Please give me the reply.
    Thanks in advance
    Regards
    Anjali

  • Key figure flag in the planning layout

    Hi,
    Can anyone explain the importance of the key figure flag in the planning layout?
    Regds
    Pavan.

    Hi Arun and  Zegion,
    Thank you for your responses.
    Arun, I do not have any aggregates on the cube. I changed the aggregate properties of the Key Figure from SUM to Minimum. this has solved my problem temporarily.
    the reason I am saying temporarily because this is a SAP delivered InfoObject. This is for the datasource 0CO_PC_PCP_01. When I read through the documents, it said, SUMMation for Aggregation and Last value for "Exception Aggregation" will display the value of KF as the last value and does not add them up.
    Since this wasn't the happening in my query, I changed the Aggregation from SUM to Minimum.
    Regards,
    S.P

  • Problem :ALV:Deletion Flags not showing in output

    hi all !
    I have a alv program which displays customer data.there are three deletion flags columns in the output.
    First deletion flag will be: KNA1-LOEVM
    Second deletion flag will be: KNB1-LOEVM
    Third deletion flag will be: KNVV-LOEVM
    earlier all three were showing.but now no one is showing.i'm pasting my code here if any expert can have a look and find out the BUG.
    CODE STARTS----
    report zqsdcap_cust.
    INCLUDE DECLARATIONS
    include:
      ziabapcapph_macros.                   "Holcim Useful Macros
    TABLE DECLARATIONS
    tables:
      tvko,                                "Org. Unit: Sales Organizations
      t001,                                "Company codes
      kna1,                                "Customer Master
      knvv,                                "Customer master sales
      knvi,                                "Customer tax classificat'n
      knb1,                                "Customer master company code
         <<CR003-DEVK949538 start ins
      adr6.                                "SMTP numbers
         <<CR003-DEVK949538 end ins
    TYPE DECLARATIONS
    type-pools:
      slis.
    STRUCTURE DECLARATIONS
    Define structure for keep data in ALV list
    data: begin of gs_output_list,
            vkorg   like  knvv-vkorg,                "Sales organization
            ktokd   like  kna1-ktokd,                "Customer A/C grp
            kunnr   like  kna1-kunnr,                "Customer number
            vtweg   like  knvv-vtweg,                "Distribution channel
            name1   like  kna1-name1,                           "Name1
            name3   like  kna1-name3,                           "Name3
            name4   like  kna1-name4,                           "Name4
            stras   like  kna1-stras,                "Street
            cityc   like  kna1-cityc,                "City
            bezei1  like  t005h-bezei,               "Sales office
            land1   like  kna1-land1,                "Country
            regio   like  kna1-regio,                "Region
            bezei2  like  t005u-bezei,               "Region decription
            kdgrp   like  knvv-kdgrp,                "Customer group
            ktext   like  t151t-ktext,               "Cust grp name
            bzirk   like  knvv-bzirk,                "Sales district
            bztxt   like  t171t-bztxt,               "Description
            zterm   like  knvv-zterm,                "Payment term
            lzone   like  kna1-lzone,                "Transport zone
            vtext   like  tzont-vtext,               "Description
            erdat   like  kna1-erdat,                "Creation date
          end of gs_output_list.
    Internal table for customer tax data
    data: begin of gs_output_tax,
            vkorg  like  knvv-vkorg,                 "Sales organization
            kunnr  like  kna1-kunnr,                 "Customer number
            vtweg  like  knvv-vtweg,                 "Distribution channel
            name1  like  kna1-name1,                            "Name1
            name3  like  kna1-name3,                            "Name3
            name4  like  kna1-name4,                            "Name4
            ort01  like  kna1-ort01,                 "City
            stcd1  like  kna1-stcd1,                 "STD code
            spart  like  knvv-spart,                 "Division
            taxkd  like  knvi-taxkd,                 "Tax classific'n
            tatyp  like  knvi-tatyp,                 "Tax category
            vtext  like  tskdt-vtext,                "Tax description
          end of gs_output_tax.
    Internal table for HVL customer master
    data: begin of gs_output_hvl,
            kunnr  like  kna1-kunnr,                 "Customer number
            stceg  like  kna1-stceg,                 "VAT registration no
            telfx  like  kna1-telfx,                 "Fax number
            telf1  like  kna1-telf1,                 "First telephone number
            stras  like  kna1-stras,                 "House number and stret
            ort02  like  kna1-ort02,                 "District
            cityc  like  kna1-cityc,                 "City code
            bezei  like  t005h-bezei,                "City description
            regio  like  kna1-regio,                 "Region
            ort01  like  kna1-ort01,                 "City
            name2  like  kna1-name2,                            "Name2
            name1  like  kna1-name1,                            "Name1
            bzirk  like  knvv-bzirk,                 "Sales district
            spart  like  knvv-spart,                 "Division
            vtweg  like  knvv-vtweg,                 "Distribution channel
            vkorg  like  knvv-vkorg,                 "Sales organization
          end of gs_output_hvl.
    Internal table for customer database CRM
    data: begin of gs_output_crm,
            vkorg      like  knvv-vkorg,             "Sales organization
            vtweg      like  knvv-vtweg,             "Distribution channel
            bzirk      like  knvv-bzirk,             "Sales district
            kunnr      like  kna1-kunnr,             "Customer number
            name1      like  kna1-name1,                        "Name1
            name2      like  kna1-name2,                        "Name2
            stras      like  kna1-stras,             "House number street
            ort01      like  kna1-ort01,             "City
            ort02      like  kna1-ort02,             "District
            pstlz      like  kna1-pstlz,             "Postal code
            cityc      like  kna1-cityc,             "City code
            telf1      like  kna1-telf1,             "First telephone number
            telfx      like  kna1-telfx,             "Fax number
            vkbur      like  knvv-vkbur,             "Sales office
            regio      like  kna1-regio,             "Region
            vkgrp      like  knvv-vkgrp,             "Sales group
            kdgrp      like  knvv-kdgrp,             "Customer group
            kvgr3      like  knvv-kvgr3,             "Customer group 3
            altkn      like  knb1-altkn,             "Previous record number
            erdat      like  knvv-erdat,             "Creation date
            found_dat  like  zcrm_bp_ext-found_dat,  "Found date
          <<CR000-DEVK943142 start del
          versg      like  knvv-versg,             "Customer statistic grp
          bukrs      like  knb1-bukrs,             "Company code
          <<CR000-DEVK943142 end del
          end of gs_output_crm.
    Internal table for customer information
    data: begin of gs_output_info,
            kunnr           like  kna1-kunnr,        "Customer number
            vkorg           like  knvv-vkorg,        "Sales organization
            vtweg           like  knvv-vtweg,        "Distribution channel
            stcd2           like  kna1-stcd2,        "Tax code
            name1           like  kna1-name1,        "Name1
            name2           like  kna1-name2,        "Name2
          <<CR002-DEVK944835 start ins
            name3           like  kna1-name3,        "Name3
          <<CR002-DEVK944835 end ins
            stras           like  kna1-stras,        "House number street
            ort01           like  kna1-ort01,        "City
            ort02           like  kna1-ort02,        "District
            pstlz           like  kna1-pstlz,        "Postal code
            regio           like  kna1-regio,        "Region
            land1           like  kna1-land1,        "Country code
            cityc           like  kna1-cityc,        "City code
            telf1           like  kna1-telf1,        "First telephone number
            telfx           like  kna1-telfx,        "Fax number
          <<CR001-DEVK944239 start ins
            bzirk           like  knvv-bzirk,        "Sales District
            vkbur           like  knvv-vkbur,        "Sales Office
            kdgrp           like  knvv-kdgrp,        "Customer group
          <<CR001-DEVK944239 end ins
            vkgrp           like  knvv-vkgrp,        "Sales group
            kvgr3           like  knvv-kvgr3,        "Customer group 3
            versg           like  knvv-versg,        "Customer stat grp
            kdkg2           like  kna1-kdkg2,        "Customer condition gp2
            kdkg1           like  kna1-kdkg1,        "Customer condition gp1
          <<CR001-DEVK944239 start del
          kdgrp           like  knvv-kdgrp,        "Customer group
          <<CR001-DEVK944239 end del
            altkn           like  knb1-altkn,        "Previous record#
            erdat           like  knvv-erdat,        "Creation date
            note_text(200)  type  c,                 "<<CR003-DEVK949538 ins
            smtp_addr       like  adr6-smtp_addr,    "<<CR003-DEVK949538 ins
            loevm1          like  kna1-loevm,        "Deletion flag all
            loevm2          like  knb1-loevm,        "Deletion flag Cd
            loevm3          like  knvv-loevm,        "Deletion flag sal
          end of gs_output_info.
    ALV Grid Declaration
    data:
      gs_fieldcat             type  slis_fieldcat_alv,
      gs_layout               type  slis_layout_alv,
      gs_event                type  slis_t_event,
      gs_variant              like  disvariant,
      gs_sort_info            type  slis_sortinfo_alv,
      gs_exit_caused_by_user  type  slis_exit_by_user,
      gs_tabname              type  slis_tabname,
      gs_header               type  slis_entry.
    INTERNAL TABLE DECLARATIONS
    Define internal table for keep data in ALV list
    data:
      gt_output_list       like  table of gs_output_list,
      gt_output_tax        like  table of gs_output_tax,
      gt_output_hvl        like  table of gs_output_hvl,
      gt_output_crm        like  table of gs_output_crm,
      gt_output_info       like  table of gs_output_info,
    <<CR003-DEVK949538 start ins
      gv_text              like  tline occurs 0 with header line,
    <<CR003-DEVK949538 start ins
    ALV Grid Declaration
      gt_fieldcat           type  slis_t_fieldcat_alv,
      gt_list_top_of_page   type  slis_t_listheader,
      gt_list_top_of_page2  type  slis_t_listheader,
      gt_sort_info          type  slis_t_sortinfo_alv.
    VARIABLE DECLARATIONS
    data:
    ALV Grid Declaration
      gv_save,
      gv_exit_caused_by_caller,
      gv_repid         type  sy-repid,
      gv_user_command  type  slis_formname value 'USER_COMMAND',
      gv_top_of_page   type  slis_formname value 'TOP_OF_PAGE',
      gv_top_of_list   type  slis_formname value 'TOP_OF_LIST',
      gv_end_of_list   type  slis_formname value 'END_OF_LIST',
      lv_store         like  thead-tdname,           "<<CR003-DEVK949538 ins
      lv_id            like  thead-tdid,             "<<CR003-DEVK949538 ins
      lv_lines         type  i.                      "<<CR003-DEVK949538 ins
    SELECTION SCREEN DECLARATIONS
    Define selection-screen of query
    selection-screen: begin of block blk with frame title text-001.
    select-options:   s_vkorg  for   knvv-vkorg           "Sales org
                                     obligatory
                                     memory id vko,
                      s_bzirk  for   knvv-bzirk,          "Sales district
                      s_vtweg  for   knvv-vtweg,          "Dist channel
                      s_spart  for   knvv-spart           "Division
                                     default 'CM',
                      s_taxkd  for   knvi-taxkd,          "Tax classific'n
                      s_kunnr  for   kna1-kunnr,          "Customer number
                      s_regio  for   kna1-regio,          "Region
                      s_kdgrp  for   knvv-kdgrp,          "Customer group
                      s_vkgrp  for   knvv-vkgrp,          "Sales group
                      s_vkbur  for   knvv-vkbur,          "Sales office
                      s_lzone  for   kna1-lzone,          "Zone
                      s_erdat  for   kna1-erdat,          "Creation date
                      s_zuawa  for   knb1-zuawa,          "Key for sorting
                      s_ktokd  for   kna1-ktokd,          "Customer A/C grp
                      s_altkn  for   knb1-altkn,          "Previous rec no
                      s_bukrs  for   knb1-bukrs           "Company code
                                     obligatory
                                     memory id buk,
                     s_loevm1 for   kna1-loevm,          "Deletion flag all
                     s_loevm2 for   knb1-loevm,          "Deletion flag Cd
                     s_loevm3 for   knvv-loevm.          "Deletion flag sal
    selection-screen: end of block blk.
    selection-screen: begin of block b2 with frame title text-002.
    parameters:       pr_cust1  radiobutton group a1
                                default 'X'
                                user-command bkg,
                      pr_cust2  radiobutton group a1,
                      pr_cust3  radiobutton group a1,
                      pr_cust4  radiobutton group a1,
                      pr_cust5  radiobutton group a1.
    selection-screen: end of block b2.
    AT SELECTION-SCREEN ON S_VKORG
    at selection-screen on s_vkorg.
      select  vkorg
        into  tvko-vkorg
        from  tvko
       where  vkorg in s_vkorg.
      authorization check for sales org.
        authority-check object 'V_VBRK_VKO'
                            id 'VKORG' field tvko-vkorg
                            id 'ACTVT' field '03'.
        check sy-subrc ne 0.
        message e002(zgen) with 'No authorization for sales org.'
                                 tvko-vkorg.
      endselect.
    AT SELECTION-SCREEN ON S_BUKRS
    at selection-screen on s_bukrs.
      if pr_cust4 eq 'X' or
         pr_cust5 eq 'X'.
        select  bukrs
          into  t001-bukrs
          from  t001
         where  bukrs in s_bukrs.
        authorization check for plant and company code
          authority-check object 'A_S_WERK'
                              id 'BUKRS' field t001-bukrs
                              id 'WERKS' dummy.
          check sy-subrc ne 0.
          message e002(zgen) with 'No authorization for this company code.'
                                   t001-bukrs.
        endselect.
      endif.
    AT SELECTION-SCREEN OUTPUT
    at selection-screen output.
      loop at screen .
        if pr_cust1 eq 'X'.
          if screen-name = 'S_VTWEG-LOW'   or
             screen-name = 'S_VTWEG-HIGH'  or
             screen-name = 'S_SPART-LOW'   or
             screen-name = 'S_SPART-HIGH'  or
             screen-name = 'S_TAXKD-LOW'   or
             screen-name = 'S_TAXKD-HIGH'  or
             screen-name = 'S_BUKRS-LOW'   or
             screen-name = 'S_BUKRS-HIGH'  or
             screen-name = 'S_ERDAT-LOW'   or
             screen-name = 'S_ERDAT-HIGH'  or
             screen-name = 'S_ALTKN-LOW'   or
             screen-name = 'S_ALTKN-HIGH'  or
             screen-name = 'S_VKBUR-LOW'   or
             screen-name = 'S_VKBUR-HIGH'  or
             screen-name = 'S_LOEVM1-LOW'  or
             screen-name = 'S_LOEVM1-HIGH' or
             screen-name = 'S_LOEVM2-LOW'  or
             screen-name = 'S_LOEVM2-HIGH' or
             screen-name = 'S_LOEVM3-LOW'  or
             screen-name = 'S_LOEVM3-HIGH'.
            screen-input = 0.
          endif.
        elseif pr_cust2 eq 'X'.
          if screen-name = 'S_BZIRK-LOW'    or
             screen-name = 'S_BZIRK-HIGH'   or
             screen-name = 'S_KDGRP-LOW'    or
             screen-name = 'S_KDGRP-HIGH'   or
             screen-name = 'S_LZONE-LOW'    or
             screen-name = 'S_LZONE-HIGH'   or
             screen-name = 'S_KTOKD-LOW'    or
             screen-name = 'S_KTOKD-HIGH'   or
             screen-name = 'S_ERDAT-LOW'    or
             screen-name = 'S_ERDAT-HIGH'   or
             screen-name = 'S_KTOKD-LOW'    or
             screen-name = 'S_KTOKD-HIGH'   or
             screen-name = 'S_ALTKN-LOW'    or
             screen-name = 'S_ALTKN-HIGH'   or
             screen-name = 'S_VKBUR-LOW'    or
             screen-name = 'S_VKBUR-HIGH'   or
             screen-name = 'S_LOEVM1-LOW'   or
             screen-name = 'S_LOEVM1-HIGH'  or
             screen-name = 'S_LOEVM2-LOW'   or
             screen-name = 'S_LOEVM2-HIGH'  or
             screen-name = 'S_LOEVM3-LOW'   or
             screen-name = 'S_LOEVM3-HIGH'  or
             screen-name = 'S_BUKRS-LOW'    or
             screen-name = 'S_BUKRS-HIGH'   or
             screen-name = 'S_VKGRP-LOW'    or
             screen-name = 'S_VKGRP-HIGH'.
            screen-input = 0.
          endif.
        elseif pr_cust3 eq 'X'.
          if screen-name = 'S_BZIRK-LOW'   or
             screen-name = 'S_BZIRK-HIGH'  or
             screen-name = 'S_KDGRP-LOW'   or
             screen-name = 'S_KDGRP-HIGH'  or
             screen-name = 'S_LZONE-LOW'   or
             screen-name = 'S_LZONE-HIGH'  or
             screen-name = 'S_ERDAT-LOW'   or
             screen-name = 'S_ERDAT-HIGH'  or
             screen-name = 'S_KTOKD-LOW'   or
             screen-name = 'S_KTOKD-HIGH'  or
             screen-name = 'S_SPART-LOW'   or
             screen-name = 'S_SPART-HIGH'  or
             screen-name = 'S_TAXKD-LOW'   or
             screen-name = 'S_TAXKD-HIGH'  or
             screen-name = 'S_REGIO-LOW'   or
             screen-name = 'S_REGIO-HIGH'  or
             screen-name = 'S_ALTKN-LOW'   or
             screen-name = 'S_ALTKN-HIGH'  or
             screen-name = 'S_VKBUR-LOW'   or
             screen-name = 'S_VKBUR-HIGH'  or
             screen-name = 'S_LOEVM1-LOW'  or
             screen-name = 'S_LOEVM1-HIGH' or
             screen-name = 'S_LOEVM2-LOW'  or
             screen-name = 'S_LOEVM2-HIGH' or
             screen-name = 'S_LOEVM3-LOW'  or
             screen-name = 'S_LOEVM3-HIGH' or
             screen-name = 'S_BUKRS-LOW'   or
             screen-name = 'S_BUKRS-HIGH'  or
             screen-name = 'S_VKGRP-LOW'   or
             screen-name = 'S_VKGRP-HIGH'  or
             screen-name = 'S_VTWEG-LOW'   or
             screen-name = 'S_VTWEG-HIGH'.
            screen-input = 0.
          endif.
        elseif pr_cust4 eq 'X'.
          if screen-name = 'S_LZONE-LOW'  or
             screen-name = 'S_LZONE-HIGH' or
             screen-name = 'S_TAXKD-LOW'  or
             screen-name = 'S_TAXKD-HIGH' or
             screen-name = 'S_REGIO-LOW'  or
             screen-name = 'S_REGIO-HIGH' or
             screen-name = 'S_ZUAWA-LOW'  or
             screen-name = 'S_ZUAWA-HIGH'.
            screen-input = 0.
          endif.
        else.
          if screen-name = 'S_LZONE-LOW'   or
             screen-name = 'S_LZONE-HIGH'  or
             screen-name = 'S_TAXKD-LOW'   or
             screen-name = 'S_TAXKD-HIGH'.
            screen-input = 0.
          endif.
        endif.
        modify screen.
      endloop.
    INITIALIZATION
    initialization.
      perform deactivate_program using sy-cprog.
    START OF SELECTION
    start-of-selection.
    Customized function to get data from database table
      perform get_data.
    <<CR003-DEVK949538 start ins
      perform get_internal_note_text tables gt_output_info.
    <<CR003-DEVK949538 end ins
    Create sort of ALV list
      perform build_sort.
    Send data to ALV list to display
      if pr_cust1 eq 'X'.
        gs_tabname = text-003.
        gs_header  = text-004.
        perform write_alv_report tables gt_output_list
                                        gt_sort_info.
      elseif pr_cust2 eq 'X'.
        gs_tabname = text-005.
        gs_header  = text-006.
        perform write_alv_report tables gt_output_tax
                                        gt_sort_info.
      elseif pr_cust3 eq 'X'.
        gs_tabname = text-007.
        gs_header  = text-008.
        perform write_alv_report tables gt_output_hvl
                                        gt_sort_info.
      elseif pr_cust4 eq 'X'.
        gs_tabname = text-009.
        gs_header  = text-010.
        perform write_alv_report tables gt_output_crm
                                        gt_sort_info.
      else.
        gs_tabname = text-011.
        gs_header  = text-012.
        perform write_alv_report tables gt_output_info
                                        gt_sort_info .
      endif.
    FORM EVENTTAB_FIELD
    Fill Event tab, for ALV Grid Display
    form eventtab_field using gs_events type slis_t_event.
      data:
        ls_event  type  slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gs_events.
      read table gs_events with key name = slis_ev_top_of_page
                               into ls_event.
      if sy-subrc = 0.
        move gv_top_of_page to ls_event-form.
        append ls_event     to gs_events.
      endif.
    endform.                    " eventtab_field
    FORM TOP_OF_PAGE
    Write at Top of Page of ALV grid
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = gt_list_top_of_page.
    endform.                    "top_of_page
    FORM COMMENT_BUILD
    Write header of ALV grid
    form comment_build using lt_top_of_page type slis_t_listheader
                             gs_header.
      data:
        lv_tdate(10),
        lv_fdate(10),
        ls_line   type  slis_listheader.
      clear: ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = gs_header.
      append ls_line to lt_top_of_page.
    endform.                    "comment_build
    FORM INIT_FIELDCAT
    Fill Field Catalog for ALV Grid
    form init_fieldcat using gs_tabname.
      refresh: gt_fieldcat.
    use this function to get the all fields in the structure.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
           exporting
                i_program_name     = gv_repid
                i_internal_tabname = gs_tabname
                i_inclname         = gv_repid
           changing
                ct_fieldcat        = gt_fieldcat.
      if sy-subrc eq 0.
      clear mark for key field to set color of key column
        gs_fieldcat-key = ''.
        modify gt_fieldcat from gs_fieldcat transporting key
                          where fieldname ne space.
        read table gt_fieldcat with key fieldname = 'FOUND_DAT'
                                   into gs_fieldcat.
        gs_fieldcat-seltext_l = text-013.
        modify gt_fieldcat from gs_fieldcat
                   transporting seltext_l
                          where fieldname = 'FOUND_DAT'.
      <<CR003-DEVK949538 start ins
        read table gt_fieldcat with key fieldname = 'NOTE_TEXT'
                                   into gs_fieldcat.
        gs_fieldcat-seltext_l = text-014.
        modify gt_fieldcat from gs_fieldcat
                   transporting seltext_l
                          where fieldname = 'NOTE_TEXT'.
      <<CR003-DEVK949538 start ins
      endif.
    endform.                    "init_fieldcat
    FORM INIT_LAYOUT
    Layout initial
    form init_layout using gs_layout type slis_layout_alv.
      gs_layout-info_fieldname    = 'LINECOLOR'.
      gs_layout-colwidth_optimize = 'X'.
      gs_layout-zebra             = 'X'.
    endform.                    " init_layout
    FORM WRITE_ALV_REPORT
    form write_alv_report tables gt_output
                                 gt_sort_info.
    ALV Grid display
      clear: gv_repid,
             gv_save.
      gv_repid          = sy-repid.
      gs_variant-report = gv_repid.
      gv_save           = 'A'.
    Build fieldcatalog
      perform init_fieldcat using gs_tabname.
    Build list events
      perform eventtab_field using gs_event.
    Show in ALV Grid form
      perform init_layout using gs_layout.
    Build comments
      perform comment_build using gt_list_top_of_page[]
                                  gs_header.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_buffer_active         = ' '
                i_callback_program      = gv_repid
                is_layout               = gs_layout
                i_save                  = gv_save
                is_variant              = gs_variant
                it_events               = gs_event[]
                it_sort                 = gt_sort_info[]
                it_fieldcat             = gt_fieldcat[]
           importing
                e_exit_caused_by_caller = gv_exit_caused_by_caller
                es_exit_caused_by_user  = gs_exit_caused_by_user
           tables
                t_outtab                = gt_output
           exceptions
                program_error           = 1
                others                  = 2.
    endform.                    "write_alv_report
    FORM GET_DATA
    form get_data.
    Get customer list
      if pr_cust1 eq 'X'.
        select  knvv~vkorg
                kna1~ktokd
                kna1~kunnr
                knvv~vtweg
                kna1~name1
                kna1~name3
                kna1~name4
                kna1~stras
                kna1~cityc
                kna1~regio
                kna1~land1
                knvv~kdgrp
                knvv~bzirk
                knvv~zterm
                kna1~lzone
                kna1~erdat
          from  kna1 join  knvv
            on  kna1kunnr = knvvkunnr
          into  corresponding fields of table gt_output_list
         where  kna1~kunnr in s_kunnr
           and  knvv~vkorg in s_vkorg
           and  knvv~bzirk in s_bzirk
           and  kna1~regio in s_regio
           and  knvv~kdgrp in s_kdgrp
           and  kna1~lzone in s_lzone
           and  kna1~erdat in s_erdat
           and  kna1~ktokd in s_ktokd.
        loop at gt_output_list into gs_output_list.
        Get City decsription
          perform get_city_description using gs_output_list-cityc
                                    changing gs_output_list-bezei1.
        Get Region description
          select single  bezei
                   from  t005u
                   into  gs_output_list-bezei2
                  where  bland = gs_output_list-regio
                    and  land1 = gs_output_list-land1"<<CR000-DEVK942345 ins
                    and  spras = sy-langu.
        Get customer group description
          select single  ktext
                   from  t151t
                   into  gs_output_list-ktext
                  where  kdgrp = gs_output_list-kdgrp
                    and  spras = sy-langu.
        Get sales district description
          select single  bztxt
                   from  t171t
                   into  gs_output_list-bztxt
                  where  bzirk = gs_output_list-bzirk
                    and  spras = sy-langu.
        Get zone decription
          select single  vtext
                   from  tzont
                   into  gs_output_list-vtext
                  where  zone1 = gs_output_list-lzone
                    and  spras = sy-langu.
          modify gt_output_list from gs_output_list index sy-tabix
                                             transporting bezei1
                                                          bezei2
                                                          ktext
                                                          bztxt
                                                          vtext.
          clear gs_output_list.
        endloop.
    Get customer tax data
      elseif pr_cust2 eq 'X'.
        select  kna1~kunnr
                kna1~name1
                kna1~name3
                kna1~name4
                kna1~ort01
                kna1~stcd1
                knvv~vkorg
                knvv~spart
                knvv~vtweg
                knvi~taxkd
                knvi~tatyp
          from  kna1 join  knvv
            on  kna1kunnr = knvvkunnr
                join  knvi
            on  kna1kunnr = knvikunnr
          into  corresponding fields of table gt_output_tax
         where  kna1~kunnr in s_kunnr
           and  knvv~vkorg in s_vkorg
           and  knvv~vtweg in s_vtweg
           and  knvv~spart in s_spart
           and  kna1~regio in s_regio
           and  knvi~taxkd in s_taxkd.
      Get customer tax description
        loop at gt_output_tax into gs_output_tax.
          select single  vtext
                   from  tskdt
                   into  gs_output_tax-vtext
                  where  tatyp = gs_output_tax-tatyp
                    and  taxkd = gs_output_tax-taxkd
                    and  spras = sy-langu.
          if sy-subrc eq 0.
            modify gt_output_tax from gs_output_tax index sy-tabix
                                             transporting vtext.
            clear gs_output_tax.
          endif.
        endloop.
    Get customer HVL data
      elseif pr_cust3 eq 'X'.
        select  kna1~kunnr
                kna1~stceg
                kna1~telfx
                kna1~telf1
                kna1~stras
                kna1~ort02
                kna1~cityc
                kna1~regio
                kna1~ort01
                kna1~name2
                kna1~name1
                knvv~bzirk
                knvv~spart
                knvv~vtweg
                knvv~vkorg
          from  kna1 join  knvv
            on  kna1kunnr = knvvkunnr
          into  corresponding fields of table gt_output_hvl
         where  kna1~kunnr in s_kunnr
           and  knvv~vkorg in s_vkorg.
        loop at gt_output_hvl into gs_output_hvl.
        Get city description.
          perform get_city_description using gs_output_hvl-cityc
                                    changing gs_output_hvl-bezei.
          if sy-subrc eq 0.
            modify gt_output_hvl from gs_output_hvl index sy-tabix
                                             transporting bezei.
            clear gs_output_hvl.
          endif.
        endloop.
    Get cust CRM data
      elseif pr_cust4 eq 'X'.
        select  kna1~kunnr
              knvv~versg                           "<<CR000-DEVK943142 del
                knvv~vkorg
                knvv~vtweg
                knvv~bzirk
                knvv~vkgrp
                knvv~kdgrp
                knvv~vkbur
                kna1~name1
                kna1~name2
                kna1~ort01
                kna1~pstlz
                kna1~regio
                kna1~stras
                kna1~telf1
                kna1~telfx
                kna1~ort02
                kna1~cityc
                knvv~kvgr3
                knb1~altkn
              knb1~bukrs                           "<<CR000-DEVK943142 del
                knvv~erdat
                zcrm_bp_ext~found_dat
          from  kna1 join knvv
            on  kna1kunnr = knvvkunnr
          join  knb1
            on  knvvkunnr = knb1kunnr
          join  zcrm_bp_ext
            on  knb1kunnr = zcrm_bp_extkunnr
          into  corresponding fields of table gt_output_crm
         where  kna1~kunnr in s_kunnr
           and  knvv~vkorg in s_vkorg
           and  knvv~vtweg in s_vtweg
           and  knvv~spart in s_spart
           and  knvv~bzirk in s_bzirk
           and  knvv~kdgrp in s_kdgrp
           and  knvv~vkgrp in s_vkgrp
           and  knvv~vkbur in s_vkbur
           and  knvv~erdat in s_erdat
           and  kna1~ktokd in s_ktokd
           and  kna1~loevm in s_loevm1
           and  knb1~loevm in s_loevm2
           and  knvv~loevm in s_loevm3
           and  knb1~bukrs in s_bukrs
           and  knb1~altkn in s_altkn.
      else.
      Get customer information
       <<CR001-DEVK944342 start del
       select  kna1~kunnr
               knvv~vkorg
               knvv~vtweg
               kna1~stcd2
               kna1~name1
               kna1~name2
               kna1~ort01
               kna1~land1
               kna1~pstlz
               kna1~regio
               kna1~stras
               kna1~telf1
               kna1~telfx
               knvv~bzirk                          "<<CR001-DEVK944239 ins
               knvv~vkbur                          "<<CR001-DEVK944239 ins
               kna1~ort02
               kna1~cityc
               knvv~vkgrp
               knvv~kvgr3
               knvv~versg
               kna1~kdkg2
               kna1~kdkg1
               knvv~kdgrp
               knb1~altkn
               knvv~erdat
               kna1~loevm
               knb1~loevm
               knvv~loevm
       <<CR001-DEVK944342 end del
      <<CR001-DEVK944342 start ins
        select  kna1~kunnr
                knvv~vkorg
                knvv~vtweg
                kna1~stcd2
                kna1~name1
                kna1~name2
                kna1~name3                           "<<CR002-DEVK944835 ins
                kna1~stras
                kna1~ort01
                kna1~ort02
                kna1~pstlz
                kna1~regio
                kna1~land1
                kna1~cityc
                kna1~telf1
                kna1~telfx
                knvv~bzirk
                knvv~vkbur
                knvv~kdgrp
                knvv~vkgrp
                knvv~kvgr3
                knvv~versg
                kna1~kdkg2
                kna1~kdkg1
                knb1~altkn
                knvv~erdat
                kna1~loevm
                knb1~loevm
                knvv~loevm
      <<CR001-DEVK944342 end ins
          from  kna1 join knvv
            on  kna1kunnr = knvvkunnr
                join knb1
            on  kna1kunnr = knb1kunnr
        <<CR001-DEVK944252 start del
        into  corresponding fields of table gt_output_info
        <<CR001-DEVK944252 end del
        <<CR003-DEVK949538 start del
          into  table gt_output_info                "<<CR001-DEVK944342 ins
        <<CR003-DEVK949538 end del
        <<CR003-DEVK949538 start ins
          into  corresponding fields of table gt_output_info
        <<CR003-DEVK949538 end ins
         where  kna1~kunnr in s_kunnr
           and  knvv~vkorg in s_vkorg
           and  knvv~vtweg in s_vtweg
           and  knvv~spart in s_spart
           and  knvv~bzirk in s_bzirk
           and  knvv~kdgrp in s_kdgrp
           and  knvv~vkgrp in s_vkgrp
           and  knvv~vkbur in s_vkbur
           and  knvv~erdat in s_erdat
           and  kna1~ktokd in s_ktokd
           and  kna1~regio in s_regio
         <<CR001-DEVK944252 start del
         and  kna1~loevm in s_loevm1
         and  knb1~loevm in s_loevm2
         and  knvv~loevm in s_loevm3
         <<CR001-DEVK944252 end del
         <<CR001-DEVK944252 start ins
           and ( kna1~loevm in s_loevm1
            or   knb1~loevm in s_loevm2
            or   knvv~loevm in s_loevm3 )
         <<CR001-DEVK944252 end ins
           and  knb1~zuawa in s_zuawa
           and  knb1~bukrs in s_bukrs
           and  knb1~altkn in s_altkn.
         <<CR003-DEVK949538 start ins
           loop at gt_output_info into gs_output_info.
          select single  adrnr
                   into  kna1-adrnr
                   from  kna1
                  where  kunnr = gs_output_info-kunnr.
          check sy-subrc eq 0.
          select single  smtp_addr
                   into  adr6-smtp_addr
                   from  adr6
                  where  addrnumber = kna1-adrnr.
          check sy-subrc eq 0.
          gs_output_info-smtp_addr = adr6-smtp_addr.
          modify gt_output_info from gs_output_info.
        endloop.
         <<CR003-DEVK949538 end ins
      endif.
    <<CR003-DEVK949538 start ins
      loop at gt_output_info into gs_output_info.
        lv_store = gs_output_info-loevm1.
      endloop.
    <<CR003-DEVK949538 end ins
    endform.
    FORM BUILD_SORT
    form build_sort.
      if pr_cust1 eq 'X' or
         pr_cust2 eq 'X'.
        clear gs_sort_info.
        gs_sort_info-fieldname = 'VKORG'.
        gs_sort_info-spos      = 1.
        gs_sort_info-up        = 'X'.
        append gs_sort_info to gt_sort_info.
      endif.
      clear gs_sort_info.
      gs_sort_info-fieldname = 'KUNNR'.
      gs_sor

    hi shivaji!
    thx for the reply.
    can u chk whether there is any problem with the queries or not.
    regards
    sachin

Maybe you are looking for

  • Ipod classic screen stuck on 'do not disconnect' not responding to anything?

    As the title suggests, I connected the ipod to load some music on it and the screen displayed the ' do not disconnect' sign.....but iTunes didn't bring it up and the ipod doesn't respond to anything. The laptop recognised an error with the ipod and s

  • Advice needed for using date type in leave quota generation.

    Requirement:   Seniority for quota generation of long service leave must be based on date "02" in IT0041. Although all the relevant config has been done using the date type 02, the quota is still being generated based on date type 01.  My Question: 

  • Transaction code F110- Report Program = RFZALI00

    Hi friends, Our client want to Insert another field into Payment Run report. Program = RFZALI00 The field which they would like to insert into the report is the u2018referenceu2019 field on the u2018Enter Vendor Invoiceu2019 screen. Please help me to

  • Emails sent with Mail show as double for Windows users

    I just restored my computer, and trying to go back to Mail instead of the bloated Outlook. However, I am having the same problem as before: every time i send an email, the recipient always sees a single message with double the content. This means he

  • How do you fix the screen

    you get like a scalpel or a sharp knife and cut the screen open and replace the screen