Problem in Custom function in I_TH_REF_DATA

Hi All,
I have a custom function where I have implemented interfaces IF_RSPLFA_SRVTYPE_IMP_CHECK & IF_RSPLFA_SRVTYPE_IMP_EXEC_REF. In method GET_REF_DATA_SEL I could specify the selection criteria to read reference data and system does read the reference data specified in E_T_REF_CHARSEL table. When I go to ADD_NEW_BLOCKS method I can see the reference data in I_TH_REF_DATA table but when control reaches to EXECUTE method I_TH_REF_DATA becomes empty
Can anyone suggest what did I miss here which lead me to this problem?
Regards,
Deepti

Hi Deepti,
the planning function is executed in blocks. So the data and reference data is split up into blocks (and for each block the execute method is called). The blocks are defined based on the characteristic values for the fields not to be changed.
It looks like you are working on a block for which no reference data has been found. Can you check this.
Regards Matthias

Similar Messages

  • Problem in calling application module's custom functions

    i m facing problem in calling application module's custom functions in jsp pages.
    i'll highly appreciate any reply to this mail.
    anant

    Hi,
    I also need to know how to call custom methods
    within an application module implementation.
    I have tried the <jbo:ApplicationModule id=am ...\>
    then later in the JSP <% am.customMethod() %>
    and this does not work. Any hints?I don't know how it works with JSPs, but if you want to call a custom method on a ApplicationModule, you first have to cast it to your custom class type.
    Somethin like this:
    MyAppModule am = (MyAppModule) sessionCookie.useApplicationModule( ... )
    or maybe in your JSP
    <jbo:ApplicationModule id="am">
    <% MyAppModuleClass am = (MyAppModuleClass) am; %>
    I think you forgot to do something like this in your JSP. Note that the code is not tested.
    Hope that helps
    Benjamin

  • SE80 problem in ECC with custom function groups

    We are in the process of upgrading from 4.64 to ECC 6 and have encountered an unusual situation.
    When we bring up a custom function group in SE80, we can no longer see the custom includes in the include section.  We can see all other sections.  We can still use SE38 to look at an include.  The automatically-generated includes are there, such as the TOP, F01 and UXX, but see none of the ones that go with the function modules we've created.  When we look at the UXX include, we can see each of the function modules with the include it belongs to.  These are function groups that existed in the 4.64 system; they are not new to the ECC system.
    We've tried rebuilding the object list at the function group and package levels.  We receive no errors and the processes work fine.
    Maybe there is a setting somewhere that needs to be updated?

    See the solution that Srini has suggested in this thread
    OA Framework & JTT Request Parameters
    you need to use jtfcrmchrome.jsp to navigate between JTF and OA pages.
    Thanks
    Tapash

  • BODI 11.7.3 - Custom Function Problem

    Could someone please tell me what I am doing wrong here? I am hitting walls each time I think I have it right.
    I wrote a custom function to select min(record id) from a list of about 15000 records where the record id may match many other fact ids.
    I am using BODI V 11.7.3 with parameters and variables declared all over the place.  I am able to get only 1 record to return when I know I should get over 2000 to return.
    I have all screen shots and details available via word doc for additional assistance. But let me lay out the custom function:
    $p_i_last_used = lookup_ext([table, 'no_cache', 'min'], [interaction_id], [null], [call_fact_id,'=',$in_call_fact_id, row_id, '=', $in_row_id, interaction_id, '<>' $p_i_last_used], [interaction_id], [$out_interaction_id]);
    return $p_i_last_used  || $out_interaction_id;
    On the left side I have parameters set up
    - anything with "in" is inward
    - "out" is outward
    - $p_i_last_used is in/out
    Then I go back into my Work Flow - declare variables and parameters.  Then set up my lookup function call within the query look up to take in the Call_Fact_ID, ROW_ID, and set $p_i_last_used as -1 or 0.
    I am able to see only 1 record return. Like it is not going thru all 15K records.
    TIA.
    Edited by: Margot Bowen on Nov 20, 2008 1:29 AM

    1. Yes, 12.2 finally suports the rfc.ini file, one reason was for the load balancing.
    2. Yes, you are right, one datastore is bound to one application server in 11.7. However, this one apllication server could submit the ABAP as a spool job rather than executing it in dialog mode and then you have your load balancing again. Checkout the datastore property "execute in background".

  • Help on custom function...

    Hi all
    I'm having a problem with this custom function/report posted on TechNet while back for ConfigMgr 2007
    http://social.technet.microsoft.com/wiki/contents/articles/7870.sccm-2007-create-report-of-upcoming-maintenance-windows-by-client.aspx
    I've made the needed changes according to this blog post:
    https://sccmfaq.wordpress.com/2013/08/22/sccm-2012-show-next-effective-maintenance-window/
    ..but when using maintenance windows that occurs for example 1st tuesday of every 1 months, the function returns the date week ahead. For example now (on 28th of Feb) next maintenance window should be on Tuesday March 3rd, but instead the report is showing
    Tuesday March 10th.
    Any help on modifying the function would be appreciated, I saw that there comments on the original post about the recurrence type 4 (monthly by weekday as noted here https://msdn.microsoft.com/en-us/library/cc143300.aspx) not working correctly in the function.
    It seems that the function now returns the weekday of first full week of the month instead of the correct day.
    The function is this:
    CREATE FUNCTION [dbo].[SCCM_GetNextServiceWindow](@ScheduleToken AS CHAR(16), @RecurrenceType AS INT) RETURNS @NextServiceWindow TABLE (ScheduleToken CHAR(16), RecurrenceType INT, NextServiceWindow DATETIME, Duration INT, IsGMTTime BIT) AS BEGIN
    --1 Occurs on 1/1/2012 12:00 AM 00011A8500080000
    --2 Occurs every 3 day(s) effective 1/1/2012 8:00 PM 02811A8040100018
    --3 Occurs every 3 week(s) on Saturday effective 1/1/2012 8:00 PM 02811A80401F6000
    --3 Occurs every 1 week(s) on Saturday effective 1/1/2012 8:00 PM 02811A80401F2000
    --5 Occurs day 2 of every 2 month(s) effective 1/1/2012 8:00 PM 02811A8040288800
    --5 Occurs day 31 of every 1 month(s) effective 1/1/2012 8:00 PM 02811A80402FC400
    --5 Occurs the last day of every 3 months effective 1/1/2012 8:00 PM 02811A8040280C00
    --5 Occurs the last day of every 1 months effective 1/1/2012 8:00 PM 02811A8040280400
    --4 Occurs the Third Monday of every 1 month(s) effective 1/1/2012 4:00 AM 00811A9E08221600
    --4 Occurs the Last Wednesday of every 1 month(s) effective 1/1/2012 8:00 PM 02811A8040241000
    --4 Occurs the Fourth Wednesday of every 1 month(s) effective 1/1/2012 8:00 PM 02811A8040241800
    --4 Occurs the Last Monday of every 1 month(s) effective 1/1/2012 8:00 PM 02811A8040221000
    --3 Occurs every 1 week(s) on Monday effective 1/1/2012 4:00 AM 00811A9E081A2000
    -- http://msdn.microsoft.com/en-us/library/cc143300.aspx [This link is external to TechNet Wiki. It will open in a new window.]
    DECLARE @RecurrenceType_NONE INT
    , @RecurrenceType_DAILY INT
    , @RecurrenceType_WEEKLY INT
    , @RecurrenceType_MONTHLYBYWEEKDAY INT
    , @RecurrenceType_MONTHLYBYDATE INT
    SELECT @RecurrenceType_NONE = 1
    , @RecurrenceType_DAILY = 2
    , @RecurrenceType_WEEKLY = 3
    , @RecurrenceType_MONTHLYBYWEEKDAY = 4
    , @RecurrenceType_MONTHLYBYDATE = 5
    -- http://msdn.microsoft.com/en-us/library/cc143505.aspx [This link is external to TechNet Wiki. It will open in a new window.]
    --DECLARE @RecurrenceType INT; SET @RecurrenceType = @RecurrenceType_WEEKLY
    --DECLARE @ScheduleToken CHAR(16); SET @ScheduleToken = '00811A9E081A2000'
    DECLARE @ScheduleStartTime INT; SET @ScheduleStartTime = CAST(CONVERT(BINARY(4), LEFT(@ScheduleToken, 8), 2) AS INT)
    DECLARE @ScheduleDuration INT; SET @ScheduleDuration = CAST(CONVERT(BINARY(4), RIGHT(@ScheduleToken, 8), 2) AS INT)
    -- Duration is in minutes
    DECLARE @Duration INT; SET @Duration = @ScheduleStartTime % POWER(2, 6)
    -- Calculate the start time
    DECLARE @StartTime DATETIME; SET @StartTime = CONVERT(DATETIME, '01/01/1970 00:00:00')
    SET @StartTime = DATEADD(YEAR, (@ScheduleStartTime / POWER(2,6)) % POWER(2, 6), @StartTime)
    SET @StartTime = DATEADD(MONTH, ((@ScheduleStartTime / POWER(2,12)) % POWER(2, 4)) - 1, @StartTime)
    SET @StartTime = DATEADD(DAY, ((@ScheduleStartTime / POWER(2,16)) % POWER(2, 5)) - 1, @StartTime)
    SET @StartTime = DATEADD(HOUR, (@ScheduleStartTime / POWER(2,21)) % POWER(2, 5), @StartTime)
    SET @StartTime = DATEADD(MINUTE, (@ScheduleStartTime / POWER(2,26)) % POWER(2, 5), @StartTime)
    -- Determinte UTC and Flags
    DECLARE @IsGMTTime BIT; SET @IsGMTTime = CAST(@ScheduleDuration % POWER(2, 1) AS BIT)
    DECLARE @Flags INT; SET @Flags = (@ScheduleDuration / POWER(2,19)) % POWER(2, 3)
    -- Calculate the total duration in minutes
    SET @Duration = @Duration + ((@ScheduleDuration / POWER(2,22)) % POWER(2, 5)) * 24 * 60 -- DAYS
    SET @Duration = @Duration + ((@ScheduleDuration / POWER(2,27)) % POWER(2, 5)) * 60 -- HOURS
    DECLARE @Now DATETIME
    IF @IsGMTTime = 1 BEGIN
    SET @Now = GETUTCDATE()
    END ELSE BEGIN
    SET @Now = GETDATE()
    END
    DECLARE @NextMaintenanceWindow DATETIME
    IF @RecurrenceType = @RecurrenceType_NONE BEGIN
    IF DATEADD(MINUTE, @Duration, @StartTime) > @Now BEGIN
    SET @NextMaintenanceWindow = @StartTime
    END
    END ELSE IF @RecurrenceType = @RecurrenceType_DAILY BEGIN
    IF DATEADD(MINUTE, @Duration, @StartTime) > @Now BEGIN
    SET @NextMaintenanceWindow = @StartTime
    END ELSE BEGIN
    -- Calculate the daily interval in minutes
    DECLARE @DailyInterval INT
    SET @DailyInterval = ((@ScheduleDuration / POWER(2,3)) % POWER(2, 5)) * 24 * 60
    SET @DailyInterval = @DailyInterval + ((@ScheduleDuration / POWER(2,8)) % POWER(2, 5)) * 60
    SET @DailyInterval = @DailyInterval + (@ScheduleDuration / POWER(2,13)) % POWER(2, 6)
    -- Calculate the total number of completed intervals
    DECLARE @DailyNumberOfCompletedIntervals INT; SET @DailyNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(MINUTE, @StartTime, @Now) AS DECIMAL) / @DailyInterval, 0, 0)
    -- Calculate the next interval
    DECLARE @DailyNextInterval DATETIME; SET @DailyNextInterval = DATEADD(MINUTE, @DailyNumberOfCompletedIntervals * @DailyInterval, @StartTime)
    -- Recalc the next interval if the next interval plus the expected duration is in the past
    IF DATEADD(MINUTE, @Duration, @DailyNextInterval) < @Now BEGIN
    SET @DailyNextInterval = DATEADD(MINUTE, (@DailyNumberOfCompletedIntervals + 1) * @DailyInterval, @StartTime)
    END
    SET @NextMaintenanceWindow = @DailyNextInterval
    END
    END ELSE IF @RecurrenceType = @RecurrenceType_WEEKLY BEGIN
    DECLARE @WeeklyInterval INT; SET @WeeklyInterval = (@ScheduleDuration / POWER(2,13)) % POWER(2, 3)
    DECLARE @WeeklyDoW INT; SET @WeeklyDoW = (@ScheduleDuration / POWER(2,16)) % POWER(2, 3)
    -- Adjust the start time to match the next day of week that matches the interval
    DECLARE @WeeklyStartTime DATETIME; SET @WeeklyStartTime = DATEADD(DAY, (7 - DATEPART(WEEKDAY, @StartTime) + @WeeklyDoW % 7), @StartTime)
    IF DATEADD(MINUTE, @Duration, @WeeklyStartTime) > @Now BEGIN
    SET @NextMaintenanceWindow = @WeeklyStartTime
    END ELSE BEGIN
    -- Calculate the total number of completed intervals
    DECLARE @WeeklyNumberOfCompletedIntervals INT; SET @WeeklyNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(WEEK, @WeeklyStartTime, @Now) AS DECIMAL) / @WeeklyInterval, 0, 0)
    -- Calculate the next interval
    DECLARE @WeeklyNextInterval DATETIME; SET @WeeklyNextInterval = DATEADD(WEEK, @WeeklyNumberOfCompletedIntervals * @WeeklyInterval, @WeeklyStartTime)
    -- Recalc the next interval if the next interval plus the expected duration is in the past
    IF DATEADD(MINUTE, @Duration, @WeeklyNextInterval) < @Now BEGIN
    SET @WeeklyNextInterval = DATEADD(WEEK, (@WeeklyNumberOfCompletedIntervals + 1) * @WeeklyInterval, @WeeklyStartTime)
    END
    SET @NextMaintenanceWindow = @WeeklyNextInterval
    END
    END ELSE IF @RecurrenceType = @RecurrenceType_MONTHLYBYWEEKDAY BEGIN
    DECLARE @MonthlyBWWeek INT; SET @MonthlyBWWeek = (@ScheduleDuration / POWER(2,9)) % POWER(2, 3)
    DECLARE @MontlhyBWInterval INT; SET @MontlhyBWInterval = (@ScheduleDuration / POWER(2,12)) % POWER(2, 4)
    DECLARE @MonthlyBWDoW INT; SET @MonthlyBWDoW = (@ScheduleDuration / POWER(2,16)) % POWER(2, 3)
    -- Calculate the total number of completed intervals
    DECLARE @MonthlyBWNumberOfCompletedIntervals INT; SET @MonthlyBWNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(MONTH, @StartTime, @Now) AS DECIMAL) / @MontlhyBWInterval, 0, 0)
    IF @MonthlyBWWeek = 0 BEGIN
    -- Calculate the next interval
    DECLARE @MonthlyBWLDOMNextInterval DATETIME; SET @MonthlyBWLDOMNextInterval = DATEADD(MONTH, @MonthlyBWNumberOfCompletedIntervals * @MontlhyBWInterval, @StartTime)
    -- Calculate last day of month
    SET @MonthlyBWLDOMNextInterval = DATEADD(DAY, DATEDIFF(DAY, @MonthlyBWLDOMNextInterval, DATEADD(DAY, -1, DATEADD(M, DATEDIFF(MONTH, 0, @MonthlyBWLDOMNextInterval) + 1, 0))), @MonthlyBWLDOMNextInterval)
    -- Calculate the last day of the week for the month
    SET @MonthlyBWLDOMNextInterval = DATEADD(DAY, -(7 - DATEPART(WEEKDAY, @MonthlyBWLDOMNextInterval) + @MonthlyBWDoW % 7), @MonthlyBWLDOMNextInterval)
    IF DATEADD(MINUTE, @Duration, @MonthlyBWLDOMNextInterval) < @Now BEGIN
    -- Recalc for the next month interval
    SET @MonthlyBWLDOMNextInterval = DATEADD(MONTH, (@MonthlyBWNumberOfCompletedIntervals + 1) * @MontlhyBWInterval, @StartTime)
    -- Calculate last day of month
    SET @MonthlyBWLDOMNextInterval = DATEADD(DAY, DATEDIFF(DAY, @MonthlyBWLDOMNextInterval, DATEADD(DAY, -1, DATEADD(M, DATEDIFF(MONTH, 0, @MonthlyBWLDOMNextInterval) + 1, 0))), @MonthlyBWLDOMNextInterval)
    -- Calculate the last day of the week for the month
    SET @MonthlyBWLDOMNextInterval = DATEADD(DAY, -(7 - DATEPART(WEEKDAY, @MonthlyBWLDOMNextInterval) + @MonthlyBWDoW % 7), @MonthlyBWLDOMNextInterval)
    END
    SET @NextMaintenanceWindow = @MonthlyBWLDOMNextInterval
    END ELSE BEGIN
    -- Calculate the next interval
    DECLARE @MonthlyBWNextInterval DATETIME; SET @MonthlyBWNextInterval = DATEADD(MONTH, @MonthlyBWNumberOfCompletedIntervals * @MontlhyBWInterval, @StartTime)
    -- Set the date to the first day of the month
    SET @MonthlyBWNextInterval = DATEADD(DAY, -(DAY(@MonthlyBWNextInterval) - 1), @MonthlyBWNextInterval)
    -- Set the date to the first day of week in the month
    SET @MonthlyBWNextInterval = DATEADD(DAY, (7 - DATEPART(WEEKDAY, @MonthlyBWNextInterval) + @MonthlyBWDoW) % 7, @MonthlyBWNextInterval)
    -- Calculate date based on the week number to add
    SET @MonthlyBWNextInterval = DATEADD(WEEK, @MonthlyBWWeek-1, @MonthlyBWNextInterval)
    IF DATEADD(MINUTE, @Duration, @MonthlyBWNextInterval) < @Now BEGIN
    -- Recalc for the next month interval
    SET @MonthlyBWNextInterval = DATEADD(MONTH, (@MonthlyBWNumberOfCompletedIntervals + 1) * @MontlhyBWInterval, @StartTime)
    -- Set the date to the first day of the month
    SET @MonthlyBWNextInterval = DATEADD(DAY, -(DAY(@MonthlyBWNextInterval) - 1), @MonthlyBWNextInterval)
    -- Set the date to the first day of week in the month
    SET @MonthlyBWNextInterval = DATEADD(DAY, (7 - DATEPART(WEEKDAY, @MonthlyBWNextInterval) + @MonthlyBWDoW % 7), @MonthlyBWNextInterval)
    -- Calculate date based on the week number to add
    SET @MonthlyBWNextInterval = DATEADD(WEEK, @MonthlyBWWeek-1, @MonthlyBWNextInterval)
    END
    SET @NextMaintenanceWindow = @MonthlyBWNextInterval
    END
    END ELSE IF @RecurrenceType = @RecurrenceType_MONTHLYBYDATE BEGIN
    DECLARE @MontlhyBDInterval INT; SET @MontlhyBDInterval = (@ScheduleDuration / POWER(2,10)) % POWER(2, 4)
    DECLARE @MonthlyBDDoM INT; SET @MonthlyBDDoM = (@ScheduleDuration / POWER(2,14)) % POWER(2, 5)
    IF @MonthlyBDDoM = 0 BEGIN
    /* This is the last day of month logic */
    -- Calculate the total number of completed intervals
    DECLARE @MonthlyBDLDOMNumberOfCompletedIntervals INT; SET @MonthlyBDLDOMNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(MONTH, @StartTime, @Now) AS DECIMAL) / @MontlhyBDInterval, 0, 0)
    -- Calculate the next interval
    DECLARE @MonthlyBDLDOMNextInterval DATETIME; SET @MonthlyBDLDOMNextInterval = DATEADD(MONTH, @MonthlyBDLDOMNumberOfCompletedIntervals * @MontlhyBDInterval, @StartTime)
    -- Calculate last day of month
    SET @MonthlyBDLDOMNextInterval = DATEADD(DAY, DATEDIFF(DAY, @MonthlyBDLDOMNextInterval, DATEADD(DAY, -1, DATEADD(M, DATEDIFF(MONTH, 0, @MonthlyBDLDOMNextInterval) + 1, 0))), @MonthlyBDLDOMNextInterval)
    -- Recalc the next interval if the next interval plus the expected duration is in the past
    IF DATEADD(MINUTE, @Duration, @MonthlyBDLDOMNextInterval) < @Now BEGIN
    SET @MonthlyBDLDOMNextInterval = DATEADD(DAY, DATEDIFF(DAY, @MonthlyBDLDOMNextInterval, DATEADD(DAY, -1, DATEADD(M, DATEDIFF(MONTH, 0, DATEADD(MONTH, (@MonthlyBDLDOMNumberOfCompletedIntervals + 1) * @MontlhyBDInterval, @StartTime)) + 1, 0))), @MonthlyBDLDOMNextInterval)
    END
    SET @NextMaintenanceWindow = @MonthlyBDLDOMNextInterval
    END ELSE BEGIN
    -- Check to make sure we won't loop forever if more than 31 days some how ends up in the token
    IF @MonthlyBDDoM > 31 SET @MonthlyBDDoM = 31
    -- Adjust the start time to match the next day of month that matches the interval
    DECLARE @MonthlyBDStartTime DATETIME; SET @MonthlyBDStartTime = DATEADD(DAY, (31 - DATEPART(DAY, @StartTime) + @MonthlyBDDoM % 31), @StartTime)
    -- This loop is used multiple times to search for the next valid date that falls on the desired day of month
    WHILE(DATEPART(DAY, @MonthlyBDStartTime) <> @MonthlyBDDoM) BEGIN
    SET @MonthlyBDStartTime = DATEADD(DAY, (31 - DATEPART(DAY, @MonthlyBDStartTime) + @MonthlyBDDoM) % 31, @MonthlyBDStartTime)
    END
    IF DATEADD(MINUTE, @Duration, @MonthlyBDStartTime) > @Now BEGIN
    SET @NextMaintenanceWindow = @MonthlyBDStartTime
    END ELSE BEGIN
    -- Calculate the total number of completed intervals
    DECLARE @MonthlyBDNumberOfCompletedIntervals INT; SET @MonthlyBDNumberOfCompletedIntervals = ROUND(CAST(DATEDIFF(MONTH, @MonthlyBDStartTime, @Now) AS DECIMAL) / @MontlhyBDInterval, 0, 0)
    -- Calculate the next interval
    DECLARE @MonthlyBDNextInterval DATETIME; SET @MonthlyBDNextInterval = DATEADD(MONTH, @MonthlyBDNumberOfCompletedIntervals * @MontlhyBDInterval, @MonthlyBDStartTime)
    WHILE(DATEPART(DAY, @MonthlyBDNextInterval) <> @MonthlyBDDoM) BEGIN
    SET @MonthlyBDNextInterval = DATEADD(DAY, (31 - DATEPART(DAY, @MonthlyBDNextInterval) + @MonthlyBDDoM % 31), @MonthlyBDNextInterval)
    END
    -- Recalc the next interval if the next interval plus the expected duration is in the past
    IF DATEADD(MINUTE, @Duration, @MonthlyBDNextInterval) < @Now BEGIN
    SET @MonthlyBDNextInterval = DATEADD(MONTH, (@MonthlyBDNumberOfCompletedIntervals + 1) * @MontlhyBDInterval, @MonthlyBDNextInterval)
    WHILE(DATEPART(DAY, @MonthlyBDNextInterval) <> @MonthlyBDDoM) BEGIN
    SET @MonthlyBDNextInterval = DATEADD(DAY, (31 - DATEPART(DAY, @MonthlyBDNextInterval) + @MonthlyBDDoM % 31), @MonthlyBDNextInterval)
    END
    END
    SET @NextMaintenanceWindow = @MonthlyBDNextInterval
    END
    END
    END
    INSERT INTO @NextServiceWindow VALUES (@ScheduleToken, @RecurrenceType, @NextMaintenanceWindow, @Duration, @IsGMTTime)
    RETURN
    END
    Thanks in advance for any suggestions!

    What an ungodly amount of the code for the task!
    I tried
    SELECT * FROM SCCM_GetNextServiceWindow('00811A9E08221600', 4)
    Which is said mean "Occurs the Third Monday of every 1 month(s)" and it returned 2015-03-17. Which is a Tuesday. But it is the third Tuesday.
    Turns out that I have British settings on that instance, DATEFIRST is 1. If do SET DATEFIRST 7, I get 2015-03-23. Which is a Monday, but the wrong one.
    The current setting of DATEFIRST can be detected with @@DATEFIRST, and that would make the code even more complex.
    My gut reaction would be to start over and do it all in C#, where at least I don't have to bother about SET DATEFIRST.
    Or maybe first inspect that the ScheduleToken is correct. Maybe it is, but to me that is just an incomprehensible hex string.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Inconsistent Errors when processing  IDocs using custom Function Module

    I am encountering a most perplexing error. Here is the situation.
    We have a custom function module to update data in the EH&S system. We are having a bizarre error occurring. This is the basic processing of the function module:
    1. IDoc data is read and loaded into an internal table.
    2. Data is run through a series of checks to determine if the data is valid for entry into the system.
    3. After validation we use function module  C1F2_SUBSTANCES_READ_WITH_REF to read  characteristic data for the  substance. This data is used to validate whether current data exists to allow for loading of the IDoc data. (This is the step where the IDoc is receiving an error even if the data is valid. This only occurs if we are processing a large amount of Idocs and one IDoc contains valid data and another invalid data for the same substance. It occurs even if the Idocs are not processed in sequence.  If individually processed or reprocessed after initial failure they pass. This is what is so confusing!) If it exists, a flag is set and  the data is loaded using function module BAPI_BUS1077_CHANGE to modify the data.
    4. If the flag is set to allow further processing, the function module C1F2_SUBSTANCES_READ_WITH_REF is used again to select different characteristic data for the substance. A similar validation process occurs and if it passes, data is loaded using BAPI_BUS1077_CHANGE to update and BAPI_BUS1077_CREATE to create new data.
    Here is the situation:
    When processing one valid record for one substance, the record loads successfully.  When processing multiple valid records (all are valid) for one substance, they all load successfully.  The problem occurs when attempting to load valid and invalid records for the same substance.  Some times the program successfully loads the valid data (as expected).  Other times, it will not load any records.  It is not consistent!
    The order of IDoc processing does not have an impact on the success of the load.  Whether the valid or invalid record processes first does not have an impact on the success of the valid substance load.
    Does anyone have ANY Idea of what is going on? I am clearing all fields in the function module before processing occurs. I cannot find what is causing the error to occur.
    HELP!
    Jim Hardy

    I have some further information. It seems that if data for a substance is sent in two separate Idocs, one with valid and one with invalid data, As long as the two IDocs are processed consecutively, they process correctly. If they are separated by IDocs containing other substance information, they fail.
    thanks
    Jim

  • Error in Custom Function Module

    Hi,
    I am working on implementing General Ledger Business content in financial Accounting.
    We had a requirement of creating a Custom Virtual cube similar to 0FIGL_V10. Hence, we had copied the standard function module RS_BCT_FIGL_DATA_GET_VC10 and created a custom function module. Before doing that, we had copied the function group RS_BCT_FIGL and created a custom function group for the custom function module.Both were activated subsequently. Then, we had created a custom virtual cube (ZFIGL_V10) using the custom function module.
    The queries on the Standard virtual cube were migrated to ZFIGL_V10 using the RSZC transaction code. when the queries are executed in RSRT, we get an error message "**An exception with the type CX_SY_DYN_CALL_ILLEGAL_FUNC occurred" and the ABAP debugger is started post that error.
    Has anyone faced this problem before?could any of you provide some pointers to it.
    Regards,
    Sainath

    You cannot use the standard function module which is used for standard cube for another cube.
    You should not change the function module.
    Instead you can make a copy of the function module you are using aand use this copy in ur virtual cube which will work in the same way the actual Fm used to work and it will make you perfrom the changes.
    Follow the below steps:
    1) Goto SE37 and In the top tool bar click on the copy button which is on right side of delete button.
    2) in fr FM give the name of the actual FM and in to Fm give the name of the function module you want to copy.
    3) Then click on copy.
    4) Now open this new function in edit mode and goto the import/export parameters and check. it will have all the same parameters as the actual FM. Here you can make the changes you want.
    5) Now use this FM in your virtual cube and it will be working as per your requirement
    https://forums.sdn.sap.com/click.jspa?searchID=9605118&messageID=4999763
    Hope it Helps
    Chetan
    @CP..

  • Problem in custom fields in mm02/mm03

    Hi folks,
    i want to add the custom fields in mm01.iam able to add and update database.but iam facing problem in when iam checking the particular material in mm02/mm03.the custom field data is not correctly.for every material the last custom field data is showing. in database it is updating correctly but in mm02/mm03 it is displaying incorrectly.
    By the following code i can able to display the data in mm02/mm03.but my problem is the last created custom field(model) data is showing for all the materials when iam checking in mm02/mm03.
    here my custom field is "MODEL"
    for eg matnr-10 model -xx.
    matnr-20 model-yy.
    if iam checking in mm02/mm03 for matnr-10 model-yy it is displaying.in database it is updating correctly.
    can u please tell me how can i write a code to select the custom data(model data) for that particular material.
    Module get_data.
    if sy-tcode = 'MM02'.
    select single model into mara-model from mara
    where matnr = mara-matnr.
    elseif sy-tcode = 'MM03'.
    select single model into mara-model from mara
    where matnr = mara-matnr.
    loop at screen.
    if screen-name = 'MARA-MODEL'.
    screen-input = 0.
    modify screen.
    ENDIF.
    endloop.
    endmodule.
    Thanks in advance,
    Neelu.

    Just read the OSS note mentioned earlier.
    Symptom
    You want to integrate customer-specific fields in material master maintenance.
    Other terms
    SAPLMGMM, RMDATIND, ALE, CI_MMH1, EXIT_SAPLMGMU_001
    Solution
    To add customer-specific fields to an existing material master table (such as MARA or MARC) , you can proceed as follows as of Release 3.0C:
          1. Use an append structure to add the fields to the required table in the Dictionary (this is not a modification; for details, see the SAP document "ABAP/4 Dictionary"). In Release 3.x, the length of the field names must be the same as  the standard five character fields. This is necessary because of dynamic assignments. As of Release 4.0A, the lengths of the field names can be longer than five characters. If the changes of the fields should be recorded in the change document and taken into account during ALE distribution, set the 'Change document-relevant' indicator for the corresponding data elements. For table MARA in Release 3.x, you must also enhance the database view MARU because the database changes are carried out using this view. This small modification is no longer necessary as of Release 4.0A because the database view MARU is enhanced automatically when you enhance table MARA or the include EMARA (which is the data part of table MARA).
          2. Enhancing online maintenance in customized material master maintenance:
          Define a subscreen with your customer-specific fields in a customer-specific function group created as a copy of the standard function group MGD1.
          In Customizing, assign this subscreen to a maintenance screen using the "Copy customized material master" function. For details, see the Implementation Guide (IMG). As of Release 4.0A, program COPYMGD1 is available. You can use this program to create customer-specific function groups as required. This program is also incorporated in the Customizing function 'Configure customized material master'. Ensure that each field of the subscreen has a field statement in the flow logic, otherwise the data is not transported correctly. You can use subscreen SAPLMGD1 2002 as an example.
          If you want these fields to be subject to standard field selection, you must add new entries for them to the central field table for material master maintenance (T130F):
          Application examples for standard field selection:
          The field is mandatory and is to be flagged with a "?".
          The field belongs exclusively to the purchasing user department. Purchasing data and MRP data are both contained on one screen. However, the MRP controller is not to see the purchasing data.
          The following data is required for each field:
                a) Field name        (T130F-FNAME)
                b) Field selection group (T130F-FGRUP)
                Here, you should use a standard field group if the customer field is subject to the same field selection as the standard fields of the standard field group. If it is not, use a customer-specific field group.
                You must then check and, if necessary, modify the attribute of the field group using the function "Maintain field selection for data screens" in Customizing under "Logistics Basic Data -> Material Master".
                Field groups 111 through 120 that are not used in the standard system are reserved as customer-specific field groups. As of Release 3.0F, additional customer field groups are available. (For details, see the IMG).
                c) Maintenance status (T130F-PSTAT)
                List of the user departments that may maintain the field. You can display possible values by using the input help for the maintenance status field in the Customizing activity "Configure Material Master" when maintaining logical screens.
                d) Reference        (T130F-KZREF)
                This indicator must be set if the field from the reference material should be proposed during creation with reference.
    Note: You cannot yet use Customizing to enhance table T130F; you can use only transaction SE16 (Data Browser) or transaction SM31. Future releases will include a separate Customizing function for maintaining customer-specific fields. See Note 306966. By implementing this note you can add entries to table T130F within Customizing. This type of maintenance is possible as of Release 4.5B.
    You may change the entries for standard fields only with regard to the reference data and field selection group. Changing other data for standard fields constitutes a modification. Therefore, you cannot use the Customizing function "Assign Fields to Field Groups" to change this data.
    In addition, you must not add new standard fields to table T130F.
          3. If you want to maintain customer-specific fields using data transfer by direct input or via ALE distribution, proceed as follows:
          Add the fields to central field table T130F (see above).
          Add the customer-specific fields to the data structures for the data transfer (for example, BMMH1 for the main data).
          Also, add the customer-specific fields to the tables in which the incorrect data is stored during direct input. These tables have the same name as the corresponding master data table and also have the suffix _TMP.
          For example: If you add customer-specific fields to table MARA, you should add the same fields to table MARA_TMP.
          If you use ALE, you must also add fields to the IDoc. To process enhanced IDocs, you can use enhancement MGV00001 with customer exit EXIT_SAPLMV01_002 for creating the IDocs and customer exit EXIT_SAPLMV02_002 for posting the IDocs.
          Prior to Release 3.0E, enhancing structure BMMH1 constitutes a modification. In this case, you must add the new fields tot the end of the structure before the last field (SENDE = record end indicator).
          As of Release 3.0F, structure BMMH1 contains the customer include CI_MMH1, which is part of the enhancement MGA0001. Here, you must proceed as follows:
                a) Add the customer-specific fields to include CI_MMH1.
                The names of the fields in CI_MMH1 must be identical to those of the corresponding fields in material master tables MARA, MARC and so on.
                Important: The fields must be CHAR type fields. Therefore, create CHAR type data elements whose lengths are identical to the output length of your fields in  table MARA and so on. Use these data elements in include CI_MMH1, but use the field names from table MARA and so on.
                b) Activate include CI_MMH1.
                c) If you have not used customer structure ZMMH1 before, create it as a copy of structure BMMH1 and delete the standard fields that you do not require. You are not permitted to delete field STYPE and include CI_MMH1 when doing this. If you have already used structure ZMMH1, add include CI_MMH1 to it.
                d) Activate structure ZMMH1. This also adds the customer-specific fields to ZMMH1.
    Run program RMDATING. This program generates routines which are supplied to your customer-specific fields from the input file. As of Release 4.5A, you also need to activate the routines/function modules generated by program RMDATING (especially, the MAT_MOVE_BMMH1_XXXX modules). Details about this subject (especially the procedure when using customer structure ZMMH1) are described in the IMG for transferring the material data under item 'Maintain Transfer Structure'. Also, check the declaration of structure WA in program RMMMBIMC to see whether it is declared with sufficient length. If necessary, enhance the declaration (for the time being, this still constitutes a minor modification).
    In addition, lengthen domain DI_DATA with CHAR 5000. As of Release 3.1H, this has already been done.
    Important: When using customer-specific fields, you can use only structure ZMMH1 to transfer the data. Otherwise, after the next SAP upgrade which contains new standard fields in structure BMMH1, the input files no longer match. If you want these new standard fields to be transferred, add them after your customer-specific fields (the order of the fields in structure ZMMH1 does not need to be the same as the order of the fields in BMMH1).
    If you want foreign key dependencies or fixed domain values to be checked, or another check for a customer field, this is possible up to and including Release 3.0D only by modifying the corresponding check function modules. As of Release 3.0E, you can use function exit EXIT_SAPLMGMU_001 (SAP enhancement MGA00001) for these purposes.
    If you want to use engineering change management to schedule future changes for your customer-specific fields or you want to use the 'Display at Key Date' function, execute program GENERATE in addition. This program generates the necessary assignments for interpreting the change documents. With regard to engineering change management, you must read Notes 60281, 60973, and 48962.
    To date, it is not possible to integrate customer-specific tables in material master maintenance without making a modification. However, you can create customer-specific development objects containing the essential additional logic. You can then integrate these development objects in your system as part of only a minor modification.
    Regards

  • Problems with customizing select lists and popup LOVs

    Hi
    I have 2 problems about select lists and popup LOVs.
    The first one is about a select list in a tabular form.
    It should be created with APEX_ITEM.SELECT_LIST_FROM_LOV or similar and take its values from a named LOV.
    This worked fine but now it should also have the possibility to enter a free value.
    I tried to accomplish that by creating a APEX_ITEM.POPUP_FROM_LOV, but there is a problem with the function that is called by the arrow icon right to the input field (for eg. genList_f11_5()).
    If the row is added by addRow, then it works fine, but if the row is is not empty
    then the function call is like genList_f11_$_row() and the input field gets no value, when a LOV option is selected.
    The other problem is about a select list which should have the possibility to enter a custom value and
    also there should be the possibility to select several values. I tried to implement this by a text area containing the selected values and a multiple select list, with an event handler in each option. The user could click options and they would be copied to the text area. The problem is that I couldn't make the event handler work in IE.
    I would appreciate any ideas about either of these problems.
    Tiina

    Hi,
    If you download application you can see source.
    I have not write any instructions, sorry.
    If you are on Apex 4 you can just load jQuery UI autocomplete library and take ideas from my app.
    If you download my sample in zip there is uncompressed htmldbQuery library.
    You can see that and take only function htmldbAutocomplete.
    Then check jQuery UI document
    http://jqueryui.com/demos/autocomplete/#method-search
    There is method search that you can use open list just by click of input.
    I hope this helps at start.
    Regards,
    Jari

  • Custom Function Help

    Post Author: edy80y
    CA Forum: Formula
    I have a report with many subreports which all contain the same formula to group teams.When a new team is added i need to update all instances of the formula so they are all up to date.I know of Custom Function so i created one out of the formula in the main report.  The problem im finding is that im unable to use that custom function in the sub reports.Am i wring in thinking that a custom function created in a main report can be used in its sub reports??Am i creating the custom function incorrectly? Heres what i have done:
    Our database has team names that have a prefix of the State they are in such as: Perth - Team Orange Perth - Team Apple Sydney - Team Grape Sydney - Team Pineapple
    At one stage the Teams in Perth had been split into Perth1 and Perth2 resulting in the following records in the database:
    Perth1 - Team Orange Perth - Team Orange
    Because of this i have created a formula that groups teams into sites:
    select Trimleft(mid({team.name},instr({team.name},'-')+1))case 'Team Orange', 'Team Apple': 'Perth'case 'Team Grape', 'Team Pineapple': 'Sydney'default:''
    I use this formula in all reports and subreports and i link by them as well, so if a new team is created (for example Perth - Team Pear) i need toupdate all instances of the formula by adding 'Team Pear' to the Perth case.
    To fix the problem i created a custom function (called 'site') out of the formula above and it created this:
    Funtion (stringvar v1)select Trimleft(mid(v1,instr(v1,'-')+1))case 'Team Orange', 'Team Apple': 'Perth'case 'Team Grape', 'Team Pineapple': 'Sydney'default:''
    Now within that main report i am able to go to the formula editor and when i type site() then wording becomes blue but when i go into a sub report to do the same it doesnt react.
    I hope i have explained my self well enough for you to understand my predicament without boring you.
    Thanks in advance for your help!

    Post Author: edy80y
    CA Forum: Formula
    Hi,
    Thanks for the reply.  Unfortunately it does make things easy for me.  If i add the custom function in the subreport then i will have to updae that as well whenever a new team is created.  I'm looking for a solution where i only have to update the custom function in the main report only and not in the 7 or 8 subreports within it.
    Unless i am doing something wrong.  I basically copied the contecnt of the Custom Function in the main report and then went into the sub report and created a new Custom Function and pasted the code in it.
    Regards,
    Eddie S

  • Custom Function in a Sequence Not Working

    Hi All,
    We have defined a Custom Function and it has got a class (ZCL_IP_DERIVE_XXX_XXXX).
    Further, in the IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~EXECUTE method of this class, we have defined a logic of appying a new Index (Sales Curve) and the forecast values are uplifted accordingly.
    This Custom functon of Applying a new Index is one od the step in a Planning Sequence.
    When I try to execute only the step of applying function in the modeler, I get the output as required and I can see them accurate in the trace.
    But If I execute the entire sequence either step by step or at one go, the function is not applied. In the messages, it says step1 to 7 are executed. But there is no change done to the records read.
    I doubt the values written back in the function are refreshed as soon as the come out of the step. Correct me if I am wrong.
    The Values are read and written abck to the table C_TH_DATA.
    Are we populating the right table? Do let me know if I need to change anything in the sequence.
    Regards,
    Harika

    Thanks for your replies.
    As suggested, the problem was with in the sequence as in the step before the function is applied, they are getting deleted...smll change in the code fixed the issue.
    But now, when I try to run the same sequence on a button in a workbook, it doesnt work.
    I checked the sequence behind the button. it is assosciated with the same one defined.
    But no clue why it doesnt work.
    Also, please let me know if there is any option to unhide the fields on the workbook in design mode.
    Regards,
    Harika

  • Custom Function in SAP MDM Data Manager Validation

    Hi SDN,
    Can we write our own custom function for Validation of the records.
    Actually my requirment is
      For a particular Account Group The value of the G/L Account must be in particular range and it must have a specific Length.
    For Example:
    IF( Chart of Account = CCA AND Account Group = ACG, G/L Account No >=100 AND G/L Account No <= 1000 AND LEN(G/L Account No) = 6, False)
    Pls provide some valuable suggestion .

    Hi Rajni thanx for ur prompt reply
    The actual problem is that :
    we have approx near about 100 Account Group, so it would become very complex to replicate same condition 100 times
    AND
    these account group may keep on increasing so even maintenance point of view it would be hard to maintain.
    can u tell me some other way to do it, i mean is there any other feature by which we can perform validation in MDM.
    Regards
    Kuldeep

  • ALE custom function module for IDOC_INPUT_COSTCENTER

    We are setting up an ALE to update cost centers in our HCM system from our ECC system.  In conjunction with the cost center update I need to convert the company code (it's not straight-forward enough to use a conversion rule) so I have created a custom copy of IDOC_INPUT_COSTCENTER and included my conversion logic there. 
    I have done all of the necessary configuration steps associated with the custom function module; created message type ZCOSMAS, process code ZCOSM, etc.  When I execute BD16 it is passing the correct message type and process code to the HCM system but I am getting a status 51 'Function module not allowed: IDOC_INPUT_COSTCENTER'.
    I must be missing some piece of configuration in my HCM system that should trigger Z_IDOC_INPUT_COSTCENTER rather than IDOC_INPUT_COSTCENTER.  Can anyone tell me what I have missed?
    Thanks in advance for any assistance you can provide.
    Regards,
    Pat
    Edited by: Patricia Holland on Dec 22, 2011 2:38 PM

    I thought that I had found found my problem in the model view but I was mistaken.  I am still getting status 51 'Function module not allowed: IDOC_INPUT_COSTCENTER'.
    It should be using Z_IDOC_INPUT_COSTCENTER.
    Edited by: Patricia Holland on Dec 22, 2011 3:00 PM

  • Use CustomFunctionController to add Repository Custom Function to a reportclientdocument

    <p class="ssiBODYCOPY">I would love to know how to add a Repository Custom Function to a reportclientdocument - If this is possible?<br />I need to know how to instantiate an object of type Custom Function from the enterprise repository or get a list of available custom functions. <br />The following code takes a "custom function object" from an existing report (which is a repository custom function) and I THINK adds it to the reportclientdocument - in fact the count of items in the customfunctioncontroller is 1 after I add the custom function but when I save the reportclientdocument they dissapear - I am not sure if I should be using ADD or INSERT method. I also was able use other controllers such as the DataDefController which works sucessfully. Please can someone help me figure out how to do this (btw where in CI_INFOOBJECTS is a custom function stored?)<br /><br />Thanks Nicole<br /><br />Dim rptClientDoc As ReportClientDocument<br />&#39;open the report<br />rptClientDoc = OpenReport("report1", ceInfoStore)<br /><br />Dim myCustomfunctions2 As CrystalDecisions.ReportAppServer.DataDefModel.CustomFunctions<br />Dim myCustomcontroller2 As CrystalDecisions.ReportAppServer.Controllers.CustomFunctionController<br />myCustomcontroller2 = rptClientDoc.CustomFunctionController()<br /><br />myCustomfunctions2 = myCustomcontroller2.GetCustomFunctions()<br />Dim cf As CustomFunction<br />cf = getfunction(ceInfoStore, ceSession) &#39; Gets valid custom function object in ANOTHER report<br />myCustomfunctions2.Add(cf)<br /><br /><br />Dim datacont As CrystalDecisions.ReportAppServer.Controllers.DataDefController<br />datacont = rptClientDoc.DataDefController<br />datacont.RecordFilterController.SetFormulaText("currentdate > month(testing)")<br /><br />SaveNewReport(ceInfoStore, rptClientDoc, "report1", "report2")</p>

    Hello Nicole
    please also use our diamond sample site to search for samples which might solve your problem.
    Your need would be in CE managed samples which we publish for JAVA and NET.
    Please use this link:
    https://boc.sdn.sap.com/
    Falk

  • Business Objects 4.0 (Custom functions) -- Expert advise required

    Good day All!!!
    I require a technical expert advise from this forum ASAP. I hope you have some time amidst
    your busy schedule and answer the required clarifications.
    Problem Description:
    I would like to write a custom function (e.g to convert local time zone to utc and from utc time zone to local) and import that function in the BO 4.0 universe so that universe has the ability to use this function.
    I understand BO 4.0 supports importing of the custom functions e.g data_quality_custom_functions.atl.
    Expert advise Required from you on below questions:
    Now my question is how to write a custom function and generate the required .atl files that can be imported in the universe?
    Does this require any specific tool/API's to generate these functions ?
    Can we use traditional languages like C/C++ to generate the custom functions or does it uses any script based languages?
    Is there any flexibility to accommodate complex algorithms in the custom based function?
    Are do we have to approach SAP to generate the .atl files by giving some interface document?
    It would be of great help at this stage if you could provide some insight into the mentioned areas as we are in a critical stage to finalize a design approach. If you have time to answer our queries and require additional details on why we have to go for custom functions then I will be glad to provide right level of details.
    Looking forward to your expert advise early....
    Thanks
    NAGSCAT

    Yes, it is. Please, look at chapter 8.5.2 in the Business Intelligence Platform Administrator Guide.

Maybe you are looking for