Add a Code to Change the ABAP Query

Hi All,
I have a requirement in which i need to add a check box to a selection screen in ABAP query i inserted this check box in the infoset .The report is using joins from table EKKO,EKPO and EKES and display all the Vendor Confirmation details but when the user clicks on the checkbox which is added on the selection screen the report should only display the latest date Vendor confirmation for each line item of the PO.So i need your help how and where should i add the code for this in the Query???
Result when no Checkbox is ticked
PO    LineItem     Date
100       1           15.01.2010   
100        1           15.02,2010
100        1           15.02.2010
Result when Checkbox is ticked
PO    LineItem     Date
100        1           15.02,2010
100        1           15.02.2010
Please help!!!
Regards,
KB

HI,
After selecting data from tables EKKO,EKPO and EKES in internal table, sort that internal table in descending order of date and in ascending order of PO number and line item and then delete adjacent duplicates from that internal table by comparing PO number and line item. This will give you the latest entry for each PO number and line item.
PFB the sample code..
*--after select query on EKKO, EKPO and EKES
SORT itab  po_number ascending line_item ascending date descending.
DELETE ADJACENT DUPLICATES FROM itab COMPARING po_number line_item.
Let's say input file contains following data
PO LineItem Date
100 1 15.01.2010
100 1 15.02.2010
101 1 15.02.2010
101 1 15.02.2010
Above code will give you output as given below :
PO LineItem Date
100 1 15.02.2010
101 1 15.02.2010
Regards,
Pranjali

Similar Messages

  • Can we change the ABAP QUERY exists in Global area

    Hi All,
    I have a requirement to  add new column in the ABAP query in layout for that I am changing a ABAP query ME80FN which is calling  infoset  /SAPQUERY/ME80FN  defined in the global area ( Environment->query areas->global area).
    1) Can I change this infoset and query
    or
    2) Do I need to follow any other steps.
    If I change the existing query in DEV can I transport this to production.
    Please clarify.
    Thanks,
    Jwala

    Yes. We can change the background of an input field. The way you do this is by editing the theme that webdynpro application uses. To edit the theme, you will need to install NWDS PLUS the theme edit plugin (Available for download from SAP).
    Once you have edited the theme, you will need to upload your theme back to application server. You can use the program : BSP_UPDATE_MIMEREPOS to do this.
    Bydefault, the theme used by webdynpro applications is :
    /SAP/PUBLIC/BC/UR/nw5/themes/sap_tradeshow
    You can apply another theme by calling the webdynpro application with a theme parameter. For example, if my webdynpro application name is "zgopaltest", then
    <i><b>http://<server>:port/sap/bc/webdynpro/sap/zgopaltest?SAP-EP-THEMEROOT=/SAP/PUBLIC/BC/UR/nw5/themes/sap_tradeshow</b></i>
    will apply the sap_tradeshow theme.
    Likewise, you can apply diffrent theme. There is another theme that SAP provides. Its called : sap_hcb. Hence, you can apply the theme to the above application by:
    <i><b>http://<server>:port/sap/bc/webdynpro/sap/zgopaltest?SAP-EP-THEMEROOT=/SAP/PUBLIC/BC/UR/nw5/themes/sap_hcb</b></i>

  • ABAP Query : code to change the display

    Hi all,
    I have created an Abap Query and generated it. I see the output now as follows:
    <u>Bill.doc</u>     <u>Item</u>   <u>Net value</u>  <u>Total amt</u>
    900000                    10                  100                  600
    900000                    20                  200                  600
    900000                    30                  300                  600
    900001                    10                  250                  250
    900002                    10                  300                  500
    900002                    20                  200                  500
    Now I want the total amt to be displayed only once for each billing document only for the first item and for the other line items it should be blank as shown below.
    <u>Bill.doc</u>   <u>Item</u>   <u>Net value</u>  <u>Total amt</u>
    900000   10      100            600
    900000   20      200           
    900000   30      300           
    900001   10      250            250
    900002   10      300            500
    900002   20      200
    Can someone please explain me where and how I should write the code to get this working?
    Thanks,
    N
    Helpful answers will be awarded for sure.

    Hi Manohar,
    I am getting the total amount from a field which exists in one of the tables which i used in the abap query.
    the total amount is appearing correctly...i dont need to modify that. i just need to display it only once for each billing doc for the first item.
    i want to know where i should do the coding...i mean in the Infoset or the Abap Program that gets created when i generate the infoset.
    Thanks!
    N
    Message was edited by:
            Narmada Mallavaram
    null

  • Generation of program code for the ABAP Query

    Dear all,
    In the creation of the ABAP query, in the final step of SQ01, Query- more functions- generate program is made.
    Why the program code is generated for the ABAP query? please  give the logical explaination for the same.
    Thanks and Regards,
    Prash

    Prash,
    a) Do you mean Program code does not have significance in query creation?
    No it does not mean this.  All queries run based on an ABAP program.  In the standard query editing process, when you save and execute the query, you will automatically re-build the existing ABAP program as necessary.  You do not need, though, to execute the menu steps you outlined in order to build, maintain, or execute the query.  It is only there for special purposes, as outlined above by Jürgen
    b) Can we see the program code generated in any transaction?
    From any screen, System > Status.  Place your cursor on the field in "Program (screen)".  Double click.
    Rgds,
    DB49

  • Help in the ABAP query

    Hi Friends,
    I am having issue in the ABAP query in the HR report, i can able to change the column Heading in the report, but the same header is not coming in the layout details fields(after executing the ALV report we have layout options where we could not see the same header as in the coulmn heading)
    pls help me to solve this issue,
    Regards,
    boobalan.v

    Hi,
    Once you have made some changes to the infoset/query, You need to adjust the infoset(SQ02) and then regenerate the query(SQ01)
    >Menu->Query/Infoset->More functions->Adjust/Generate program.
    Letme know if this is still not reflecting..
    Reward if useful
    Regards
    Shiva

  • How to change the lov query??

    Hi Friends,
    I am trying to extend a controller of the base page to change the lov query. I am not able to get the lov VO since I am not getting the lov AM in the controller.
    I want to use the setQuery() to set the lov query programatically in base class controller PR.
    My controller code looks like ::
    OAApplicationModule am = oapagecontext.getRootApplicationModule();
    oapagecontext.writeDiagnostics(this,"The Root AM is : " + am.toString(),6); // displaying oracle.apps.icx.por.req.server.RequisitionAMImpl
    OAApplicationModule lovAM = (OAApplicationModule)am.findApplicationModule("RequisitionLovAM"); // Returning Null
    OAViewObjectImpl vo = (OAViewObjectImpl)lovAM.findViewObject("ReqSupplierVO");
    String seededQuery = vo.getQuery();
    oapagecontext.writeDiagnostics(this,"Seeded Query for ReqSupplierVO is "+ seededQuery,6);
    String customQuery = "new_query" // here i m writing my new query.
    vo.setQuery(customQuery); // setting my custom query.
    oapagecontext.writeDiagnostics(this,"Custom Query for the ReqSupplierVO is "+ vo.getQuery(),6);
    The following are the details.
    Base Page : /oracle/apps/icx/icatalog/shopping/webui/NonCatalogRequestPG
    Base Page Controller : logi.oracle.apps.icx.icatalog.shopping.webui.NonCatalogRequestCO
    Lov Region : /oracle/apps/icx/lov/webui/ReqSupplierLovRN
    Lov Controller : oracle.apps.icx.lov.webui.ReqSupplierLovCO
    Lov VO : oracle.apps.icx.lov.server.ReqSupplierVO ( i want to remove outer join in this VO query )
    I cant extend the lov controller since the same lov region is using in other pages also where i dont want apply my new lov query.
    Is the way i am trying is correct? How can i get the Lov AM in the base page? Any help highly appreciated.

    Hi Pratap,
    Thanks for coming back on this.
    The background of this customization is, We are implementing AME and are trying to restrict the number of approvers in the Change First Approver LOV (ApprroverLovVO.xml) based on company code and cost centre during the creation of Requistion. At the moment, the LOV is bringing back every employee who has a valid WF role.
    At the moment (up till I saw this thread) I was trying to customize ReqApprChfCo.java by adding this code to processRequest method
    OAMessageLovInputBean CompanyCode = (OAMessageLovInputBean)oawebbean.findIndexedChildRecursive("ChargeAccountFlex0_column"); //this is returing null
    OAMessageLovInputBean CostCentre = (OAMessageLovInputBean)oawebbean.findIndexedChildRecursive("ChargeAccountFlex1_column"); //this is returing null
    RequisitionLovAMImpl am = (RequisitionLovAMImpl)oapagecontext.getApplicationModule(oawebbean); // this is returning null
    OAViewObject approverLovVO = (OAViewObject)oam.findViewObject("ApproverLovVO");
    Then, once found to append the viewobject with where clause. Was this the right method of achiving it, or to create a new custom VO and region?
    Regards,
    Chetan

  • How do I change the underlying query for the task board (and backlog board) on TFS Preview

    All,
    We work with multi-area projects, each area representing a significant component within the project with its own release/iteration cycle. i.e. Several areas may be active at once, each with different iterations.
    When we look at the task board these take no account of the area being worked on. What I need to do is to be able to change the query behind these boards to point to a particular release/iteration for a particular area.
    Unfortunately there is no drop down selection on these pages to see this automatically so I need to be able to change the underlying query that populates these boards to get the the area and release/iteration that I need.... but I can't find where these
    are.
    Using multiple areas is actually highly frustrating with TFS Preview as it doesn't seem geared up at all to make it easy to switch between them... are we doing something wrong?
    I think I can do this by changing the current iteration - but I can't work out how to do this either once an iteration for a particular area has started.
    Can anybody help?
    Thanks

    It is not possible to modify the query behind the task board. If I understand you correctly, you would like to filter the task board by area path.
    In TFS 2012 we have repurposed the area path field to be the field that determines the team you are working on. We are continuously improving our product and being able to filter your task is one of the improvements that we are thinking of.
    Sorry I can't help you better than this for the moment.
    Please remember to mark the replies as answers if they help.
    Hi Ewald,
    We have a similar problem, see the thread "Best approach for multi-team/multi-projects." on this forum. I'm hopping you can help, since so far the different answers doesn't help.
    Best Regards,
    SYSOTI

  • T-Code for changing the default Exchange Rate reference for creating PO?

    Dear All,
           Can somebody kindly give me the T-Code for changing the default
    Exchange Rate reference for creating PO? Is there a Step by Step
    procedure before changing the default exchange rate?
    Thank you in advance.
    Regards,
    Gopesh

    Hi
    There is not such Tcode to change the default exchange rate from the PO.
    If you want you can confugure the exchange rate in the following path in the IMG,
    SPRO>MM>LIV>Incoming Invoice>Configure How Exchange Rate Differences Are Treated
    Hope it helps you.
    Cheers
    Umakanth

  • I have just bought an old ibook g3 and i need a code to change the region on the dvd drive . how can i get this ?, i have just bought an old ibook g3 and i need a code to change the region on the dvd drive . how can i get this ?

    i do not know the code to change the region on the dvd drive and it is stuck on region 1 and i need to change it to region 2. i am using an old ibook g3 , can any one help with the code

    You must have a G4 iBook as the G3 models can only install up to 10.4.11.
    Some links to read for possible help.
    https://discussions.apple.com/message/759882#759882
    https://discussions.apple.com/message/5083031#5083031
    https://discussions.apple.com/message/20461888#20461888

  • Own tag in code templates of the abap editor

    Hi,
    i think you all know the code hints and that you can define own code templates in the abap editor (at the options screen). As an information I dont mean the code patterns.
    So does somebody know how to define own tags for these code templates? Or where the logic is located for the code hints?
    Bye
    Richard

    Hi Richard,
    I know its pretty late to answer the question but just in case if you have not figured it out then see,
    Regards,
    Ankit.

  • Changing the Infoset Query out put field

    Hi,
      Please let me know can we do the changes for the Input/Output field for the infoset query in PRD. That mean  if some of the fields are hidden and we want to show them at the output can we directly do the changes in PRD .
    Thanks & Best Regards,
      Mahesh

    hi
    Create the infoset with PNP database and add all the infotypes required (including custom ones). Add all fields.. vale, text etc. as seperate fields of the custom Z tables as additional fields in the infotypes and write your code accordingly to select the data into these fields based on the already existing infotype fields. For example if you want to get designation based on position you will write:
    select <designation> from ZDESG
    into <custom field>
    where PLANS = P0001-PLANS
    Creating joins over already existing joins will not be a stable solution.
    thanks & regards
    Satish

  • Checkbox in the ABAP query selection screen

    Hi experts,
    The reqiurement is to add checkbox(parameter name: EX_ZE_ST) to the selection screen of the query and if its checked then the records with the quantity = 0, should not be displayed in the output.
    I added a check box and now my issue is, how to suppress displaying the record having quantity = 0.
    that quantity field is a custom added field and in sq02 i selected that quantity( Z_HANDQTY) field and gone into the code for the same and wrote below code...
    the total generated table view for this query is : marav
    if EX_ZE_ST = 'X' and Z_HANDQTY = 0.
    break-point.
    clear: marav, Z_MATDESC, Z_MATGRPDESC, Z_TAXIND,
            Z_TAXTYPE, MARD, MARD-LGPBE, Z_PREVMATNR,
            Z_CSTTOTAL, Z_CSTUNIT, Z_VSTOCK.
            FREE MEMORY ID 'AQLISTDATA'.
    endif.
    But still i could see a blank line in the output if that record has quantity( Z_HANDQTY) = 0.
    Thanks in advance...
    Karthik

    hi,
    Try this wa y...
    if EX_ZE_ST = 'X' and Z_HANDQTY = 0.
    break-point.
    clear: marav, Z_MATDESC, Z_MATGRPDESC, Z_TAXIND,
    Z_TAXTYPE, MARD, MARD-LGPBE, Z_PREVMATNR,
    Z_CSTTOTAL, Z_CSTUNIT, Z_VSTOCK.
    FREE MEMORY ID 'AQLISTDATA'.
    Continue.
    endif.

  • Data filtering in XML report with out changing the underlying query

    Hi, This is Nagesh and from Verizon.
    I'm testing Query based XML report in Peoplesoft 9.1 app with tools version 8.5.
    I'm trying to filter the data on XML Report template with out changing the underlying PS query. I mean filter the data on the report to only specific accounts though the underlying PS query query return transactions booked to all Accounts for a given Legal Entity. Is it possible. any advise or idea is highly appreciated.
    Thanks
    Ages

    If the value is not of importance how come it became obligatory in your program?
    Any how you can do one thing...Put some value in your obligatory field, put a debugger point where you are interested in  and use the pencil tool to change the value of the field while debugging. 
    Regards,
    Philip.

  • How to change the SQL-Query in (Report in ReportViewer) by running Java App

    Hello,
    Ich have an App which generates dynamicly SQL-Queries. By pressing a button it should generate a report with this generated Query.
    I´m using the ReportViewer.jar. Further is it possilbe to a extra parameters form app which are not in a DB?

    <p>There are a few ways that you can achieve this. If your SQL Queries have their filters modified (ie. WHERE clause) then this can be easily solved by adding report parameters to the Report filter. Search the in-product help for "Record Filter" and you should get a number of helpful resources returned.</p><p>Additionally, you can pass in java.sql.ResultSet objects with a populated recordset of the data you want to show in the report. We don&#39;t currently provide any tools to assist the creation of the code stubs for thick-client applications (like we do for JSP pages) however you can download a collection of thick-client sample code from here:</p><p><a href="http://support.businessobjects.com/communityCS/FilesAndUpdates/crxi_r2_jrc_desktop_samples.zip">http://support.businessobjects.com/communityCS/FilesAndUpdates/crxi_r2_jrc_desktop_samples.zip</a> </p><p>As I mentioned, this sample contains a collection of code snippets. The one in particular you will be interested in is titled "JRCResultsetDatasource". Hopefully, this will provide you with a few options. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) </p>

  • How to change the standard query "Create a Master Agreement" by a custom one

    Hello Sourcing CLM experts,
    I would need to replace the standard query displayed when the user tries to create a Master Agreement by a custom query to filter the MA types according to some criteria:
    According to this post: Re: Create security profile for a document template in SAP Sourcing, I've tried to achieve it by doing the following steps:
    Create a new query as a copy of exsiting query FCI-ContractTypes
    Modify query group FCI-ContractTypesBP to include my custom query instead of the standard one to only list the MAType "Standard Master Agreement"
    Following you can see the change done into the query group FCI-ContractTypesBP:
    However, standard query has not been replaced and same set of MA Types are listed.
    Therefore, I would like to ask you:
    Is it possible to do this kind of modifications? If so, which query group need to be modified?
    If it is not possible, is there any other way to achieve that requirement?
    Thanks in advance for your time and support!
    Best regards,
    Isaac

    Hello again experts,
    If this query cannot be modified, is there any option to disable button below? Or at lease, to disable the query group to avoid the listing of MA Types when it is pressed?
    The reason is because we are going to set up the system in the way that only it will be possible to create Master Agreements from Template. However, if user keep on using that button he will be able to create MA from document types.
    Any ideas?
    Thanks again and best regards,
    Isaac

Maybe you are looking for