ResultSet loop back to first record

I have an Access table : products
I have a total of 7 products. When I use rs.next(), it will scroll for each record until the last record.
How do I make it go back to the first record after it hit the last record ?
I hv tried rs.first() and rs.last(0 method, but it doesn't work and give me TYPE FORWARD kind of error, further clarify with some expert, they said it is because my cursor state is the Forward Type only ... so cannot loop back....
Then I also use the cn.createConnection(ResultSet.InSensitive Result ... kind of stuff ... all cannot work as Access seems like cannot go backward ...
Any other good suggestion ?

1. Use this, st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Or,
2. Store your result set in a temporary array and scroll thru this array for subsequent repetitive iterations.
Sudha

Similar Messages

  • Need tab order to loop back to first field.

    Using Adobe Pro, would like the form to loop back to the first tab after tabbing off of the last field.  Currently it goes to a couple text boxes that I added to the form that are not part of the fillable text fields.

    That's the way it is designed to work. Your options are to set the text boxes to read-only and they won't get the focus with Acrobat/Reader 11 and above, or flatten them so they are converted to regular page contents. You can use the following free JavaScript-based tool to do this: http://www.uvsar.com/projects/acrobat/flattener/

  • IPhone Playlists Now Loop Back to First Entry

    Hi,
    Don't know if this is a new "feature" or problem. So I thought I would check here first.
    When I select the first entry in a Playlist, that entry and all others play in sequence just fine. When the last entry plays, the Playlist loops back and starts to play the first entry again. Prior to the 2.0 software upgrade, when the last entry was finished playing, the playlist would just end.
    Any one else run into this?

    When a song is playing, tap the artwork (in portrait mode). You will get a progress bar. The "racetrack" symbol on the left is the repeat control. White is mo repeat. Blue is repeat all. Blue with a number 1 is repeat one.

  • *** I need to pull back just one record when more than one is listed.... **

    I have two (or more sometimes), there is a field called POC_type and then the POC_name, the POC_Name is different, but the rest of the records are the same, I only want to pull back the first record so I onlist one POC_Type, Name, ...
    Below is the code I have right nwo, but like I said it is pulling back multiples becase they have been entered into the systme twice (because of the diff POCs)...
    select distinct m1.*
    from  report_surv_ques_poc m1,
      (select investment_id, investment_acronym, investment_name, count(*)
      from  mv_surv_ques_poc
      where poc_type = 'Program Manager'
      and poc_status = 1
      group by investment_id, investment_acronym, investment_name
      having count(*) > 1) m2
    where m1.investment_id = m2.investment_id
      and m1.poc_type = 'Program Manager'
      and m1.poc_status = 1
      --and m1.investment_id = 14003
    order by m1.investment_id

    Thanks...
    I am using 10g.
    My code is now like...
    select distinct m1.*
    from  report_surv_ques_poc m1,
      (select investment_id, investment_acronym, investment_name, count(*)
      from  mv_surv_ques_poc
      where poc_type = 'Program Manager'
      and poc_status = 1
      group by investment_id, investment_acronym, investment_name
      having count(*) > 1) m2
    where m1.investment_id = m2.investment_id
      and m1.poc_type = 'Program Manager'
      and m1.poc_status = 1
      and m1.survey_id IN (67201, 67208)
    order by m1.survey_idshould it be like:
    WITH get_rows AS
       SELECT DISTICT ml.* ROW_NUMBER () OVER (ORDER BY m1.investment_id) AS rno
       FROM from  report_surv_ques_poc m1,
         (select investment_id, investment_acronym, investment_name, count(*)
            from  mv_surv_ques_poc
          where poc_type = 'Program Manager'
            and poc_status = 1
       group by investment_id, investment_acronym, investment_name
      having count(*) > 1) m2
      where m1.investment_id = m2.investment_id
      and m1.poc_type = 'Program Manager'
      and m1.poc_status = 1
    ) SELECT * FROM get_rows WHERE rno =1;cause that is not working ... I am sure I have something wrong....
    Kipp

  • How do I loop back from the first frame to the last frame?

    Hi there,
    I'm currently working on the framework for a product viewer.
    I have:
    a movie clip called 'viewer_mc' which contains the images take from different angles of the product. The actionscript generates a script on the last frame of this that returns it to frame 1.
    a button instance called 'autoplay_btn' which plays through the movie clip from whatever the current frame is, and stops on frame 1.
    a left and right button which serve to move the movie clip frame, to give the appearance that the product is rotating.
    I have succeeded in getting it to:
    have the movie clip play through once, return to frame 1 and stop.
    have the buttons return functions when held down, that move the frame in the movie clip using nextFrame and prevFrame commands. The right button successfully loops round to frame 1 and continues functioning to give the appearance of continual rotation.
    The last problem I am experiencing is getting the left button to act in the corresponding manner, going from the first frame to the last and continuing to function.
    Here is my actionscript so far:
    import flash.events.MouseEvent;
    var lastFrame:Number = viewer_mc.totalFrames;
    var thisFrame:Number = viewer_mc.currentFrame;
    var backFrame:Number = viewer_mc.currentFrame-1;
    1. This is the part that gets it to play through once before returning to the first frame. I think perhaps the problem I am experiencing is because of the 'viewer_mc.addFrameScript(lastFrame-1, toStart)' part i.e. although I'm holding the left button, its returning to this script and therefor getting bounced back immediately to the first frame. However, there is no flicker on the screen which you might expect if this were the case
    Note - as this is a generic product viewer which I can use as a template I am using lastFrame etc. as opposed to typing the value in
    function toStart (){
              viewer_mc.gotoAndStop(1);
    viewer_mc.addFrameScript(lastFrame-1, toStart);
    2. This is the functionality for the autoplay_btn that will play through a rotation / return the viewer to the initial (frontal) view of the product (frame 1).
    autoplay_btn.addEventListener(MouseEvent.MOUSE_DOWN, autoplay);
    function autoplay (ev:MouseEvent):void{
              var startFrame:Number = viewer_mc.currentFrame;
              viewer_mc.gotoAndPlay(startFrame);
    3. This is the functionality of the right button, which when held, moves the movie clip to the next frame via the 'rotateRight' function based on the 'nextFrame' command. It loops back round to the first frame due to the 'viewer_mc.addFrameScript(lastFrame-1, toStart)' script generated on the last frame of the movie clip, as is desired.
    right_btn.addEventListener(MouseEvent.MOUSE_DOWN, rightDown);
    function rightDown(e:Event){
        stage.addEventListener(MouseEvent.MOUSE_UP,stoprightDown); //listen for mouse up on the stage, in case the finger/mouse moved off of the button accidentally when they release.
        addEventListener(Event.ENTER_FRAME,rotateRight); //while the mouse is down, run the tick function once every frame as per the project frame rate
    function stoprightDown(e:Event):void {
        removeEventListener(Event.ENTER_FRAME,rotateRight);  //stop running the tick function every frame now that the mouse is up
        stage.removeEventListener(MouseEvent.MOUSE_UP,stoprightDown); //remove the listener for mouse up
    function rotateRight(e:Event):void {
        viewer_mc.nextFrame();
    4. This is the functionality of the left button, which when held, moves the movie clip to the prev frame via the 'rotateRight' function based on the 'prevFrame' command. And this is where the problem lies, as although it works for getting the movieclip back to frame 1, it does not loop round to the last frame and continue functioning, as is wanted.
    left_btn.addEventListener(MouseEvent.MOUSE_DOWN, leftDown);
    function leftDown(e:Event){
        stage.addEventListener(MouseEvent.MOUSE_UP,stopleftDown); //listen for mouse up on the stage, in case the finger/mouse moved off of the button accidentally when they release.
        addEventListener(Event.ENTER_FRAME,rotateLeft); //while the mouse is down, run the tick function once every frame as per the project frame rate
    function stopleftDown(e:Event):void {
        removeEventListener(Event.ENTER_FRAME,rotateLeft);  //stop running the tick function every frame now that the mouse is up
        stage.removeEventListener(MouseEvent.MOUSE_UP,stopleftDown); //remove the listener for mouse up
    I'd imagine it is probably my logic for this part that is really letting me down - I can do a similar function in actionscript 2, but am trying to learn actionscript 3 just to move with the times as it were, and struggling a bit. Still this is only a few days in!
    function rotateLeft(e:Event):void{
              if(thisFrame==1){
                        gotoAndStop(viewer_mc.totalFrames-1);
              } else{
              viewer_mc.prevFrame();
    Any help you can give me would be gratefully received. For an example of the effect I am trying to achieve with the autoplay button etc. I recommend:
    http://www.fender.com/basses/precision-bass/american-standard-precision-bass

    Thanks for getting back to me.
    Here's the code without my comments / explanations:
    import flash.events.MouseEvent;
    import flash.events.Event;
    var lastFrame:Number = viewer_mc.totalFrames;
    var thisFrame:Number = viewer_mc.currentFrame;
    var backFrame:Number = viewer_mc.currentFrame-1;
    function toStart (){
              viewer_mc.gotoAndStop(1);
    viewer_mc.addFrameScript(lastFrame-1, toStart);
    //last image of viewer_mc = first image of viewer_mc
    autoplay_btn.addEventListener(MouseEvent.MOUSE_DOWN, autoplay);
    function autoplay (ev:MouseEvent):void{
              var startFrame:Number = viewer_mc.currentFrame;
              viewer_mc.gotoAndPlay(startFrame);
    right_btn.addEventListener(MouseEvent.MOUSE_DOWN, rightDown);
    function rightDown(e:Event){
        stage.addEventListener(MouseEvent.MOUSE_UP,stoprightDown); //listen for mouse up on the stage, in case the finger/mouse moved off of the button accidentally when they release.
        addEventListener(Event.ENTER_FRAME,rotateRight); //while the mouse is down, run the tick function once every frame as per the project frame rate
    function stoprightDown(e:Event):void {
        removeEventListener(Event.ENTER_FRAME,rotateRight);  //stop running the tick function every frame now that the mouse is up
        stage.removeEventListener(MouseEvent.MOUSE_UP,stoprightDown); //remove the listener for mouse up
    function rotateRight(e:Event):void {
        viewer_mc.nextFrame();
    left_btn.addEventListener(MouseEvent.MOUSE_DOWN, leftDown);
    function leftDown(e:Event){
        stage.addEventListener(MouseEvent.MOUSE_UP,stopleftDown); //listen for mouse up on the stage, in case the finger/mouse moved off of the button accidentally when they release.
        addEventListener(Event.ENTER_FRAME,rotateLeft);//while the mouse is down, run the tick function once every frame as per the project frame rate
    function stopleftDown(e:Event):void {
        removeEventListener(Event.ENTER_FRAME,rotateLeft);  //stop running the tick function every frame now that the mouse is up
        stage.removeEventListener(MouseEvent.MOUSE_UP,stopleftDown); //remove the listener for mouse up
    function rotateLeft(e:Event):void{
              viewer_mc.prevFrame();
    The definition of the rotateLeft function is where the problem lies I think - I've taken out my poor attempts at doing the logic from the previous post. If I were to write it out long-hand the statement I want to write is: 'If you get to frame 1 and function rotateLeft is called go to the end of the movie clip'.
    The reason I have to use the viewer_mc.totalFrames-1 definition in the addFrameScript call is the addFrameScript function is 0 based i.e. if you want to call frame 1 of the movieclip you have to return a value of 0 in the addFrameScript (or such is my understanding of it anyway). As such, the last image in the movie clip will need to be the view obtained at 360 degree rotation, which is of course the same view as at 0 degree rotation. As a consequence, the last frame in the movie clip is superfluous for the user, but necessary for the overall effect to be achieved. And, in addition, to keep up the effect of a 360 degree view when the rotateLeft function is called it needs to skip that last frame to go to the lastFrame-1 (or totalframes-1), or in other words, the view of the image prior to completing the full 360 rotation.
    the variables thisFrame and lastFrame are defined at the very top of the script. Like you said they might need to be defined or called on again elsewhere.

  • Asp code does not render for first record in looped recordset

    I have posted this question on a javascript forum as it
    contains javascript code however it was believed to be an asp
    issue.
    The following head section javascript code contains the
    function showBigImage( isource,bigImage,header ) function call of
    discussion:
    var currentImage;
    function showBigImage( isource,bigImage,header ) {
    var theImage = document.getElementById( 'largeimage' );
    theImage.src = isource;
    currentImage = bigImage;
    document.getElementById( 'photoHeader' ).innerHTML=header;
    document.getElementById( 'largeimage' ).alt=header;
    The following rendered looped recordset code illustrates how
    the "header" parameter of this showBigImage(
    isource,bigImage,header ) function call does not render ONLY FOR
    THE FIRST RECORD OF THE RECORDSET as it is blank:
    <a href= "javascript:;" > <td height=36
    valign="middle" class="small_img" onmouseover="showBigImage(
    'imagescript.asp?path=images/portable_stage.jpg&width=250','images/portable_stage.jpg',''
    )"> <img
    src="imagescript.asp?path=images/portable_stage.jpg&width=36"
    border="0" alt="" /> </td> </a>
    <a href= "javascript:;" > <td height=36
    valign="middle" class="small_img" onmouseover="showBigImage(
    'imagescript.asp?path=images/seated_riserset.jpg&width=250','images/seated_riserset.jpg', 'Portable
    stage configuration using 9 units of the 3 ft x 8 ft platforms in 3
    different heights' )"> <img
    src="imagescript.asp?path=images/seated_riserset.jpg&width=36"
    border="0" alt="" /> </td> </a>
    <a href= "javascript:;" > <td height=36
    valign="middle" class="small_img" onmouseover="showBigImage(
    'imagescript.asp?path=images/Stageset.jpg&width=250','images/Stageset.jpg','Portable
    stage configuration using 16 units of the 4 ft x 8 ft platforms'
    )"> <img
    src="imagescript.asp?path=images/Stageset.jpg&width=36"
    border="0" alt="" /> </td> </a>
    <a href= "javascript:;" > <td height=36
    valign="middle" class="small_img" onmouseover="showBigImage(
    'imagescript.asp?path=images/Runset.jpg&width=250','images/Runset.jpg','Portable
    stage runset configuration' )"> <img
    src="imagescript.asp?path=images/Runset.jpg&width=36"
    border="0" alt="" /> </td> </a>
    Because of this problem, the caption text does not display
    for this first image record once the thumbnail images are moused
    over. You can view this page example at
    http://www.canchair.com/new_web_product_detail.asp?ProductID=198&ProductFamily=1&ProductFa milySub=10

    Please help with this issue!!!

  • *Flash animation looping but going back to first frame {want to hold on last frame}

    I came across this article on looping animations = http://www.quip.net/blog/2006/flash/how-to-loop-three-times
    I'm a novice with flash and just trying to plug thru to get some ads up and running for the first time.
    Everything worked for me in the article...the one thing I wanted to do but haven't found an answer to is how to stop the animation on the last frame after looping is complete, instead of automatically going back to the first frame??
    What's the easiest/most effective way to do this?
    The stop script does not work...still goes back to first frame.
    For all my flash ads, I've imported an FLV video...so don't know if it's some function for flv's/video's that auto-rewinds to first frame...
    Thanks so much, really appreciate any insight on this.
    The sooner you can catch a minute to get back the better

    Ok...not working for me - prob. b/c I'm missing something again.
    What I did was...
    1)  Renamed the instace of replay button = "replay_btn".
    [not sure if that's correct...guessed b/c you reference it in the code]
    2)  I placed this in the action code on action layer on last keyframe =
    var loopNum:Number;
    loopNum++;
    if(loopNum%3==0){
    stop();
    your_replay_btn._visible=true;
    } else {
    your_replay_btn._visible=false;
    3) I placed this in action code on the replay layer on last keyframe =
    your_replay_btn.onRelease=function(){
    this.gotoAndPlay(1);
    What happens is the replay button still flashes at the end of each loop and the loops just continue...it doesn't stop at 3.
    I also get this error =
    Can you break down what I'm doing wrong and how to fix...need to get this out asap.
    I truly appreciate your help and time so far on this...big thanks kglad!

  • Postfix, mail loop back to myself

    Hello. I have tried to set up postfix and dovecot. However, I cant seem to figure out what is causing this error messages when trying to send emails to other local users.
    My servers hostname is aurora.tholden.no
    MX host is aurora.tholden.no
    I have two domains. Tholden.no and srckurs.no
    srckurs.no have two email accounts. Both working fine, and I can send and recve mail between them, and the outside.
    However, for the tholden.no domain, reciving of emails does not work. I can send them though.
    What can be the problem?
    main.cf
    # Global Postfix configuration file. This file lists only a subset
    # of all parameters. For the syntax, and for a complete parameter
    # list, see the postconf(5) manual page (command: "man 5 postconf").
    # For common configuration examples, see BASIC_CONFIGURATION_README
    # and STANDARD_CONFIGURATION_README. To find these documents, use
    # the command "postconf html_directory readme_directory", or go to
    # [url]http://www.postfix.org/BASIC_CONFIGURATION_README.html[/url] etc.
    # For best results, change no more than 2-3 parameters at a time,
    # and test if Postfix still works after every change.
    # COMPATIBILITY
    # The compatibility_level determines what default settings Postfix
    # will use for main.cf and master.cf settings. These defaults will
    # change over time.
    # To avoid breaking things, Postfix will use backwards-compatible
    # default settings and log where it uses those old backwards-compatible
    # default settings, until the system administrator has determined
    # if any backwards-compatible default settings need to be made
    # permanent in main.cf or master.cf.
    # When this review is complete, update the compatibility_level setting
    # below as recommended in the RELEASE_NOTES file.
    # The level below is what should be used with new (not upgrade) installs.
    compatibility_level = 2
    # SOFT BOUNCE
    # The soft_bounce parameter provides a limited safety net for
    # testing. When soft_bounce is enabled, mail will remain queued that
    # would otherwise bounce. This parameter disables locally-generated
    # bounces, and prevents the SMTP server from rejecting mail permanently
    # (by changing 5xx replies into 4xx replies). However, soft_bounce
    # is no cure for address rewriting mistakes or mail routing mistakes.
    #soft_bounce = no
    # LOCAL PATHNAME INFORMATION
    # The queue_directory specifies the location of the Postfix queue.
    # This is also the root directory of Postfix daemons that run chrooted.
    # See the files in examples/chroot-setup for setting up Postfix chroot
    # environments on different UNIX systems.
    queue_directory = /var/spool/postfix
    # The command_directory parameter specifies the location of all
    # postXXX commands.
    command_directory = /usr/bin
    # The daemon_directory parameter specifies the location of all Postfix
    # daemon programs (i.e. programs listed in the master.cf file). This
    # directory must be owned by root.
    daemon_directory = /usr/lib/postfix/bin
    # The data_directory parameter specifies the location of Postfix-writable
    # data files (caches, random numbers). This directory must be owned
    # by the mail_owner account (see below).
    data_directory = /var/lib/postfix
    # QUEUE AND PROCESS OWNERSHIP
    # The mail_owner parameter specifies the owner of the Postfix queue
    # and of most Postfix daemon processes. Specify the name of a user
    # account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS
    # AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In
    # particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
    # USER.
    mail_owner = postfix
    # The default_privs parameter specifies the default rights used by
    # the local delivery agent for delivery to external file or command.
    # These rights are used in the absence of a recipient user context.
    # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
    #default_privs = nobody
    # INTERNET HOST AND DOMAIN NAMES
    # The myhostname parameter specifies the internet hostname of this
    # mail system. The default is to use the fully-qualified domain name
    # from gethostname(). $myhostname is used as a default value for many
    # other configuration parameters.
    #myhostname = host.domain.tld
    myhostname = aurora.tholden.no
    # The mydomain parameter specifies the local internet domain name.
    # The default is to use $myhostname minus the first component.
    # $mydomain is used as a default value for many other configuration
    # parameters.
    #mydomain = tholden.no
    # SENDING MAIL
    # The myorigin parameter specifies the domain that locally-posted
    # mail appears to come from. The default is to append $myhostname,
    # which is fine for small sites. If you run a domain with multiple
    # machines, you should (1) change this to $mydomain and (2) set up
    # a domain-wide alias database that aliases each user to
    # [email protected].
    # For the sake of consistency between sender and recipient addresses,
    # myorigin also specifies the default domain name that is appended
    # to recipient addresses that have no @domain part.
    #myorigin = $myhostname
    #myorigin = $mydomain
    # RECEIVING MAIL
    # The inet_interfaces parameter specifies the network interface
    # addresses that this mail system receives mail on. By default,
    # the software claims all active interfaces on the machine. The
    # parameter also controls delivery of mail to user@[ip.address].
    # See also the proxy_interfaces parameter, for network addresses that
    # are forwarded to us via a proxy or network address translator.
    # Note: you need to stop/start Postfix when this parameter changes.
    inet_interfaces = all
    inet_protocols = all
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost
    # The proxy_interfaces parameter specifies the network interface
    # addresses that this mail system receives mail on by way of a
    # proxy or network address translation unit. This setting extends
    # the address list specified with the inet_interfaces parameter.
    # You must specify your proxy/NAT addresses when your system is a
    # backup MX host for other domains, otherwise mail delivery loops
    # will happen when the primary MX host is down.
    #proxy_interfaces =
    #proxy_interfaces = 1.2.3.4
    # The mydestination parameter specifies the list of domains that this
    # machine considers itself the final destination for.
    # These domains are routed to the delivery agent specified with the
    # local_transport parameter setting. By default, that is the UNIX
    # compatible delivery agent that lookups all recipients in /etc/passwd
    # and /etc/aliases or their equivalent.
    # The default is $myhostname + localhost.$mydomain. On a mail domain
    # gateway, you should also include $mydomain.
    # Do not specify the names of virtual domains - those domains are
    # specified elsewhere (see VIRTUAL_README).
    # Do not specify the names of domains that this machine is backup MX
    # host for. Specify those names via the relay_domains settings for
    # the SMTP server, or use permit_mx_backup if you are lazy (see
    # STANDARD_CONFIGURATION_README).
    # The local machine is always the final destination for mail addressed
    # to user@[the.net.work.address] of an interface that the mail system
    # receives mail on (see the inet_interfaces parameter).
    # Specify a list of host or domain names, /file/name or type:table
    # patterns, separated by commas and/or whitespace. A /file/name
    # pattern is replaced by its contents; a type:table is matched when
    # a name matches a lookup key (the right-hand side is ignored).
    # Continue long lines by starting the next line with whitespace.
    # See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
    #mydestination = $myhostname, localhost.$mydomain, localhost
    #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    mydestination = aurora, localhost.localdomain, localhost
    # mail.$mydomain, www.$mydomain, ftp.$mydomain
    # REJECTING MAIL FOR UNKNOWN LOCAL USERS
    # The local_recipient_maps parameter specifies optional lookup tables
    # with all names or addresses of users that are local with respect
    # to $mydestination, $inet_interfaces or $proxy_interfaces.
    # If this parameter is defined, then the SMTP server will reject
    # mail for unknown local users. This parameter is defined by default.
    # To turn off local recipient checking in the SMTP server, specify
    # local_recipient_maps = (i.e. empty).
    # The default setting assumes that you use the default Postfix local
    # delivery agent for local delivery. You need to update the
    # local_recipient_maps setting if:
    # - You define $mydestination domain recipients in files other than
    # /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.
    # For example, you define $mydestination domain recipients in
    # the $virtual_mailbox_maps files.
    # - You redefine the local delivery agent in master.cf.
    # - You redefine the "local_transport" setting in main.cf.
    # - You use the "luser_relay", "mailbox_transport", or "fallback_transport"
    # feature of the Postfix local delivery agent (see local(8)).
    # Details are described in the LOCAL_RECIPIENT_README file.
    # Beware: if the Postfix SMTP server runs chrooted, you probably have
    # to access the passwd file via the proxymap service, in order to
    # overcome chroot restrictions. The alternative, having a copy of
    # the system passwd file in the chroot jail is just not practical.
    # The right-hand side of the lookup tables is conveniently ignored.
    # In the left-hand side, specify a bare username, an @domain.tld
    # wild-card, or specify a [email protected] address.
    #local_recipient_maps = unix:passwd.byname $alias_maps
    #local_recipient_maps = proxy:unix:passwd.byname $alias_maps
    #local_recipient_maps =
    # The unknown_local_recipient_reject_code specifies the SMTP server
    # response code when a recipient domain matches $mydestination or
    # ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty
    # and the recipient address or address local-part is not found.
    # The default setting is 550 (reject mail) but it is safer to start
    # with 450 (try again later) until you are certain that your
    # local_recipient_maps settings are OK.
    unknown_local_recipient_reject_code = 550
    # TRUST AND RELAY CONTROL
    # The mynetworks parameter specifies the list of "trusted" SMTP
    # clients that have more privileges than "strangers".
    # In particular, "trusted" SMTP clients are allowed to relay mail
    # through Postfix. See the smtpd_recipient_restrictions parameter
    # in postconf(5).
    # You can specify the list of "trusted" network addresses by hand
    # or you can let Postfix do it for you (which is the default).
    # By default (mynetworks_style = subnet), Postfix "trusts" SMTP
    # clients in the same IP subnetworks as the local machine.
    # On Linux, this does works correctly only with interfaces specified
    # with the "ifconfig" command.
    # Specify "mynetworks_style = class" when Postfix should "trust" SMTP
    # clients in the same IP class A/B/C networks as the local machine.
    # Don't do this with a dialup site - it would cause Postfix to "trust"
    # your entire provider's network. Instead, specify an explicit
    # mynetworks list by hand, as described below.
    # Specify "mynetworks_style = host" when Postfix should "trust"
    # only the local machine.
    #mynetworks_style = class
    #mynetworks_style = subnet
    #mynetworks_style = host
    # Alternatively, you can specify the mynetworks list by hand, in
    # which case Postfix ignores the mynetworks_style setting.
    # Specify an explicit list of network/netmask patterns, where the
    # mask specifies the number of bits in the network part of a host
    # address.
    # You can also specify the absolute pathname of a pattern file instead
    # of listing the patterns here. Specify type:table for table-based lookups
    # (the value on the table right-hand side is not used).
    mynetworks = 213.239.218.93, 127.0.0.0/8
    #mynetworks = $config_directory/mynetworks
    #mynetworks = hash:/etc/postfix/network_table
    # The relay_domains parameter restricts what destinations this system will
    # relay mail to. See the smtpd_recipient_restrictions description in
    # postconf(5) for detailed information.
    # By default, Postfix relays mail
    # - from "trusted" clients (IP address matches $mynetworks) to any destination,
    # - from "untrusted" clients to destinations that match $relay_domains or
    # subdomains thereof, except addresses with sender-specified routing.
    # The default relay_domains value is $mydestination.
    # In addition to the above, the Postfix SMTP server by default accepts mail
    # that Postfix is final destination for:
    # - destinations that match $inet_interfaces or $proxy_interfaces,
    # - destinations that match $mydestination
    # - destinations that match $virtual_alias_domains,
    # - destinations that match $virtual_mailbox_domains.
    # These destinations do not need to be listed in $relay_domains.
    # Specify a list of hosts or domains, /file/name patterns or type:name
    # lookup tables, separated by commas and/or whitespace. Continue
    # long lines by starting the next line with whitespace. A file name
    # is replaced by its contents; a type:name table is matched when a
    # (parent) domain appears as lookup key.
    # NOTE: Postfix will not automatically forward mail for domains that
    # list this system as their primary or backup MX host. See the
    # permit_mx_backup restriction description in postconf(5).
    #relay_domains = $mydestination
    # INTERNET OR INTRANET
    # The relayhost parameter specifies the default host to send mail to
    # when no entry is matched in the optional transport(5) table. When
    # no relayhost is given, mail is routed directly to the destination.
    # On an intranet, specify the organizational domain name. If your
    # internal DNS uses no MX records, specify the name of the intranet
    # gateway host instead.
    # In the case of SMTP, specify a domain, host, host:port, [host]:port,
    # [address] or [address]:port; the form [host] turns off MX lookups.
    # If you're connected via UUCP, see also the default_transport parameter.
    #relayhost = $mydomain
    #relayhost = [gateway.my.domain]
    #relayhost = [mailserver.isp.tld]
    #relayhost = uucphost
    #relayhost = [an.ip.add.ress]
    # REJECTING UNKNOWN RELAY USERS
    # The relay_recipient_maps parameter specifies optional lookup tables
    # with all addresses in the domains that match $relay_domains.
    # If this parameter is defined, then the SMTP server will reject
    # mail for unknown relay users. This feature is off by default.
    # The right-hand side of the lookup tables is conveniently ignored.
    # In the left-hand side, specify an @domain.tld wild-card, or specify
    # a [email protected] address.
    #relay_recipient_maps = hash:/etc/postfix/relay_recipients
    # INPUT RATE CONTROL
    # The in_flow_delay configuration parameter implements mail input
    # flow control. This feature is turned on by default, although it
    # still needs further development (it's disabled on SCO UNIX due
    # to an SCO bug).
    # A Postfix process will pause for $in_flow_delay seconds before
    # accepting a new message, when the message arrival rate exceeds the
    # message delivery rate. With the default 100 SMTP server process
    # limit, this limits the mail inflow to 100 messages a second more
    # than the number of messages delivered per second.
    # Specify 0 to disable the feature. Valid delays are 0..10.
    #in_flow_delay = 1s
    # ADDRESS REWRITING
    # The ADDRESS_REWRITING_README document gives information about
    # address masquerading or other forms of address rewriting including
    # username->Firstname.Lastname mapping.
    # ADDRESS REDIRECTION (VIRTUAL DOMAIN)
    # The VIRTUAL_README document gives information about the many forms
    # of domain hosting that Postfix supports.
    # "USER HAS MOVED" BOUNCE MESSAGES
    # See the discussion in the ADDRESS_REWRITING_README document.
    # TRANSPORT MAP
    # See the discussion in the ADDRESS_REWRITING_README document.
    # ALIAS DATABASE
    # The alias_maps parameter specifies the list of alias databases used
    # by the local delivery agent. The default list is system dependent.
    # On systems with NIS, the default is to search the local alias
    # database, then the NIS alias database. See aliases(5) for syntax
    # details.
    # If you change the alias database, run "postalias /etc/aliases" (or
    # wherever your system stores the mail alias file), or simply run
    # "newaliases" to build the necessary DBM or DB file.
    # It will take a minute or so before changes become visible. Use
    # "postfix reload" to eliminate the delay.
    #alias_maps = dbm:/etc/aliases
    #alias_maps = hash:/etc/aliases
    #alias_maps = hash:/etc/aliases, nis:mail.aliases
    #alias_maps = netinfo:/aliases
    alias_maps = hash:/etc/postfix/aliases
    # The alias_database parameter specifies the alias database(s) that
    # are built with "newaliases" or "sendmail -bi". This is a separate
    # configuration parameter, because alias_maps (see above) may specify
    # tables that are not necessarily all under control by Postfix.
    #alias_database = dbm:/etc/aliases
    #alias_database = dbm:/etc/mail/aliases
    #alias_database = hash:/etc/aliases
    #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
    alias_database = $alias_maps
    # ADDRESS EXTENSIONS (e.g., user+foo)
    # The recipient_delimiter parameter specifies the separator between
    # user names and address extensions (user+foo). See canonical(5),
    # local(8), relocated(5) and virtual(5) for the effects this has on
    # aliases, canonical, virtual, relocated and .forward file lookups.
    # Basically, the software tries user+foo and .forward+foo before
    # trying user and .forward.
    #recipient_delimiter = +
    # DELIVERY TO MAILBOX
    # The home_mailbox parameter specifies the optional pathname of a
    # mailbox file relative to a user's home directory. The default
    # mailbox file is /var/spool/mail/user or /var/mail/user. Specify
    # "Maildir/" for qmail-style delivery (the / is required).
    #home_mailbox = Mailbox
    home_mailbox = Maildir/
    # The mail_spool_directory parameter specifies the directory where
    # UNIX-style mailboxes are kept. The default setting depends on the
    # system type.
    #mail_spool_directory = /var/mail
    #mail_spool_directory = /var/spool/mail
    # The mailbox_command parameter specifies the optional external
    # command to use instead of mailbox delivery. The command is run as
    # the recipient with proper HOME, SHELL and LOGNAME environment settings.
    # Exception: delivery for root is done as $default_user.
    # Other environment variables of interest: USER (recipient username),
    # EXTENSION (address extension), DOMAIN (domain part of address),
    # and LOCAL (the address localpart).
    # Unlike other Postfix configuration parameters, the mailbox_command
    # parameter is not subjected to $parameter substitutions. This is to
    # make it easier to specify shell syntax (see example below).
    # Avoid shell meta characters because they will force Postfix to run
    # an expensive shell process. Procmail alone is expensive enough.
    # IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
    # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
    #mailbox_command = /some/where/procmail
    #mailbox_command = /some/where/procmail -a "$EXTENSION"
    # The mailbox_transport specifies the optional transport in master.cf
    # to use after processing aliases and .forward files. This parameter
    # has precedence over the mailbox_command, fallback_transport and
    # luser_relay parameters.
    # Specify a string of the form transport:nexthop, where transport is
    # the name of a mail delivery transport defined in master.cf. The
    # :nexthop part is optional. For more details see the sample transport
    # configuration file.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must update the "local_recipient_maps" setting in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    # Cyrus IMAP over LMTP. Specify ``lmtpunix cmd="lmtpd"
    # listen="/var/imap/socket/lmtp" prefork=0'' in cyrus.conf.
    #mailbox_transport = lmtp:unix:/var/imap/socket/lmtp
    # Cyrus IMAP via command line. Uncomment the "cyrus...pipe" and
    # subsequent line in master.cf.
    #mailbox_transport = cyrus
    # The fallback_transport specifies the optional transport in master.cf
    # to use for recipients that are not found in the UNIX passwd database.
    # This parameter has precedence over the luser_relay parameter.
    # Specify a string of the form transport:nexthop, where transport is
    # the name of a mail delivery transport defined in master.cf. The
    # :nexthop part is optional. For more details see the sample transport
    # configuration file.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must update the "local_recipient_maps" setting in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #fallback_transport = lmtp:unix:/file/name
    #fallback_transport = cyrus
    #fallback_transport =
    # The luser_relay parameter specifies an optional destination address
    # for unknown recipients. By default, mail for unknown@$mydestination,
    # unknown@[$inet_interfaces] or unknown@[$proxy_interfaces] is returned
    # as undeliverable.
    # The following expansions are done on luser_relay: $user (recipient
    # username), $shell (recipient shell), $home (recipient home directory),
    # $recipient (full recipient address), $extension (recipient address
    # extension), $domain (recipient domain), $local (entire recipient
    # localpart), $recipient_delimiter. Specify ${name?value} or
    # ${name:value} to expand value only when $name does (does not) exist.
    # luser_relay works only for the default Postfix local delivery agent.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must specify "local_recipient_maps =" (i.e. empty) in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #luser_relay = [email protected]
    #luser_relay = [email protected]
    #luser_relay = admin+$local
    # JUNK MAIL CONTROLS
    # The controls listed here are only a very small subset. The file
    # SMTPD_ACCESS_README provides an overview.
    # The header_checks parameter specifies an optional table with patterns
    # that each logical message header is matched against, including
    # headers that span multiple physical lines.
    # By default, these patterns also apply to MIME headers and to the
    # headers of attached messages. With older Postfix versions, MIME and
    # attached message headers were treated as body text.
    # For details, see "man header_checks".
    #header_checks = regexp:/etc/postfix/header_checks
    # FAST ETRN SERVICE
    # Postfix maintains per-destination logfiles with information about
    # deferred mail, so that mail can be flushed quickly with the SMTP
    # "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".
    # See the ETRN_README document for a detailed description.
    # The fast_flush_domains parameter controls what destinations are
    # eligible for this service. By default, they are all domains that
    # this server is willing to relay mail to.
    #fast_flush_domains = $relay_domains
    # SHOW SOFTWARE VERSION OR NOT
    # The smtpd_banner parameter specifies the text that follows the 220
    # code in the SMTP server's greeting banner. Some people like to see
    # the mail version advertised. By default, Postfix shows no version.
    # You MUST specify $myhostname at the start of the text. That is an
    # RFC requirement. Postfix itself does not care.
    #smtpd_banner = $myhostname ESMTP $mail_name
    #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
    # PARALLEL DELIVERY TO THE SAME DESTINATION
    # How many parallel deliveries to the same user or domain? With local
    # delivery, it does not make sense to do massively parallel delivery
    # to the same user, because mailbox updates must happen sequentially,
    # and expensive pipelines in .forward files can cause disasters when
    # too many are run at the same time. With SMTP deliveries, 10
    # simultaneous connections to the same domain could be sufficient to
    # raise eyebrows.
    # Each message delivery transport has its XXX_destination_concurrency_limit
    # parameter. The default is $default_destination_concurrency_limit for
    # most delivery transports. For the local delivery agent the default is 2.
    #local_destination_concurrency_limit = 2
    #default_destination_concurrency_limit = 20
    # DEBUGGING CONTROL
    # The debug_peer_level parameter specifies the increment in verbose
    # logging level when an SMTP client or server host name or address
    # matches a pattern in the debug_peer_list parameter.
    debug_peer_level = 2
    # The debug_peer_list parameter specifies an optional list of domain
    # or network patterns, /file/name patterns or type:name tables. When
    # an SMTP client or server host name or address matches a pattern,
    # increase the verbose logging level by the amount specified in the
    # debug_peer_level parameter.
    #debug_peer_list = 127.0.0.1
    #debug_peer_list = some.domain
    # The debugger_command specifies the external command that is executed
    # when a Postfix daemon program is run with the -D option.
    # Use "command .. & sleep 5" so that the debugger can attach before
    # the process marches on. If you use an X-based debugger, be sure to
    # set up your XAUTHORITY environment variable before starting Postfix.
    debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    ddd $daemon_directory/$process_name $process_id & sleep 5
    # If you can't use X, use this to capture the call stack when a
    # daemon crashes. The result is in a file in the configuration
    # directory, and is named after the process name and the process ID.
    # debugger_command =
    # PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;
    # echo where) | gdb $daemon_directory/$process_name $process_id 2>&1
    # >$config_directory/$process_name.$process_id.log & sleep 5
    # Another possibility is to run gdb under a detached screen session.
    # To attach to the screen sesssion, su root and run "screen -r
    # <id_string>" where <id_string> uniquely matches one of the detached
    # sessions (from "screen -list").
    # debugger_command =
    # PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen
    # -dmS $process_name gdb $daemon_directory/$process_name
    # $process_id & sleep 1
    # INSTALL-TIME CONFIGURATION INFORMATION
    # The following parameters are used when installing a new Postfix version.
    # sendmail_path: The full pathname of the Postfix sendmail command.
    # This is the Sendmail-compatible mail posting interface.
    sendmail_path = /usr/bin/sendmail
    # newaliases_path: The full pathname of the Postfix newaliases command.
    # This is the Sendmail-compatible command to build alias databases.
    newaliases_path = /usr/bin/newaliases
    # mailq_path: The full pathname of the Postfix mailq command. This
    # is the Sendmail-compatible mail queue listing command.
    mailq_path = /usr/bin/mailq
    # setgid_group: The group for mail submission and queue management
    # commands. This must be a group name with a numerical group ID that
    # is not shared with other accounts, not even with the Postfix account.
    setgid_group = postdrop
    # html_directory: The location of the Postfix HTML documentation.
    html_directory = no
    # manpage_directory: The location of the Postfix on-line manual pages.
    manpage_directory = /usr/share/man
    # sample_directory: The location of the Postfix sample configuration files.
    # This parameter is obsolete as of Postfix 2.1.
    sample_directory = /etc/postfix
    # readme_directory: The location of the Postfix README files.
    readme_directory = /usr/share/doc/postfix
    #inet_protocols = ipv4
    meta_directory = /etc/postfix
    shlib_directory = /usr/lib/postfix
    # Configure Virtual Mail Addresses
    virtual_mailbox_domains = srckurs.no
    virtual_mailbox_base = /mail
    virtual_mailbox_maps = hash:/etc/postfix/vmailbox
    virtual_minimum_uid = 50
    virtual_uid_maps = static:73
    virtual_gid_maps = static:73
    virtual_alias_maps = hash:/etc/postfix/virtual
    mailbox_size_limit = 0
    virtual_mailbox_limit = 0
    # SASL SUPPORT FOR CLIENTS
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_local_domain = $myhostname
    broken_sasl_auth_clients = no
    smtpd_sasl_security_options = noanonymous
    smtpd_tls_security_level=may
    smtpd_sasl_type = dovecot
    smtpd_sasl_path = private/auth
    smtpd_tls_auth_only = no
    smtpd_tls_loglevel = 1
    # With Postfix version before 2.10, use smtpd_recipient_restrictions
    smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_tls_cert_file = /etc/ssl/certs/server.crt
    smtpd_tls_key_file = /etc/ssl/certs/server.key
    master.cf
    # Postfix master process configuration file. For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master" or
    # on-line: [url]http://www.postfix.org/master.5.html)[/url].
    # Do not forget to execute "postfix reload" after editing this file.
    # ==========================================================================
    # service type private unpriv chroot wakeup maxproc command + args
    # (yes) (yes) (no) (never) (100)
    # ==========================================================================
    smtp inet n - n - - smtpd
    587 inet n - n - - smtpd
    #submission inet n - n - - smtpd
    # -o smtpd_tls_security_level=encrypt
    # -o smtpd_sasl_auth_enable=yes
    # -o smtpd_sasl_type=dovecot
    # -o smtpd_sasl_path=/var/spool/postfix/private/auth
    # -o smtpd_sasl_security_options=noanonymous
    # -o smtpd_sasl_local_domain=$myhostname
    # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    # -o smtpd_sender_login_maps=hash:/etc/postfix/virtual
    # -o smtpd_sender_restrictions=reject_sender_login_mismatch
    # -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject
    #smtp inet n - n - 1 postscreen
    #smtpd pass - - n - - smtpd
    #dnsblog unix - - n - 0 dnsblog
    #tlsproxy unix - - n - 0 tlsproxy
    #submission inet n - n - - smtpd
    # -o syslog_name=postfix/submission
    # -o smtpd_tls_security_level=encrypt
    # -o smtpd_sasl_auth_enable=yes
    # -o smtpd_reject_unlisted_recipient=no
    # -o smtpd_client_restrictions=$mua_client_restrictions
    # -o smtpd_helo_restrictions=$mua_helo_restrictions
    # -o smtpd_sender_restrictions=$mua_sender_restrictions
    # -o smtpd_recipient_restrictions=
    # -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
    # -o milter_macro_daemon_name=ORIGINATING
    #smtps inet n - n - - smtpd
    # -o syslog_name=postfix/smtps
    # -o smtpd_tls_wrappermode=yes
    # -o smtpd_sasl_auth_enable=yes
    # -o smtpd_reject_unlisted_recipient=no
    # -o smtpd_client_restrictions=$mua_client_restrictions
    # -o smtpd_helo_restrictions=$mua_helo_restrictions
    # -o smtpd_sender_restrictions=$mua_sender_restrictions
    # -o smtpd_recipient_restrictions=
    # -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
    # -o milter_macro_daemon_name=ORIGINATING
    #628 inet n - n - - qmqpd
    pickup unix n - n 60 1 pickup
    cleanup unix n - n - 0 cleanup
    qmgr unix n - n 300 1 qmgr
    #qmgr unix n - n 300 1 oqmgr
    tlsmgr unix - - n 1000? 1 tlsmgr
    rewrite unix - - n - - trivial-rewrite
    bounce unix - - n - 0 bounce
    defer unix - - n - 0 bounce
    trace unix - - n - 0 bounce
    verify unix - - n - 1 verify
    flush unix n - n 1000? 0 flush
    proxymap unix - - n - - proxymap
    proxywrite unix - - n - 1 proxymap
    smtp unix - - n - - smtp
    relay unix - - n - - smtp
    # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq unix n - n - - showq
    error unix - - n - - error
    retry unix - - n - - error
    discard unix - - n - - discard
    local unix - n n - - local
    virtual unix - n n - - virtual
    lmtp unix - - n - - lmtp
    anvil unix - - n - 1 anvil
    scache unix - - n - 1 scache
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    # Many of the following services use the Postfix pipe(8) delivery
    # agent. See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #maildrop unix - n n - - pipe
    # flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
    # ====================================================================
    # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
    # Specify in cyrus.conf:
    # lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
    # Specify in main.cf one or more of the following:
    # mailbox_transport = lmtp:inet:localhost
    # virtual_transport = lmtp:inet:localhost
    # ====================================================================
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    #cyrus unix - n n - - pipe
    # user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
    # ====================================================================
    # Old example of delivery via Cyrus.
    #old-cyrus unix - n n - - pipe
    # flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
    # ====================================================================
    # See the Postfix UUCP_README file for configuration details.
    #uucp unix - n n - - pipe
    # flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    # ====================================================================
    # Other external delivery methods.
    #ifmail unix - n n - - pipe
    # flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    #bsmtp unix - n n - - pipe
    # flags=Fq. user=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
    #scalemail-backend unix - n n - 2 pipe
    # flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
    # ${nexthop} ${user} ${extension}
    #mailman unix - n n - - pipe
    # flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
    # ${nexthop} ${user}
    hosts
    ### Hetzner Online AG installimage
    # nameserver config
    # IPv4
    127.0.0.1 aurora.tholden.no aurora
    213.239.218.93 aurora.tholden.no aurora
    # IPv6
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    2a01:4f8:a0:8030::2 Archlinux-2014-64-minmal
    Here is the output of journalctl
    Apr 19 19:44:27 aurora dovecot[1044]: imap-login: Login: user=<[email protected]>, method=CRAM-MD5, rip=::1, lip=::1, mpid=1050, secured, session=<XaePChkUqgAAAAAAAAAAAAAAAAAAAAAB>
    Apr 19 19:44:27 aurora dovecot[1044]: imap([email protected]): Disconnected: Logged out in=32 out=449
    Apr 19 19:44:27 aurora dovecot[1044]: imap-login: Login: user=<[email protected]>, method=CRAM-MD5, rip=::1, lip=::1, mpid=1053, secured, session=<dcqRChkUqwAAAAAAAAAAAAAAAAAAAAAB>
    Apr 19 19:44:27 aurora dovecot[1044]: imap([email protected]): Disconnected: Logged out in=44 out=526
    Apr 19 19:44:51 aurora postfix/pickup[1041]: 342B0F8033D: uid=33 from=<[email protected]>
    Apr 19 19:44:51 aurora postfix/cleanup[1059]: 342B0F8033D: message-id=<[email protected]>
    Apr 19 19:44:51 aurora dovecot[1044]: imap-login: Login: user=<[email protected]>, method=CRAM-MD5, rip=::1, lip=::1, mpid=1062, secured, session=<3Ov5CxkUrQAAAAAAAAAAAAAAAAAAAAAB>
    Apr 19 19:44:51 aurora postfix/qmgr[1042]: 342B0F8033D: from=<[email protected]>, size=580, nrcpt=1 (queue active)
    Apr 19 19:44:51 aurora postfix/smtp[1063]: 342B0F8033D: to=<[email protected]>, relay=none, delay=0.08, delays=0.07/0.01/0.01/0, dsn=5.4.6, status=bounced (mail for tholden.no loops back to myself)
    Apr 19 19:44:51 aurora postfix/cleanup[1059]: 4BDE7F8033E: message-id=<[email protected]>
    Apr 19 19:44:51 aurora postfix/bounce[1064]: 342B0F8033D: sender non-delivery notification: 4BDE7F8033E
    Apr 19 19:44:51 aurora postfix/qmgr[1042]: 4BDE7F8033E: from=<>, size=2523, nrcpt=1 (queue active)
    Apr 19 19:44:51 aurora postfix/qmgr[1042]: 342B0F8033D: removed
    Apr 19 19:44:51 aurora postfix/virtual[1065]: 4BDE7F8033E: to=<[email protected]>, relay=virtual, delay=0.21, delays=0.13/0.01/0/0.07, dsn=2.0.0, status=sent (delivered to maildir)
    Apr 19 19:44:51 aurora postfix/qmgr[1042]: 4BDE7F8033E: removed
    Last edited by tzomatz (2015-04-19 20:04:18)

    tzomatz wrote:
    srckurs.no have two email accounts. Both working fine, and I can send and recve mail between them, and the outside.
    However, for the tholden.no domain, reciving of emails does not work. I can send them though.
    What can be the problem?
    virtual_mailbox_domains = srckurs.no
    But tholden.no is not configured (except in hostname which is for local @aurora.tholden.no users).

  • How to return to the first record of a multiple row cursor (Forms 6i)

    Hi all,
    I had a bit of a search through here, but couldn't quite find the answer I'm after.
    I have a multiple row cursor, which I feed into a multi-row block in Forms 6i. I have the following code:
    OPEN CURSOR;
    LOOP
       FETCH CURSOR INTO :FIELD1, :FIELD2, :FIELD3, :FIELD4;
       ... do other code not related with cursor
       EXIT WHEN CURSOR%NOTFOUND;
       NEXT_RECORD;
    END LOOP;Now, I use the Forms built-in NEXT_RECORD to move down through the records on the form and fill in each row from the db. However, once the block loads (this works correctly), the current item (ie where the typing cursor is left) is on the last record.
    Obviously, I need the current item (after loading) to be on the first record. I tried using the Forms built-in FIRST_RECORD after the END LOOP command, but that gives me an ORA-06511 error (An attempt was made to open a cursor that was already open).
    Does anyone know how I might be able to return to the first record of the block correctly?
    Thanks in Advance,
    Chris.

    Ok, I feel like a bit of a dolt.
    I found that all cursors had to be closed before navigating back to the first record.
    Case closed! :)

  • How to skip first record while inserting data from a flat file to BW system

    Hi Experts,
    In my project we have to upload flat file into a BW system. I have written a program and it is working fine.
    Now we have got another requirement. The flat file will have a header record (first row). While uploading the flat file we have to skip this record. How I can do so?
    The code is as below:
    FORM upload1.
      DATA : wf_title    TYPE string,
              lt_filetab  TYPE filetable,
              l_separator TYPE char01,
              l_action    TYPE i,
              l_count     TYPE i,
              ls_filetab  TYPE file_table,
              wf_delemt TYPE rollname,
              wa_fieldcat TYPE lvc_s_fcat,
              tb_fieldcat TYPE lvc_t_fcat,
              rows_read TYPE i,
              p_error   TYPE char01,
              l_file      TYPE string.
      DATA: wf_object(30)  TYPE c,
              wf_tablnm TYPE rsdchkview.
      wf_object = 'myprogram'.
      DATA i TYPE i.
      DATA:
           lr_mdmt                TYPE REF TO cl_rsdmd_mdmt,
           lr_mdmtr               TYPE REF TO cl_rsdmd_mdmtr,
           lt_idocstate           TYPE rsarr_t_idocstate,
           lv_subrc               TYPE sysubrc.
      TYPES : BEGIN OF test_struc,
               /bic/myprogram TYPE  /bic/oimyprogram,
               txtmd   TYPE rstxtmd,
               END OF test_struc.
      DATA :    tb_assum TYPE TABLE OF /bic/pmyprogram.
      DATA: wa_ztext TYPE  /bic/tmyprogram,
            myprogram_temp TYPE ziott_assum,
            wa_myprogram TYPE /bic/pmyprogram.
      DATA : test_upload TYPE STANDARD TABLE OF test_struc,
             wa2 TYPE  test_struc.
      DATA : wa_test_upload TYPE test_struc,
             ztable_data TYPE TABLE OF /bic/pmyprogram,
             ztable_text TYPE TABLE OF /bic/tmyprogram,
             wa_upld_text TYPE /bic/tmyprogram,
             wa_upld_data TYPE /bic/pmyprogram,
              t_assum TYPE ziott_assum.
      DATA : wa1 LIKE  test_upload.
      wf_title = text-026.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = wf_title
          default_extension       = 'txt'
          file_filter             = 'Tab delimited Text Files (*.txt)'
        CHANGING
          file_table              = lt_filetab
          rc                      = l_count
          user_action             = l_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          OTHERS                  = 3.                          "#EC NOTEXT
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      LOOP AT lt_filetab INTO ls_filetab.
        l_file = ls_filetab.
      ENDLOOP.
      CHECK l_action = 0.
      IF l_file IS INITIAL.
        EXIT.
      ENDIF.
      l_separator = 'X'.
      wa_fieldcat-fieldname = 'test'.
      wa_fieldcat-dd_roll = wf_delemt.
      APPEND wa_fieldcat TO tb_fieldcat.
      CALL FUNCTION 'MESSAGES_INITIALIZE'.
      CLEAR wa_test_upload.
    Upload file from front-end (PC)
    File format is tab-delimited ASCII
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = l_file
          has_field_separator     = l_separator
        TABLES
         data_tab                = i_mara
        data_tab                   = test_upload
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        EXIT.
      ELSE.
       CALL FUNCTION 'MESSAGES_INITIALIZE'.
        IF test_upload IS NOT INITIAL.
          DESCRIBE TABLE test_upload LINES rows_read.
          CLEAR : wa_test_upload,wa_upld_data.
          LOOP AT test_upload INTO wa_test_upload.
            CLEAR :  p_error.
            rows_read = sy-tabix.
            IF wa_test_upload-/bic/myprogram IS INITIAL.
              p_error = 'X'.
              MESSAGE s153 WITH wa_test_upload-/bic/myprogram sy-tabix.
              CONTINUE.
            ELSE.
              TRANSLATE wa_test_upload-/bic/myprogram TO UPPER CASE.
              wa_upld_text-txtmd  = wa_test_upload-txtmd.
              wa_upld_text-txtsh  = wa_test_upload-txtmd.
              wa_upld_text-langu =  sy-langu.
              wa_upld_data-chrt_accts = 'xyz1'.
              wa_upld_data-co_area = '12'.
              wa_upld_data-/bic/zxyzbcsg = 'Iy'.
              wa_upld_data-objvers = 'A'.
              wa_upld_data-changed = 'I'.
              wa_upld_data-/bic/zass_mdl = 'rrr'.
              wa_upld_data-/bic/zass_typ = 'I'.
              wa_upld_data-/bic/zdriver = 'yyy'.
              wa_upld_text-langu = sy-langu.
              MOVE-CORRESPONDING wa_test_upload TO wa_upld_data.
              MOVE-CORRESPONDING wa_test_upload TO wa_upld_text.
              APPEND wa_upld_data TO ztable_data.
              APPEND wa_upld_text TO ztable_text.
            ENDIF.
          ENDLOOP.
          DELETE ADJACENT DUPLICATES FROM ztable_data.
          DELETE ADJACENT DUPLICATES FROM ztable_text.
          IF ztable_data IS NOT INITIAL.
            CALL METHOD cl_rsdmd_mdmt=>factory
              EXPORTING
                i_chabasnm     = 'myprogram'
              IMPORTING
                e_r_mdmt       = lr_mdmt
              EXCEPTIONS
                invalid_iobjnm = 1
                OTHERS         = 2.
       CALL FUNCTION 'MESSAGES_INITIALIZE'.
       **Lock the Infoobject to update
            CALL FUNCTION 'RSDG_IOBJ_ENQUEUE'
              EXPORTING
                i_objnm      = wf_object
                i_scope      = '1'
                i_msgty      = rs_c_error
              EXCEPTIONS
                foreign_lock = 1
                sys_failure  = 2.
            IF sy-subrc = 1.
              MESSAGE i107(zddd_rr) WITH wf_object sy-msgv2.
              EXIT.
            ELSEIF sy-subrc = 2.
              MESSAGE i108(zddd_rr) WITH wf_object.
              EXIT.
            ENDIF.
    *****Update Master Table
            IF ztable_data IS NOT INITIAL.
              CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
                    EXPORTING
                      i_iobjnm                     = 'myprogram'
                      i_tabclass                   = 'M'
           I_T_ATTR                     = lt_attr
                    TABLES
                      i_t_table                    = ztable_data
                      EXCEPTIONS
                     attribute_name_error         = 1
                     iobj_not_found               = 2
                     generate_program_error       = 3
                     OTHERS                       = 4.
              IF sy-subrc <> 0.
                CALL FUNCTION 'MESSAGE_STORE'
                  EXPORTING
                    arbgb  = 'zddd_rr'
                    msgty  = 'E'
                    txtnr  = '054'
                    msgv1  = text-033
                  EXCEPTIONS
                    OTHERS = 3.
                MESSAGE e054(zddd_rr) WITH 'myprogram'.
              ELSE.
                CALL FUNCTION 'MESSAGE_STORE'
                  EXPORTING
                    arbgb  = 'zddd_rr'
                    msgty  = 'S'
                    txtnr  = '053'
                    msgv1  = text-033
                  EXCEPTIONS
                    OTHERS = 3.
              ENDIF.
    *endif.
    *****update Text Table
              IF ztable_text IS NOT INITIAL.
                CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
                  EXPORTING
                    i_iobjnm               = 'myprogram'
                    i_tabclass             = 'T'
                  TABLES
                    i_t_table              = ztable_text
                  EXCEPTIONS
                    attribute_name_error   = 1
                    iobj_not_found         = 2
                    generate_program_error = 3
                    OTHERS                 = 4.
                IF sy-subrc <> 0.
                  CALL FUNCTION 'MESSAGE_STORE'
                    EXPORTING
                      arbgb  = 'zddd_rr'
                      msgty  = 'E'
                      txtnr  = '055'
                      msgv1  = text-033
                    EXCEPTIONS
                      OTHERS = 3.
                ENDIF.
              ENDIF.
            ELSE.
              MESSAGE s178(zddd_rr).
            ENDIF.
          ENDIF.
          COMMIT WORK.
          CALL FUNCTION 'RSD_CHKTAB_GET_FOR_CHA_BAS'
            EXPORTING
              i_chabasnm = 'myprogram'
            IMPORTING
              e_chktab   = wf_tablnm
            EXCEPTIONS
              name_error = 1.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    ****Release locks on Infoobject
          CALL FUNCTION 'RSDG_IOBJ_DEQUEUE'
            EXPORTING
              i_objnm = 'myprogram'
              i_scope = '1'.
        ENDIF.
      ENDIF.
      PERFORM data_selection .
      PERFORM update_alv_grid_display.
      CALL FUNCTION 'MESSAGES_SHOW'.
    ENDFORM.
    Please let me know how I can skip first record of the flat file?
    Regards,
    S

    go through this hope u can get some idea
    REPORT  ztest no standard page heading line-size 255.
                          Declaration                            *
    TYPES t_itab1 TYPE alsmex_tabline.
    types: begin of t_csks,
           kostl like csks-kostl,
          end of t_csks.
    types: begin of t_cska,
           kstar like cska-kstar,
          end of t_cska.
    data: begin of t_flatfile,
          docdate like COHEADER-BLDAT,
          postdate like COHEADER-BUDAT,
          doctext like COHEADER-BLTXT,
           costele like RK23F-KSTAR,
           amount like RK23F-WTGBTR,
           scostctr like RK23F-SKOSTL,
           rcostctr like RK23F-EKOSTL,
           rintorder like RK23F-EAUFNR,
         end of t_flatfile.
    data: begin of t_flatfile1,
          docdate like COHEADER-BLDAT,
          postdate like COHEADER-BUDAT,
          doctext like COHEADER-BLTXT,
           costele like RK23F-KSTAR,
           amount like RK23F-WTGBTR,
           scostctr like RK23F-SKOSTL,
           rcostctr like RK23F-EKOSTL,
           rintorder like RK23F-EAUFNR,
           NUM LIKE SY-INDEX,
         end of t_flatfile1.
    data: itab like table of t_flatfile with header line.
    data: itab2 like table of t_flatfile1 with header line.
    DATA: it_itab1 TYPE STANDARD TABLE OF t_itab1 WITH HEADER LINE,
          MESSTAB1 LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE,
          MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    data: begin of bdcdata occurs 0.
            include structure bdcdata.
    data: end of bdcdata.
    data:t_lin type i VALUE '0',
         u_rec type i VALUE '0',
         s_rec type i VALUE '0'.
    data: it_csks type standard table of t_csks,
          wa_csks type t_csks.
    data: it_cska type standard table of t_cska,
          wa_cska type t_cska.
    *Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME  TITLE text-010.
    parameters: p_docdat  LIKE  COHEADER-BLDAT obligatory,
                p_postda LIKE  COHEADER-BUDAT obligatory,
                p_doctxt  LIKE  COHEADER-BLTXT.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME  TITLE text-011.
    parameters: p_file LIKE RLGRAP-FILENAME obligatory,
                DIS_MODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N'.
    SELECTION-SCREEN END OF BLOCK b2.
                  A T  S E L E C T I O N   S C R E E N                  *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM get_local_file_name USING p_file.
    *Start of Selection
    START-OF-SELECTION.
      Perform get_Excel_data.
      perform validate_data.
      Perform Process_Data.
                    end-of-selection
    end-of-selection.
      perform display_data.
    *&      Form  get_local_file_name
          text
         -->P_P_FILE  text
    FORM get_local_file_name  USING    P_P_FILE.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          file_name = p_file.
    ENDFORM.                    " get_local_file_name
    *&      Form  get_Excel_data
          text
    -->  p1        text
    <--  p2        text
    FORM get_Excel_data .
      FIELD-SYMBOLS : <FS>.
      DATA : V_INDEX TYPE I.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_file
          i_begin_col             = 1
        i_begin_row             = 2
          i_begin_row             = 1
          i_end_col               = 256
          i_end_row               = 9999                        "65536
        TABLES
          intern                  = it_itab1
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        Message text-013 type 'E'.
      ENDIF.
      IF IT_ITAB1[] IS INITIAL.
        Message text-001 type 'E'.
      else.                                    "IF IT_ITAB1[] IS INITIAL.
        data: itab2 like itab occurs 0 with header line.
        SORT IT_ITAB1 BY ROW COL.
        LOOP AT IT_ITAB1.
          MOVE :IT_ITAB1-COL TO V_INDEX.
          ASSIGN COMPONENT V_INDEX OF STRUCTURE itab2 TO  <FS>.
          MOVE : IT_ITAB1-VALUE TO <FS>.
          AT END OF ROW.
            MOVE-CORRESPONDING itab2 TO itab.
            APPEND itab.
            CLEAR:itab,itab2.
          ENDAT.
        endloop.
        describe table itab lines t_lin.
      endif.               "IF IT_ITAB1[] IS INITIAL.
    ENDFORM.                    " get_Excel_data
    *&      Form  Process_Data
          text
    -->  p1        text
    <--  p2        text
    FORM Process_Data .
      data:l_tabix type sy-tabix.
      data:l_periv like t001-periv,
           l_monat like bkpf-monat,
           l_gjahr like bkpf-gjahr,
           l_amt(21) type c.
      data: l_ddate(10),
            l_pdate(10).
      WRITE p_docdat TO l_ddate.
      WRITE p_postda TO l_pdate.
      clear: l_periv,l_monat,l_gjahr.
      select single periv from t001 into l_periv where bukrs = '5000'. "P_bukrs
      if sy-subrc eq 0.
        l_gjahr = p_postda+0(4).
        call function 'FI_PERIOD_DETERMINE'
          EXPORTING
            i_budat = p_postda
            i_bukrs = '5000'     "p_bukrs
            i_periv = l_periv
            i_gjahr = l_gjahr
          IMPORTING
            e_monat = l_monat.
        clear:l_periv.
      endif.
      loop at itab2.
        refresh:bdcdata.
        clear:bdcdata.
        l_tabix = sy-tabix.
        perform bdc_dynpro      using 'SAPLK23F1' '1200'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'COHEADER-SEND_REC_REL'
                                      '10SAP'.
        perform bdc_field       using 'RK23F-STATUS'
                                      'S'.
        perform bdc_field       using 'COHEADER-BLDAT'
                                 itab-docdate.
                                      l_ddate.
        perform bdc_field       using 'COHEADER-BUDAT'
                                 itab-postdate.
                                      l_pdate.
        perform bdc_field       using 'COHEADER-PERIO'
                                       l_monat.                 "'9'.
        perform bdc_field       using 'COHEADER-BLTXT'
                                 itab-doctext.
                                      p_doctxt.
        perform bdc_field       using 'RK23F-KSTAR'
                                      itab2-costele.
        WRITE itab2-amount TO l_amt.
    l_amt = itab-amount.
        condense l_amt no-gaps.
        perform bdc_field       using 'RK23F-WTGBTR'
                                       l_amt.
                                 itab-amount.
        perform bdc_field       using 'RK23F-WAERS'
                                      'USD'.
    *perform bdc_field       using 'RK23F-SGTXT'
                                 itab-doctext.
        perform bdc_field       using 'RK23F-SKOSTL'
                                      itab2-scostctr.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RK23F-EAUFNR'.
        perform bdc_field       using 'RK23F-EKOSTL'
                                      itab2-rcostctr.
        perform bdc_field       using 'RK23F-EAUFNR'
                                      itab2-rintorder.
        perform bdc_dynpro      using 'SAPLK23F1' '1200'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=POST'.
        perform bdc_field       using 'COHEADER-SEND_REC_REL'
                                      '10SAP'.
        perform bdc_field       using 'RK23F-STATUS'
                                      'S'.
        perform bdc_field       using 'COHEADER-BLDAT'
                                 itab-docdate.
                                      l_ddate.
        perform bdc_field       using 'COHEADER-BUDAT'
                                  itab-postdate.
                                      l_pdate.
        perform bdc_field       using 'COHEADER-PERIO'
                                 '9'.
                                        l_monat.
        perform bdc_field       using 'COHEADER-BLTXT'
                                  itab-doctext.
                                      p_doctxt.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RK23F-KSTAR'.
        perform bdc_field       using 'RK23F-WAERS'
                                      'USD'.
        CALL TRANSACTION 'KB15N' USING BDCDATA MODE DIS_MODE MESSAGES INTO MESSTAB.
        If sy-subrc = 0.
          s_rec = s_rec + 1.
        ELSE.
          u_rec = u_rec + 1.
          move ITAB2-NUM to messtab1-msgv1.
          concatenate itab2-costele ' | ' itab2-scostctr  ' | '  itab2-rcostctr ' | ' itab2-rintorder  into  messtab1-msgv2.
          condense messtab1-msgv2.
          condense messtab1-msgv1.
          append messtab1.
        endif.
        clear:itab2.
      endloop.
    ENDFORM.                    " Process_Data
          BDC_DYNPRO                                                     *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
           BDC_FIELD                                                     *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> ''. "NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    "BDC_FIELD
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      skip 2.
      write:/15 text-002.
      skip 2.
      write:/8 text-003.
      SKIP.
      write:/12 text-008,
             25 P_DOCDAT.
      SKIP.
      write:/12 text-009,
             25 P_POSTDA.
      SKIP.
      write:/12 text-012,
              25 P_DOCTXT.
      SKIP.
      write:/12 text-004,
             25 p_file.
      skip 2.
      write:/8 text-005,
            60 t_lin.
      skip.
      write:/8 text-006,
            60 s_rec.
      skip.
      write:/8 text-007,
            60 u_rec.
      skip.
      write:/10 'row no',
             20 'Information'.
      skip.
      loop at messtab1.
        write:/10 messtab1-msgv1,
               20 messtab1-msgv2.
        clear:messtab1.
      endloop.
    ENDFORM.                    " display_data
    *&      Form  validate_data
          text
    -->  p1        text
    <--  p2        text
    FORM validate_data .
      data: l_tabix1 type sy-tabix.
    data: l_tabix2 type sy-tabix.
      if not itab[] is initial.
        select kostl from CSKS into table it_csks.
        if sy-subrc eq 0.
          sort it_csks by kostl.
        endif.
        select kstar from CSKA into table it_cska.
        if sy-subrc eq 0.
          sort it_cska by kstar.
        endif.
        loop at itab.
          l_tabix1 = sy-tabix.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = itab-scostctr
    IMPORTING
       OUTPUT        = itab-scostctr .
          read table it_csks into wa_csks with key kostl = itab-scostctr.
          if sy-subrc ne 0.
            u_rec = u_rec + 1.
           L_TABIX2 = l_tabix1 + 1.
           move l_tabix2 to messtab1-msgv1.
            move l_tabix1 to messtab1-msgv1.
            move itab-rintorder to messtab1-msgv2.
            concatenate itab-costele  ' | ' itab-scostctr  ' | '  itab-rcostctr  ' | ' itab-rintorder  into  messtab1-msgv2.
            condense messtab1-msgv2.
            condense messtab1-msgv1.
            append messtab1.
            clear:wa_csks.
           CLEAR:L_TABIX2.
            continue.
          endif.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = itab-rcostctr
    IMPORTING
       OUTPUT        = itab-rcostctr .
          read table it_csks into wa_csks with key kostl = itab-rcostctr.
          if sy-subrc ne 0.
            u_rec = u_rec + 1.
           L_TABIX2 = l_tabix1 + 1.
           move l_tabix2 to messtab1-msgv1.
            move l_tabix1 to messtab1-msgv1.
              concatenate itab-costele ' | ' itab-scostctr  ' | '  itab-rcostctr ' | ' itab-rintorder  into  messtab1-msgv2.
            condense messtab1-msgv2.
            condense messtab1-msgv1.
            append messtab1.
            clear:wa_csks.
           CLEAR:L_TABIX2.
            continue.
          endif.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = itab-costele
    IMPORTING
       OUTPUT        = itab-costele .
          read table it_cska into wa_cska with key kstar = itab-costele.
          if sy-subrc ne 0.
            u_rec = u_rec + 1.
           L_TABIX2 = l_tabix1 + 1.
           move l_tabix2 to messtab1-msgv1.
            move l_tabix1 to messtab1-msgv1.
            concatenate itab-costele ' | ' itab-scostctr  ' | '  itab-rcostctr ' | ' itab-rintorder  into  messtab1-msgv2.
            condense messtab1-msgv2.
            condense messtab1-msgv1.
            append messtab1.
            clear:wa_csks.
           CLEAR:L_TABIX2.
            continue.
          endif.
    move-corresponding itab to itab2.
    MOVE l_tabix1  TO ITAB2-NUM.
    append itab2.
    clear: itab2.
          clear:itab.
        endloop.
      else.
        message 'No records in File'  type 'S'.
      endif.
    ENDFORM.                    " validate_data

  • Cfmail loops back to original form document yet not sending email.

    I had produced a form to be emailed. after one finishes the form and press submit it loops back top the form again, yet i do not get an email. Doen anyone know why this is happening? Below is the code for the original form and below that is code to my action page... Any suggestions would be welcomed..
    FORM ORIGINAL CODE
    <cfquery name="select_ministry" datasource="ministry9">
    SELECT ministry.ministry
    FROM ministry
    ORDER BY ministry.ministry
    </cfquery>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    @import url("CSS/event_Req_Label.css");
    -->
    </style>
    </head>
    <body>
    <!--- Begin ColdFusion Form --->
    <cfform name="Event_Request" action="EventRequestSend.cfm" method="post" >
    <strong>Event Contact</strong><br />
    <br />
      <span class="eventReq_label">First Name:</span>
                        <cfinput
                        type="text"
                        name="First_Name"
                        message="Please enter your First Name..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Last Name:</span>
                          <cfinput
                        type="text"
                        name="Last_Name"
                        message="Please enter your Last Name..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Phone:</span>
                          <cfinput
                        type="text"
                        name="Phone"
                        message="Please enter your Phone Number..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Email:</span>
                          <cfinput
                        type="text"
                        name="Email_Address"
                        message="Please enter your Email Address..."
                        required="yes" class="event_Request_Box"
                        size="30">
                        </span><br />
                          <br />
                        <br />
                          <strong>About Event/Program</strong><br />
                        <br />
                          <span class="eventReq_label">Event Title:</span>
                          <cfinput
                        type="text"
                        name="Event_Title"
                        message="Please enter the Name of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <br />
                          <span class="eventReq_label">Ministry: </span>
                               <select name="select_ministry" size="1" class="event_Request_Box">
                                 <cfoutput query="select_ministry">
                                   <option value= "#select_ministry.Ministry#" <cfif (isDefined("select_ministry.Ministry") AND select_ministry.Ministry EQ select_ministry.Ministry)>selected</cfif>>#select_ministry.Ministry#</option>
                                 </cfoutput>
                                 </select>
                               <br />
                          <span class="eventReq_label">Event Description:</span>
                          <cftextarea name="Event_Description" cols="40" rows="10" label="Event_Description" required="yes" class="event_Request_Box" id="Event_Description" message="Please Enter a description for the event." tooltip="Please Describe the event in 75 words or less." enabled="no" value="Event_Description" maxlenght="75"></cftextarea>
                          <br />
                          <span class="eventReq_label">Event Date:</span>
                          <cfinput
                        type="text"
                        name="Event_Date"
                        message="Please enter the Date of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Event Time:</span>
                          <cfinput
                        type="text"
                        name="Event_Time"
                        message="Please enter the Time of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Address:</span>
             <cfinput
                        type="text"
                        name="Event_address"
                        message="Please enter the Address of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                        <br />
                          <span class="eventReq_label">Address 2:</span>
                          <cfinput
                        type="text"
                        name="Event_address_2"
                        message="Please enter the Address of the Event..."
                        required="no" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">City:</span>
                          <cfinput
                        type="text"
                        name="Event_City"
                        message="Please enter the City of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">State:</span>
                          <cfinput
                        type="text"
                        name="Event_State"
                        message="Please enter the State of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Zipcode:</span>
                          <cfinput
                        type="text"
                        name="Event_Zip_code"
                        message="Please enter the Zip Code of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Admission Cost:</span>
                          <cfinput
                        type="text"
                        name="admission_Cost"
                        message="Please enter the cost of admission for the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                        <br />
                        <input type="submit" name="Submit" class="submit" value="Submit">
                        <br />
                        <br />
             <!--- End ColdFusion Form --->
                        </cfform>
    </body>
    </html>
    FORM ACTION PAGE CODE
    <!--- Add cfparams to prevent errors on the page --->
    <cfparam name="Event_Request.First_Name" default="">
    <cfparam name="Event_Request.Last_Name" default="">
    <cfparam name="Event_Request.Phone" default="">
    <cfparam name="Event_Request.Email_address" default="">
    <cfparam name="Event_Request.Event_title" default="">
    <cfparam name="Event_Request.select_ministry" default="">
    <cfparam name="Event_Request.Event_Description" default="">
    <cfparam name="Event_Request.Event_Date" default="">
    <cfparam name="Event_Request.Event_Time" default="">
    <cfparam name="Event_Request.Event_address" default="">
    <cfparam name="Event_Request.Event_address_2" default="">
    <cfparam name="Event_Request.Event_City" default="">
    <cfparam name="Event_Request.Event_State" default="">
    <cfparam name="Event_Request.Event_Zip_code" default="">
    <cfparam name="Event_Request.admission_Cost" default="">
    <!--- Create an empty error string --->
    <cfset strError = "">
    <!--- If the form is submitted --->
    <cfif isDefined("Event_Request.Submit")>
    <!--- If the First Name field is empty --->
        <cfif Len(Trim(Event_Request.First_Name)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter your First Name...<br>">
        </cfif>
    <!--- If the Last Name field is empty --->
        <cfif Len(Trim(Event_Request.Last_Name)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter your Last Name...<br>">
        </cfif>
        <!--- If the Phone field is empty --->
        <cfif Len(Trim(Event_Request.Phone)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter your Phone Number...<br>">
        </cfif>
        <!--- If the Email field is empty --->
        <cfif Len(Trim(Event_Request.Email_address)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter your Email Address...<br>">
        </cfif>
        <!--- If the Event_title field is empty --->
        <cfif Len(Trim(Event_Request.Event_title)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter the Name of the Event...<br>">
        </cfif>
    <!--- If the select_ministry is empty --->
        <cfif Len(Trim(Event_Request.select_ministry)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please select the ministry...<br>">
        </cfif>
    <!--- If the Event_Description is empty --->
        <cfif Len(Trim(Event_Request.Event_Description)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "please include your description...<br>">
        </cfif>
    <!--- If the Event_Date is empty --->
        <cfif Len(Trim(Event_Request.Event_Date)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter the date of your program...<br>">
        </cfif>
    <!--- If the Event_Time is empty --->
        <cfif Len(Trim(Event_Request.Event_Time)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter the Time of your program...<br>">
        </cfif>
    <!--- If the Event_address is empty --->
        <cfif Len(Trim(Event_Request.Event_address)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter the address of your program...<br>">
        </cfif>
    <!--- If the Event_City is empty --->
        <cfif Len(Trim(Event_Request.Event_City)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter the city of your program...<br>">
        </cfif>
    <!--- If the Event_State is empty --->
        <cfif Len(Trim(Event_Request.Event_State)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter the state of your program...<br>">
        </cfif>
    <!--- If the Event_Zip_code is empty --->
        <cfif Len(Trim(Event_Request.Event_Zip_code)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter the zipcode of your program...<br>">
        </cfif>
    <!--- If the admission_Cost is empty --->
        <cfif Len(Trim(Event_Request.admission_Cost)) LT 1>
            <!--- Add this to the error string --->
            <cfset strError = strError & "Please enter the Admission Cost of your program...<br>">
        </cfif>
    <!--- If the form was not submitted --->
    <cfelse>
        <!--- Send the user to the form page --->
        <cflocation addtoken="no" url="Event_Request.cfm">
    </cfif>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Response Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    @import url("CSS/event_Req_Label.css");
    -->
    </style>
    </head>
    <body>
    <!--- If the error string is still empty show the results --->
    <cfif strError EQ "">
        <p>Thank you for submitting the Event Request form.</p>
        <p>You submitted the following information:</p>
        <cfoutput>
            <p>    First Name:     #Trim(EVENT_REQUEST.First_Name)#<br><br>
                Last Name:     #Trim(EVENT_REQUEST.Last_Name)#<br><br>
                      Phone:         #Trim(EVENT_REQUEST.Phone)#<br><br>
                Email:         #Trim(EVENT_REQUEST.Email_Address)#<br><br><br><br>
                Event Title:     #Trim(EVENT_REQUEST.Event_Title)#<br><br>
                Ministry:     #Trim(EVENT_REQUEST.select_ministry)#<br><br>
                Description:     #Trim(EVENT_REQUEST.Event_Description)#<br><br>
                Event Date:     #Trim(EVENT_REQUEST.Event_Date)#<br><br>
                Event Time:     #Trim(EVENT_REQUEST.Event_Time)#<br><br>
                Event Address:     #Trim(EVENT_REQUEST.Event_address)#<br><br>
                Event Address 2:#Trim(EVENT_REQUEST.Event_address_2)#<br><br>
                Event City:     #Trim(EVENT_REQUEST.Event_City)#<br><br>
                Event State:     #Trim(EVENT_REQUEST.Event_State)#<br><br>
                Zip code:     #Trim(EVENT_REQUEST.Event_Zip_code)#<br><br>
          Admission_Cost:    #Trim(EVENT_REQUEST.admission_Cost)#<br><br></p>
        </cfoutput>
        <p>Someone will contact you if necessary. </p>
    <!--- Send the email --->
    <cfmail from="#EVENT_REQUEST.Email_Address#"         to="[email protected]"
            subject="You have mail from"
            replyto="#EVENT_REQUEST.Email_Address#"
            server="mail.thehansonco.com">
    You Have an inquiry from:     #Trim(EVENT_REQUEST.First_Name)#
                                #Trim(EVENT_REQUEST.Last_Name)#<br><br>
                          Phone:     #Trim(EVENT_REQUEST.Phone)#<br><br>
                        Email:     #Trim(EVENT_REQUEST.Email_Address)#<br><br><br><br>
                        Event Title:     #Trim(EVENT_REQUEST.Event_Title)#<br><br>
                        Ministry:         #Trim(EVENT_REQUEST.select_ministry)#<br><br>
                        Description:     #Trim(EVENT_REQUEST.Event_Description)#<br><br>
                        Event Date:     #Trim(EVENT_REQUEST.Event_Date)#<br><br>
                        Event Time:     #Trim(EVENT_REQUEST.Event_Time)#<br><br>
                        Event Address:     #Trim(EVENT_REQUEST.Event_address)#<br><br>
                        Event Address 2:#Trim(EVENT_REQUEST.Event_address_2)#<br><br>
                        Event City:     #Trim(EVENT_REQUEST.Event_City)#<br><br>
                        Event State:     #Trim(EVENT_REQUEST.Event_State)#<br><br>
                        Zip code:         #Trim(EVENT_REQUEST.Event_Zip_code)#<br><br>
                        Admission_Cost:    #Trim(EVENT_REQUEST.admission_Cost)#<br><br>
        </cfmail>
    <!--- If the error string is not empty show the form again --->
        <cfelse>
        <!--- Begin ColdFusion Form --->
    <cfform name="Event_Request"  action="EventRequestSend.cfm" method="post" >
    <strong>Event Contact</strong><br />
    <br />
    <!--- Add table row to show error message --->
                    <cfoutput>#strError#</cfoutput>
      <span class="eventReq_label">First Name:</span>
                        <cfinput
                        type="text"
                        name="First_Name"
                        message="Please enter your First Name..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Last Name:</span>
                          <cfinput
                        type="text"
                        name="Last_Name"
                        message="Please enter your Last Name..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Phone:</span>
                          <cfinput
                        type="text"
                        name="Phone"
                        message="Please enter your Phone Number..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Email:</span>
                          <cfinput
                        type="text"
                        name="Email_Address"
                        message="Please enter your Email Address..."
                        required="yes" class="event_Request_Box"
                        size="30">
                        </span><br />
                          <br />
                        <br />
                          <strong>About Event/Program</strong><br />
                        <br />
                          <span class="eventReq_label">Event Title:</span>
                          <cfinput
                        type="text"
                        name="Event_Title"
                        message="Please enter the Name of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <br />
                          <span class="eventReq_label">Ministry: </span>
                               <select name="select_ministry" size="1" class="event_Request_Box">
                                 <cfoutput query="select_ministry">
                                   <option value= "#select_ministry.Ministry#" <cfif (isDefined("select_ministry.Ministry") AND select_ministry.Ministry EQ select_ministry.Ministry)>selected</cfif>>#select_ministry.Ministry#</option>
                                 </cfoutput>
                                 </select>
                               <br />
                          <span class="eventReq_label">Event Description:</span>
                          <cftextarea name="Event_Description" cols="40" rows="10" label="Event_Description" required="yes" class="event_Request_Box" id="Event_Description" message="Please Enter a description for the event." tooltip="Please Describe the event in 75 words or less." enabled="no" value="Event_Description" maxlenght="75"></cftextarea>
                          <br />
                          <span class="eventReq_label">Event Date:</span>
                          <cfinput
                        type="text"
                        name="Event_Date"
                        message="Please enter the Date of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Event Time:</span>
                          <cfinput
                        type="text"
                        name="Event_Time"
                        message="Please enter the Time of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Address:</span>
             <cfinput
                        type="text"
                        name="Event_address"
                        message="Please enter the Address of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                        <br />
                          <span class="eventReq_label">Address 2:</span>
                          <cfinput
                        type="text"
                        name="Event_address_2"
                        message="Please enter the Address of the Event..."
                        required="no" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">City:</span>
                          <cfinput
                        type="text"
                        name="Event_City"
                        message="Please enter the City of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
      <span class="eventReq_label">State:</span>
      <cfinput
                        type="text"
                        name="Event_State"
                        message="Please enter the State of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
    <br />
                          <span class="eventReq_label">Zipcode:</span>
                          <cfinput
                        type="text"
                        name="Event_Zip_code"
                        message="Please enter the Zip Code of the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                          <span class="eventReq_label">Admission Cost:</span>
                          <cfinput
                        type="text"
                        name="admission_Cost"
                        message="Please enter the cost of admission for the Event..."
                        required="yes" class="event_Request_Box"
                        size="30">
                          <br />
                        <br />
                        <input type="submit" name="Submit" class="submit" value="Submit">
                        <br />
                        <br />
                        </cfform>
                        </cfif>
    </body>
    </html>

    When you submit a form, the name of it doesn't matter.  When you process it it's form.this and form.that, not name_of_form.this and name_of_form.that.  In your code, the structure event_request does not exist until the cfparam tags create it.  All of those tags will create variables with empty strings.  Later your code adds a bunch of error messages and doesn't send any mail because of your if/else logic.

  • Merge 2 internal tables into one and show first record from common fields

    Hello PPl,
              I have 3 tables kna1 knb1 and knvp i have to join kna1 and knb1 on kunnr and move the data into an internal table it_data then  on the basis of that data in it_data i have to retrieve records FOR ALL ENTRIES from KNVP and move it into it_knvp.
    Then both it_data and it_knvp should be merged in it_alv and from that internal table report has to be displayed.
    [NOTE: i had tried using loop twice but the report got messed up]
    Apart from that for these set of values
    0000000004
    0000000418
    0000000954
    0000001190
    0000001222
    0000001451
    0000001453
    0000001455
    0000001470
    0000001508
    finally knvp is showing records in such a way that for 2 records kunnr is same and so does all the other fields except PARZA and KUNN2 so the req. is to display only the first record among 2.
    Plz help me by providing code for that its urgent......
    Below i m providing my code so far, i hope it will be of some help.
    TREMENDOUS REWARD POINTS GURANTEED!!!!!
    REPORT  zfanz_alv_report_whv.
    TYPE-GROUPS                                                         *
    TYPE-POOLS: slis.
    TYPES                                                               *
    TYPES: BEGIN OF ty_data,
           kunnr TYPE kunnr,
           ort01 TYPE ort01,
           pstlz TYPE pstlz,
           regio TYPE regio,
           bukrs TYPE bukrs,
           zterm TYPE zterm,
           END OF ty_data,
           BEGIN OF ty_knvp,
           vkorg TYPE vkorg,
           vtweg TYPE vtweg,
           spart TYPE spart,
           parvw TYPE parvw,
           parza TYPE parza,
           kunn2 TYPE kunn2,
           lifnr TYPE lifnr,
           END OF ty_knvp,
           BEGIN OF ty_alv,
           kunnr TYPE kunnr,
           ort01 TYPE ort01,
           pstlz TYPE pstlz,
           regio TYPE regio,
           bukrs TYPE bukrs,
           zterm TYPE zterm,
           vkorg TYPE vkorg,
           vtweg TYPE vtweg,
           spart TYPE spart,
           parvw TYPE parvw,
           parza TYPE parza,
           kunn2 TYPE kunn2,
           lifnr TYPE lifnr,
           END OF ty_alv,
           BEGIN OF ty_kna1,
           kunnr TYPE kunnr,
           END OF ty_kna1,
           BEGIN OF ty_knb1,
           bukrs TYPE bukrs,
           END OF ty_knb1.
    *DATA: IT_KNVP TYPE KNVP,
    DATA: it_knvp TYPE STANDARD TABLE OF ty_knvp WITH HEADER LINE.
    DATA: it_data TYPE STANDARD TABLE OF ty_data WITH HEADER LINE.
    Report data to be shown.
    DATA: it_alv TYPE STANDARD TABLE OF ty_alv WITH HEADER LINE.
    Heading of the report.
    DATA: t_heading TYPE slis_t_listheader.
    *DATA: fieldcatalog type standard table of slis_fieldcat_alv with header
    *line.
    DATA: fieldcatalog TYPE  slis_t_fieldcat_alv WITH HEADER LINE.
    *TABLES
    tables:knvp,kna1,knb1.
                     CONSTANTS                                           *
    CONSTANTS: c_kunnr TYPE char5 VALUE 'KUNNR',
    c_ort01 TYPE char5 VALUE 'ORT01',
    c_pstlz TYPE char5 VALUE 'PSTLZ',
    c_regio TYPE char5 VALUE 'REGIO',
    c_bukrs TYPE char5 VALUE 'BUKRS',
    c_zterm TYPE char5 VALUE 'ZTERM',
    c_vkorg TYPE char5 VALUE 'VKORG',
    c_vtweg TYPE char5 VALUE 'VTWEG',
    c_spart TYPE char5 VALUE 'SPART',
    c_parvw TYPE char5 VALUE 'PARVW',
    c_parza TYPE char5 VALUE 'PARZA',
    c_kunn2 TYPE char5 VALUE 'KUNN2',
    c_lifnr TYPE char5 VALUE 'LIFNR'.
    WORKAREA                                                           *
    DATA: wa_data TYPE ty_data,
          wa_knvp TYPE ty_knvp,
          wa_alv TYPE ty_alv,
          wa_fcat  TYPE slis_fieldcat_alv,
          wa_layout TYPE slis_layout_alv.
    ======================= Selection Screen ==========================
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    *DATA: wa_kunnr LIKE kna1-kunnr,
         wa_bukrs LIKE knb1-bukrs,
         wa_vkorg LIKE knvp-vkorg,
         wa_vtweg LIKE knvp-vtweg,
         wa_spart LIKE knvp-spart,
         wa_parvw LIKE knvp-parvw.
    SELECT-OPTIONS                                                      *
    SELECT-OPTIONS s_kunnr FOR kna1-kunnr NO INTERVALS OBLIGATORY
    SELECT-OPTIONS: s_bukrs FOR knb1-bukrs NO-EXTENSION NO INTERVALS,
    s_vkorg FOR knvp-vkorg  NO-EXTENSION NO INTERVALS,
    s_vtweg FOR knvp-vtweg NO-EXTENSION NO INTERVALS,
    s_spart FOR knvp-spart NO-EXTENSION NO INTERVALS,
    s_parvw FOR knvp-parvw NO-EXTENSION NO INTERVALS.
    SELECTION-SCREEN: END OF BLOCK b1.
    AT SELECTION-SCREEN                                            *
    AT SELECTION-SCREEN ON s_kunnr.
      PERFORM validate_data.
    START-OF-SELECTION                                                   *
    START-OF-SELECTION.
      PERFORM get_data.  "fetch data from table and perform join on them
      PERFORM final_table.
      PERFORM build_fieldcatalog.            "populate field catalog
      PERFORM build_layout.
      PERFORM grid_display.                  "display the result in ALV grid
    END-OF-SELECTION                                                     *
    END-OF-SELECTION.
    describe
    SUBROUTINES (FORMS)
    *&      Form  get_data
          Gets the information to be shown in the report.
          Join on tables KNA1, KNB1 and for all enteries in KNVP
    -->  p1        text
    <--  p2        text
    FORM get_data.
      SELECT kna1~kunnr
      kna1~ort01
      kna1~pstlz
      kna1~regio
      knb1~bukrs
      knb1~zterm
      INTO TABLE it_data
      FROM kna1 INNER JOIN knb1
      ON kna1kunnr = knb1kunnr
        WHERE kna1~kunnr IN s_kunnr
       AND knb1~bukrs IN s_bukrs.
      SELECT vkorg
             vtweg
             spart
             parvw
             parza
             kunn2
             lifnr
            INTO TABLE it_knvp FROM knvp
       FOR ALL ENTRIES IN it_data
       WHERE  knvp~kunnr = it_data-kunnr
         AND  vkorg IN s_vkorg
         AND  vtweg IN s_vtweg
         AND  spart IN s_spart
         AND  parvw IN s_parvw.
    ENDFORM. " get_data
    *ENDFORM. " get_data
    *&      Form  FINAL_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM final_table .
      LOOP AT it_data.
        it_alv-kunnr = it_data-kunnr.
        it_alv-ort01 = it_data-ort01.
        it_alv-pstlz = it_data-pstlz.
        it_alv-regio = it_data-regio.
        it_alv-bukrs = it_data-bukrs.
        it_alv-zterm = it_data-zterm.
        APPEND it_alv.
        CLEAR it_alv.
      ENDLOOP.
      LOOP AT it_knvp.
        it_alv-vkorg = it_knvp-vkorg.
        it_alv-vtweg = it_knvp-vtweg.
        it_alv-spart = it_knvp-spart.
        it_alv-parvw = it_knvp-parvw.
        it_alv-parza = it_knvp-parza.
        it_alv-kunn2 = it_knvp-kunn2.
        it_alv-lifnr = it_knvp-lifnr.
        APPEND it_alv.
        CLEAR it_alv.
      ENDLOOP.
    ENDFORM.                    " FINAL_TABLE
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      IF it_alv[] IS NOT INITIAL.
        wa_fcat-fieldname   = c_kunnr.
        wa_fcat-seltext_l   = 'Customer Master'(001).
        wa_fcat-col_pos     = 1.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_ort01.
        wa_fcat-seltext_l   = 'City'(002).
        wa_fcat-col_pos     = 2.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_pstlz.
        wa_fcat-seltext_l   = 'Postal Code'(003).
        wa_fcat-col_pos     = 3.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_regio.
        wa_fcat-seltext_l   = 'Region'(004).
        wa_fcat-col_pos     = 4.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_bukrs.
        wa_fcat-seltext_l   = 'Company Code'(005).
        wa_fcat-col_pos     = 5.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_zterm.
        wa_fcat-seltext_l   = 'Terms of payment'(006).
        wa_fcat-col_pos     = 6.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_vkorg.
        wa_fcat-seltext_l   = 'Sales Organization'(007).
        wa_fcat-col_pos     = 7.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_vtweg.
        wa_fcat-seltext_l   = 'Distribution Channel'(008).
        wa_fcat-col_pos     = 8.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_spart.
        wa_fcat-seltext_l   = 'Division'(009).
        wa_fcat-col_pos     = 9.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_parvw.
        wa_fcat-seltext_l   = 'Partner function'(010).
        wa_fcat-col_pos     = 10.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_kunn2.
        wa_fcat-seltext_l   = 'Customer number of partner'(011).
        wa_fcat-col_pos     = 11.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
        wa_fcat-fieldname   = c_lifnr.
        wa_fcat-seltext_l   = 'Account Number of Vendor'(012).
        wa_fcat-col_pos     = 12.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
       wa_fcat-fieldname   = c_parza.
       wa_fcat-seltext_l   = 'Partner counter'(013).
        wa_fcat-col_pos     = 13.
        APPEND wa_fcat TO fieldcatalog.
        CLEAR  wa_fcat.
    *fieldcatalog-fieldname   = c_kunnr.
       fieldcatalog-seltext_l   = 'Customer Master'(001).
       fieldcatalog-col_pos     = 1.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_ort01.
       fieldcatalog-seltext_l   = 'City'(002).
       fieldcatalog-col_pos     = 2.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_pstlz.
       fieldcatalog-seltext_l   = 'Postal Code'(003).
       fieldcatalog-col_pos     = 3.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_regio.
       fieldcatalog-seltext_l   = 'Region'(004).
       fieldcatalog-col_pos     = 4.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_bukrs.
       fieldcatalog-seltext_l   = 'Company Code'(005).
       fieldcatalog-col_pos     = 5.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_zterm.
       fieldcatalog-seltext_l   = 'Terms of payment'(006).
       fieldcatalog-col_pos     = 6.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_vkorg.
       fieldcatalog-seltext_l   = 'Sales Organization'(007).
       fieldcatalog-col_pos     = 7.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_vtweg.
       fieldcatalog-seltext_l   = 'Distribution Channel'(008).
       fieldcatalog-col_pos     = 8.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_spart.
       fieldcatalog-seltext_l   = 'Division'(009).
       fieldcatalog-col_pos     = 9.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_parvw.
       fieldcatalog-seltext_l   = 'Partner function'(010).
       fieldcatalog-col_pos     = 10.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_kunn2.
       fieldcatalog-seltext_l   = 'Customer number of partner'(011).
       fieldcatalog-col_pos     = 11.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_lifnr.
       fieldcatalog-seltext_l   = 'Account Number of Vendor'(012).
       fieldcatalog-col_pos     = 12.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
       fieldcatalog-fieldname   = c_parza.
       fieldcatalog-seltext_l   = 'Partner counter'(013).
       fieldcatalog-col_pos     = 13.
       APPEND fieldcatalog TO fieldcatalog.
       CLEAR  fieldcatalog.
      ENDIF.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  build_layout
          text
    -->  p1        text
    <--  p2        text
    form build_layout .
    Set layout field for field attributes(i.e. input/output)
    wa_layout-stylefname = 'FIELD_STYLE'.
      wa_layout-zebra             = 'X'.
    endform.                    " build_layout
    *&      Form  GRID_DISPLAY
          text
    FORM grid_display. "using t_data type ty_tbl_data.
      IF it_alv[] IS NOT INITIAL.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = sy-repid
       IS_LAYOUT                         = wa_layout
         it_fieldcat                       = fieldcatalog[]
        TABLES
          t_outtab                          = it_alv[]
      EXCEPTIONS
            program_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.
      ENDIF.
    ENDIF.
    ENDFORM.                    "GRID_DISPLAY
    *&      Form  VALIDATE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM validate_data .
      DATA : li_kna1 TYPE STANDARD TABLE OF ty_kna1,
             li_knb1 TYPE STANDARD TABLE OF ty_knb1,
             li_knvp TYPE STANDARD TABLE OF ty_knvp.
      SELECT kunnr
      FROM kna1
      INTO TABLE li_kna1
      WHERE kunnr IN s_kunnr.
      IF sy-subrc <> 0.
        MESSAGE 'Invalid Customer Number'(013) TYPE 'E'.
      ENDIF.
      SELECT bukrs
      FROM t001
      INTO TABLE li_knb1
      WHERE bukrs IN s_bukrs.
        IF sy-subrc <> 0.
          MESSAGE 'Invalid Company Code'(014) TYPE 'E'.
        ENDIF.
        SELECT vkorg
        FROM tvko
        INTO TABLE li_knvp
        WHERE vkorg IN s_vkorg.
          IF sy-subrc <> 0.
            MESSAGE 'Invalid Sales Organization'(015) TYPE 'E'.
          ENDIF.
          SELECT vtweg
          FROM tvtw
          INTO TABLE li_knvp
          WHERE vtweg IN s_vtweg.
            IF sy-subrc <> 0.
              MESSAGE 'Invalid Distribution Channel'(016) TYPE 'E'.
            ENDIF.
            SELECT spart
            FROM tspa
            INTO TABLE li_knvp
            WHERE spart IN s_spart.
              IF sy-subrc <> 0.
                MESSAGE 'Invalid Division'(017) TYPE 'E'.
              ENDIF.
              SELECT parvw
              FROM tpar
              INTO TABLE li_knvp
              WHERE parvw IN s_parvw.
                IF sy-subrc <> 0.
                  MESSAGE 'Invalid Partner function'(018) TYPE 'E'.
                ENDIF.
            ENDFORM.                    " VALIDATE_DATA

    *1----
    FORM get_data.
      SELECT kna1~kunnr
      kna1~ort01
      kna1~pstlz
      kna1~regio
      knb1~bukrs
      knb1~zterm
      INTO TABLE it_data
      FROM kna1 INNER JOIN knb1
      ON kna1kunnr = knb1kunnr
        WHERE kna1~kunnr IN s_kunnr
       AND knb1~bukrs IN s_bukrs.
      CHECK it_data[] IS NOT INITIAL.
      SELECT kunnr
             vkorg
             vtweg
             spart
             parvw
             parza
             kunn2
             lifnr
            INTO TABLE it_knvp FROM knvp
       FOR ALL ENTRIES IN it_data
       WHERE  kunnr = it_data-kunnr
         AND  vkorg IN s_vkorg
         AND  vtweg IN s_vtweg
         AND  spart IN s_spart
         AND  parvw IN s_parvw.
      IF sy-subrc EQ 0.
        SORT it_knvp BY kunnr.
      ENDIF.
    ENDFORM. " get_data
    *2----
    FORM final_table .
      LOOP AT it_data INTO wa_data.
        READ TABLE it_knvp
        INTO wa_knvp
        WITH KEY kunnr = wa_data-kunnr
        BINARY SEARCH .
        IF sy-subrc = 0.
          MOVE-CORRESPONDING wa_data TO wa_alv.
          MOVE-CORRESPONDING wa_knvp TO wa_alv.
          APPEND wa_alv TO it_alv.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " FINAL_TABLE
    Edited by: Faisal Khan on Mar 27, 2008 1:59 PM

  • IPhone: Using embedded QT movies that either Loop or Loop Back and Forth

    Hi to everyone,
    I'm working on a very simple iPhone app:
    it has several buttons that launch different QuickTime movies embedded in the application, that will either Loop or Loop Back and Forth.
    The desired looping behaviour is already set within QuickTime itself (those settings are available in QuickTime's View menu).
    So far it doesn't seem to work, as the iPhone's SDK doesn't seem to recognize these QuickTime settings of Loop or Loop Back and Forth.
    I've been trying to find advanced documentation on the matter, with no luck.
    Does anyone knows if it's possible to create an iPhone application that has embedded QuickTime movies that either Loop or Loop Back and Forth?
    If it is possible to do so, can you please post some code (or links) explaining how to proceed?
    If the feature is not currently supported, does anyone knows if it will eventually be supported by Apple (maybe in a future SDK revision)?
    While I don't know the entire context the SDK engineering team has to contend with, it seems to me it should be rather simple for Apple's iPhone SDK to simply accept the settings already put in place inside a QuickTime movie.
    Many thanks in advance for any feedback on this!

    Well, my programmers have come back to me and the news is not good.
    The QTMovieLoopsAttribute is not supported in the SDK's QT Kit.
    I'll now call it SDK's *QuickTime Kit Lite*, if you don't mind.
    *QuickTime Kit Lite*, the key audio/video toolbox available for development of applications on the iPhone through the SDK, provides a single option:
    a Play / Stop button.
    The only other thing available (I think) is the option to hide the play/stop controller. That's it.
    Apparently, there are several unofficial, private frameworks that give access to lower-level QuickTime functions and that may provide a way to actually loop videos, but chances are that an app using these unofficial frameworks would get rejected by Apple upon submission for the store.
    I'm still waiting for more info and the final word from my programmers, but from the looks of it, this is going to be a show-stopper shortcoming of QT Kit Lite, as far as my project is concerned.
    I'm probably going to have to fold my project and wait (hope) for an eventual upgrade to the SDK's QT Kit.
    By the way, does anyone knows if there is a way to communicate with Apple and request new features for inclusion in future revisions of the SDK?
    Upgrading the QuickTime Kit librairies to include the video Loop and Loop Back and Forth Attributes would be my first (and only) request.
    many thanks to all!

  • Only first record in internal table in output

    Hi,
    I have a requirement.
    I loop at an internal table and that tabl (list_selected_records) records.
    Loop at list_of_selected_nodes into wa_selected_nodes.
    node = wa_selected_nodes-node_id.
    node_level = wa_selected_nodes-node_level.
    read table ex_list_of_texts
    into wa_list_of_texts
    with key node_id = node
    binary search.
    IF sy-subrc eq 0.
    node_text = wa_list_of_texts-text.
    ENDIF.
    node_level = node_level - 1.
    Selecting Text for Node selected (Business Scenario)
    READ TABLE list_of_all_nodes into wa_all_nodes WITH KEY NODE_LEVEL = node_level
    BINARY SEARCH.
    if sy-subrc = 0.
    SELECT SINGLE TEXT FROM TTREET into texts WHERE ID EQ wa_all_nodes-tree_id
    AND SPRAS EQ 'EN '.
    IF NOT TEXTS IS INITIAL.
    wa_final-texts = texts.
    append wa_final to it_final.
    CLEAR WA_FINAL.
    endif.
    endif.
    endloop.
    This is my code.
    Now from the select single stmt i fetch a text and add it to be internal table . Once i fetch a one record the loop should be ended and a new iteration for for a second guid should start.
    Once one record , first record is fetched for texts, only that shd appear in alv output but not other. but the loop should contnue for other fields. Please help
    Thanks in Advance.
    SS

    Hi Swarna,
    Use control event AT-NEW inside the loop. This event will triger only once for every new node_id.
    Loop at list_of_selected_nodes into wa_selected_nodes.
    AT-NEW node_id.
    node = wa_selected_nodes-node_id.
    node_level = wa_selected_nodes-node_level.
    read table ex_list_of_texts
    into wa_list_of_texts
    with key node_id = node
    binary search.
    IF sy-subrc eq 0.
    node_text = wa_list_of_texts-text.
    ENDIF.
    node_level = node_level - 1.
    Selecting Text for Node selected (Business Scenario)
    READ TABLE list_of_all_nodes into wa_all_nodes WITH KEY NODE_LEVEL = node_level
    BINARY SEARCH.
    if sy-subrc = 0.
    SELECT SINGLE TEXT FROM TTREET into texts WHERE ID EQ wa_all_nodes-tree_id
    AND SPRAS EQ 'EN '.
    IF NOT TEXTS IS INITIAL.
    wa_final-texts = texts.
    append wa_final to it_final.
    CLEAR WA_FINAL.
    endif.
    endif.
    ENDAT.
    endloop.
    Thanks & Regards,
    Parameswaran.K

  • File Write Adapter, First record as a Column Header

    Hi,
    Using File adapter of type WRITE i m creating a file.
    I want to include the column header also as a first record in File.
    One way i can think of Creating one record manually and append as a first record in the File write variable.
    Is there any other simple way or standard way to do it??

    To have fixed header every time before it writes the data, i think you should have file with header and data, then use it to configure file write in JCA adapter.
    This will create a schema with static header and dynamic results to the schema file.
    So that everytime you will have the header then it write the data below that.
    Note: I have done this some years back, i wrote here with from my memory.
    Let me know if you still have problem, wll try to create a simple example and share.
    Thanks,
    Vijay

Maybe you are looking for

  • How Do I get SSIS To Stop Looping Through Excel Rows After Last Populated Record?

    I have a package that loops through many excel files. Each Excel File has about 5000 rows. My problem is that after the 5000th row SSIS keeps looping through all the rows after the last row. There are nothing in these rows. This is a complete bottlen

  • Oracle support table w/HACMP on RS/6000

    There use to a be a table that we could reference for versions of Oracle supported with versions of HACMP. What happened to it? It used to be: http://www.oracle.com/ibm/rs6000/html/rs6matrix.html#rdbms Any ideas?

  • Upload Personnel Photos

    Hi, I will make the integration with the time attendance machines and I want to know what is the field name and what is the table storage the personnel photos on database. I have followed the given steps below: 1. Create a number range for SAP Archiv

  • A little dot in my screen???A diff coloured pixel?Froze twice.

    Well, on my ipod i only notice it sometimes so i guess its there only sometimes but its( i will give an example) the apple logo is on and you will see this white little dot in the screen, its not on it cause i wipped it off.Its part of the video scre

  • I can't remember what my security questions are

    How do I reset my security questions