Report joining

Dear All.
plz help me in this regards, i am not getting output if i am debagging then in loop data is not comming.
thanks in advance.
REPORT  Y_STOCK_HOL_REP_01 NO STANDARD PAGE HEADING
LINE-SIZE 128
LINE-COUNT 64.
TYPE-POOLS : SLIS.
TABLES :MARA,MCHB,MAKT,MARD,MDSM,VBBE,resb.
*SELECTION SCREEN                            *
SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME.
select-options:MATNO FOR MCHB-MATNR.
SELECT-OPTIONS:PLANT FOR MCHB-WERKS.
select-options:SLOC  FOR MCHB-LGORT.
select-options:BATCH FOR MCHB-CHARG.
SELECTION-SCREEN END OF BLOCK BLK2.
*FIELDCAT DECLARATION
TYPES :  BEGIN OF TY_FINAL,
          MATNO     TYPE MCHB-MATNR,
          MGROUP    TYPE MARA-MATKL,
          MATDES    TYPE MAKT-MAKTX,
          BOU       TYPE MARA-MEINS,
          ONORDER   TYPE MarD-labst,
          ONHAND    TYPE mard-labst,
          ALOC      TYPE vbbe-omeng,
          ABLE      TYPE MARD-LABST,
          END OF TY_FINAL.
DATA : IT_FINAL TYPE STANDARD TABLE OF TY_FINAL,
       WA_FINAL TYPE TY_FINAL.
DATA : T_FCAT TYPE SLIS_T_FIELDCAT_ALV,
       W_FCAT TYPE SLIS_FIELDCAT_ALV.
DATA : IT_SORT TYPE SLIS_T_SORTINFO_ALV,
       WA_SORT TYPE SLIS_SORTINFO_ALV.
DATA : T_HEAD TYPE SLIS_T_LISTHEADER,
       W_HEAD TYPE SLIS_LISTHEADER.
       W_HEAD-TYP = 'H'.
       W_HEAD-INFO = 'MY STOCK HOLDING REPORT'.
       APPEND W_HEAD TO T_HEAD.
DATA : T_EVENTS TYPE SLIS_T_EVENT," WITH HEADER LINE.
       W_EVENTS TYPE SLIS_ALV_EVENT.
       W_EVENTS-NAME = 'TOP_OF_PAGE'.
       W_EVENTS-FORM = 'TOP'.
       APPEND W_EVENTS TO T_EVENTS.
W_FCAT-COL_POS = 1.
W_FCAT-FIELDNAME = 'MATNO'.
W_FCAT-SELTEXT_M = 'MATERIALNO'.
*W_FCAT-DO_SUM =  'X'.
W_FCAT-OUTPUTLEN = 20.
*W_FCAT-EMPHASIZE = 'X'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
W_FCAT-COL_POS = 2.
W_FCAT-FIELDNAME = 'MGROUP'.
W_FCAT-SELTEXT_M = 'MATGROUP'.
W_FCAT-OUTPUTLEN = 10.
W_FCAT-DO_SUM = 'X'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
*W_FCAT-COL_POS = 3.
*W_FCAT-FIELDNAME = 'MPLANT'.
*W_FCAT-SELTEXT_M = 'MATPLANT'.
*W_FCAT-OUTPUTLEN = 40.
*APPEND W_FCAT TO T_FCAT.
*CLEAR W_FCAT.
W_FCAT-COL_POS = 3.
W_FCAT-FIELDNAME = 'MATDES'.
W_FCAT-SELTEXT_M = 'DESCRIPTION'.
W_FCAT-OUTPUTLEN = 40.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
W_FCAT-COL_POS = 4.
W_FCAT-FIELDNAME = 'BOU'.
W_FCAT-SELTEXT_M = 'BASEUNIT'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
W_FCAT-COL_POS = 5.
W_FCAT-FIELDNAME = 'ONORDER'.
W_FCAT-SELTEXT_M = 'ONORDER'.
*W_FCAT-DO_SUM    = ''.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
W_FCAT-COL_POS = 6.
W_FCAT-FIELDNAME = 'ONHAND'.
W_FCAT-SELTEXT_M = 'ONHAND'.
W_FCAT-INTTYPE = 'I'.
W_FCAT-DO_SUM = 'X'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
W_FCAT-COL_POS = 7.
W_FCAT-FIELDNAME = 'ALOC'.
W_FCAT-SELTEXT_M = 'ALOCATED'.
W_FCAT-INTTYPE = 'I'.
W_FCAT-DO_SUM = 'X'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
W_FCAT-COL_POS = 8.
W_FCAT-FIELDNAME = 'ABLE'.
W_FCAT-SELTEXT_M = 'AVALILABLE'.
W_FCAT-INTTYPE = 'I'.
W_FCAT-DO_SUM = 'X'.
APPEND W_FCAT TO T_FCAT.
CLEAR W_FCAT.
WA_SORT-SPOS =  2.
WA_SORT-FIELDNAME = 'MGROUP'.
WA_SORT-UP = 'X'.
WA_SORT-GROUP = 'MATKL'.
WA_SORT-SUBTOT = 'X'.
WA_SORT-TABNAME = 'IT_FINAL'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
select m~matnr
       mr~matkl
       mr~meins
       k~maktx
       b~labst
       v~omeng
       INTO TABLE  it_final
       from
       mchb as m
       inner join mara as mr on mmatnr = mrmatnr
       inner join makt as k on mmatnr = kmatnr
       inner join mard as b on mmatnr = bmatnr
       inner join vbbe as v on mmatnr = vmatnr
       where m~matnr in matno
       and   m~werks in plant
       and   m~lgort in sloc
       and   m~charg in batch.
      and spras = 'en'.
   LOOP AT IT_final INTO WA_final.
    WA_FINAL-MATNO  = MCHB-MATNR.
    WA_FINAL-MGROUP = MARA-MATKL.
    WA_FINAL-MATDES = MAKT-MAKTX.
    WA_FINAL-BOU    = MARA-MEINS.
    WA_FINAL-ONORDER = MARD-LABST.
    WA_FINAL-ONHAND = MARD-LABST.
    wa_final-aloc   = VBBE-OMENG.
    WA_final-ABLE =   WA_FINAL-ONHAND - WA_final-ALOC.
    DELETE ADJACENT DUPLICATES FROM IT_FINAL.
    APPEND WA_FINAL TO IT_FINAL.
    ENDLOOP.
    CLEAR WA_FINAL.
DATA : MYPRG TYPE SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
   I_CALLBACK_PROGRAM                = 'MYPRG'
  I_CALLBACK_PF_STATUS_SET          = ' '
  I_CALLBACK_USER_COMMAND           = ' '
   I_CALLBACK_TOP_OF_PAGE            = 'TOP'
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
   I_BACKGROUND_ID                   = 'Z_LOGO'
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
  IS_LAYOUT                         = layout
   IT_FIELDCAT                       =  T_FCAT
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =
    IT_EVENTS                         = T_EVENTS
  IT_EVENT_EXIT                     =
  IS_PRINT                          =
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  IT_ALV_GRAPHICS                   =
  IT_HYPERLINK                      =
  IT_ADD_FIELDCAT                   =
  IT_EXCEPT_QINFO                   =
  I_HTML_HEIGHT_TOP                 =
  I_HTML_HEIGHT_END                 =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
  TABLES
    T_OUTTAB                          = IT_FINAL
EXCEPTIONS
  PROGRAM_ERROR                     = 1
  OTHERS                            = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*ENDLOOP.
FORM TOP.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
  EXPORTING
    IT_LIST_COMMENTARY       = T_HEAD
    I_LOGO                   = 'Z_LOGO'
ENDFORM.

Oh I thought your orignal question was a joke.
How do you expect someone to be able to tell you why your SQL is not returning any data.
How do you think you should be checking to see why it is not returning anything. I will give you a clue.
Try transaction SE16.
That is the end of my input with this n00bish request.

Similar Messages

  • Two report join not working

    I have two reports: Lead History(registered reciepents) and Campaign Reciepents History(email click-thru reciepents) with columns Full Name, Company/Account Name, and Job Title. I want to do a join that pull out the click-thru's that registered. Union and Union All gives me everything, Minus gives me just the click-thru's, and Intersect gives me nothing. What complicated join can I do to make this possible?

    Thank you, Barney-15E and Nerowolfe.
    First, you are right - I am using the 17" MacBook Pro (but not the ltest version).
    Second, I looked in the Library folders and found Sidetrack in the Startup items. I deleted it (although I had already removed it from the Startup items in the System Preferences.
    Third, I reset the PRAM.
    However the 2-finger scrolling is still not working. I did notice (and I don't know if this is something new) that the cursor is now immobile when trying to use two fingers although it is fine with one finger. It as though the trackpad recognizes that two fingers are different from one, but it doesn't know what to do with two-fingers.
    On a more general note, thank you all for your interest and quick responses. But...what should I try next? Apple suggests resetting the Power Management.

  • List Report ( Join Query )

    I am developing list report and in that i have to use approximately 8-9 inner joins and according  to SAP we can use only 2-3 joins so is there any alternative of fetching data from multiple table without effecting performance, i am listing my query below for proper understanding of the situation.
    SELECT  vbrk~vbeln vbrk~kunag vbrk~vtweg vbrk~vkorg
              vbrp~fkimg vbrp~matnr vbrp~werks vbrp~vkbur
              j_1iexchdr~exnum j_1iexchdr~exdat
              kna1~stceg kna1~name1 kna1~regio
              t005u~bezei
              adrc~street adrc~str_suppl1 adrc~str_suppl2
              t023t~wgbez
              likp~traid
              zmm_deliv_badi~lr_number zmm_deliv_badi~lr_date zmm_deliv_badi~manual_no
              zmm_deliv_badi~curr_num zmm_deliv_badi~manual_no1 zmm_deliv_badi~curr_num1
              mara~spart
         FROM vbrk INNER JOIN vbrp       ON vbrp~vbeln = vbrk~vbeln
                   INNER JOIN j_1iexchdr ON j_1iexchdr~rdoc = vbrk~vbeln
                   INNER JOIN kna1       ON kna1~kunnr = vbrk~kunag
                   INNER JOIN t005u      ON t005u~bland = kna1~regio
                                             AND t005u~spras = 'EN'
                                             AND t005u~land1 = 'IN'
                   INNER JOIN adrc       ON adrc~addrnumber = kna1~adrnr
                   INNER JOIN t023t      ON  t023t~matkl = vbrp~matkl
                   INNER JOIN likp       ON  likp~vbeln =  vbrp~vgbel
                   INNER JOIN zmm_deliv_badi ON zmm_deliv_badi~vbeln =  vbrp~vgbel
                   INNER JOIN mara           ON mara~matnr =  vbrp~matnr
              INTO CORRESPONDING FIELDS OF TABLE lit_st
         WHERE vbrk~vtweg IN ('03','04','06')
           AND vbrk~fkdat IN so_date
           AND vbrp~werks IN p_werks
           AND j_1iexchdr~status = 'C'
           AND vbrk~vkorg IN p_vkorg
           AND vbrk~kunag NOT IN ('0000001130','0000001150','0000001220','0000001240').
    What is the other alternative of apart from using joins , making views is not the solution as it will increase database objects and it is also not recommended and ranges and for all entries in will also decrease performance and for that we have to make lots of temporary objects
    So , please advice.
    Thanks .
    Ankesh Jindal

    >
    Ankesh Jindal wrote:
    > What is the other alternative of apart from using joins , making views is not the solution as it will increase database objects and it is also not recommended and ranges and for all entries in will also decrease performance and for that we have to make lots of temporary objects
    If you are saying neither Views nor for all entries nor Joins would work with aspect of performance, than I'm Sorry to say that we have no option left now.
    BTW you are misleading with your assumption for join. You can use Join in this case.
    Cheers,
    Amit.

  • Get a report joining data from Get-MailBox and Get-MailBoxStatistics

    Hi
    I have 2 cmdlets, and every has different information of the same users, the point is that I have to get the information of every cmdlet  and in excel I have to join the information
    Is there a way to get both information joined in one shot?
    This is one cmdlet:
    Get-Mailbox -Server MB05 | Select-Object DisplayName,SamAccountName,UserPrincipalName,UseDatabaseRetentionDefaults,OrganizationalUnit,PrimarySmtpAddress,WhenCreated,WhenChanged,HiddenFromAddressListsEnabled,@{N="AddressListMembership";E={
    $_.AddressListMembership -JOIN ';'}},UseDatabaseQuotaDefaults,ForwardingAddress,DeliverToMailboxAndForward,RecipientLimits,ManagedFolderMailboxPolicy,@{N="GrantSendOnBehalfTo";E={ $_.GrantSendOnBehalfTo -JOIN ';'}},MaxSendSize,MaxReceiveSize,Database
    | Export-CSV -Path d:\ms\mb05.txt -Delimiter "`t"  -Encoding Unicode -NoTypeInformation
    This is the other cmdlet:
    Get-MailboxStatistics Server MB05| Select-Object DisplayName,Database,StorageLimitStatus,@{label="Total Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}},@{label="Total Delete (MB)";expression={$_.TotalDeletedItemSize.Value.ToMB()}},
    ItemCount,DeletedItemCount,LastLogoffTime,@{label="ProhibitSendQ (MB)";expression={$PSQ}}| Export-CSV -Path d:\ms\ms05a.txt -Delimiter "`t" -Encoding Unicode -NoTypeInformation
    Thank you in advanced.
    Doc MX

    I think something like this would work:
    $stuff = @()
    Get-Mailbox -ResultSize unlimited -Database MB05| foreach{
    $x = "" | select `
    DisplayName, `
    SamAccountName, `
    UserPrincipalName, `
    UseDatabaseRetentionDefaults, `
    OrganizationalUnit, `
    PrimarySmtpAddress, `
    WhenCreated, `
    WhenChanged, `
    HiddenFromAddressListsEnabled, `
    AddressListMembership, `
    UseDatabaseQuotaDefaults,
    ForwardingAddress, `
    DeliverToMailboxAndForward, `
    RecipientLimits, `
    ManagedFolderMailboxPolicy, `
    GrantSendOnBehalfTo, `
    MaxSendSize, `
    MaxReceiveSize, `
    Database, `
    StorageLimitStatus, `
    'Total Size (MB)', `
    'Total Delete (MB)', `
    ItemCount, `
    DeletedItemCount, `
    LastLogoffTime, `
    'ProhibitSendQ (MB)'
    $m = Get-Mailbox $_
    $x.DisplayName = $m.Displayname,
    $x.SamAccountName = $m.SamAccountName,
    etc.,
    etc.,
    etc.
    $m = Get-MailboxStatistics $_
    $x.StorageLimitStatus = $m.StorageLimitStatus,
    $x.'Total Size (MB)' = $m.TotalItemSize.Value.ToMB(),
    etc.,
    etc.,
    etc.
    $stuff += $x
    $stuff | export-csv -Path d:\ms\mb05.txt -Delimiter "`t" -Encoding Unicode -NoTypeInformation
    --- Rich Matheisen MCSE&I, Exchange MVP

  • Creating a simple ALV report based on join condition

    Dear All
    SAP Version: ECC6 EHP7
    I wan to create simple ALV report based on join condition. can anyone provide me the complete steps to create this report.
    Regards,

    Hi Syed,
    Please check the link,
    ALV report - Joining 2 tables
    Regards,
    Prakash.

  • Comparing fields from multiple entities in the same report (report builder 1.0)

    Created a model that contains 2 entities. I open that model in report builder 1.0.  When I drag a field from one of the entities into the design area, i can no longer see the other entity or use any of the fields from that other entity. 
    I need to use fields from both entities in the same report (join tables).  In management studio i would simply write a query and join tables but i cannot figure out how to do this in report builder.  Once i select a field from one entity
    how do i select fields from more than one entity and drag them into the same report.

    Would it be possible for you to send me instructions for this? I am not that familiar with SQL coding but I can definitely figure it out. I have been wanting to get information on reports from multiple entities for a very long time! The only way I can
    currently do it is have our document management software people write the report for me for quite a large fee. I would much rather do this myself. Right now I can select a few fields from one entity (the main one), some from a second entity under that one,
    but I cannot add any fields from a third entity! Quite annoying and hindering! Thank you :)

  • Crystal report command query

    Hi expert,
    regarding crystal report query,im still new in crystal report,actually i want to make report join with table opor,por1,opor,oitm,oshp,nnm1,ocrn,por10 and octg.im face difficulty when want to join por10.then i join with por10.docentry = por1.docentry with table por1 and por1.visorder = por10.aftlinenum and im not sure it correct or not.im just want to make condition like this
    if (T1.U_CSUS_Size = '') and (t2.LineType = 'T') then it will show (t0.U_CSUS_ItmCode + ' ' + t0.U_CSUS_ItmDescp + ' ' + t1.U_CSUS_Size) else (t0.U_CSUS_ItmCode + ' ' + t0.U_CSUS_ItmDescp) and joining (from POR1 T0 
    INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
    inner join por10 T2 on T0.docentry = T2.docentry and T0.visorder = T2.aftlinenum)
    for 'u_csus_.....' is for udf i created.can i know how easier step for this condition.i also already try alot of query.sometime can make duplicate column.
    regards,
    Arif
    Edited by: Ahmad Arif on Jan 10, 2012 4:03 AM

    Dear Anmad Arif
    Try the below query
    SELECT
                          (CASE WHEN  (T1.U_CSUS_Size = '') and (t2.LineType = 'T') THEN
                    (t0.U_CSUS_ItmCode + ' ' + t0.U_CSUS_ItmDescp + ' ' + t1.U_CSUS_Size)AS NVARCHAR(1000))
                   else T1.[Dscription] End) AS [Description],                      
                    T1.VisOrder,
                    (CASE WHEN T1.[Quantity]<=0 THEN  NULL ELSE T1.[Quantity] END) AS Qty,
                    CAST(ISNULL(T3.UserText, '''') AS VARCHAR(MAX)) As ItemDesc,
                        T1.Currency, T3.SuppCatNum,
                        (CASE WHEN T1.linetotal<=0 THEN NULL ELSE T1.linetotal END)  as amount,
                    (CASE WHEN T1.[price]<=0 THEN NULL ELSE T1.[price] END) AS  Rate,
                    T3.UserText,
                    T0.DocEntry,
                    ISNULL(T1.U_Unit, T3.SalUnitMsr) AS SaleUnit,
                    ISNULL(T3.BuyUnitMsr, '''') AS PurchaseUnit,T1.VisOrder,'' LineSeq,'' aftLineNum,
                    ISNULL(T0.U_QText,'') AS QText,T1.U_QRR as QRR
              FROM     OPOR T0
                    RIGHT OUTER  JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry
                        RIGHT OUTER  JOIN OITM T3 ON T1.ItemCode = T3.ItemCode
                        LEFT OUTER JOIN dbo.OSCN AS T4 ON (T0.CardCode=T4.CardCode AND T1.ItemCode=T4.ItemCode)     
              WHERE   T0.Docnum = '4063'
    UNION ALL
              SELECT  CAST(ISNULL(T1.LineText, '') AS VARCHAR(MAX)) AS [Description],
                    T1.AftLineNum,
                    NULL Qty,
                    null,
                    null ,NULl ,NULL,
                    null Rate,
                    NULL,
                    T0.DocEntry,
                    null,
                    null,T1.OrderNum,T1.LineSeq,AftLineNum,'' AS BPCatlog,
                    null
              FROM     OPOR T0
                    RIGHT OUTER  JOIN POR10 T1 ON T0.DocEntry = T1.DocEntry
              WHERE   T0.Docnum = '4063'
                         And T1.LineText IS NOT NULL 
    Note : Change the DocNum= DocKey When you use Crystal report  As per your requied
    Regards
    Kamlesh

  • Report for tracing the Appropriation Request

    Hi!
    In the case of Projects created in the background after approval of the Appropriation Request-Do we have any report wherein we
    can trace the related appropriation request number if we know the project code? (like ME5J or ME2J for PRs and POs)
    Thanks in advance
    Prasad

    Hi Prasad,
    Our users also had the same requirement but I could not find standard report.
    So I did a simple SQVI report joining PRPS & IMAKZ tables.
    Another way,
    Simply you can find the appro.request(AR), just open project in CJ20N
    ->select the WBS that link AR.
    -> CRT+shift+F4( Menu Edit->WBS element-> Investment Progrms.->Investment program)
    ->then infor message come & click in question mark to see infor, there also system gives the AR that related to current WBS.
    Hope those would help you out.
    regards,
    Sam..

  • Possible to report between CO1 CO2 CO3 ?

    I have custom objects set up like so:
    CO1 = Event
    CO2 = Project
    CO3 = Programme
    The relationship is like this:
    Programme(CO3) m:m Project(CO2) m:m Event (CO1)
    I just want to display a report that shows a list of programmes in the first column, 2nd column shows a list of all projects related to the programmes, and 3rd column a list of all events related to the project.
    Is this possible at all? I've been trying various designs in reports and I can't get it to work.
    It works fine if I'm just reporting CO3 <> CO2 or CO2 <> CO1, but not if I try to get all 3 together.

    "Combine Similar Analysis" combines the rows, not the columns of the report, so it's not useful in this case.
    I've pretty much come to the conclusion that it can't be done due to the way the reports join objects, e.g. every object MUST be directly AND primarily linked to the active subject area dimension.

  • OBIEE generated SQL differs if it's a Physical Table or Select Table...

    Hi!
    I have some tables defined in the Physical Layer, which some are Physical Tables and others are OBIEE "views" (tables created with a Select clause).
    My problem is that the difference in the generated SQL for the same table, differs (as expected) whether it is a Physical Table or a "Select Table". And this difference originates problems in the returned data. When it a Physical Table, the final report returns the correct data, but when it is a Select Table it returns incorrect/incomplete data. The report joins this table with another table from a different Database (it is a join between Sybase IQ and SQL Server).
    This is the generated SQL in the log:
    -- Physical Table generated SQL
    select T182880."sbl_cust_acct_row_id" as c1,
    T182880."sbl_cust_acct_ext_key" as c2,
    T182880."sbl_cust_source_sys" as c3
    from
    "SGC_X_KEY_ACCOUNT" T182880
    order by c2, c3
    -- "Select Table" generated SQL
    select
         sbl_cust_acct_ext_key,
         ltrim(rtrim(sbl_cust_source_sys)) as sbl_cust_source_sys,
         sbl_cust_acct_row_id,
         sbl_cust_acct_camp_contact_row_id,
         ods_date,
         ods_batch_no,
         ods_timestamp
    from dbo.SGC_X_KEY_ACCOUNT
    As you may notice, the main difference is the use of Aliases (which I think that it has no influence in the report result) and the use of "Order By" (which I start to think that it its the main cause to return the correct data).
    Don't forget that OBIEE server is joining the data from this table, with data from another table from a differente database. Therefore, the join is made in memory (OBIEE Engine). Maybe in the OBIEE Engine the Order by is essential to guarantee a correct join...but then again, I have some other tables in the Physical Layer that are defined as "Select" and the generated SQL uses the aliases and the Order by clause...
    In order to solve my problem, I had to transform the "Select Table" into a "Physical Table". The reason it was defined as a "Select Table" was because it had a restriction in the Where Clause (which I eliminated already, althouth the performance wil be worse).
    I'm confused. Help!
    Thanks.
    FPG

    Hi FPG,
    Not sure if this is a potential issue for you at all, but I know it caused me all kinds of headaches before I figured it out. Had to do with "Features" tab Values in the database object's settings in the Physical Layer:
    Different SQL generated for physical table query vs. view object query?
    Mine had to do with SQL from View objects not being submitted as I would expect, sounds like yours has more to do with "Order By"? I believe I remembered seeing some Order By and Group By settings in the "Features" list. You might make a copy of your RPD and experiement around with setting some of those if they aren't already selected and retesting your queries with the new DB settings.
    Jeremy

  • Help needed with the MM module

    hi,
    I have a question regarding the MM and AP data......In MM module we have 0vendor and in AP also we have another 0vendor......the task is how we can connect these 2 vendors into one 0vendor object.....i appreciate ur help... thanks in advance

    hi,
    they are the same 0vendor actually,
    the same infoobject in bw share the same master data,
    rsa1->infoobjects->choose 0vendor, and right click 'maintain master data', put e.g 10000 for the max no of hits and execute, you will see 0vendor from MM and AP there. (also you can try se16 and type in /bi0/tvendor - vendor text, to view the vendor and description).
    if you want to have vendor report join from MM and AP, you can use multiprovider join MM cube and AP cube (or ods), then create query from the multiprovider.
    take a look docs multiprovider technical detail and sample, and how to create efficient queries on multiprovider
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/11291595-0501-0010-c881-e02c27261b55
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/751be690-0201-0010-5e80-f4f92fb4e4ab
    hope this helps.

  • List of PO with unparked invoices

    How to find report of purchase orders against which GR is done (fully or partially) but invoice parking is not done in SAP

    Hi,
    As mentioned there is no standard report for your requirement, write a Z report joining these (below) tables for the desired information.
    EKKO - Purchasing document header
    EKPO -  Purchasing Document: Item
    MKPF - Material document: Header
    MSEG - Material document: item
    RBKP - Invoice Header table
    RSEG - Invoice item table
    Hope this helps.
    Reetesh

  • Group By Clause Problem

    Hello every body,
    I want to make a report joining two tables one is master and other is detail. The tables have following detail;
    Master Table(FILEMASTER)
    FILEID NUMBER,(PK)
    FILENAME VARCHAR2(80),
    DESCRIPTION VARCHAR2(50)
    Detail Table(FILEDETAIL)
    FILEDETAILID NUMBER,(PK)
    FILEID NUMBER,(PK)(FK)
    RECEIVEDATE DATE,
    SENDDATE DATE,
    TO_FROM VARCHAR2(50),
    ACTION VARCHAR2(50),
    FROM_TO VARCHAR2(50),
    DESIGNATION_ID NUMBER,
    TODESIGNATION NUMBER,
    FROMDESIGNATION NUMBER
    Now there are multiple records in the detail table against each record in the master. I want to display the max(FILEDETAILID) with some other columns of DETAILED Table and MASTER table. for example I want to display FILENAME,FILEDETAILID,FILEID,RECEIVEDATE and ACTION fields I used the following query;
    select max(FILEDETAIL.FILEDETAILID), FILEDETAIL.FILEID, FILEDETAIL.RECEIVEDATE, FILEDETAIL.ACTION,FILEMASTER.FILENAME
    from FILEDETAIL, FILEMASTER
    where FILEMASTER.FILEID=FILEDETAIL.FILEID
    group by FILEDETAIL.FILEID, FILEMASTER.FILENAME, FILEDETAIL.RECEIVEDATE, FILEDETAIL.ACTION;
    The number of rows returned are 32. Which include some rows which should not be. Because total record in the master table are 29 and I want one (maximum filedetailid) record from detail table for each record of master table.
    The following query runs fine and return 29 record;
    select max(FILEDETAIL.FILEDETAILID), FILEDETAIL.FILEID, FILEMASTER.FILENAME
    from FILEDETAIL,FILEMASTER
    where filemaster.FILEID=filedetail.FILEID
    group by FILEDETAIL.FILEID,filemaster.FILENAME
    so what happens if add some more columns like FILEDETAIL.RECEIVEDATE and FILEDETAIL.ACTION from child table?
    Please tell me as soon as possible.
    Regards,
    Iftikhar Ahmad

    Try something like this one:
    select FILEDETAIL.FILEDETAILID, FILEDETAIL.FILEID, FILEDETAIL.RECEIVEDATE, FILEDETAIL.ACTION,FILEMASTER.FILENAME
    from FILEDETAIL, FILEMASTER
    where FILEMASTER.FILEID=FILEDETAIL.FILEID
    and (FILEDETAIL.FILEID, FILEDETAIL.FILEDETAILID) in
    (select FILEID, max(FILEDETAILID) from FILEDETAIL group by FILEID)
    I have not tested this.
    Martin

  • Help on pivoting in oracle 11g

    Hello,
    I trying build a dynamic report with unlimited rows and columns. So I have 3 tables. The first table has report names mean while the second and the third tables have rows and columns information respectively.
    -- table for report
    reportid reportname
    1 purchase
    2 vendor
    -- table for report rows
    rowid rowname reportid
    1 soap 1
    2 shampoo 1
    --table for report columns
    colid colname reportid
    1 liquid 1
    2 kids 1
    From those tables, I want to have a result like:
    rowname liquid 1 kids 2
    soap
    shampoo
    How do I obtain this kind of result using pivot in oracle 11g? If I can have, end users have to enter some values to the soap and liquid row, soap and kids rows,... Then I have to execute some query getting new values and column id.
    Thank you.

    user12144220  wrote:
    Hello,
    I trying build a dynamic report with unlimited rows and columns. So I have 3 tables. The first table has report names mean while the second and the third tables have rows and columns information respectively.
    -- table for report
    reportid reportname
    1 purchase
    2 vendor
    -- table for report rows
    rowid rowname reportid
    1 soap 1
    2 shampoo 1
    --table for report columns
    colid colname reportid
    1 liquid 1
    2 kids 1
    From those tables, I want to have a result like:
    rowname liquid 1 kids 2
    soap
    shampoo
    How do I obtain this kind of result using pivot in oracle 11g? If I can have, end users have to enter some values to the soap and liquid row, soap and kids rows,... Then I have to execute some query getting new values and column id.
    Thank you.hows does actual report generation know, decide, or determine
    from which table the actual columns are to be obtained?
    some,many, most reports join two or more tables.
    How does this design support joining tables required for reporting against more than 1 table?
    some,many,most reports contain computed values like SUM(), COUNT(), etc.
    Are you conceding that none of your reports will contain any of these values?

  • ABAP Looping in internal tables

    Hi,
    I am working on alv report which fetches matnr with no transaction data by passing in ekpo,mseg,ekko tables and query is working is fine and append matnr in it_final to display.
    But now I want to display matnr & matkx-makt but to get this field I have to compare with it_final-matnr to get the corresponding material description. correct values are fetched but issue is with display.
    Code attached in file below.
    Any help to sort out this would be appreciated.
    Message was edited by: Drashti Amrutia

    You could simplify you report
    - Join MARA and MAKT
    - Check non existence of records in subquery
    Sample :
    TYPES: BEGIN OF record,
              matnr TYPE mara-matnr,
              maktx TYPE makt-maktx,
            END OF record.
    DATA: itab TYPE TABLE OF record,
           lo_table TYPE REF TO cl_salv_table.
    PARAMETERS: p_mtart TYPE mara-mtart.
    START-OF-SELECTION.
       SELECT * INTO CORRESPONDING FIELDS OF TABLE itab
         FROM mara
         JOIN makt
           ON mara~matnr EQ makt~matnr
         WHERE mara~mtart EQ p_mtart
           AND makt~spras EQ sy-langu
           AND NOT EXISTS ( SELECT * FROM ekpo WHERE matnr EQ mara~matnr )
           AND NOT EXISTS ( SELECT * FROM ekbe WHERE matnr EQ mara~matnr )
           AND NOT EXISTS ( SELECT * FROM mseg WHERE matnr EQ mara~matnr ).
    END-OF-SELECTION.
       cl_salv_table=>factory(
         IMPORTING
           r_salv_table   = lo_table
         CHANGING
           t_table        = itab ).
       lo_table->display( ).
    Now execute some performance comparison with your FOR ALL ENTRIES options, and decide yourself.
    (How did you choice the tables to check EKPO & EKBE but no EBAN, no RESB ?)
    Regards,
    Raymond

Maybe you are looking for

  • Multiple SAP SIDs on single Physical machine. Windows with Oracle

    Hi I need bit information regarding this issue, I am installing 3 SIDs on single machine 1. ECC 6.0 EHP4 2. Netweaver PI. 3. Netweaver MI. Operating System : Wiindows 2008 Server. Database: Oracleg 10.2.0.4 . All done successfuly however i am not abl

  • Facebook loses descriptions when shared from iPhoto 9.4.2

    When I share individual photos or photo albums from iPhoto latest (9.4.2) to Facebook all descriptions are lost (other than album description); I know this was working a few months ago so not sure what's up now. I found a few older support threads, b

  • Create clustered table from heap table

    Hi I have a table with more than 15 million rows. I want to create a clustured table from this heap table and as you know, I can't use CTAS for clustered table I created a clustered table and started insert data to it (Using append hint and parallel

  • Setting up two wrt160n

    I have two wrt160n routers I want to setup on each side of a large building to get full coverage.  I can wire both two routers together or have them both wired directly to the incoming internet.  What is the recommended way to set this up and how do

  • FM for Infotype 0001 Texts

    Hi, can anyone provide me with some function modules for retrieving all the texts of infotype 0001? For example, the text of field KOSTL. I don't want to read directly from database tables. Thanks. /Elvez