Calculate two values (SAP HRFORMS)

Dear All,
I need held calculating two values within HRFOMS.
I would like to have a screenfield with the value of the current page Therefore i got a global variable G_total_pagecount and i have the current page xfa.layout.page(this)
I tried  the following
data.#pageSet[0].Startseite.Titel_und_Anschrift.Allgemeine_Daten.Org_Daten.Seite_global::r eady:layout
$.rawValue = $record.G_TOTAL_PAGECOUNT + xfa.layout.page(this)
and received no value
or
var page = parseInt(xfa.layout.page(this), 10); // , 10 erzwingt die Umwandlung als dezimalzahl
var global = parseInt(xfa.record.G_TOTAL_PAGECOUNT, 10)
var total = page + global:
this.rawValue = total.rawValue;
But both did not work
I would be happy to get any new idea
Angela

Hi Paul,
first of all many thanks for your help. I normally do only Abap programming, bur unfortunatly I ended up with this HRFORMS Payslip. I have no idea how to decide to choose Formcalc or javascript. I only tried some small pieces which i got from the online help.
I did try the following
----- data.#pageSet[0].Startseite.Titel_und_Anschrift.Allgemeine_Daten.Org_Daten.Seitenzahl::ready:layout - (FormCalc, Client)
$.rawValue
= $record.G_TOTAL_PAGECOUNT + xfa.layout.page($)
=> id did not get a value in my field
than I tried
----- data.#pageSet[0].Startseite.Titel_und_Anschrift.Allgemeine_Daten.Org_Daten.Seitenzahl::calculate: - (JavaScript, Server)
 var  1 = parseInt(xfa.layout.page(this), 10); // , 10 erzwingt die Umwandlung als dezimalzahl
var  2 = parseInt(xfa.record.G_TOTAL_PAGECOUNT, 10)this.rawValue
= 1 + 2;
=> still no value
Last I tried
----- data.#pageSet[0].Startseite.Titel_und_Anschrift.Allgemeine_Daten.Org_Daten.Seitenzahl::ready:layout - (JavaScript, Client)
 var  1 = parseInt(xfa.layout.page(this), 10); // , 10 erzwingt die Umwandlung als dezimalzahl
var  2 = parseInt(xfa.record.G_TOTAL_PAGECOUNT, 10)this.rawValue
= 1 + 2;
Still no succsess
As I am working within HRFORM i only get limited Error Messages or warnings and for everything i tried i did not get a warning at all.
It would be really nice if you could tell me what i did wrong
Thanks in advance
Angela

Similar Messages

  • How to calculate a value in sap script?

    Hi friends i have to do addition and then display the added value in grandtotal like
    total amount + late fee = grand total
    i have to do this in sap script can anyone tell me the procedure where to declare wheather in abap aditor if yes how?

    Hi ...
    Its easy to add up two values...
    u can do it in a subpool program...
    Refer the following code:
    Code the following in the Script...
    /:   PERFORM TOTAL_SUM  IN PROGRAM 'ZTEST_ADDITION'
    /:   USING    &VAL1&
    /:   USING    &VAL2&
    /:   CHANGING &TOTAL&
    In the EDitor..create a program ' ZTEST_ADDITION'..
    FORM TOTAL_SUM  TABLES in_tab  STRUCTURE itcsy
                                                 out_tab STRUCTURE itcsy.
    Read in_tab index 1.
    Here u will get the val1...
    Read in_tab index 2.
    here u will get val2.
    l_v_total = val1 + val2.
    read out_tab index 1.
    out_tab-value = l_v_total.
    modify out_tab index 1.
    Write the changing paramets in the form
    to Output the values...
    Thanx,
    navin..!

  • How to calculate the Percentage differencebased on two values

    Not sure how to do this.
    Just want to calculate the % difference of two values (seem to have a problem when one value is zero)
    Here is the current output
    49 Apr 2
    64 Aug 1
    55 Feb 0
    Here is the output I would like to see
    49 Apr 2 4.08%
    64 Aug 1 1.56%
    55 Feb 0 0.00%
    Here is the current SQL
    Select TO_CHAR (RCA_CLOSE_DATE, 'Month') "Month",
    SUM (CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) "BI&D - CBAT No of Adj",
    Count(1) as "Count of Adjustments"
    from TW_BILL_ADJ_DATA
    where (RCA_CLOSE_DATE between nvl (:P8_DATE_FROM,FORM_RECEIVED)
    and nvl (:P8_DATE_TO, FORM_RECEIVED))
    group by TO_CHAR (RCA_CLOSE_DATE, 'Month')

    You can try something like this one:
    Select TO_CHAR (RCA_CLOSE_DATE, 'Month') "Month",
    SUM (CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) "BI&D - CBAT No of Adj",
    Count(1) as "Count of Adjustments",
    round(count(1)/SUM(CASE WHEN RCA_CODE = 'BI&D' THEN 1 ELSE 0 END) * 100,2) || '%' percent
    from TW_BILL_ADJ_DATA
    where (RCA_CLOSE_DATE between nvl (:P8_DATE_FROM,FORM_RECEIVED)
    and nvl (:P8_DATE_TO, FORM_RECEIVED))
    group by TO_CHAR (RCA_CLOSE_DATE, 'Month')
    CODE NOT TESTED !!!
    Best Regards
    Krystian Zieja / mob

  • Can we assign two values to the same parameter? If yes how? For details ple

    Can we assign two values to the same parameter? If yes how? For details please go through the following SAP related program.
    Here I need to print 2 queries using the same parameter "QUERY" the value assigned to this parameter(query) is REPORT_TEST1. I want to assign one more value to this Parameter. Is is possible? This question may sound stupid if it is not possible please kindly reply.
    I want to do this to print two documents(values) with a single command (parameter)
    Anybody please help quickly,
    Now, I have 2 tables from different queries. I have a print (HTML written) option in my WEB Template
    JAVA PROGRAM:
    <param name="QUERY" value="REPORT_TEST1"/>
    function PrintReport(typePaper) {
    document.title ='Report';
    if (typePaper == "0")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('39') + '&qtitle=' + escape(document.title);};
    if (typePaper == "1")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('52') + '&qtitle=' + escape(document.title);};
    CurrentReportName += '&ASOFDATE=' + escape(AsOfLabel.innerText);
    var openCMD='<SAP_BW_URL>';
    openCMD += '&DATA_PROVIDER=REPORT_TEST1&TEMPLATE_ID=DPW_PRINT_PAGE&CMD=RELEASE_DATA_PROVIDER';
    openCMD += CurrentReportName;
    openWindow(openCMD,'MainTitleNow',800,600);
    The data provider here is REPORT_TEST1. Now it only prints the corresponding data for the data proviedr 1 i.e., REPORT_TEST1. I have a second table whose data comes from the data provider 2 when i use this HTML to print I want the second table contents from the data provider 2 (REPORT_TEST2)also to be printed simlutaneously.
    Please help.
    THANX A LOT,
    SRINI

    Hi,
    Try assigning two values seperated by a delimiter ( say '|') to the same parameter.
    In the function get the parameter value and seperate the values using the same delimiter.
    <param name="QUERY" value="REPORT_TEST1|REPORT_TEST2"/>
    Regards,
    Uma

  • Can we assign two values to the same parameter? If yes how?

    Can we assign two values to the same parameter? If yes how? For details please go through the following SAP related program.
    Here I need to print 2 queries using the same parameter "QUERY" the value assigned to this parameter(query) is REPORT_TEST1. I want to assign one more value to this Parameter. Is is possible? This question may sound stupid if it is not possible please kindly reply.
    I want to do this to print two documents(values) with a single command (parameter)
    Anybody please help quickly,
    Now, I have 2 tables from different queries. I have a print (HTML written) option in my WEB Template
    JAVA PROGRAM:
    <param name="QUERY" value="REPORT_TEST1"/>
    function PrintReport(typePaper) {
    document.title ='Report';
    if (typePaper == "0")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('39') + '&qtitle=' + escape(document.title);};
    if (typePaper == "1")
    {var CurrentReportName = '&?mp=U&ptot=1&rtot=0&psize=' + escape(typePaper) + '&fsize=' + escape('52') + '&qtitle=' + escape(document.title);};
    CurrentReportName += '&ASOFDATE=' + escape(AsOfLabel.innerText);
    var openCMD='<SAP_BW_URL>';
    openCMD += '&DATA_PROVIDER=REPORT_TEST1&TEMPLATE_ID=DPW_PRINT_PAGE&CMD=RELEASE_DATA_PROVIDER';
    openCMD += CurrentReportName;
    openWindow(openCMD,'MainTitleNow',800,600);
    The data provider here is REPORT_TEST1. Now it only prints the corresponding data for the data proviedr 1 i.e., REPORT_TEST1. I have a second table whose data comes from the data provider 2 when i use this HTML to print I want the second table contents from the data provider 2 (REPORT_TEST2)also to be printed simlutaneously.
    Please help.
    THANX A LOT,
    SRINI

    Hi,
    Try assigning two values seperated by a delimiter ( say '|') to the same parameter.
    In the function get the parameter value and seperate the values using the same delimiter.
    <param name="QUERY" value="REPORT_TEST1|REPORT_TEST2"/>
    Regards,
    Uma

  • Calculate single value as ranked number function does not apply in CR

    Hi everybody,
    I built up a query with the SAP BEx Query designer. For one key figure I enabled the function "Calculate single values" as ranked list. So the query has the following result.
    Instead of...
    Score
    1220
    2032
    2390
    2389
    ...I got...
    Score
    1
    2
    4
    3
    Unfortunately when importing the query to Crystal Reports Crystal is just importing the key figure itself - the ranked list does not exist... so the output is the same as in the first example.
    I tried to rebuild the formula with crystal means using the Rank function but I failed...
    Can anybody provide a workaround for me?
    Is there another way as using the formula workbench?
    Best regards,
    Sebastian

    Hi Ingo and everybody,
    I used now the following function using the Nth largest function:
    If nthlargest(1, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "1"
    else if nthlargest(2, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "2"
    else if nthlargest(3, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "3"
    else if nthlargest(4, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "4"
    else if nthlargest(20, {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]})
       = {TECHNAME_OF_QUERY.[Measures]-[9XU9YT56S6PRL7DR80I3DK9RA]} then "20"
    The formula is not very handsome and will fail, if the number of records exceeds...
    Are there any alternatives?
    And: Is there a possibility to change the field name, because those clumsy field names cause that the whole formula is almost unreadable. Or is the only way to build subreports?
    Regards,
    Sebastian

  • How to calculate acquisition value for specified day

    Hi,
    in my z program I have a problem how to calculate acquisition value for my asset for specified day.
    Example:
    I have asset created 8.7.2008 with TTYPE 104 (External asset acquisition) with value 5950.
    30.11.2008 there is another TTYPE 272 (Retirement of current-yr acquis., w/o revenue) with value 950.
    So BEFORE 30.11.2008 acquisition value is 5950. After is 5000. Is there any function module (or something else) in SAP system where I can send asset number and date a it return to me acquisition value for that day?
    Many thanks for any answer!

    Hi,
    your suggestion means that I have to compute acquisition value by myself (sum all TTYPE 1** - sum all TTYPE 2**). So SAP does't provide such functionality (LDB ADA have it, because it can compute acquisitiob value for specific day)?
    Mant thanks for answer

  • Maintaining two values for upper & lower specification for a MIC

    Hi gurus,
    My client requirement is that they want to maintain two values for upper specification and lower specification for a quantitative characteristic.
    For eg. Master inspection characteristic is carbon %
    & for this characteristic they want to maintain values as follows
    lower specification:0.00   upper specification:0.32
    lower specification:0.37   upper specification:0.60
    The requirement is that both these limits should be maintained for the same MIC and system should not allow values between 0.32-0.37
    Is this possible in standard scenario.If possible pls. provide me the solution.
    Thanks in advance.

    No, not possible in standard SAP.  A test can only have one set of limts.
    What you describe sounds more like specs anyway rather then test limits. 
    Your client isn't maintaining specs for materials in MIC's are they?  This would be the least desirable method and not really the way SAP designed it to be.
    Craig

  • Field to be populated based on other two values

    I have a two fields from and to
    From value is AB000000121 and To value is AB000001200
    I have a third field quantity i need the range between the above two values to be displayed automatically
    How can we do this

    For me the question is what is the range between the tow values? They are not numbers, integers or longs.
    The only solution I see is to implement a bean method which calculates the range (you have to do this yourself) and return the correct number or store it in a bean property.
    This you can use in a EL to show the result.
    Timo

  • Value SAP

    Hi,
    What is the Value SAP and ASAP methodology? the differenemce between these two?
    REgards.

    Hi,
    ASAP or Accelerated SAP and Value SAP are both project phases for implementation. ASAP has 5 phases - Project preparation, business blueprint, realization, final prep. golive and support. Each face has a deliverable.
    These phases have been restructured in Value SAP into three phases - Discovery and evolution, Implementation and Operations & continous Improvement.
    Link for Value SAP -
    [http://help.sap.com/printdocu/core/Print46c/en/data/pdf/SVASAP/SVASAP.pdf]
    Hope this helps
    Thanks and Regards,
    Anit

  • How can i calculate excisable value

    hii
    actually excisable column is disable mode in my sales order..i want calculate excisable value...shall i create udf fields or not.any other way.if i  create udf, how i calculate..what is process..
    plz suggest me...

    Dear.......
    You need to create tax code which is given in standard by SAP.
    You need to only modify the Tax Rates or Add new Tax Rates......
    And create Tax Code accordingly. Your Tax 10.3% will calculate automatically.
    No need to work around with UDF.....
    Regards,
    Rahul

  • Calculate Inventory Value - Month end

    Hi guys,
        How do I calculate Inventory value end of every month from 0IC_C03 ?
       What variable can I use to restrict my 0CALDAY ? OR any other ways to achieve this ?

    Please check this http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f83be790-0201-0010-4fb0-98bd7c01e328&overridelayout=true
    This link helped me a lot. Check out the section for snap shot scenario and follow the steps given.
    They have provided screen shots for assistance
    hope it helps

  • SQL query problem while combining two values.

    Hi,
    I am having a table test with columns X and Y. X is not nullable where as Y is nullable.
    I had a requirement where I have to get these two values seperated by '-' (Hyphen).
    So I wrote the query like :
    Select X||'-'|| Y from test.
    But now Y is nullable. So I'm getting some values ended by hypen if y is null. So is there any way to append these two only if Y is present and not to join if Y is null or empty.
    Help me out in resolving this issue.
    Regards,
    Venky.

    There are several ways to avoid/remove that hypen
    1. select RTRIM(X||'-'||Y,'-') from test
    2. select X||decode(Y,null,null,'-'||Y) from test
    HTH,
    Mohana

  • Two values from a LOV to Timecard LDT

    Hi,
    I have a requirement to pull two values from single LOV to Timecard layout page.
    e.g.: Suppose we have a LOV field 'emp_number' on layout and this field is getting value from one LOV. Query in LOV shows emp_number and emp_last_name. I want to put one more field on layout page by the name Last_Name and whenever a emp_number value is selected in LOV, corresponding emp_last_name value should be coming to Last_Name field of layout page. Can somebody please help me on how to do this?
    I have tried to add one similar HXC_LAYOUT_COMPONENTS as of Emp_number LOV field to ldt file with component = 'Text_Field' but it is not working for me :(

    Follow this note 307151.1, this note describes how to populate a Task Name in a different field when Task number is selected in LOV, you have a similar requirement, so you can configure the attributes as described in that note.
    - Ramu

  • How do I return two values from a stored procedure into an "Execute SQL Task" within SQL Server 2008 R2

    Hi,
    How do I return two values from a
    stored procedure into an "Execute SQL Task" please? Each of these two values need to be populated into an SSIS variable for later processing, e.g. StartDate and EndDate.
    Thinking about stored procedure output parameters for example. Is there anything special I need to bear in mind to ensure that the SSIS variables are populated with the updated stored procedure output parameter values?
    Something like ?
    CREATE PROCEDURE [etl].[ConvertPeriodToStartAndEndDate]
    @intPeriod INT,
    @strPeriod_Length NVARCHAR(1),
    @dtStart NVARCHAR(8) OUTPUT,
    @dtEnd NVARCHAR(8) OUTPUT
    AS
    then within the SSIS component; -
    Kind Regards,
    Kieran. 
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Below execute statement should work along the parameter mapping which you have provided. Also try specifying the parameter size property as default.
    Exec [etl].[ConvertPeriodToStartAndEndDate] ?,?,? output, ? output
    Add a script task to check ssis variables values using,
    Msgbox(Dts.Variables("User::strExtractStartDate").Value)
    Do not forget to add the property "readOnlyVariables" as strExtractStartDate variable to check for only one variable.
    Regards, RSingh

Maybe you are looking for

  • Any program for mac to download videos from website like youtube, dailymotion, and any video online?

    Any program for mac to download videos from website like youtube, dailymotion, and any video online?

  • Generated ODS Objects

    Hello All, I have 2 questions: 1) I have loaded all my data from R/3 to ODS and now want to load from ODS to Cube. SO I have generated an export datasource by right clicking on the ODS and selecting "Generate Export..." and it gave a successful messa

  • Iconfunction in Advanced Datagrid

    I'm specifying an 'iconfunction' in my advanced datagrid - works but not quite as desired. I have two flavors of data in the grid: (a) Directory and (b) Database For the Directory icon I can easily specify a folder icon. There does not appear to me,

  • 11g db links issue

    Hi All, We are sitting on 11gR2 . I have one issue , where one of the db link refuse to work because of the wrong password. on 11g , we can find the password for db links.well, is there any workaround of these situation , as we can not recreate the d

  • Buy the same apps again?

    Hi. My family has a iTunes account in common, but now i have made my own. Is it possible for me to get the IOS apps and mac apps I bought on the other account. My mom don't want to use them anyway, and we don't want to pay for the same apps over agai