Select from vbak, vbrk and vbrp

Hi experts,
In one of my programs i hve to select the data from tables <b>VBAK, VBRK</b> and <b>VBRP.</b>
The requirement is:
<b>parameters: p_matnr like vbrp-matnr,
            p_charg like vbrp-charg.
select-options: audat for vbak-audat.</b>
upon entering the values on selection-screen,
i need to select <b>FKDAT, FKIMG</b> from tables VBRK and VBRP respectively.
Please help me in writing the selection.
Any help is appreciated.
Thanks a lot.

Hi,
Hope this will give u some idea..
select avbeln bfkdat into table itab from vbak as a inner join
                              vbrk as b on
                              avbeln = bvbeln where
                              a~audat in s_audat.
if not itab[] is initial.
select fkimg into corresponding fields of table itab_final
              from vbrp for all entries in itab
              where vbeln = itab-vbeln and
                    matnr = p_matnr and
                    charg = p_charg.
endif.
Cheer,
Vikram
Pls reward fopr helpful replies!!

Similar Messages

  • How to update the VBFA table without entries in VBRK and VBRP tables

    Hello,
    I have a requirement , where the sales order , delivery happens in one SAP system say X system and billing document wil happens in other sap system say Y.
    Now in this particular case , if the user want to know the billing document number in X system. what would be the solution.
    Is there any possibility to update the VBFA table with invoice number of Y system (without updating the VBRK and VBRP tables).
    User want to see the billing doc number from sales order in the form of document flow in X system
    Thanks in advance
    Pradeep

    Hii
    Without updating VBRK/VBRP table and updating VBFA is not possible, So you have to play with work arround to create one Z TABLE, so whenever system Y will create billing document with the reference of System X data you have to update Ztable with Invoice number created in System Y, The primary key will be in Z TABLE is Delivery document number to track one to one with billing doc.
    Thanks and Regards
    Shambhu Sarkar

  • Select from two tables and insert into a third

    I'm trying to do a select from two tables and do an insert into a third table from the two resulting columns.
    I have the following....
    DECLARE
    tempsid number;
    temphostid number;
    BEGIN
    select "DBSID_ID","ID" into tempsid,temphostid from "DBSIDS","SERVERS"
    where "HOST_SID" like '%'||"DBSID_NAME"||'%'
    and "HOST_NAME" not like 'vio%'
    and exists (select "DBSID_NAME" from DBSIDS)
    order by "DBSID_NAME";
    insert into "DBSID_LOOKUP" ("SIDLOOKUP_ID", "SERVERLOOKUP_ID")
    values(tempsid, temphostsid);
    END;
    run;
    I get the error ....
    ORA-06550: line 11, column 18:
    PL/SQL: ORA-00984: column not allowed here
    ORA-06550: line 10, column 1:
    PL/SQL: SQL Statement ignored
    1. DECLARE
    2. tempsid number;
    3. temphostid number;

    okay ... I tried a different way ...
    DECLARE
    a number;
    b number;
    BEGIN
    select "DBSID_ID","ID" into a,b from "DBSIDS","SERVERS"
    where "HOST_SID" like '%'||"DBSID_NAME"||'%'
    and "HOST_NAME" not like 'vio%'
    and exists (select "DBSID_NAME" from DBSIDS)
    order by "DBSID_NAME";
    insert into "DBSID_LOOKUP" (SIDLOOKUP_ID, SERVERLOOKUP_ID) values (a, b);
    END;
    and now it whines about ...
    ORA-01422: exact fetch returns more than requested number of rows

  • Standard function modules for selection from vbak/vbup/ekko/ekpo

    hi experts ,
    do you know if there is an existing standard function modules for selection from vbak/vbup/ekko/ekpo.
    please help

    Hi,
    for VBAK
    ADSPCM_READ_VBAK               Read VBAK (with SPEC2KM-data)
    PRS_GET_GLOBAL_VBAK            Get global structure VBAK
    Regards,
    Jyothi CH.
    Edited by: Jyothi Chinnabathuni on Feb 23, 2009 2:46 PM

  • Select from 2 tables and insert same data into 2 other tables(BPEL Process)

    Hi All,
    Please suggest me how to select from 2 tables and insert the same data into 2 tables. I am successful in selecting data from 2 tables, but i am not able to insert the same data into 2 other tables. There is foreign key constraint between 2 tables.
    Thanks in Advance,
    MAH

    I have created DB Adapter for selecting from 2 tables and also DB adapter for insert and i have created parent child relationship between 2 tables.
    I am getting this error
    <Faulthttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>env:Server</faultcode>
    <faultstring>com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 6f3fe20c1b031057:-6cc7dfb5:11b8bf5fbe1:-7fa4. Please check the process instance for detail.</faultstring>
    </Fault>

  • Find total quantity from vbrk and vbrp

    Hi frinds doing a report to display sales in 3 month 6 month snd past 12 months but didnt get logic to find out
    here is my code
    SELECT vbrk~vbeln
             vbrk~fkdat
             vbrp~fkimg
             vbrp~matnr
             vbrp~werks
             INTO CORRESPONDING FIELDS OF TABLE iquan
             FROM vbrk INNER JOIN
             vbrp ON vbrkvbeln = vbrpvbeln
             WHERE vbrk~fkdat >= w_date " w_date =past 12month
               AND vbrp~matnr IN s_matnr  " = imatr-matnr
               AND vbrp~werks IN s_werks. " = imatr-werks
    **now how to find the total sales quantity
    i tried in this way its not working "iquan is same as iquan1 with added added sales field.
      LOOP AT iquan.
        READ TABLE iquan1 WITH KEY matnr = iquan-matnr
                                   werks = iquan-werks.
        IF sy-subrc = 0.
          IF w_date3 LE iquan-fkdat.
            w_tot3 = w_tot3 + iquan-fkimg.
          ELSEIF
            w_date2 LE iquan-fkdat.
            w_tot2 = w_tot2 + iquan-fkimg.
          ELSEIF
            w_date1 LE iquan-fkdat.
            w_tot1 = w_tot1 + iquan-fkimg.
          ENDIF.
          iquan-sale12 = w_tot1.
          iquan-sale6 = w_tot2.
          iquan-sale3 = w_tot3.
        ENDIF.
        MODIFY iquan.
      ENDLOOP.
    *PLs pls pls pls help me with code or suggestion
    0ut put shpuld be
    material plant sales 3months  6months 12 months
    01        0040    130          00.00    120
    regards

    Hi Farukh,
    Try this code. This will definitely help you.
    <b>REPORT ZTEST .</b>
    <b>TABLES:</b> VBRK,
            VBRP.
    <b>SELECT-OPTIONS :</b>
    s_matnr FOR VBRP-MATNR,
    S_WERKS FOR VBRP-WERKS.
    <b>DATA:</b> BEGIN OF STRUCT,
    matnr LIKE vbrp-matnr,
    werks LIKE vbrp-werks,
    vbeln LIKE vbrk-vbeln,
    fkdat LIKE vbrk-fkdat,
    fkimg LIKE vbrp-fkimg,
    sale6 LIKE vbrp-fkimg,
    sale12 LIKE vbrp-fkimg,
    sale3 LIKE vbrp-fkimg,
    END OF STRUCT,
    IQUAN LIKE TABLE OF STRUCT WITH HEADER LINE,
    IQUAN1 LIKE TABLE OF IQUAN WITH HEADER LINE.
    <b>DATA:</b> w_tot1 LIKE iquan-fkimg,
          w_tot2 LIKE iquan-fkimg,
          w_tot3 LIKE iquan-fkimg.
    <b>DATA:</b>  W_DATE1 LIKE SY-DATUM,
          W_DATE2 LIKE SY-DATUM,
          W_DATE3 LIKE SY-DATUM.
    **assign dates
    W_DATE1 = '20051107' .
    W_DATE2 = '20060507' .
    W_DATE3 = '20060807'.
    <b>SELECT</b> vbrk~vbeln
    vbrk~fkdat
    vbrp~fkimg
    vbrp~matnr
    vbrp~werks
    INTO CORRESPONDING FIELDS OF TABLE iquan
    FROM vbrk INNER JOIN
    vbrp ON vbrkvbeln = vbrpvbeln
    WHERE vbrk~fkdat >= w_date1     " w_date1 =past 12month
    AND vbrp~matnr IN s_matnr       " = imatr-matnr
    AND vbrp~werks IN s_werks.      " = imatr-werks
    <b>SORT</b> IQUAN BY MATNR WERKS.
    IQUAN1[] = IQUAN[].
    <b>LOOP AT iquan.</b>
      READ TABLE iquan1 WITH KEY matnr = iquan-matnr
      werks = iquan-werks.
      IF sy-subrc = 0.
    "w_date3 : PAST 3 MONTHS
        IF w_date3 LE iquan-fkdat.   
          w_tot3 = w_tot3 + iquan-fkimg.
        ELSEIF
    "w_date2 : PAST 6 MONTHS
        w_date2 LE iquan-fkdat.               
          w_tot2 = w_tot2 + iquan-fkimg.
        ELSEIF
    "w_date1 : PAST 12 MONTHS
        w_date1 LE iquan-fkdat.
          w_tot1 = w_tot1 + iquan-fkimg.      
        ENDIF.
        iquan-SALE12 = w_tot1.
        iquan-sale6 = w_tot2.
        iquan-Sale3 = w_tot3.
      ENDIF.
    <b> MODIFY iquan.</b>
    ENDLOOP.
    <b>LOOP AT IQUAN.</b>
    STRUCT = IQUAN.
    <b>AT END OF WERKS.</b>
    <b>WRITE:/</b>
           STRUCT-matnr, ' ',
           STRUCT-werks, ' ',
           STRUCT-sale6, ' ',
           STRUCT-sale12, ' ',
           STRUCT-sale3.
    ENDAT.
    <b>ENDLOOP.</b>
    <b>The output is:</b>
    9767A002AA           3201         10,255.000               0.000               0.000
    C9138-60001          3201         10,255.000           2,000.000               0.000
    C9361-30001          3201         10,255.000           2,004.000               0.000
    Hope this will solve your purpose.
    Regards,
    Pragya

  • Vbrk and Vbrp tables performance problem

    Hi all,
    The below query is taking lot of time in QAS i need to decrease the time without affecting the logic.....
      SELECT vbrk~kunag
           vbkd~bstkd
           vbkd~bstdk
           INTO TABLE c_tab_po FROM vbrp
           INNER JOIN vbrk ON vbrkmandt = vbrpmandt AND vbrk~vbeln =
           vbrp~vbeln
           INNER JOIN vbkd ON vbkdmandt = vbrpmandt AND vbkd~vbeln =
           vbrp~aubel
                              AND vbkd~posnr = con_zposnr
           WHERE vbrp~vbeln EQ nast-objky.
      DELETE ADJACENT DUPLICATES FROM c_tab_po COMPARING ALL FIELDS.
    *Getting the other Invoices based on the customer PO number
      IF c_tab_po[] IS NOT INITIAL.
        SELECT
        vbrk~kunag
        vbkd~bstkd
        vbkd~bstdk
        vbkdposex_e vbrkvkorg
        vbrpvbeln vbrpposnr vbrp~erdat
               vbpakunnr vbrpaubel vbrpaupos vbakerdat
               vbrpmatnr vbrkmwsbk vbrp~netwr
               vbrkvaldt vbrkzterm vbrk~vbtyp
                INTO TABLE g_tab_invoice FROM vbrp
                INNER JOIN vbrk ON vbrkmandt = vbrpmandt AND vbrk~vbeln =
                vbrp~vbeln
                INNER JOIN vbkd ON vbkdmandt = vbrpmandt AND vbkd~vbeln =
                vbrp~aubel
                               AND vbkd~posnr = con_zposnr
                INNER JOIN vbpa ON vbpamandt = vbrpmandt AND vbpa~vbeln =
                vbrp~aubel
                               AND vbpaposnr = con_zposnr AND vbpaparvw =
                               con_parvw
                INNER JOIN vbak ON vbakmandt = vbakmandt AND vbak~vbeln =
                vbrp~aubel
                FOR ALL entries IN c_tab_po
                    WHERE vbrk~kunag EQ c_tab_po-kunag AND
                    vbkd~bstkd EQ c_tab_po-bstkd AND
                    vbkd~bstdk EQ c_tab_po-bstdk.
      ENDIF.

    Hi Younus,
    First join seems to be oku2026
    But you are querying Db tables multiple times to avoid this.
    Fetch the fields
    vbkdposex_e vbrkvkorg
    vbrpvbeln vbrpposnr vbrp~erdat
    vbrpaubel vbrpaupos
    vbrpmatnr vbrkmwsbk vbrp~netwr
    vbrkvaldt vbrkzterm vbrk~vbtyp
    in the first join itself.
    SELECT vbrk~kunag
    vbkd~bstkd
    vbkd~bstdk
    vbkd~posex_e vbrk~vkorg
    vbrp~vbeln vbrp~posnr vbrp~erdat
    vbrp~aubel vbrp~aupos
    vbrp~matnr vbrk~mwsbk vbrp~netwr
    vbrk~valdt vbrk~zterm vbrk~vbtyp
    INTO TABLE c_tab_po FROM vbrp
    INNER JOIN vbrk ON vbrk~mandt = vbrp~mandt AND vbrk~vbeln =
    vbrp~vbeln
    INNER JOIN vbkd ON vbkd~mandt = vbrp~mandt AND vbkd~vbeln =
    vbrp~aubel
    AND vbkd~posnr = con_zposnr
    WHERE vbrp~vbeln EQ nast-objky.
    then Just join VBPA & VBAK and get required data.
    Thanks,
    Sudha

  • Sales Document from VBAK ,VBAP and VEDA

    Hi ,
    I need to fetch the Sales Document from VBAK and VBAP and VEDA with the contract sign date for sales document line item .
    Contract sign date is in selection screen as select options.
    Please let me know how to fetch the sales Document per line item from these 3 tables considering that A sales document could have many line items and each can have a different sign date.
    Thanks
    Sachin

    Hi,
    The link between all the tables VBAK, VBAP and VEDA is VBELN i.e sales document number.
    However, while fetching from VBAP and VEDA you would need to consider POSNR as well.
    As your ABAPer to code the logic using 'for all entries' method.
    Regards,
    Amit
    Edited by: Amit Iyer on Jun 23, 2011 12:28 PM

  • VBAK,VBRK AND KONA LINK????

    HI EXPERTS,
    How to create a report based on agreements from KONA and assigned to Sales documents from VBAK and billing documents from VBRK?
    how to create link between these tables? is that based on KNUMA only or do we need to consider any other links to create the report, because one agreement can create to several sales documents or several billing documents.
    plz suggest me the logic to create a report.
    here is the example.
    Agreement Sales Doc  Net value    Billing Doc Net Value Billing Date
    1                 10000           100           60000       100          10.12.2010
                        20000          150           70000       150          11.12.2010
    2                 30000           100          80000        100          12.12.2010
                                                            90000        150          13.12.2010
    regards
    venuscm

    Hi Venugopal
    You can try this logic.
    The KONA-KNUMA rebate number can be passed through KONP-KNUMA_BO to fetch the Condition record number and the Condition type. The application is always V for rebates. So from KONP table you can fetch out Condition number (KONP-KNUMH) and the condition type (KONP-KSCHL). Once we have this the condition number is the link to fetch the invoice numbers. As in every invoice that references the rebate the condition number would be copied.
    You can pass the condition number, condition type and application through KONV. That is KONP-KNUMH as KONV-KNUMH and some more parameters such as condition type and application to make the query faster. You can get KONV-KNUMV from here. Pass the KONV-KNUMV as the VBRK-KNUMV to get the VBRK-VBELN. Since you will get multiple entries for KONV-KNUMV (multiple invoices referenced by one single rebate) you will have to loop to find VBRK-VBELN multiple times.
    Now passing VBRK-VBELN through VBFA-VBELN you can get VBFA-VBELV which will be the VBAK-VBELN.
    I hope this helps.
    Thanks
    Indranil

  • Selecting from one table and Update another in the same Page

    Could someone help me with this HTMLDB task. In my page design, I am selecting data from two tables (masters: DEPT, EMP) which I want to display on the left column of the page and at the same time a user would be able to update another table (ATTENDANCE:with many children) which would have a radiogroup on the right side for each value of the master such as employee name. The placement of data has to appear in corresponding rows on the page. For instance, employee names of the master table must appear on the same row with its corresponding child value. The page would be grouped by DEPT_NO. The user would click on the department name, a new page with the employee name would apprar. From that page, the user would then update attendance column for each employee in that department. In this operation, it is only the ATTENDANCE table that is being updated. I can send out more information about the structure of the tables if you need more information. I tried many HTMLDB options, forms, reports, etc. I have not been able to get quite right. Your help will be appreciated.

    Raju,
    Thanks for responding to my problem. I have actually tried using the example on how-to you sent me a link to but it did not help as I expected. You see, the page would be updated every meeting date for each employee. I can send you more information about the table structure if you like. However, let me see if this will help you a bit.
    Tables are: 1) Dept [dept_no (pk),dept_name] 2) EMP [emp_no (pk),emp_name, dept_no(fk)] 3) Meetings [meet_key(pk),attended, meeting_date, emp_no(fk)]
    What I want to do is create two pages, one would list the departments, when a user selects a department, the user would be linked to a meeting attandance page. The meeting attendance page would list department name once, Meeting date once, and then list employees in that department. At the right column of every employee would be a checkbox for meeting.attended for update. The meeting_date would be pre-populated so that what the user would do is just check Yes/NO. The second page is the one I'm having the most problem with.
    If I can do a fetch from dept, emp, and meetings and then do an update on the Meetings table on the same page, I think that might solve the problem. That was how I solved it in MS Access three years ago.
    Here is email address in case you want to contact me directly. [email protected]
    Thanks again for your help.

  • Selecting from two tables and confirming from them despites they not relate

    Please I need a query to select from two tables that are not related to each other.
    I also want to confirm data's as in verify wether what the user has entered is in accordance with what is in the tables
    Examples
    the first table is named "Card" and the second table is named "Student_Details"
    Card table contains a column named "Pin_Number".
    The Student_Details table contains fields such as Exam_Number, Name, Age, Sex.
    The user has to Enter the Pin_Number which has to be confirmed in the Card table and Exam_Number which has to be confirmed in the Student_Details table and verify that both data's are correct.
    Please I need the SQL and PL/SQL queries for this problem.
    Thanks

    Hi,
    I think you need two different queries
    You can write a procedure like:
    create or replace procedure p1 (p_pin_number number, p_exam_number)
    is
      r_card_row            card%rowtype;
      r_student_details     student_details%rowtype;
      cursor c1 is
      select *
        from card
       where pin_number = p_pin_number;
      cursor c2 is
      select *
        from student_details
       where exam_number = p_exam_number;
    begin
      open c1;
        loop
          fetch c1 into  r_card_row;
          exit when c1%notfound;
          ....  do whatever you want..... and the samething you can do with other cursor
        end loop;
      close c1;
    end p1;Hope this helps
    Ghulam

  • "How to sum FKIMG in VBRK and VBRP Table with sample output

    Sir\Mam\Gurus ;
    I hardly found it difficult in resolving my program in getting the sum of FKIMG inside the VBRP and VBRK tables
    The scenario is that i have one Sales Order with multiple invoices . What i need to do is to sum up the fkimg or the quanitity of specific material regardless of how many invoices the material have in a particular SO
    Example I have Sales Order number 35678952 with
    3 invoices
    Invoice # 123 with material number mat1=12, mat2=5 , mat3=7
    345 with material number mat1=7, mat2=7
    678 with material number mat1=5, mat3=10
    Output shoud be
    salesorder# 35678952
    mat1 = 24
    mat2 = 12
    mat3 = 17
    Below is my Sample Codes:
    DATA : it_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
    ls_vbrp_details TYPE wa_vbrp_details,
    ls_vbrp_details1 TYPE wa_vbrp_details,
    lsfinal_vbrp_details TYPE wa_vbrp_details,
    it2_vbrp_details TYPE STANDARD TABLE OF wa2_vbrp_details,
    ls2_vbrp_details TYPE wa2_vbrp_details,
    it3_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
    itfinal1_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
    itfinal2_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
    itfinal3_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
    ls3_vbrp_details TYPE wa_vbrp_details,
    rtime1 TYPE i,
    rtime2 TYPE i,
    rtime3 TYPE i,
    s_erdate type d,
    scr_erdat type d,
    s_erdate = scr_erdat.
    CALL FUNCTION 'MONTH_PLUS_DETERMINE'
    EXPORTING
    months = 1 " Negative to subtract from old date, positive to add
    olddate = s_erdate
    IMPORTING
    newdate = new_date.
    """ This is another way manual adding by days
    CALL FUNCTION 'CALCULATE_DATE'
    EXPORTING
    days = +30
    start_date = s_erdate
    IMPORTING
    result_date = new_date.
    result_date = ddate.
    REFRESH: it_vbrp_details.
    SELECT
    vbrp~matnr
    vbrp~aubel
    vbrp~aupos
    vbrp~vbeln
    vbrp~kzwi1
    vbrp~kzwi2
    vbrp~kzwi3
    vbrp~kzwi4
    vbrp~kzwi5
    vbrp~kzwi6
    vbrp~mvgr1
    vbrp~mvgr2
    vbrp~mvgr3
    vbrp~mvgr4
    vbrp~mvgr5
    vbrp~knuma_pi
    vbrp~knuma_ag
    vbrp~mwsbp
    vbrp~vkaus
    vbrp~fkimg
    vbrk~vbeln
    vbrk~fkart
    vbrk~belnr
    vbrk~xblnr
    vbrk~vbtyp
    vbrk~kunag
    vbrk~fksto
    vbap~posnr
    INTO TABLE it_vbrp_details
    FROM vbrp INNER JOIN vbrk ON vbrkvbeln EQ vbrpvbeln
    where vbeln eq gt_data-vbeln
    where vbrpaubel eq vbapvbeln
    WHERE vbrp~posnr GE ''
    AND vbrk~vbtyp EQ 'M'
    AND vbrk~fksto NE 'X'
    AND ( vbrperdat GE s_erdate OR vbrperdat LE new_date OR vbrp~erdat IN s_erdat ) " + JP 09 19 2011 Additional Optimization
    ORDER BY aubel aupos .
    ORDER BY aubel aupos matnr.
    """" This where i need your help Sir\Mam\Gurus
    it3_vbrp_details = it_vbrp_details.
    SORT it3_vbrp_details BY aubel matnr fkimg kzwi1 kzwi2 kzwi3 kzwi4 kzwi5 kzwi6 aupos vbeln
    mvgr1 mvgr2 mvgr3 mvgr4 mvgr5 knuma_pi knuma_ag mwsbp vkaus fkart belnr vbtyp kunag fksto.
    LOOP AT it3_vbrp_details INTO ls_vbrp_details.
    COLLECT ls_vbrp_details INTO itfinal1_vbrp_details.
    APPEND ls_vbrp_details TO it_vbrp_details.
    ENDLOOP.
    kzwi1,kzwi2,kzwi3 is also been sum up
    Sir the output is something like this
    Sales Ord# Material Qty KWIZ1 KWIZ2 KWIZ3 MGVR1 VBELN
    1234       Mat1     24  23.2  22    12           LastInvoice#
    1234       Mat2     12  20.0  21    15           LastInvoice#  
    1234       Mat3     37  22.0  22    16           LastInvoice#
    5432       Mat1     30  25.0  23    15           LastInvoice#
    5432       Mat2     24  22.0  24    23           LastInvoice#
    5432       Mat3     20  18.0  20    12           LastInvoice#
    Hope you can help me as i cant hardy sleep thinking of this ...
    I will really appreciate your great help..
    Thanks !
    I will really appreciate your great help..
    Thanks !
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on Sep 20, 2011 3:05 PM

    Hi,
      How you want to display the output?..
    If you want to display the output as mentioned below, then you have to use nested loop & dynamic field assignments to get result.
    Output column
    sales order     Mat1 Mat2 Mat3 ......
    1234               24    12     37
    Kindly let me know, if you have any questions
    Regards,
    S.Senthilkumar

  • Facing problem in selecting from table vbrk

    Hi,
    I have developed a simple report for calculating the total logistic cost.
    That program was working fine in the development server.
    Now in production, its not working.
    While debugging i found that its getting stuck at a select query where its fetching data from  VBRK table and is getting timed out.
    What should be done for reducing the time?
    Please help.
    Thanks in advance
    Nitin

    Hi Naren ,Seshu & Aarun
       First of all thanks a lot for replying.
    The structure of my select query is
    START-OF-SELECTION.
      SELECT cityc regiogroup bzirk  INTO  TABLE  it_ztaluka_1
        FROM ztaluka_1
             WHERE    regiogroup  IN   pregroup.
      IF sy-subrc NE 0.
        MESSAGE 'No records in ztaluka_1.' TYPE 'E'.
      ENDIF.
       I N I T I A L I S I N G   IT_VBRK   F R O M  VBRK  *******
      IF NOT it_ztaluka_1[] IS INITIAL.
        SELECT  vbeln bzirk regio cityc zzwerks knumv
           FROM vbrk
           INTO  TABLE it_vbrk
             FOR ALL  ENTRIES IN it_ztaluka_1
               WHERE     zzwerks  IN  pzzwerks
               AND        regio   IN  pregio
               AND        cityc = it_ztaluka_1-cityc.
        IF sy-subrc NE 0.
          MESSAGE 'No records in vbrk.' TYPE 'E'.
        ENDIF.
        SORT it_vbrk BY vbeln .
    The key field is vbeln,but that not included in my where condition  as its not in my selection criteria also in the previous tables which r used in the program.
    i found the order in the select qusery is not in the order of vbrk table.
    That i will change.But since the key field is not included it will again cause problems na??

  • Join Problem LIKP,LIPS,VBRK and VBRP

    Hi,
    i am working on the SAP Query report. But having problem in creating joins between the following tables
    LIKP
    LIPS
    VBRK
    VBRP
    please guide me
    regard
    khurram

    LIKP
    LIPS
    VBRK
    VBRP
    select a~ b~ c~ d~ into corresponding fields of table itab from likp as a inner join
    LIPS as b on a~VBELN = b~VBELN
    VBRK as c~VBELN = a~VBELN
    VBRP as d~VBELN = a~~VBELN.
    also check the first condition  a~VBELN = b~(KDAUF,VBELV,VGBEL,WKTNR)
    second condition a~VBELN = c~SFAKN
    third condition a~VBELN = d~(AUBEL,VBELV,VGBEL,VGBEL_EX)
    hope it solves...

  • Amount is different in VBRK and VBRP

    For currency USD, why the amount posted to NETWR in VBRK is correct and amount posted to NETWR in VBRP is with 2 decimal places. Example, total of 226.472,0000 USD but posted as 22.647.200,00.

    Hi,
    1> Please check the decimal notation settings under default tab for the user under transaction SU3.
    2> If your condition rate currency is different than document currency, exchange rate will be applied during the condition value calculation.  Exch rate * TCURF-FFACT  = VBRK-KURRF (In case of billing doc).   So plz check the TCURF table FFACT value whether is 1 or 100.  It should be 100 for no decimal currencies (Such as JPY, TWD)
    Regards,
    P Gomatheeswaran

Maybe you are looking for