Custom code in HR Ad Hoc query

Hi Friends  ,
I am facing one issue where the custom ad hoc query is giving incorrect results so I have to overwrite the values in available  internal tables with my own logic , But I am unable to write the code at right point through Extras>create>code  path in SQ02   the values are populate after the point where i can right code . Request you to kindly help me .
Thanks & Regards
Gaurav Deep

Hi,
Write the coding in End-of-selection(before list) event. Your internal table would not be changed after this point.
Regards,
Srini.

Similar Messages

  • Ad hoc query missing amounts

    Hi:
    I'm having problems in order to obtain amounts from a custom infotype, this custom infotype (9001) is attached to the positions. When I try to obtain information about amounts that I have store in the custom infotype with the ad hoc query, I have the following error:
    Error when generating the report (see long text)
    Message no. AQ_AD_HOC221
    Diagnosis
    The report cannot be generated because the internal description is invalid or incomplete, or because the selection screen is too large.
    Regenerate the assigned InfoSet, and read the log. If the InfoSet is OK, make sure that at least one field is given as output.
    If you used the 'Refresh' icon to start the query, use the 'Output' menu option to execute the query. This gives you a full screen display of the data.
    If an output was generated, the query cannot work with actual data in the construction view. In this case, always use the 'Output' function to execute the query.
    And I just tried to obtain information of 1 record.
    I'm in 640 version.
    Thanks in advance!!

    Hi Antonio,
    Without knowing the structure of your custom infotype, it is difficult to identify the cause of your problem.  I would first start with that - use transaction SE11 and make sure the infotype structure and definition for the requested field are correct and activated. 
    Since the infotype is tied to Position, I would create a new PCH based Infoset (SQ02) with the Position as the key.  Then include the IT1001, 1005, 9001, etc as well as the IT0000, 0001, 0002, etc. for Person as Holder.  Generate the Infoset, assign it to your user group (via SQ03) and then create an Ad Hoc Query with it. 
    It is also possible the custom infotype may not work in Ad Hoc, but could if the query is created directly in SQ01.  I would also give that a try.  Again, the problem is probably in the custom infotype and the field itself or in the generation of your infoset. 
    Paul

  • 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.

  • Validation of EEO code using ad hoc query

    Hi,
    I just want to ask for a help or any ideas with regards to the case below.
    The EEO job categories have been revised and I've already map the existing job codes to the correct EEO job category in table T5U13. But when I try to run a query for a specific job to check and verify if the mapping of the new EEO job category to the existing job code is correct, the EEO code field is left blank. Meaning that there is no EEO job category attached to the job code. But I've maintain the mapping already and when I double check table T5U13, the job code is map to the new EEO job category. I just want to ask for help that if I run the query, the EEO code field would have an entry based on the mapping I've done.
    Thanks in advance for your help!

    Hi Sanghmitra,
    I have got a query  in AD-HOC query.
    After creating the Adhoc query using the join table functionality the resulting adhoc query does not results any out put.
    What I have done is :
    1.Created a user group through SQ03
    2.Attched user to My user group
    3.Created an infoset using join table functionality(SQ02).
    4.Saved and generated the infoset
    5.Added the user group to the infoset and than run the ADHOC query.
    The table I have used to join is all PA table (For test pupose)
    Though the purpose of the custom infoset is to join PA,OM and E rec infotypes, for testing purpose I have joined only PA infotypes.
    Result:The adhoc query does not gives any out put instead it says no data could be read.
    Could you please tell what else I need to do so that the custom infosets gives an out put.
    Will greatly appreciate your help.
    Thanks and best regards
    Rajeev

  • Problem with custom code in infoset query

    Hi,
    I have created a infoset. In the infoset i added a few additional fields and wrote code in the field code for those fields. I saved and generated the infoset. But in the output of the query, i am getting blank values for those additional fields. When i checked the generated program (SE38), the code is not present in the program.
    If anyone has encountered a similar problem and resolved it, please let me know where i am going wrong.
    Thanks.

    Hello,
    After adding the code for additional fields in Infoset, please syntax check and then activate the Infoset. Then the program will be regenerated with your custom code.
    Thanks,
    Venu

  • Transaction Code to AD Hoc Query

    I have created an Ad Hoc Query and Given it a name and saved it.
    Next Time when I wanted to execute that query I go to S_PH0_48000510 - Ad Hoc Query , select that query and press on Output to get the result. In between I have selected the setting "Start via selection screen" in Extras>Settings.
    Hence I get into the selection screen and while I execute, I go to the output result.
    What I am looking for is how to assign a transaction code to this query that I have created, so that I execute that transaction code I am directly into the selection screen. By means of this I can skip some of the steps like going to S_PH0_48000510 - Ad Hoc Query and then selecting the query and then the other steps.

    Both the ad-hoc and the SQ01 queries create a program that can be assigned to a transaction.  However, the program name that is generated contains a 2 digit code that is specific to the client you are working on.  This makes it hard to run the same transaction in DEV, QAS, and PRD.  Instead, create a parameter transaction that runs the START_REPORT transaction with parameters set that run the D_SREPOVARI-REPORTTYPE=AQ, D_SREPOVARI-EXTDREPORT=<sap query name in SQ01>, D_SREPOVARI-REPORT=<user groups belonging to the query>

  • Ad Hoc query Addition Field code

    Dear Experts,
    I need amend Ad hoc query to be able to report on Expected End MPP Q0088-EEMPP, It is not a standard field in the infotype for SE16 or SAP Query/Ad Hoc. We need to be able to query off this field. Can someone please point me in the right direction about how to get the calculated value from this field added to queries, or what code is needed.
    I have created an additional field in SQ02, i probably need code to make it fetch the data
    thanks
    haji

    Hi,
    Please take a look at standard function module HR_GBSMP_MPP_DATES. It returns the expected end date.
    Hope this helps.
    Donnie

  • Write code in ad hoc query

    hello All,
    I have a reqmnt, My client has an existing ad hoc query and I need to add two fields to it, both of the fields are not direct and needs some coding, cud anyone please explain how can i go bout it?
    thanks,
    RS

    Its quite straight forward, so just have a play around, but the steps are something like:
    1.     SQ01/environment/info sets/query areas/standard
    2.     Choose the info set you wish to change
    3.     Choose the filed group you wish to add a field to
    4.     Right click the infoset you want to add a field to
    5.     Add the new field to the field group for that infoset
    6.     Then use the extras button to add code to that field
    I tend to use the initialization, and record processing event blocks for adding my code.  USe the eblow link for the SAP documentation.
    http://saphelp.user.ad.glasgow.gov.uk:8000/saphelp/helpdata/EN/d2/cb3efb455611d189710000e8322d00/frameset.htm
    And here is some sample code i've used for one particaulr field, just to give you an idea of how easy it is.
    rp_provide_from_last p0000 space pn-begda pn-endda.
    * Get last Ity2001 record
    IF p0000-massn = '16'.
      SELECT SINGLE pernr max( endda )
             FROM pa2001
             INTO (p2001-pernr, p2001-endda)
                  WHERE pernr = pernr-pernr
                  GROUP BY pernr.
    ELSE.
      rp_provide_from_last p2001 space pn-begda pn-endda.
    ENDIF.
    SELECT SINGLE UMSKD
           INTO WA_UMSKD
           FROM Y0PT_AMMSUBS
                WHERE PERNR = p2001-pernr
                AND   ENDDA = p2001-endda.
    wa_OCCHC  = wa_UMSKD(2).
    occhealth = wa_OCCHC.
    <a href="http://saphelp.user.ad.glasgow.gov.uk:8000/saphelp/helpdata/EN/d2/cb3efb455611d189710000e8322d00/frameset.htm">http://saphelp.user.ad.glasgow.gov.uk:8000/saphelp/helpdata/EN/d2/cb3efb455611d189710000e8322d00/frameset.htm</a>

  • How to get List Item attachments name without write any custom code or any database query?

    Hi,
    How to get List Items attachments name without write any custom code or any database query?

    You can get it from Rest,
    There are 2 options,
    1) create a 'Result Source' which has a search query for that List which has attachments 
     - Use rest query to get the 'Filename' , it will have the attachment file name 
    For example, if the result source id is : 73e6b573-abf8-4407-9e5f-8a85a4a95159 , then the query will be 
    http://[site URL]/_api/search/query?querytext='*'&selectproperties='Title,Path,FileExtension,SecondaryFileExtension,Filename'&sourceid='73e6b573-abf8-4407-9e5f-8a85a4a95159'&startrow=0&rowLimit=100
    You can refine the query, be giving proper 'querytext'
    2) Use the List rest api
    For example if your list guid is :38d524a1-e95c-439f-befd-9ede6ecd242e
    You can get he attachments for 1st item using this 
    http://[Site URL]/_api/lists(guid'38d524a1-e95c-439f-befd-9ede6ecd242e')/items(1)/AttachmentFiles
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • How to query a dataset using custom code in report builder 3.0

    Hi,
    Can anyone please suggest whether it is possible to query a dataset by using custom code in report builder 3.0.
    Thanks in advance.

    Hi Purbasha,
    please see below similar thread:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9af8f39a-9dc5-49ab-91af-2f64198c8477/ssrs-2008-custom-code-for-database-query
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/440ff5de-1c21-47de-95d8-e4212d6cef6d/dataset-in-custom-code-in-sql-server-reporting-services?forum=sqlreportingservices
    swallow

  • Ad-hoc query

    Hello,
    Our business users would like to use ad-hoc query for the reports they would want to generate on the as need basis. Can anyone please elaborate on how to use ad-hoc reports in HR.
    I tried with the t-code S_PHO_48000516 for running ad-hoc reports, but its only for PA. We would want to run queries both on PA and OM data simultaneously. Also I could not pull the custom infotypes data in there.
    Please elaborate on how to use Ad-hoc and Infoset queries.
    Thanks in advance.

    Hi,
    U can use Infoset Query for report in HR. T-Codes are SQ03, SQ02 AND SQ01. By SQ03 create user group. then SQ02 -infoset and by SQ01 create reports.
    try this. it works.
    Regards
    Nas

  • Ad hoc query report geneartion

    Hi Guys,
    I am seeking your help on ad hoc query report generation.
    My requirement: There is a customized table maintained to fetch the description and the relevant data.. For ex: 
    Type of Vehicle
    Description
    XYZ
    Test description1
    ABC
    Test description 2
    The requirement is to fetch the description using ad-hoc query for all the type of vehicles. I have created a type of vehicle field and included in the field group. So far, I am able to get the type of vehicle on my ad-hoc report. But, the description fails to retrieve. Please note I have also created an additional description field on ad-hoc reports to fetch the description.. After the generation of the info set, I am unable to fetch the type of vehicle with the description.
    Can anyone please guide the field code that needs to be maintained specially to fetch the contents all together?
    Thanks.
    BP

    Hi,
    I have already mentioned that "Please note I have also created an additional description field on ad-hoc reports to fetch the description."

  • Questions in Ad Hoc Query & How to Configure the EEO standard reports

    Hi all,
      I have a  question in Ad hoc query report in HR.
    <b>How to:</b> Get a list of the total number of employees included in a particular report at the end of the report. Ex: If i create and run a report for salaried employees, sorted out by company codes, how can i get a sub-total and total no. of employees listed in the report.
    I tried Ranked format, but when you print the report it doesn't retain the report name on the top.
    -->I have a question regarding the Standard reports for EEO and AAP
    <b> How do I</b>
    1. Start configuring these report
    2. What are the things i should have before configuring it in IMG
    If anyone can provide me with some documentation regarding the EEO and AAP report configuration that would be great.
    Thanks in advance.....
    Harish

    This can be done using the security for the Infoprovider,  provide the users access to create queries only for that Infoprovider.

  • How to execute custom code only when a specific node is selected in infoset

    Hi,
    We have written a piece of custom code under a node (P1045). Not all users will have access to this Infotype as it is related to Appraisals. So, when users (w/no access to 1045) try to run a Query for other info types data, they are getting error message 'Can not access 1045'. Custom code is getting generated whenever user runs a query. Tried to control custom code with simple IF condition by giving user name. Still generating 1045 code.
    All users use same infoset, where a group of users has access to 1045 and another group does not have access to 1045.
    Appreciate your inputs to get this resolved.
    Thanks,
    Swapna.

    Why don't you try another aproach, instead of adding the infotype to the infoset, create a new table as an alias (with the fields you want to show in regards to infotype 1045) and fill it in the node depending on the authorization check for that infotype in the code ?
    I think that adding the infotype as a node will always get the data from the infotype regardless, that is why it's showing the error.

  • Generation of custom code from oracle DB.

    Hi All,
    I am new to oracle BIP which is used to pull reports.I got a requirement to pull the data through BIP using java custom code.I got the API doc for BIP and statrd developing some sample code.My input to the code will be in XML which has one unique attribute and based on the attribute i will run a query to connect to the database and pull some attributes related to the unique attribute input.The output will also be in an XML.When i go through the doc i came to know that "DocumentProcessor" (not sure) is the calss which can be able to pull it data from database.I am using oracle 9i DB.If anyone has any such requirements can you please share the piece of code which helps me to understand and procced further.Here is the piece of code that is written.
    DocumentProcessor docProcessor = null;
              try
              docProcessor = new DocumentProcessor(xmlFilePath, temporaryDirectory);
              Vector outputList = docProcessor.process();
              catch(IOException ioe)
              // If this exception is thrown, the temporaryDirectory information is incorrect.
              ioe.printStackTrace();
              catch(Exception exc)
              //If this exception is thrown, process() failed
              exc.printStackTrace();
    Can yoou please guide me what to do further or the above code is correct.
    Thanks in advance.

    Hello Narinder,
    Thanx for your advice.
    As far as I understand, JAX-RPC is a specification which different vendors could implement in different ways. So WebServices generated from wscompile of Vendor A doesn't need to run in a WebServiceEngine from Vendor B.
    I have downloaded the Java WebService DeveloperPack, but only Tomcat and the SUN ApplicationServers are supported. In our project, we are now focusing on the technology the SAP NetWeaverDeveloperStudio provides.
    Thanx again and have a nice weekend
    Mo

Maybe you are looking for