How to display only one row in report when...

Hi,
  I've a report display in which i've 3 fields EBELN, LIFNR , MENGE. EBELN, LIFNR are from EKKO table and MENGE id from EKPO table .
         On clicking the EBELN there will be getting another report in which we get EBELN,EBELP and MATNR and MENGE from EKPO table .
       The problem is while displaying 1st report if the purchase order has two items in EKPO table then its displaying two times. How can i get only one time and the MENGE should be sum of those two item prices.

hi use the statement not to get the  multiple items..
sort itab by ebeln.
delete adjacent duplicates from itab comparing vbeln.
i will give u an example to get the total and subtotal ....
*& Report  ZR_A1
REPORT  ZR_A1
        NO STANDARD PAGE HEADING.
Tables declarations
TABLES: VBAK, VBAP.
Variable declarations
DATA: C1 TYPE C.
Internal Table declarations*
DATA: BEGIN OF IT_VBAK OCCURS 0,
      VBELN LIKE VBAK-VBELN,
      VKORG LIKE VBAK-VKORG,
      VTWEG LIKE VBAK-VTWEG,
      SPART LIKE VBAK-SPART,
      END OF IT_VBAK.
DATA: BEGIN OF IT_VBAP OCCURS 0,
      VBELN LIKE VBAP-VBELN,
      POSNR LIKE VBAP-POSNR,
      MATNR LIKE VBAP-MATNR,
      NETWR LIKE VBAP-NETWR,
      BRGEW LIKE VBAP-BRGEW,
      NTGEW LIKE VBAP-NTGEW,
      END OF IT_VBAP.
DATA: BEGIN OF IT_FINAL OCCURS 0,
      VBELN LIKE VBAK-VBELN,
      VKORG LIKE VBAK-VKORG,
      VTWEG LIKE VBAK-VTWEG,
      SPART LIKE VBAK-SPART,
      POSNR LIKE VBAP-POSNR,
      MATNR LIKE VBAP-MATNR,
      NETWR LIKE VBAP-NETWR,
      BRGEW LIKE VBAP-BRGEW,
      NTGEW LIKE VBAP-NTGEW,
END OF IT_FINAL.
Selection-screen design
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-R01.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
SELECTION-SCREEN: END OF BLOCK B1.
TOP-OF-PAGE.
FORMAT INTENSIFIED ON COLOR 5.
WRITE:/7 'LIST TO DISPLAY SALES ITEM INFO'.
START-OF-SELECTION.
Populating it_vbak table
SELECT VBELN
       VKORG
       VTWEG
       SPART
       FROM VBAK
       INTO TABLE IT_VBAK
       WHERE VBELN IN S_VBELN.
populating it_vbap table
IF NOT IT_VBAK[] IS INITIAL.
SELECT  VBELN
        POSNR
        MATNR
        NETWR
        BRGEW
        NTGEW
        FROM VBAP
        INTO TABLE IT_VBAP
        FOR ALL ENTRIES IN IT_VBAK
        WHERE VBELN = IT_VBAK-VBELN.
ENDIF.
populating the final list
LOOP AT IT_VBAP.
READ TABLE IT_VBAK WITH KEY VBELN = IT_VBAP-VBELN.
IF SY-SUBRC = 0.
MOVE:  IT_VBAK-VBELN TO IT_FINAL-VBELN,
       IT_VBAK-VKORG TO IT_FINAL-VKORG,
       IT_VBAK-VTWEG TO IT_FINAL-VTWEG,
       IT_VBAK-SPART TO IT_FINAL-SPART,
       IT_VBAP-POSNR TO IT_FINAL-POSNR,
       IT_VBAP-MATNR TO IT_FINAL-MATNR,
       IT_VBAP-NETWR TO IT_FINAL-NETWR,
       IT_VBAP-BRGEW TO IT_FINAL-BRGEW,
       IT_VBAP-NTGEW TO IT_FINAL-NTGEW.
APPEND IT_FINAL.
ENDIF.
ENDLOOP.
SORT IT_FINAL BY VBELN.
LOOP AT IT_FINAL.
AT FIRST.
FORMAT INTENSIFIED ON COLOR 1.
WRITE:/35 'SALES DOCUMENT ITEM LIST'.
ULINE AT (100).
*endat.
FORMAT INTENSIFIED ON COLOR 5.
WRITE:/ SY-VLINE,
      2  'SALES.DOCU.NO',
      13 'ITEM',
      21 'MATERIAL',
      50 'NET-VAL',
      65 'GROSS-WT',
      82 'NET-WT',
      100 SY-VLINE.
ENDAT.
FORMAT INTENSIFIED ON COLOR 2.
WRITE:/ SY-VLINE,
       2   C1 AS CHECKBOX,
       5 IT_FINAL-VBELN,
      13  IT_FINAL-POSNR,
      21  IT_FINAL-MATNR,
      41  IT_FINAL-NETWR,
      56  IT_FINAL-BRGEW,
      71  IT_FINAL-NTGEW,
      100 SY-VLINE.
AT END OF VBELN.
SUM.
FORMAT INTENSIFIED ON COLOR 3.
WRITE:/    SY-VLINE,
         30   'SUB-TOTAL:',
         41   IT_FINAL-NETWR,
         56   IT_FINAL-BRGEW,
         71   IT_FINAL-NTGEW.
   WRITE:/100 SY-VLINE.
ENDAT.
AT LAST.
SUM.
FORMAT INTENSIFIED ON COLOR 6.
WRITE:/ SY-VLINE,
          30  'GRAND-TOTAL:',
          41  IT_FINAL-NETWR,
          56  IT_FINAL-BRGEW,
          71  IT_FINAL-NTGEW.
  WRITE:/100  SY-VLINE.
  ENDAT.
  ENDLOOP.
regards,
venkat .

Similar Messages

  • Display only one row for distinct columns and with multiple rows their valu

    Hi,
    I have a table having some similar rows for some columns and multiple different rows for some other columns
    i.e
    o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
    9825000111 01-jan-06 'a' 980515464 01-feb-06 c
    9825000111 01-jan-06 'a' 991543154 02-feb-06 d
    9825000111 01-jan-06 'a' 154845545 10-mar-06 a
    What i want is to display only one row for above distinct row along with multiple non distinct colums
    ie
    o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
    9825000111 01-jan-06 'a' 980515464 01-feb-06 c
    991543154 02-feb-06 d
    154845545 10-mar-06 a
    regards,
    Kumar

    Re: SQL Help

  • How to select only one row

    hello,
    i've got a select query which returns a couple of rows.
    now i would like for the query to return only one row (the first match it can find).
    how do i do that?
    thank you!
    my sample of my data as below , the first and seconde record is equal and i want to display all the colomn for the first row and ignore the second row .
    84A8E46E8C97     9410     20110812
    84A8E46E8C97     9420     20110813
    84A8E46E8C6E     9410     20110816
    84A8E46E8AFA     9400     20110819

    876602 wrote:
    my sample of my data as below , the first and seconde record is equal and i want to display all the colomn for the first row and ignore the second rowThere is no row order in relational database tables. Same query canreturn rows in different order next time you run it unless you specify ORDER BY. Only ORDER BY guarantees order, so when you say first row/second row you must provide ordering criteria.
    SY.

  • How to display only one record.

    Hi Gurus,
    Here my requirement is i have 2 pages.
    first page having project_number lov,create and tableRN.
    once u select the projectnumber and click on the create button it is navigate to secound page,here enter the data and click on the submit button it ll insert into database table and navigate to fitst page and display the data in tableRN what ever u insert the data(this part is over).
    but the problem is, in tableRN displays all the records(previous records also displayed)
    my requirement is display only one record(click on the submit button at the time of record only).
    Plz help me
    its very urgent.
    Thanks
    Seshu.
    Edited by: its urgent on Jan 3, 2012 10:52 PM

    Seshu,
    Do u want to display the inserted row...
    Regards,
    Gyan
    www.gyanoracleapps.blogspot.com
    www.querenttech.com

  • How to restrict only one row in Table ??.

    Hi all,
    i want to restrict no. of rows to one,
    that is not more that one row should be there in the table.
    Following trigger works well in all conditions
    except:
    insert into myTab select 'x' from emp;
    inserts 14 rows.
    Create or replace trigger one_row_myTab
    before insert on myTab
    for each row
    declare
    cnt number;
    pragma AUTONOMOUS_TRANSACTION;
    Begin
    select count(*) into cnt from mydual;
    if cnt=1 then
    raise_application_error(-20001,'MyDual Can have only one Row');
    end if;
    end;
    i think with trigger it w't be possible because,
    same transaction triggers c't query the table (Mutating Table),
    Autonomus trans ca't identify uncommited changes.
    pls add your suggestions.
    Thanks for Reading the Post.
    Rajashekhar Ganga,
    mail : [email protected]

    nice try Mulder ! it doesn't work everywhere...
    SQL> connect scott/tiger@lsc69
    Connected to:
    Oracle7 Server Release 7.3.4.5.0 - Production
    With the distributed and parallel query options
    PL/SQL Release 2.3.4.5.0 - Production
    SQL>  create table d as select * from dual;
    Table created.
    SQL> create index i on d(1);         
    create index i on d(1)
    ERROR at line 1:
    ORA-00904: invalid column name
    SQL> connect scott/tiger@lsc65
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - 64bit Production
    JServer Release 8.1.7.4.0 - 64bit Production
    SQL> create table d as select * from dual;
    Table created.
    SQL> create index i on d(1);         
    Index created.
    SQL> connect scott/tiger@lsc68
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
    With the Partitioning and Data Mining options
    SQL> create table d as select * from dual
    Table created.
    SQL> CREATE UNIQUE INDEX i on d(1);                  
    CREATE UNIQUE INDEX i on d(1)
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel

  • Multi Language- Picklist fields are displayed only one language for Reports

    Hi!
    I am working on Siebel On Demand with Multi Language (English and Spanish) and it works well for web interface, the automatic translation for picklist works properly.
    However when I create any report (with any Record Type) the fields setup with picklist are displayed only in spanish language even though I am on English mode.
    Have you any reference(s) or previous experience(s) on that?
    Thanks in advance
    Mtb

    Hi,
    in reports the language of the picklists corresponds always to the company default language.
    The only solution I now (its really static and not so nice):
    Create one report per language and change the picklist field by using CASE statements...you see its hard to refresh if you have lots of values :)
    cheers
    Myriam

  • How to make only one row detail disclosed in uix:TableDetail

    I display row details to user with <uix:TableDetail>. I'd like to have only one detail displayed in the same time. When the page first loads, all details should be hidden, but whe user shows one another detail and one is already disclosed, only the new one should be displayed.
    I use <bc4juix:Table> and JDev 9.0.3.2
    Thanks in advance

    Viliam,
    The <table> element has the detailDisclosure complex attribute that you should use to control whether the details for table rows are disclosed. You should databind the detailDisclosure attribute to some DataObjectList that has the "disclosed" key set for each DataObject in the list. Then, when you disclose a new row, you should modify the DataObject for the corresponding row in the DataObjectLlist, and ensure that all other DataObjects set the "disclosed" key to false.
    Hope this helps,
    Ryan

  • How to display only one message in WD

    Hi all,
    I want to display successful message or error message when certain action is perform.
    I have my message enter in the MessagePool, say Request_Successful_Updated and value is "your request is successfully updated"
    In my WD, I do this:
    IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
    IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();
    msgMgr.reportSuccess(textAccessor.getText(IMessage<my class>.Request__Successful__Update));
    The error message appear three times in the top view, right side view and the bottom of the view.
    How to just displayed one error message on just on side of the view?

    Hi
    Define a success message or Error message in the pool.
    Use the following statement
                   wdComponentAPI.getMessageManager().reportMessage(IMessage<Comp_Name>.<MessageKey>,
                        null,false);
    Define message areas  View element in your View and place it where you want to display the error message.
    May be this helps you.
    Regards
    Kalyan

  • How to remove only one row from the database using labview6.1

    using labview 6.1 I create a table with various rows and columns and store bulk of data's in them.,, what procedure should I follow to remove only one paticular row from the database? Help me out with an example please,,
    Thanking you in advance!

    Hi,
    If you have the database toolkit you can delete a row using just a SQL Query to "DB Tools Execute Query.VI"
    Example:
    DELETE FROM Table name Where SerialNum='Value' And Date='Value' And Time='Value'
    See also attached VI
    Best Regards
    Johan
    Attachments:
    Delete_a_row_in_a_database_table.vi ‏48 KB

  • Day View Event List: How to Display Only One Day

    I love Day View in the calendar, but I find it confusing to have the whole week's list of events on the left list column.
    How do I change it so that I display only that day's events?
    Any help would be greatly appreciated! Thank you!

    Hi,
    That is not configurable in the current version.
    This is a user to user forum. By posting here you are not guaranteed someone from Apple will read it. If you'd like Apple to know about this I suggest you send them feedback.
    Best wishes
    John M

  • How to set only one row selection  in ALV GRID DISPLAY

    How to set single row selection in grid display
    not multiselection.

    Hi,
    In the USER COMMAND, build the code to check the REFRESHED Data & then check the number of records with SEL  = 'X'.
    If more than single entry found, then raise an error message.
    Best regards,
    Prashant

  • How to display only one role to show , not double show on role

    Dear Sir,
    I have the problem on Role , Normally, we will create the user and add in the group . And then to assigned role in group. However, the user can add in many gropus. Sometimes ,  the role will be assinged double. And show in the menu the same. How can to make the role which double not display.
    Thank you and best regards,
    Vimol

    Hi,
    if this is really the same role than this role should be assigned to the user only once -- regardless of how many groups this user belongs to and how many times this role is assigned to the groups.
    You can check this by searching for the user and clicking on assigned roles (with the recursive flag activated). Then you should see the role only once.
    If the rolename is different however, then you might have to work with MergeIDs (http://help.sap.com/saphelp_nw70/helpdata/en/53/89503ede925441e10000000a114084/frameset.htm)
    Hope this helps,
    Holger.

  • How to display only contact containing a number when accessing from phone

    Many of the contact in the address book, contain e-mail only data. These are very useful for mail but are distracting when you launch the address book to call someone. Is there a way to show only names that actually have a phone number, when you open the contacts from the Phone app.

    Not that I'm aware of.

  • How can I display only one value of a field with two or more values?

    Post Author: skiabox
    CA Forum: Crystal Reports
    I have a field in my report with 2 or more values (depending of another field id).For example for id = 1 the report gives me 2 names in that field.For id = 3 the report gives me 3 names in that field.I want to display only one of these names in the id row.The selection of name is random.Thanks!

    Hello Tim,  would barely fit in this situation since this code resides on the client’s interaction side of things. I’d recommend using JavaScript for this matter, e.g. var Data_FName1 = document.getElementById(‘Data_FName1’).value;. If you still opt for using CFML, then you’d go for proxying your JavaScript code to a CFC.

  • Missing rows / output only one row in a Report after applying patchset 2

    Hi.
    We use Reports Builder for 10g R2. We had the problem with our AS 10g R2 on windows 2003, that some reports creates duplicate rows when it is a ASCII report (desformat = delimited), see Bug 3340546.
    Now we apply Patchset 2 on a local machine, to test the functionality. It fix the problem (look in metalink doc ID 398955.1 under "2.12 Oracle Reports Developer Bugs")-
    But now most csv reports creates only one row instead of multiple rows.
    We run reports on our local machine with OC4N and local started Form (via Forms Builder) to generate the reports (local started report server) from DevSuite).
    When we start the reports with desformat=delimited the txt-file has only the header row and one data row (instead of multiple ones).
    And when we generate the same report with desformat=delimiteddata it looks fine and generates all rows as expected.
    We found neither here in the forum or in metalink knowledge base nor on the internet.
    Have you any suggestions for us how to fix this problem?
    Using delimiteddata is now acceptable solution for us, because delimited is easier to use.
    Thanks for your help!

    Hey folks.
    We have solved the problem. :)
    We applied PatchSet2 for 10gR2. But we don´t know how the csv-report outputs only 1 data-row instead of several rows.
    Than we create a similar report (with the same sql-query) as a new one with the reports builder assistant.
    This one works pretty fine. So we looked for the attributes and see the "max. number datasets for each site" and it was in the new one set to 0 and in our old one set to 1.
    So we change this and ... the old one works pretty fine! :)
    So the problem is, that this attribute does not had any consequences in the old version. But since we update with PatchSet 2 it respect this attribute but we don´t "see" it.
    Hope this helps others.

Maybe you are looking for

  • Free goods concept in STO

    hi all, i have an issue regarding free goods for STO betn plants. our concept is to give free goods for ex- 10 out of 100 are free goods. when i am creating a po with item catagory U, the free goods indicator is become vanice. so i am unable to proce

  • The file name format for Voice Memos has changed - how can I change it to the original format?

    The file names for the voice memos changed in the last update.  Now the day is first, which means when you sort them in a file folder, they sort by the number of the day and not year - month - day as before.  Is there a way to change it back?

  • How to get used InfoPackage name in SAP BW 3.5 in update/ start routine?

    Hello Experts, according to the Infopackage (weekly load ord monthly) the update rule should change. In BI 7.0 helps the method P_R_REQUEST. Is there any similar for BW 3.5? =Or is there a possiblility to get the request nr in the startroutine with a

  • Can't Sign in. Been trying all day to fix this. Help plz

    When I try to sign into ITunes Store I recieve error -50 & -3212 "unknown error". I can't connect to Apple TV.  It also won't allow me to turn on home sharing. I'm using windows 7 and the current version of iTunes. I'm using Avast Free, but made the

  • 17" iMac G5 2GHz (ALS but no iSight) runs hot and LOUD fans

    Hi all, I love my iMac. I've had it for nearly 8 months now. From day 1, I've been surprised by how loud it is under any significant CPU load. Unfortunately for me, I have waited until I'm well out of my phone support window to do anything about it.