Custom field mappings in query

Hello
In our classes we use GregorianCalendar for date representation.
Therefore I wrote a ColumnFieldMapping class for mapping of
GregorianCalendar to SQL_DATE.
(I used the SQLDateMapping class as example).
The storing and retrieving works without problems.
Just, when I want to query for a specific date, I have to pass a
java.util.Date object as parameter:
String filter = "_dateOfSample >= startDate";
Query query = pm.newQuery(Sample.class, filter);
query.declareParameters("java.util.Date startDate");
Java.util.date startDate = ...
Collection samples = (Collection)query.execute(startDate);
Although, this works fine, I think, that the caller of the query shouldn't
have to know, the DB "internal" representation of a field.
Is there a way, that the parameter is also transformed by the mapping class?
Thanx for any help
-- Pat

Hi Patrick
Thanx for your reply.
What happens if you pass a GregorianCalendar parameter to the query?kodo.util.UserException: The specified parameter of type "class
java.util.GregorianCalendar" is not a valid query parameter.
Also, are you overriding the getDataStoreValue() method in your mapping?No.
I just adapted the SQLDateMapping example.
Now, I've rewritten the mapping class based on IsMaleMapping and everything
works fine.
And it's even easier.
Thanx for your help
-- Pat

Similar Messages

  • Alignment and restriction of Custom field in SAP query report

    Hi Experts,
    I have one custom field in query report(SQ01) called Amount in local currency which is calculated based on Amount in document currecy * exchange rate.
    But this field values are coming in left alignment instead of right alignment so how i should get in right alignment and second issue is how i can restrict field value to only 2 decimals.
    I tried the below link "http://media.techtarget.com/searchSAP/downloads/SAP_Query_C7.pdf" but the steps they mentioned are not appearing in SQ01 for example in that link they mentioned to click Basic List option for advanced steps but when i click i goes directly to field list with field groups on left pane
    Please provide solution for this.
    Thanks&Regards,
    narasimha

    Hello narasimha,
    In the Infoset when you create the additional field, enter an existing SAP table field that has type CURR in the parameter labeled LIKE Reference.  For example you can enter BSAK-DMBTR as a value. When you select the additional field in the query, the currency will also show.
    Kind Regards,
    Rae Ellen Woytowiez
    Edited by: Rae Ellen Woytowiez on Apr 25, 2011 11:27 PM

  • Add custom field to af:query component?

    Anyone had any experience overriding af:query copmonent? I need to add my custom search field (to query component), which would have a search icon next to it, and on click, a popup widow would open containing my custom task flow where I could select a record with certain value and on return that custom field (in query component) would get populated with selected value. I hope I'm being clear. Please point me to any useful information. Is that even possible? I use JDeveloper 11.1.2.3.4.0 Regards, Marko

    Hi,
    af:query is a component that comes as is. Its not designed for customization in that you can add your own fields. If you have a requirement for this then
    1. expose a method on the VO Impl or AM Impl that expect arguments (your query parameters)
    2. Use the arguments to populate bind variables used by a ViewCriteria
    3. Apply the View Criteria to the View Object
    4. Execte the View Object
    5. Drag and drop the method from the DC panel as a parameter form
    6. Ensure the result table PartialTrigger property is pointing to the button ID of the parameter form
    7. Change whatever UI component you want to change in the parameter form
    This gets you going ...
    Frank

  • Custom Field in Infoset Query missing in Infoset

    Hi Everyone,
    I'm in a puzzle and I hope someone can help me. Basically I need to maintain an existing infoset Query - While looking through the query and it's related Infoset I noticed there is a custom field appearing in the query (SQ01) but this field is nowhere to be seen in the Infoset (SQ02) - I'm just wondering how can this be ?
    The same custom field exists in another Infoset - is it therefore possible to build a query using an infoset while pulling in fields from another ?
    I would appreciate any thoughts on this matter as I'm in a very confused way over this.
    Thanks in advance
    Kind Regards
    Damien
    Edited by: Damien Kesle on Jul 22, 2009 3:48 PM

    Hi Damien Kesle ,
    There are ways by which you can create fields ( they are called Local fields ) in the Query too.
    Please see , whether the custom field you are asking is present in the Query.
    Even then , just to confirm that your said field does not exist in the infoset, follow the steps.
    Go to SQ02, put the name of your Infoset and click on tab "Description ".
    Then do a Ctrl + F (Find/Search) for the field. If its not there, then you can confirm that the field comes from Query and not Infoset.
    Approach for any further queries.
    Regards,
    Subin John

  • How to add & fill custom fields in POWL Query

    Hi all,
    I have a requirement where I need to create a new POWL Query and should show the Defect data of each Issue ID. I looked for tutorials and threads about POWL queries but can't seem to find the information I needed.
    In details, I need a new query which should be available in NWBC -> Quality Issue Management -> Worklists. We already have one which is an overview of all Issues, but I need to create a new worklist which displays the Defect data of each Issue. (Please note, I am new to QIM and this is my first time handling QIM requirement.)
    May I ask if you can guide me or if you know some links where there are steps how can I extract the Defect data? I also looked at OSS Note 1865206, is the steps for "Additional result fields" all I need?
    Thanks,
    Leo

    Hi James,
    The above was cancelled, but now I need to look why the query is not automatically refreshing the data when I changed the worklist parameters. It doesn't also refreshes the data when I click "Refresh list" button below the table in NWBC QIM worklist view:
    But when I close the tab and reopen it, it now displays the updated list.
    I tried the refresh configs I found here, but still doesn't work.
    Thanks,
    Eo

  • ABAP query using logical database KDF is not populating custom fields

    Hi Experts ,
    I created two following queries
    1.       VENDORCATKDF – uses KDF logical database
    2.       VENDORCATLFA1 – uses table = LFA1
    I’m pulling the same information in both queries:
    ·         Vendor Number
    ·         Country
    ·         Vendor Name
    ·         Vendor Category  (custom fields added to LFA1)
    The results for the query that uses the logical database KDF is incorrect.  It doesn’t pull in the flag on the custom field LFA1-ZMRO.   Even though the logical database KDF is made up of the table LFA1 and has these fields. 
    Is there something that can be done – so that all of these “custom” category fields under LFA1 (such as LFA1-ZZMRO) – get pulled into queries – when we use the logical database KDF ?

    Hi,
    I have got the error removed by ensuring that fields from one table are a part of one line ( taking help of ruler) only. But the underlying problem remains, the output is not ALV but List output.
    I do not think having additional fields in the query is reason for this.
    Is it bcoz iI am adjusting the output length of columns to ensure no hierarchical error ?
    Can we not have a query using LDB which is shown as SAP List?
    Regards,
    Garima.

  • Adhoc query custom field selection

    Hi Experts,
    In adhoc query, we have added a custom field and we find that it is giving correct output.  However, we want to make the "selection" box appear and we don't know how to do it.  Would you have instructions?
    If we add standard/ready-made fields to a field group, both the selection and output boxes are already available but if we copy the standard to make a custom field, only the output box is available.

    Hi,
    Where do we find this customizing field we need to select? We have tried accessing sq01 and changed a query we have created. We clicked on the basic list button and checked the checkboxes for list field and selection field.  When we got to infoset query, the selection checkbox is still missing.  Are we checking the right path?  The infoset is also missing that checkbox.
    We also got a suggestion here that maybe the problem is on the "extras" tab in SQ02 - that our field should have an entry there.

  • Adding Fields to Custom Infotype Using Custom Infoset in SAP QUERY

    Hi All,
    We have a requirement to add fileds to a custom infotype for querying Custom Infoset in SAP Query.
    We are facing problem as the added field is not getting displayed in the Query set so that we can select and display it in the Basic List along with the other filds.
    Kindly suggest a solution.
    Full points will be rewarded.
    Thanks in Advance
    Kumar

    Hi Salman,
    Thank you for your valuable information. I haven't Configured Dynamic Actions yet. Is it simple to write the Logic for Dynamic Actions. Is this the only way to solve this Issue?
    I tried by adding the standard fields, but they are not populating the values; but just appearing as Input Fields with Input help option.
    Please let me know if you have any suggestion in this direction?
    Regards,
    Hems.

  • How to make a custom field as text as well as value fied in ad hoc query

    hi,
      i have created a custom infotype 9004 in which the custom field contain the code values, and the text of this code values are maintained in another ztable.
    when i am viewing this infotype in Ad hoc query i am able to see this fields as only value fields and hence i am unable to get text for this field i.e when we right click on this field only the value option is enabled and the text option is disabled, both these options are enabled in some other standard fields like pernr(personnel no), persg(employee group),persk(employee subgroup).
       can anybody suggest me how to enable both these options for custom fields.

    Assign you table of text as a table text to the data element/domain of your custom field or thru external key on your infotype.
    Query is able to analyse these links.
    Regards.

  • Creating an SQL Query for Project Custom Fields Values

    Hello:
    I'm currently trying to create an SQL Query to show all of the server's Project Custom Fields Values, along with the modification date.
    So far, I've managed to display correctly all of the data for all of the Projects' text value Custom Fields (those not based on a LookUp Table) with this query:
    SELECT
    MSP_PROJECTS.PROJ_NAME,
    MSP_CUSTOM_FIELDS.MD_PROP_NAME,
    MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE,
    MSP_PROJ_CUSTOM_FIELD_VALUES.TEXT_VALUE,
    MSP_PROJ_CUSTOM_FIELD_VALUES.MOD_DATE
    FROM
    MSP_PROJ_CUSTOM_FIELD_VALUES
    INNER JOIN
    MSP_CUSTOM_FIELDS
    ON MSP_CUSTOM_FIELDS.MD_PROP_UID = MSP_PROJ_CUSTOM_FIELD_VALUES.MD_PROP_UID
    INNER JOIN
    MSP_PROJECTS
    ON MSP_PROJECTS.PROJ_UID = MSP_PROJ_CUSTOM_FIELD_VALUES.PROJ_UID
    WHERE
    MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE IS NULL
    ORDER BY
    MSP_PROJ_CUSTOM_FIELD_VALUES.PROJ_UID,
    MSP_PROJ_CUSTOM_FIELD_VALUES.MD_PROP_UID
    However, when I try a new Query to obtain the actual values for the Projects Custom Fields that do use a LookUp Table, I can't seem to find what table in the model I'm supposed to link to the MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE field (the TEXT_VALUE
    field has NULL value when CODE_VALUE field isn't NULL)
    Any suggestions on how to obtain the actual Projects' custom fields values instead of the Code Value, for Metadata that do use a LookUp Table?
    Also, I'm able to run this query only in the Published Database, since the MSP_CUSTOM_FIELDS table is empy in the Draft Database. Why is that?
    Awaiting your kind reply,
    Sebastián Armas PMO Project Manager

    Hi Sebastián, rather than directly accessing the database it would be better to use the PSI to get this data.  Take a look at the ProjTool sample in the SDK whcih gets this data.
    Best regards,
    Brian.
    Blog |
    Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter |
    Project Developer Center |
    Project Server Help | Project Product Page

  • MS Project 2010: SQL Query Expansion to custom field

    In a further forum topic I got the solution for searching for server admins approvals pending, not publisched projects and team members not sended times.
    We defined a new enterprise custom field called "Status reporting" from type Flag (yes/no).
    Can someone help me to expand the following MS SQL query get the state of "Status Reporting" in the solution table?
    SELECT DISTINCT  R.RES_NAME as [RESOURCE NAME], RB.RES_NAME STATUS_MANAGER, P.PROJ_NAME,A.TASK_NAME,
    [STATUS] = Case TR.ASSN_TRANS_ACTION_ENUM When 0 Then
    'Pending' When 1 Then 'Accepted' When 2 Then 'Rejected' End,
    IS_PUBLISHED = CASE WHEN P.WPROJ_LAST_PUB >TR.ASSN_TRANS_SUBMIT_DATE THEN 'Yes' ELSE 'No' END,
    TASKSTATUS = CASE WHEN AU.ASSN_UID IS NULL AND TR.ASSN_TRANS_ACTION_ENUM = 0 THEN 'Saved' ELSE 'Submitted' END,
    BASELINED = CASE AB_BASE_NUM WHEN 0 THEN 'Yes' ELSE 'No' END
     FROM MSP_ASSIGNMENT_TRANSACTIONS TR WITH(READPAST)
    LEFT OUTER JOIN dbo.MSP_CONVERSIONS C ON ((C.CONV_VALUE =
    TR.ASSN_TRANS_ERROR_ENUM) AND (STRING_TYPE_UID = 'A16A340A-4AD1-4F62-880C-564C45021502'))
    LEFT OUTER JOIN MSP_ASSIGNMENTS_SAVED A WITH(READPAST) ON TR.ASSN_UID = A.ASSN_UID
    LEFT OUTER JOIN MSP_ASSIGNMENTS_SUBMITTED AU WITH(READPAST) ON TR.ASSN_UID = AU.ASSN_UID
    LEFT OUTER JOIN MSP_ASSIGNMENT_BASELINES AB WITH(READPAST) ON TR.ASSN_UID = AB.ASSN_UID AND AB.AB_BASE_NUM = 0
    LEFT OUTER JOIN MSP_PROJECTS P ON A.PROJ_UID = P.PROJ_UID
    LEFT OUTER JOIN MSP_TASKS_SAVED TA ON TR.TASK_UID = TA.TASK_UID
    LEFT OUTER JOIN MSP_PROJECT_RESOURCES R ON A.RES_UID = R.RES_UID AND R.PROJ_UID = P.PROJ_UID
    LEFT OUTER JOIN MSP_PROJECT_RESOURCES RD ON
    TR.ASSN_TRANS_DELEGATEE_RES_UID = RD.RES_UID AND P.PROJ_UID = RD.PROJ_UID
    LEFT OUTER JOIN MSP_RESOURCES RD1 ON TR.ASSN_TRANS_DELEGATEE_RES_UID = RD1.RES_UID
    LEFT OUTER JOIN MSP_PROJECT_RESOURCES RS ON
    TR.ASSN_TRANS_SUBMITTER_RES_UID = RS.RES_UID AND P.PROJ_UID = RS.PROJ_UID
    LEFT OUTER JOIN MSP_RESOURCES RS1 ON TR.ASSN_TRANS_SUBMITTER_RES_UID = RS1.RES_UID
    LEFT OUTER JOIN MSP_RESOURCES RA ON TR.ASSN_TRANS_APPROVER_RES_UID = RA.RES_UID
    LEFT OUTER JOIN MSP_RESOURCES RB ON A.WRES_UID_Manager = RB.RES_UID
    LEFT OUTER JOIN PS_TestFarm01__Prodcp20130606_Reporting.dbo.MSP_EpmResource mer on A.WRES_UID_Manager=mer.ResourceUID
    Murol

    Hello Paul,
    great, it works. I inserted:
    Statusreporting =
    CASE PV.[Status
    Reporting] WHEN 1
    THEN
    'Yes'
    ELSE
    'No'
    END
    LEFT OUTER JOIN PS_TestFarm01__Prodcp20130606_Reporting.dbo.MSP_EpmProject_UserView PV
    ON PV.ProjectUID = P.Proj_UID
    The first line I understand a little bit but I don't understand 
    PV.[Status Reporting]
    But, the second line "LEFT OUTER ...", I doesn't understand
    Many thanks and kind regards
    Peter
    Murol

  • Using custom fields of Infoset as Selection Criteria in Query Reporting

    Hi Experts,
    I have created one Infoset based on LDB PNPCE and added some custom fields to it. Coding has been done for the custom fields.
    But these additional custom fields are not available as selection criteria while creating the query.
    Can you please tell me how to use the custom fields as selection criteria?
    Reply soon
    Thanks in Advance.
    Raveesh

    Hello Guys,
    I just noticed that it is possible to select custom fields as selection criteria in case of SAP Query,
    but NOT is case of Infoset(Adhoc) query.
    Can anyone tell me the whether it is possible to select the custom fields as Selection Criteria in case of Infoset Query?
    Thanks in Advance,
    Raveesh

  • Populating custom field in an existing sap query

    HI,
    I am making changes to existing query . Query already had a qty field, now I need to display the % of qty delivered for every
    vendor  as a subtotal text for every vendor.
    I added the custom field to query and can display it as subtotal text. But I am not able to populate the value into it.
    Because, When I sort by Qty and sum by Qty, I am getting value. Now I need to divide the sum of qty / number of items, which i dont get until I display the output, So my subtotal text field is always zero.
    I
    I debugged the program generated by query, it is using select--endselect and putting in %dbtab(which is not defined in query) .
    To get the final value, i cannot change standard code generated from Query/Infoset and add teh LOOP ..ENDLOOP and make At new logic for vendor.
    Any suggestion on calculating the % of delivered qty,..
    Thanks

    if your query is based on an infoset, you just have to put the formula in code of infoset

  • SAP Query Custom Field with ABAP Code

    Hi All,
    I have a custom field in my SAP query which has some ABAP code under it. The code finally writes some value to a variable. My question is do i need to explicitly link the variable in the ABAP code to the custom field OR it's done automatically. For some reason i don't see any value for this custom field. Thanks.

    Thanks Sandra

  • Display Custom Fields in a SharePoint 2010 Content Query Web Part?

    Using SharePoint 2010, Having Custom List With 4 Columns, Now I am Using Content Query Web-part To Display List Data ,But Currently It Display Only First Column, SO How to Display Custom Fields in a SharePoint 2010 Content By Query Web Part
    AKshay Nangare

    Hi,
    By default CQWP shows only one column. However, if you want to show more than one column, then CQWP needs to be customized. The property which you are looking for is CommonViewFields. It is used to specify the additional fields that you want to display in
    the Web Part. See this for more information:
    https://msdn.microsoft.com/en-us/library/ms497457%28v=office.14%29.aspx?f=255&MSPPError=-2147217396
    Blog | SharePoint Learnings CodePlex Tools |
    Export Version History To Excel |
    Autocomplete Lookup Field

Maybe you are looking for