How to use mathematical calculations in abap

Hi!
                            In my program,
                             I declared one variable as w_h(2) type n.
i am doing calculation as,
w_h = 100 /60.
its giving the o/p as 2(1.66...). but in 1.6 i want that 1 alone as my o/p.normally math function floor() is there to bring the o/p as 1. in abap how to use this floor function. or any other possible is there to get the o/p as 1.could anybody plz help me.

define w_h  as i.
data: w_h  type i.
Edited by: mayank jain on Sep 8, 2009 9:42 AM

Similar Messages

  • Mathematical calculations in ABAP Query

    Dear gurus
    Can I perform mathematical calculations in ABAP Query?
    Kingly guide
    MK

    Hi
    You would need tables - AFPO, AUFM, MSEG, MAKTX (if you need mtl description).
    Use AFPO table to pass your FERT material number, then read the order numbers for this order.
    Now in AUFM there is an Index on AUFNR field, so you can pass all the order nos. of the FERT to this field.
    If you want to limit for a certain period, then use AUFM-BUDAT which is the posting date.
    Now add all the 261 movements for which there is no 262 movement, you can check for reversals in MSEG table. This you can do per component & display the data as per your need.
    Regards,
    Vivek
    Added
    You can get this info in COOIS report as well, by selecting List option as Documented Goods Movement & by using suitable filter options.

  • How to use the Calculated attibute in view object

    Hi,
    I have a view object query with the calculated attribute name as 'TRANCODE' in the below sql.This query works for the initial page loading.
    After the page gets loaded, there is a search section in the same page at the top.
    Here i will have to build the whereclause to the same query and retrieve the values.
    i am using jDeveloper 10.1.3.1, with adf and jHeadstart.
    Can some one tell as how to use the calculated attribute TRANCODE in whereclause?
    SELECT /*+ first_rows(10) */
    BatchCntl.FILE_CNTL_ID,
    CASE WHEN chk_bit(Entry.ENTRY_FLAGS, 2)='Y' OR Entry.ENTRY_SUBSTATUS = 'D' OR Entry.ENTRY_SUBSTATUS = 'J'
    THEN
    CASE eeh.TRAN_CODE
    WHEN '21' THEN 'C'
    WHEN '22' THEN 'C'
    WHEN '31' THEN 'C'
    WHEN '32' THEN 'C'
    WHEN '26' THEN 'D'
    WHEN '27' THEN 'D'
    WHEN '36' THEN 'D'
    WHEN '37' THEN 'D'
    ELSE eeh.TRAN_CODE
    END
    ELSE
    CASE Entry.TRAN_CODE
    WHEN '21' THEN 'C'
    WHEN '22' THEN 'C'
    WHEN '31' THEN 'C'
    WHEN '32' THEN 'C'
    WHEN '26' THEN 'D'
    WHEN '27' THEN 'D'
    WHEN '36' THEN 'D'
    WHEN '37' THEN 'D'
    ELSE Entry.TRAN_CODE
    END
    END AS TRANCODE,
    FROM Batch_Cntl BatchCntl, Entry, ENTRY_EDIT_HIST eeh
    WHERE (BatchCntl.BATCH_TYPE = 'E')
    AND (BatchCntl.BATCH_STATUS in ('A','D','R','P'))
    AND entry.in_batch_cntl_id = BatchCntl.BATCH_CNTL_ID
    and Entry.fi_rt = eeh.fi_rt (+)
    and Entry.entry_id = eeh.entry_id (+)
    AND (Entry.ENTRY_STATUS in ('A','D','R','P'))
    ORDER BY BatchCntl.BATCH_CNTL_ID, Entry.entry_id
    regards
    Raj.

    Let's say your application module is com.yourcompany.someapp.services.MyService, and let's say you authored a method like the following in the MyServiceImpl.java file:
      public void doSomething(int i, String s) {
      }and you exposed this AM custom method using the AM editor.
    BC4J design time will automatically create you the com.yourcompany.someapp.services.common.MyService interface that will look like this if you go look at the source code:
    package com.yourcompany.someapp.services.common;
    import oracle.jbo.ApplicationModule;
    public interface MyService extends ApplicationModule {
      public void doSomething(int i, String s);
    }To use your custom method from a client, just cast your ApplicationModule to your custom interface like this:
    import com.yourcompany.someapp.services.common.MyService;
      MyService mySvc = (MyService)yourAM;
      mySvc.doSomething(1,"foo");

  • How to use messages in WebDynpro-ABAP

    Hi,
        How to use messages in WebDynpro-ABAP.
    Does it has any class to manage messages like IWDMessageManager or we can just use standard SAP Message types.. like E,W,X,I,S..
    I hope it have a message container to display messages.
    Thank U for Ur time.
    Cheers,
    Sam

    Hi Sam,
    U can hard code the message or u can use the Assistance class's text elements to store the messages.
    1) Code to display hard coded message:
    report message
    CALL METHOD l_message_manager->report_attribute_error_message
    EXPORTING
    message_text = "Enter the correct Connection ID"
    element = elem_flightinfo
    attribute_name = 'CONNID'.
    2) Code to display message from text element of assistance class:
    lv_text = wd_assist->if_wd_component_assistance~get_text( key = '002' ).
    report message
    CALL METHOD l_message_manager->report_attribute_error_message
    EXPORTING
    message_text = lv_text
    element = elem_flightinfo
    attribute_name = 'CONNID'.
    Where Message "Enter the Correct Connection ID" is stored in Text Element with key '002'
    Hope this helps,

  • How to use RTRIM function in ABAP

    Hey,
    I have a question on using trim function in ABAP. According to all documents, I should be able to use rtrim as
    shorttext = rtrim('abcde-xx', '-xx').
    But when I do that, it gives me an error message "Comma without preceding colon (after shorttest?)"
    Anyone can tell me why is this happening? how should I use this trim function? And for me to cut off variable's last few character, what else method can I use? 
    Thank you very much.

    DATA : T1    TYPE STRING VALUE 'abcde-xx',
                T2    TYPE STRING  VALUE '-xx'.
    REPLACE T2 INTO T1 WITH SPACE.
    WRITE :/, T1.
    result output is :    'abcde'.
    regards
    Guna

  • How to use FTI_TR_CASH_FLOWS ldb in abap programming.

    I want to use FTI_TR_CASH_FLOWS  logical database in existing ABAP program but i am not able to use this logical data base in the program.Please suggest how to use this logical database in the program.

    I have developed a customized report and i want to use  logical database "FTI_TR_CASH_FLOWS" into my program . i don't know how to use SAPDBFTI_TR_CASH_FLOWS  into my report. how i pass data from my report to this LDB report. plz suggest.

  • How to use a calculated column in the same query

    Hi All,
    I need some help with using a calculated column in the same query.
    For eq
    I am joining a couple of tables and some of the select columns are calculated based on the columns of the tables and i want a new column in the same query to use this calculated feild in some other calcualtion.
    something like this...
    select (12+3) as Sum1, (12-3) as Sum2, (Sum1 + Sum2 ) as Sum3
    from dual
    or
    select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( "Sum1" / "Sum2" * 100 > 0 ) THEN 'Yes' ELSE 'No' END
    from dual
    Thanks

    user548171 wrote:
    select (12+3) as Sum1, (12-3) as Sum2, (Sum1 + Sum2 ) as Sum3
    from dual
    or
    select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( "Sum1" / "Sum2" * 100 > 0 ) THEN 'Yes' ELSE 'No' END
    from dual
    ThanksWhat about just repeating the column values:
    select (12+3) as "Sum1", (12-3) as "Sum2", CASE WHEN ( (12+3) / (12-3)  * 100  > 0 )  THEN 'Yes' ELSE 'No'  END FROM DUAL

  • How to use Adobe forms in ABAP

    Hello Everybody,
    I have used Adobe forms in webdynpro applications. Now, i want to use adobe forms in ABAP stack. Please provide me steps and guidelines to develop Adobe forms in ABAP.
    What should be the infrastructure needed for that?
    Thanks in Advance,
    Bhavik

    Hi Bhavik,
    there is extensive documentation on creating PDF-based forms for printing in ABAP Workbench (transaction SFP) on the SAP Help Portal at http://help.sap.com/saphelp_nw04/helpdata/en/d2/4a94696de6429cada345c12098b009/frameset.htm.
    The infrastructure is identical (ADS on Java Engine) except that you need an ABAP backend (minimum 6.40) and the corresponding SAP GUI. You also need to create an HTTP connection from your ABAP system to the ADS in transaction SM59 (see ADS Configuration Guide).
    Your Adobe LiveCycle Designer installation from the NWDS should be OK, if you are working on the same frontend. (If you have difficulties with Designer, uninstall it and install it with the SAP GUI again).
    Note that Web Dynpro for ABAP integration is only supported as of NetWeaver 2004s (going into ramp-up with mySAP ERP 2005 this month), which means that interactive scenarios are more cumbersome to implement in ABAP with NetWeaver 04.
    Some of the things you get with the Web Dynpro framework (such as the return of data in interactive scenarios via the WD context) would need to be manually coded when working in SFP, which was designed for output forms.
    Hope this helps,
    Markus Meisl
    SAP NetWeaver Product Management

  • How to use external debugger on ABAP using webdynpro application?

    Hello experts,
    Im working currently on SAP Netweaver 04 ,EP 6 and R3 is 4.7
    im trying to use external debugger in the R3 system via webdynpro application.We have created Jco connections with the same user id which is available on R3 system.the problem is tht external breakpoint on ABAP code is not pinging.we r not able to use external debugger of ABAP.
    Can anyone help me out in resolving this issue?
    Thanks in advance

    Hi Latha,
         Please try to activate your Debugging using the Tcode SICF.
         To activate Goto SICF>EDIT->Debugging-->Activate Debugging
    Regards
    Vamsi

  • How to use mathematical functions in XSL mapping

    Hi,
    I am using Jdeveloper 10.1.3.3. I need to insert mathematical functions like "multiply,divide,power" etc in my mapping. But in the XSL i am getting all string functions and very few math functions for number.
    I am newbie in Jdev. Please if anyone can share how this can be done.
    Thanks

    Hi,
    The RfcAdapter trys to find a Sender Agreement for this RFC call but the lookup failes. The values used for this lookup are:
    Sender Party/Sender Service: The values from Party and Service belonging to the sender channel.
    Sender Interface: The name of the RFC function module.
    Sender Namespace: The fix RFC namespace urn:sap-com:document:sap:rfc:functions
    Receiver Party/Receiver Service: These fields are empty. This will match the wildcard
    Regards,
    Suryanarayana

  • How to use HR infotypes in abap

    hi i m new for ABAP HR .
    how i can use or extract data from infotypes.
    Thanks.

    hi,
    You can get data from Infotypes as like normal tables ..
    ex : consider the infotypes PA0001 , PA0002.
    so there will be table named as pa0001 & pa0002 correspondingly..
    so ur normal SELECT  statement itself will work..
    reply back for further queries..
    With Regards,
    S.Barani

  • How to use background image in ABAP -  webdynpro

    Hi,
    My requirement is like that.
    I want to display a background image. Over the background image i want to display my ALV list or report.
    How to display my personalized image in background.
    Please assist me....
    Thanks in Adv.

    hi ,
    this is not possible:
    refer these threads :
    Background Image
    I Assign Background Image to a Group (Ans by Thomas)
    Image as Background Image possible?
    as correctly pointed above and in this thread
    use your own stylesheets
    refer this thread for more  information on styles :
    EP 7 Portal stylesheet with WD ABAP
    to display image in the foreground :
    refer this WIKI
    https://wiki.sdn.sap.com/wiki/display/stage/DisplayEmployeeImageinABAPWebDynpro+Application
    regards,
    amit

  • How to use web service with ABAP Web Dynpro

    Hi.
         do you know, how to web service with ABAP Web Dynpro?

    Hi,
    If you have a webservice ready with you then you can generate a proxy from SE80 and you can use that. You just have to create a port and assign to that generated proxy(CLASS) and you are good to go.
    Let me know if you need more information.
    Thank You,
    Gajendra.

  • How to use LDB PNP with ABAP objects in a program

    Hello,
    I am wondering if anybody has used the HR logical database(LDB) PNP with user defined ABAP objects in a program? I am using the FM- <b>LDB_PROCESS</b> but its not working. Also assigning PNP in the attributes section of the program -- so that I can use predefined fields from the LDB and then invoking the FM doesn't work -- throwing 'Logical database already active' error.
    I suppose even with the ABAP objects and the new FM -- I should still be able to utilize the pre-defined fields of the PNP database -- and also the built in authorizations. I cannot use GET PERNR and REJECT as they give errors. I understand that the use of HR-macros (RP-PROVIDE-FROM-LAST and et al.) are not allowed as they use the table work area -- which is not allowed in ABAP-OOPS.
    I would really appreciate if anyone could show me some insight regarding this. Thank you.
    Kshitij R. Devre

    Hi Kshitij
    It would be really good if we could use both together. But as I know, it is not possible. "GET pernr." is an event-like loop statement and so cannot be used in OO context. And I guess, the same restriction holds for the "LDB_PROCESS" since it uses LDB-specific processing.
    What I suggest you is to use standard and BAPI functions.
    Sorry for giving bad news...
    *--Serdar

  • How to use Webservice in Webdynpro ABAP?

    I tried searching option for importing WSDL file in WebDynpro ABAP. But I am unable to upload it in my component. In service call wizard I can see only one option i.e. to import Function module.
    We cant use Webservice in ABAP webdynpro?
    Thanks
    Nitesh Shelar

    Thanks Rich for quick answer.
    But my problem is, I have a stand alone WAS without any RFC Function modules and dictionary structures, of backend R/3, on WAS which I wanted to map in my component.
    I strongly believe that in case of stand alone WAS I need to have at least backend dictionary structures to begin with my design. I can’t use wizard, as I don’t have function modules on this system. I have to code for that manually..
    So that is why, I was looking for Webservice option..
    Thanks,
    Nitesh Shelar.

Maybe you are looking for

  • GTX 680 - Windows - AECS6 Not Supported?

    Looking at the list of supported cards, I should have no trouble using my GPU in AE for the Raytracing engine... However, my program is telling me that I have an incompatible device/driver. I have the most updated AECS6 (11.0.4) And Nvidia's most rec

  • What will happen if i load transaction data first?

    HI, With out master data if i load transactional data , what will happen? While loading master data then only SID will be created, If i load Transactional data first means when will SID will be create? -Arun.M.D

  • Autodiscover powershell command

    Hello everyone i want to configure autodiscover on exchange server 2007 sp1 please do guide me the powershell command to setup autodiscover. PS] C:\Users\Administrator.\Desktop>Get-ActiveSyncVirtualDirectory | fl ActiveSyncServer: https://mail.mydoma

  • Slow performance during CD-import in iTunes -- 2. GHz iMac

    This folowing is the text of a feedback I have sent to Apple. Something doesn't quite seem right. Yesterday I had problems trying to rip to Apple lossless format. Initially the discs started off ripping at around 5~8x and then maxed out at about 14x.

  • Diagram Disable cosmetic bug ?

    Start from here (attached VI): switch to the Enabled case and wire the top tunnel to the right tunnel: Oops! While is the wire misaligned? The strange thing is that this problem does not occur if you wire from right to top. Tested in LV 2011. Attachm