A simple ABAP question

Friends,
I am intrigued with the following date comparison logic. This is a small snippet that I cut&paste from SAP code and modified to check whether the logic is correct.
the logic below writes STATUS 68. From SAP point of view and I agree, that it should not write 68.
Can you please elaborate the problem here.
Thanks in advance.
William
DATA: i_aedat type sy-datum,  " Equipment Change date in the decentral
      l_aedat type sy-datum.  " Equipment Change date in the central.
I_aedat = '20120119'. "From deployed
L_aedat = '20120118'. "In central
* posting in Central
  if l_aedat  is not initial.
*...change mode
    if I_aedat < L_aedat.
*.....existing entry is the actual one,
*.....we don't won't overtake old data
      write: / 'status 68'.
    endif.
  endif.
Moderator message: please choose more descriptive titles for your posts, everybody here has ABAP questions...
Edited by: Thomas Zloch on Feb 20, 2012

Ok, here is the function module
Please note i_aedat is the change date in the decentral and l_aedat is the changed date in the central
The function module determine whether the existing central date is before the Decentrla date.
If so it would update the central data with decentral data.
Code below produce 68 at our installation and it does not with Vijaj and Patrick. I concur with their reply.
The code that I have provided is how the function module behaves.
So is it a kernel issue?
Any help is much appreciated.
Thanks
William
function /isdfps/etups_maintain_chk.
""Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(I_EQUNR) TYPE  EQUNR
*"     REFERENCE(I_AEDAT) TYPE  AEDAT
*"  EXCEPTIONS
*"      NOT_ALLOWED
  data: l_aedat  like equi-aedat.
  select single aedat into l_aedat
    from equi
   where equnr = i_equnr.
  if sy-subrc is initial and
     l_aedat  is not initial.
*...change mode
    if i_aedat < l_aedat.
*.....existing entry is the actual one,
*.....we don't won't overtake old data
      raise not_allowed.
    endif.
  endif.
endfunction.

Similar Messages

  • Abap  questions

    Hi !
    I wanted to ask few Abap questions :
    1. How do i show a calendar on select options date field ?
    2. what is the name of the function for changes currencies of field ? for example i need to change from type Usd to Euro ?
    3. What is the function for abstract , adding dates fields ? ( not to take in account a  Saturday and not working days ).
    thanks
    moshe

    Hi Moshe,
    For Calender if you any field to which the domain DATUM is assigned it shows calender.
    for eg,
    select-options date for P0000_AF-hiredate.
    You can try the function module to add the days WDKAL_DATE_ADD_FKDAYS.
    One of the function modules to convert currency is HR_ECM_CONVERT_CURRENCY
    Thanks
    Lakshman

  • Barcode printing in simple abap report

    Hai,
    I want to print Barcode for 'RESERVATION' in my simple abap report.Can you please give step by step procedure to achieve this?
    Thank you.
    Note :I saw many threads in sdn,it is NOT clear for me.
    With Regards,
    Jaheer.

    Hi Hussain ,
    Go through the program RSPO0031
    This will help you out.
    Regards,
    Yogendra Bhaskar

  • Printing a simple abap-list in panel-format (DIN A4)

    Hallo Ladies and Gentlemen,
    i have a simple abap-list. when i print it, the list will be printed in landscape-format. how can i change it? i have to print it in panel-format.
    Thanks a lot,
    Marcel

    Hi Marcel,
    I think you have to click on the "Full Administration" button t see the option for "Page Formats"...
    Also go to transaction SPAD,
    in Devices / Servers tab press Output devices button
    Double click on the device type of your printer
    Press button Formats
    and here you get a list of all formats for your printer
    Regards,
    Abhy

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • 4 Simple Flash Questions that Are Stumping Me!

    What is the Frame Rate for Web Animations
    Q1. I am making an animation which will be played on the web. What is the default frame rate (fps) of Flash CS5? And what is the frame rate of for web?
    Q2. My animation needs to be 30 seconds long. So at 15 fps that would mean I need to use 600 frames in Flash?
    How Do I Mask everything so all I see is the Content on the Stage?
    I have a wide image that extends past my movies stage size so when I preview my movie the image is visible. How do I mask out anything that extends past my movies window size? I believe I can create a layer named "mask" and place it above all other layers, but I forget how to make the mask. Any help is appreciated.
    How to Fade a Graphic
    I have a graphic element (some type) and I want it to fade from 0% to 100%. In older versions of Flash I could just select the symbol and then set it's alpha value to 0%, move a few keyframes and then set the alpha to 100%. Voila! but now it doesn't seem to work that way. How can I do this in CS5?

    Ned, it says 24 fps which means there is 24 frames per second so each 24 frames is 1 second.
    Date: Fri, 4 Nov 2011 05:35:16 -0600
    From: [email protected]
    To: [email protected]
    Subject: 4 Simple Flash Questions that Are Stumping Me!
        Re: 4 Simple Flash Questions that Are Stumping Me!
        created by Ned Murphy in Flash Pro - General - View the full discussion
    1 You can create your character as a movieclip and copy/paste that movieclip from one file to another. 2. One way to create a movieclip is to copy all the frame of the animation's timeline (select them all, right click the selection, choose Copy Frames), then create a new movieclip symbol (Insert -> New Symbol...etc) right click on its only keyframe and chhose Paste Frames.  THat will put all the layers and frames you copied into the movieclip The only way to come close to being certain about the timing of you animation is to use code to keep track of the time, something like getTimer()..  The frame rate that a file plays at is not a reliable means of dictating the time it takes due to a variety of factors which include the amount of content you are trying to process and performance limits of the user's machine.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4007420#4007420
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4007420#4007420. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Flash Pro - General by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Converting PNP related statement to simple ABAP

    Hello,
    i had a report which uses PNP logical database of HR module.
    the code contains two specific lines to be used with it.
    Get PERNR.
    and
    rp_provide_from_last p0000 space pn-begda pn-endda.
    Now i want to do the same functionality using simple ABAP statements.
    Could you please guide me. My requirement is that i had to fill a table, lets take Pa0000 internal table, so for that i could use a select statemnt instead of GET PERNR statement.
    but didnt getting the conversion for the macro being used above. Also the PERNR field is not a mandatory one on the selection screen

    hi check this program,
    *& Report  ZBEN
    REPORT  ZBEN.
    tables:t591a,pa0021,pa0002.
    DATA:BEGIN OF IT_PA0002 OCCURS 0,
         PERNR LIKE PA0002-PERNR,
         BEGDA LIKE PA0002-BEGDA,
         ENDDA LIKE PA0002-ENDDA,
         END OF IT_PA0002.
    DATA:BEGIN OF IT_PA0021 OCCURS 0,
         PERNR LIKE PA0021-PERNR,
         subty like pa0021-subty,
         BEGDA LIKE PA0021-BEGDA,
         ENDDA LIKE PA0021-ENDDA,
         FAMSA LIKE PA0021-FAMSA,
         OBJPS LIKE PA0021-OBJPS,
         FAVOR LIKE PA0021-FAVOR,
         FANAM LIKE PA0021-FANAM,
         KDSVH LIKE PA0021-KDSVH,
         KDART LIKE PA0021-KDART,
         END OF IT_PA0021.
    data:it_t591a type t591a occurs 0 with header line.
    data:it_t591s type t591s occurs 0 with header line.
    PARAMETERS:P_PERNR LIKE PA0021-PERNR.
    START-OF-SELECTION.
    SELECT PERNR
           BEGDA
           ENDDA
           FROM PA0021
           INTO TABLE IT_PA0002
           WHERE PERNR = P_PERNR.
           IF SY-SUBRC = 0.
           SELECT PERNR
                  subty
                  BEGDA
                  ENDDA
                  FAMSA
                  FAVOR
                  OBJPS
                  FANAM
                  KDSVH
                  KDART
                  FROM PA0021
                  INTO CORRESPONDING FIELDS OF TABLE IT_PA0021
                  FOR ALL ENTRIES IN IT_PA0002
                  WHERE PERNR = IT_PA0002-PERNR.
                  if sy-subrc = 0.
                 SELECT * FROM T591A
                        INTO table it_t591a
                        for all entries in it_pa0021
                         where infty = '0021'
                         and subty = it_pa0021-subty.
                   if sy-subrc = 0.
                   select * from t591s into table it_t591s where sprsl = 'EN'
                                                           and infty = '0021'
                                                           and subty = it_t591a-subty.
                  IF SY-SUBRC = 0.
                  LOOP AT IT_PA0021.
                  WRITE:/ IT_PA0021-PERNR, IT_PA0021-BEGDA, IT_PA0021-ENDDA, IT_PA0021-FAMSA, IT_PA0021-OBJPS,it_t591s-stext,IT_PA0021-FAVOR, IT_PA0021-FANAM, IT_PA0021-KDSVH, IT_PA0021-KDART.
                  ENDLOOP.
                  ENDIF.
               endif.
                  ENDIF.
                  endif.
    reward points if useful,
    venkat.
    Edited by: venkat  appikonda on Mar 5, 2008 12:11 PM

  • Simple performance question

    Simple performance question. the simplest way possible, assume
    I have a int[][][][][] matrix, and a boolean add. The array is several dimensions long.
    When add is true, I must add a constant value to each element in the array.
    When add is false, I must subtract a constant value to each element in the array.
    Assume this is very hot code, i.e. it is called very often. How expensive is the condition checking? I present the two scenarios.
    private void process(){
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
             if (add)
             matrix[i][ii][iii][...]  += constant;
             else
             matrix[i][ii][iii][...]  -= constant;
    private void process(){
      if (add)
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
             matrix[i][ii][iii][...]  += constant;
    else
    for (int i=0;i<dimension1;i++)
    for (int ii=0;ii<dimension1;ii++)
      for (int iii=0;iii<dimension1;iii++)
        for (int iiii=0;iiii<dimension1;iiii++)
           matrix[i][ii][iii][...]  -= constant;
    }Is the second scenario worth a significant performance boost? Without understanding how the compilers generates executable code, it seems that in the first case, n^d conditions are checked, whereas in the second, only 1. It is however, less elegant, but I am willing to do it for a significant improvement.

    erjoalgo wrote:
    I guess my real question is, will the compiler optimize the condition check out when it realizes the boolean value will not change through these iterations, and if it does not, is it worth doing that micro optimization?Almost certainly not; the main reason being that
    matrix[i][ii][iii][...]  +/-= constantis liable to take many times longer than the condition check, and you can't avoid it. That said, Mel's suggestion is probably the best.
    but I will follow amickr advice and not worry about it.Good idea. Saves you getting flamed with all the quotes about premature optimization.
    Winston

  • Havent a clue! Please help! Easy ABAP Question!

    Helly Gurus
    I am loading from a dso to a cube and doing a lookup on a second dso.
    eg
    'Name' is in the DSO1
    I lookup 'Address' from DSO2
    Then load to the cube.
    The problem is there may be more than one address so although I have coded the lookup to
    find all addresses, I do know how to get these into my results.
    Only the first address it finds is there.
    loop at DATA_PACKAGE.
        select * from DSO1 where
        NAME = DATA_PACKAGE-NAME.
        if sy-subrc = 0.
          move-corresponding DSO2 to itab1. collect itab1.
        endif.
        endselect.
      endloop.
    What do I need to do to get all of the results?
    I am in 3.5 so do not have the use of an End Routine.
    Thanks
    Tom Tom

    you need to do several treatments in fact you need to add records on the data_package (by the way it is not an easy ABAP question as you mentioned !)
    So
    Treatment 1: select all the records from ods2 table of adresses outside the loop
        select names adresses
        from ods2
        into table g_itab_ods2
          for all entries in data_package
          where name eq data_package-name.
    Treatment 2: delete double records of the internal table.
        delete adjacent duplicates from g_itab_ods2 comparing names adresses.
    Treatment 3: loop over the data_package. Within this loop read the internal ods2 table and loop over it to assign the corresponding adresses. Then append the results to the temporary data_package_tmp and move all the records to the initial data_package.
    loop at data_package assigning <data_fields>.
       read table g_itab_ods2 into l_g_itab_ods2
          with key name = <data_fields>-name.
          if sy-subrc eq 0.
            loop at g_itab_ods2 assigning <adresses>
            where name                = <data_fields>-name.
              <data_fields>-adresses= <adresses>-adresses.
              append <data_fields> to lt_data_package_tmp.
            endloop.
          endif.
        endloop.
        data_package[] = lt_data_package_tmp[].
    free lt_data_package_tmp.
    this should do what you want to do. hope this could help you out.

  • A few simple Logic questions...please help.

    I have a few probably simple Logic questions, that are nonetheless frustrating me, wondering if someone could help me out.
    1. I run Logic 8, all of the sounds that came with logic seem to work except organ sounds. I can't trigger any organ sounds (MIDI) on Logic, they won't play. I have a Yamaha Motif as my midi controller.
    Any idea why?
    2. I've starting running into a situation where I will record a MIDI track, the notes are recorded but they won't playback. The only track effected is the one that was just recorded. All other midi tracks playback.
    I have to cut the track, usually go out of Logic and back in, re record for it to playback properly. Any idea why this may be happening?
    3. How important is it to update to Logic 9. Are there any disadvantages down the road if I don't upgrade. If I purchase the $200 upgrade, do I get a package of discs and material, or it just a web download.
    Any help is appreciated!
    Colin

    seeren wrote:
    Data Stream Studio wrote:
    3) You get a full set of disks and manuals.
    They're including manuals now?
    I think his referring to the booklets ...on how to install etc
    It would be great to see printed manuals though ...I love books especially Logic/Audio related !!
    A

  • Simple Quick Question

    wrong section, post was moved.
    Message was edited by:
    Rob17

    you titled "simple quick question"...
    .. complicated to answer..
    a) the TermsOfUse of the iTS don't allow any processing of purchased files, these are "copy protected"..
    b) iM has a voice-over function..
    c) iM is a video-edit app.. easy to use... just learn to handle it...
    d) iM allows to "extract" audio (=muting the original audio, adding your own..)
    e) to learn iM, spend some time here: http://www.apple.com/ilife/tutorials/imovie/index.html
    f) use pencil and paper first! WRITE and scribble, what shall happen when in your movie/parody... make a script, draw a storyboard .. THEN launch iM.. in other words: think first, then edit.. iM is just a tool, it does not "create"... Picasso needed a papertowel and half a stencil to create art....
    g) to get comfortable with iM, start with your own, small, short (3min!) project... import some stills, edit them, add a funny voice-over, add sounds, add music... good? make a bigger one...
    h) .. in our Lecture II, we teach you how to import shows from TV, youtube, wherever..
    standard disclaimer:
    be nice to ©opyrights ...

  • Simple query question

    hi all,
    I have a XMLType table with one column - I have presently one row, in my column xmlsitedata I have stored one large xml file.The schema definition is given below:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:element name="siteList">
    - <xs:complexType>
    - <xs:sequence>
    <xs:element name="site" type="siteType" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    - <xs:complexType name="siteType">
    - <xs:sequence>
    <xs:element name="nameEn" type="xs:string" />
    <xs:element name="nameFr" type="xs:string" />
    </xs:sequence>
    <xs:attribute name="code" type="xs:string" />
    </xs:complexType>
    </xs:schema>
    I have executed the query below:
    select x.XMLSITEDATA.extract('/siteList/site/nameEn/text()').getCLOBVal() "stName" from wsitelist x;
    and I get all english names of some 200 locations, however, there is 1 row selected and all names show up on one row. How do I split them into 200 or whatever rows?
    Thanks,
    Kowalsky

    Have a look at the answer provided in the following thread.
    very simple XML question
    This may solve your problem.
    use xmlsequence.
    Alvinder

  • Update Routine ABAP question

    Hi,
    I am updating data between two ODS objects using some update routines. I would like to write the following routine (in pseudo code):
    ++++++++++++++++++++++++++++++++++++++++++++++++++++
    Check if the characteristic i am updating is not null
    IF COMM_STRUCTURE-field1 = 'value1'     AND
             COMM_STRUCTURE-field2 = 'value2'.
    RESULT COMM_STRUCTURE-field3.
    ELSE.
    Don't update anything
    END IF
    +++++++++++++++++++++++++++++++++++++++++++++++++++
    My questions:
    1. How i tell the routine not to update anything (as specified in the pseudo code)?
    2. How i can check that the characteristic i woul like to update is not null?
    3. What is the preferred debug method in case i do not use the PSA?
    BR,
    Xibi

    Thanks Siggi for your prompt and helpful answer. There are however some fundamental things which are not fully clear to me (BTW, where i can find some good documentation on ABAP for BW??):
    > Hi,
    >
    > 1. How i tell the routine not to update anything (as
    > specified in the pseudo code)?
    >
    > set the returncode to a value <> 0.
    I wrote the following:
    returncode = 1.
    Consequently the updated failed. Maybe i am doing something wrong but my intention is not to have the whole thing fail, but rather skip the update for some records.
    > 2. How i can check that the characteristic i woul
    > like to update is not null?
    >
    > if not comm_structure-<fieldname> is initial.
    The problem is that the characteristic i am trying to update is not contained in the source ODS but only in the target one. Will "if not comm_structure-<fieldname> is initial" still work in this case?
    >
    > 3. What is the preferred debug method in case i do
    > not use the PSA?
    >
    > Without psa, you need to add a endless loop:
    > statics: st_flag type c value '0'.
    >
    > while st_flag = '0'.
    > break-point.
    > endwhile.
    >
    >
    > Hope this helps!
    >
    > regards
    >
    > Siggi

  • Abap Questions Needed

    Hi,
    Could anyone please send me the abap certification questions or any mock questionnaire on abap to my mail id?
    I have already gone through the forum and found some useful links.Request you not to provide any links to me but just mail me the docs to my mail id:[email protected]
    Request you to please provide the answers as well.
    Thanks in advance for your help.
    Sandeep.
    Edited by: Sandeep Ram on Mar 25, 2008 4:31 PM

    Done

  • Download Simple ABAP report as PDF

    Hi freinds,
    There is a requirement that a simple classical abap report has to download as PDF on user PC. how it can be acheived without using smartforms and sapscript.
    regards
    Rajesh

    hi,
    This might resolve your problem.
    [https://forums.sdn.sap.com/click.jspa?searchID=18642809&messageID=4655514]

Maybe you are looking for

  • How do I create multiple live USBs of Operating systems to boot from on one flashdrive?

    How do I create multiple live USBs of Operating systems to boot from on one flashdrive? I am attempting to create multiple live USBs within one flashdrive so that i can boot various operating systems without having to buy multiple USb sticks. I am us

  • Control/Limit web access

    I am curious if I can use our 10.5 Server (currently serving afp and ftp) to also control the users web surfing. Ideally down to 1 hour a day minus the approved websites we maintain.

  • IPod mini coming up with all kinds of errors!

    My iPod mini (2nd Gen) was working perfectly fine until a couple of days ago when it refused to be updated and in the end I restored it. However, resorting it seemed to make no difference, the iPod once updated about 72MB of music but after that had

  • Error must declare the scalar variable

    por que me marca ese error una consulta? DECLARE  @feci AS datetime DECLARE @fecf AS datetime SET @FECI=(SELECT DISTINCT(T0.DOCDATE) FROM ORTT T0 WHERE T0.DOCDATE='[%0]') SET @FECF=(SELECT DISTINCT(T0.DOCDATE) FROM ORTT T0 WHERE T0.DOCDATE='[%1]') EX

  • Enable Category field in Case Mgmt PCUI

    Hello Experts, I am using CRM 5.0 & EP 7.0. In the Case Mgmt (CRMD_CASE) Application the Category field is disabled. What I want to know is, how to activate this Category field? Many Thanks in Advance. SP