Coding for an additional structure in ABAP Query

I am creating an ABAP query to extract the Purchase Inforecords prices. While linking EINA and EINE Iam able to extract the effective price. When there is a scaled pricing, I want to extract information from KONM or KONW tables. Howeever, can't find a quick answer.
I liked the function module ME_GET_INFORECORD_CONDITIONS that gives the scaled prices for  a given PIR information.
I would like to create an additional structure in my abap query and extract this information.
Can some one please provide the coding: I tried the following after creating a new structure called addscale. This did not work.  I have limited understanding of ABAP.
CALL FUNCTION 'ME_GET_INFORECORD_CONDITIONS'
    EXPORTING
      i_ekorg = eine-ekorg
      i_esokz = eine-esokz
      i_infnr = eine-infnr
      i_lifnr = eina-lifnr
      i_matnr = eina-matnr
      i_matkl = eina-matkl
      i_werks = eine-werks
      i_vabme = eina-vabme
    TABLES
      tekomd  = addscale.

use the following function module you will get the required info.
BAPI_INFORECORD_GETLIST

Similar Messages

  • Select from KONV using Additional Code in ABAP Query

    I'm attempting to modify an ABAP Query Infoset (using transaction SQ02) that already has a join in it between tables VBAP and VBAK, and two additional alias tables on KONV (to get price history for sales documents).  I wish to get history of all PN00 records from KONV.  I can get ONE record with the following code in the Record Processing of the Extras element in my Infoset:
    SELECT SINGLE KBETR KPEIN KMEIN KDATU
    INTO (PN00_PRICE, PN00_PER, PN00_UOM, PN00_DATE) FROM KONV
      WHERE KNUMV  = VBAK-KNUMV
      AND KPOSN  = VBAP-POSNR
      AND STUNR = 198
      AND ZAEHK = 01.
    But we have many counters (field ZAEHK) for the PN00 condition and I want to have a new row for each PN00 record in KONV.  I've tried some loop syntax, but I've not been able to get any code to function or return more than one row for each sales order item row (VBAP-POSNR).
    Thanks for any hints.
    Dan Gallagher

    Change it like this
    SELECT KBETR KPEIN KMEIN KDATU
      INTO (PN00_PRICE, PN00_PER, PN00_UOM, PN00_DATE)
      FROM KONV
    WHERE KNUMV = VBAK-KNUMV
       AND KPOSN = VBAP-POSNR
       AND STUNR = 198.
    ..... do something with this record and store
    ENDSELECT.

  • How to give References for the field in the Abap Query

    Dear Freinds,
               I am not able to get Text for Cost Centre which iam using in My custom infotype , when iam calling the Custom infotype in abap querry i dont find the T symbol for my field Cost Centre , since i have created in my custom infotype for Cost Centre similar to the infotype 0001. When i look at the
    infotype 0001 fields in my abap query i can see that there is T field for P0001-KOSTL and again if i double click on it i can see that in the REFERENCES Tab i can see " Function Module:HR_TXID_KOSTL" . Could any one let me how i can assign to my custom field "Function Module:HR_TXID_KOSTL " in the References Tab.
    Regards
    divya

    solved the problem

  • Please tell me if coding for ITS is done in ABAP.

    Hi all,
    Please tell me if coding for ITS based on ABAP.
    Thanks.

    Hello Sanjiv,
    I'm not sure I understand the question...
    ITS uses BusinessHTML and HTML and other Internet standards (css, js, etc).  However, you can develop in ABAP and then use SE80 to generate a template for you or use the WEBGUI service to call your ABAP developed transaction directly.  You can find more information by using the links at the top of the ITS forum to go to the Wiki or FAQ or Product page for the ITS.
    Edgar

  • Taking display value for calculations using structures in Bex query

    Hi
    I am using Bex analyzer to do a simple report with two key figures ‘Sales’ and ‘Plans’ from cube and two more calculated key figures ‘Abs Deviation’ and ‘% error’. The report displays at category and product levels. Category is higher and one category contains multiple products.
    The simple formulas for the two calculated KF are,
    1. Abs Deviation = Abs (Sales – Plans).
    Abs Deviation is set with the property Calculate result as ‘summation’ to add up Abs deviations at product level to show at Category level.
    2. % Error = Abs Deviation / Plan.
    The issue is with the % Error value at category level. At product level, all the values are showing correctly.
    To illustrate the issue with a simple test case,
    CategryProductSale-PlanAbs Dev----%Error
    C1--P1--100-60---40--
    67%
    C1--P2---50120---70--
    58%
    C1 Total--150180---110--
    17%
    Observe that in the output the calculation for ‘%Error’ at product level is correct all the way. But the summary
    calculation for ‘Error%’ i.e. C1 total which is showing as 17% is wrong. The correct value as per the formula should be 110/180 = 61%.
    SAP, through OSS replied that it is not a bug but the default behavior of OLAP calculation. OLAP processor first calculates the formula for % Error and then shows the display value at C1 total for Abs Dev. Meaning, ‘% Error’ is calculated first and next the summation for Abs dev is displayed. Abs dev 110 at C1 level is only a display value but not the value taken for % Error at C1 level. Instead OLAP calculates the Abs Dev at C1 level by Total sale – Total plan = 180 – 150 = 30 and the % Error calculation takes this 30 value in the formula and gives % Error = 30/180 * 100 = 17% at C1 level. But 17% doesn't make any sense to the user. Further, to display value of 61% at % Error at C1, it is being advised that by defining two structures, I can force the calculation to take display value of 110 in the % Error calculation at C1 level by using the cell editor.
    Has any body tried to achieve similar result as above by defining two structures and cell editor in the query? If so, can you please throw some pointers of how to define two structures in a query and how to force the % Error at category level to take the display value of 110 in the calculation? I have gone through the documentaion on structures and cell editor but the approach is not at all clear.
    Thanks in advance for your suggestions.
    Prasad
    Unilever Asia IT department

    Hi,
    Have u read aabout the Formula Collision.
    Take a look on this link .
    http://help.sap.com/saphelp_bw32/helpdata/en/d2/02223c5f00612be10000000a11402f/frameset.htm
    Read the Formula Collision, and let us know , whether your pb is solved by changing the Formula Collision of % error formula.
    With rgds,
    Anil Kumar Sharma .P
    Kindly assign points , If it really helps you.

  • Finding custom prices for customer based on district (abap-query).

    Hello.
    I can find in table A601-BZIRK the District-number, which i also can find on the customer in BP in CRM (we have both CRM and ERP).
    I want to make a query in SQ02, where i enter the customer-number, and gets the list of materials they have custom prices for, based on the district number.
    Sorry bad english. Tell me if there is something more you need to know
    Points will be awarded.
    Thanks.

    Hi,
    The answer to your query is 'Yes'. You need to design a 'UPDATE' metadata type custom integrator. The custom integrator shall use a parameter based view to first download data and then use a PL/SQL wrapper/API to re-upload it back. The brief steps are listed below:
    1. Create a 'UPDATE' metadata type custom integrator. Give a parameter list name, std/custom view for data download and a PL/SQL wrapper.
    2. Create a form function and associate the form function with the custom integrator created.
    3. Add the form function to the std WebADI menu for access.
    4. Define a layout for the custom integrator defined.
    4. To create a parameter use the standard integrator 'HR Standalone Query'. As a part of this integrator you can define the SQL WHERE clause (parameter based) that you will like to use with the custom/std view defined in the custom integrator definition.
    Note: You can use a max of 5 parameters only. For each parameter, one needs to define the datatype and also the HR standalone query has a size limitation of 2000 chars in 11i10. You increase this length you may apply patch - 3494588 to get 4000 chars.
    Hope this information helps.
    Thanks,
    Nitin jain

  • Inserting addition field in ABAP query (SQ01) while generating reports.

    Please let me know the procedure of adding field and applying mathematical  formula in the query.

    Hi,
    have a look at the help <a href="http://help.sap.com/saphelp_erp2005/helpdata/EN/d2/cb4138455611d189710000e8322d00/frameset.htm">Creating and Changing Queries</a>. I doubt that you can add real formulas besides the predefined statistics.
    Regards,
    Christian

  • ABAP Query - addition of logic in infoset

    Hi Friends,
    I have generated a query and there is a problem. There is a field 'Cycle count date'. Each material can have more than 1 count date. So my report displays repeated lines with same material and other details remaining same except that there are different count dates. Hence the users think there is a repetition of entries.
    The requirement is to have only the most recent count date displayed and all the other lines should be removed.
    I tried coding for the internal table %G00 (the table in the system generated code) but the infoset is throwing an error that the table is not declared. And if I declare, the system says same internal table declared twice (since it is already declared in the system generated code).
    How do I code for this in the infoset.
    Appreciate your quick response.
    Regards,
    Dikshitha

    Hi
    Here is what you should do:
    1. In the infoset, go to event END-OF-SELECTION(After list).
        Here you'll find table %G00 with final data to be displayed.
    2. You should enter the following ABAP code:
        data: str type string.
       field-symbols: <GOO> type table.
       field-symbols: <GOO_WA> type any.
       str = '%g00[]'.
       ASSIGN (str) TO <GOO>.
       loop at <GOO> assigning <GOO_WA>.
       ...do whatever you like here....
       endloop.
    3. Of course, you don't need to do a loop here, you can do whatever you want.
    This solution was created with the brilihant developer Hayit Yuzis.
    Good luck
    Yasmin Yezerski.

  • Performance tuning for ABAP Query (created from t-cd SQ01)

    Hello all,
    We created ABAP Query report from transaction SQ01.
    But the generated report has an appropriate SQL statement which causes performance problem.
    To solve this issue, I guess the easiest way is;
    0. Give up to use it.
    1. Copy it to another object in the customer namespace.
    2. Ajust SQL statement.
    But I'm wondering if there're appropriate ways to adjust SQL statement of Query.
    Could anybody give me any better idea?
    Thank you
    Yuko

    You can try this: Create 2 ranges, for objnr and cdtcode and fill like:
    ra_objnr-sign = 'I'.
    ra_objnr-option = 'CP'.
    ra_objnr-low = 'OR*'.
    append ra_objnr.
    ra_code-sign = 'I'.
    ra_code-option = 'CP'.
    ra_code-low = 'CO*'.
    append ra_code.
    SELECT objnr udate utime
    FROM jcds
    INTO TABLE it_jcds
    WHERE objnr IN ra_objnr
    AND stat = l_tj02t
    AND cdtcode IN ra_code
    AND inact = space
    Regards,
    John.

  • How to set default value in select option for ABAP query

    Hi experts,
    What is the way to set up default values for select-options in ABAP query.
    e.g.
    I have one field 'Year' in my ABAP query selection screen.
    I want value of current year to be appeared here whenever user execute report
    Thanks in Advance
    -Harkamal

    Hi Harkamal,
    execute your Query via SQ01. On Selection-Screen
    goto save Variant. Mark your field
    as selection variable an press Button election variable.
    Take variable from TVARV and use it.
    Than save the Variant.
    Look at TVARV if the 'Year' is updated to the actualYear!
    regards, Dieter

  • Error in abap query sq03,02,01(to get data from structure) it is possible?

    hi
    experts,
    i am developing a report using abap query .(stand t code is s_alr_87012277 it contain more fields but i want only 4 fields , i found 2 but remaining 2 are from structure)
    my problem is that debit and credit amount is in structure
    how  i can get data from structure(FAGL_S_RFSSLD00_LIST )
    solbm = debit.
    habbm  = credit.
    report is like
    op.
    gl acc no, discription, credit amount,debit amount.

    Hi ajay,
    try to use with  logical database  SDF.
    assign the logical database name in info set.
    gl acc no    -               SKA1-SAKNR
    debit.         -     Field: um02h
    credit.        -     field:  um02s 
    discription  -               SKAT-TXT20
    regards,
    sateesh.

  • Additional field in selection screen of a abap query

    Hi,
    I am adding a new additional field in the selection screen through abap query(using transaction SQ02) which is of type VBRK-FKSTO.
    The value entered can be 'X' or empty space.But the value which is entered in the selection screen is not getting reflected in the code.Kindly advice me on what needs to be done to capture the selection screen value in the code.
    Regards,
    S.Subasree

    Hi
    You can add new field in VFX3 selection screen as follow. In the report code we can see various explicit enahcement points provided by SAP.One of them is ENHANCEMENT-POINT sdblbddl_01 SPOTS es_sdblbddl STATIC. Here you can declare your selection screen parameters.  Then in the processing i can see a call customer fucntion happening in VBSK_DISPALY which you can implement to add your logic.
    Thanks
    Nabheet

  • How to do coding in abap-query

    Hi friends,
      Please help me how to write the coding in abap-query.
    Regards,
    Bhavani

    hI
    There are certain exit points available in the query, these can be accessed in SQ02 - Infoset editor. Click 'Extras', then the 'Coding' tab. There is a drop down to access different coding sections, e.g. DATA, GET, etc.
    It is not always clear where and when they execute so you may need to experiment with some 'break-point' statements to start with, run the query to find out where the breaks are then go back to SQ02 to enter some code at that section.
    http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_FunctionalAreas_LogicalDB.asp

  • How to create ABAP Query for vendor open items

    HI,
    My client has requested me to create ABAP Query for vendor open items . So that it will be usefull for the users . Could anyone help me with this. I will assign you points.Thanks in advance.

    Hello,
    Use Table BSIK <Open Items of AP > & BSAK <AP Cleared items>......
    For Query you can use SQ01.
    USE BSID & BSAD for AR open/clear items...
    LFA1, LFB1 are vendor master data tables
    This is FYI
    Hope this helps.
    Rgds
    Rajendra

  • 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

Maybe you are looking for

  • Stroring data taken from database as a variable

    Hi there I;m having a problem and I was wondering if anyone can help me? I am trying to extract data from a MySQL database and store the variables so I can use them in another bean... so far I am getting a SQL exception error but I dont know what Im

  • Changing over from 30G to 60G

    I just bought a 60GB IPOD and I have a pile of music on my computer from my 30GB... basically I want to know what the best path to take is. I believe the software will see my 60GB as a guest to share with, so I thought I should reload ITunes but then

  • Fail over Between Gateways

    Hello Thanks in advance... currently we are using 2 management servers NW.contoso.com and WD.contoso.com and four gateway servers(abc.com,xyz.com,123.com,987.com)reporting to above management servers  NW.contoso.com as primary and WD.contoso.com as s

  • Need old 'missing plug in' for Java 6

    Hi all, I have recently downloaded the new Java 7 download however this is not compatible with alot of programmes that I need to use on my computer. I have completly restored all of my computer and am now back to square one so have the Java 6 downloa

  • Problems creating translations in Netweaver Developer Studio

    We require English an French for our content.  I am trying to create translations and I am having problems.  I have 2 views and 1 simple dictionary type to translate.  I found the xlf files for each of these and created the _fr versions.  This had no