Re: SQL for Gross profit Report by Customer between posting date parameters

Hi,
im new to SAP Forum, and have been provided with a task to provide the above referenced report.
The problem is that i am completely new to SAP and its 'T0. ' classification on headers in SQL.
So firstly, what does T0 stand for?
Secondly - would anyone have an idea about how i may go about producing a report which details the Gross Profit earned by Customer by Period?

Hi,
We use T0,T1 etc for tables alias name.
Select t0.docnum from ordr t0
here t0 is the alias name for table "ORDR"
Check below link.
http://www.w3schools.com/sql/sql_alias.asp
Regards
Deepak tyagi

Similar Messages

  • Base Price for Gross Profit

    Does anyone know if there is a way to update this field through the DI API?
    It is the column GrossBuyPr in the RDR1 table. I don't see anyway to update this through the DI API.
    I can update it through the UI API but this is not the best way.
    The field is called Base Price for Gross Profit in the B1 client.
    Curtis

    Hi Curtis,
    Currently that field is not exposed thru DI API.
    Vasu Natari.

  • Gross profit report

    i need to create a gross proft report can some one tell me which tables i should use to get gross profit
    i need to show
    cardcode,cardname,docnum,doctotal and grossprofit.
    can someone tell mewhich tables i should use it.

    You could get Gross Profit from Sales Analysis Report.  Anything you are not happy with it?
    Thanks,
    Gordon

  • How to see pure SQL for a Bex Report

    Hi All,
    I need to do troubleshooting on a report and I need to have the pure SQL code of the Bex report. Is there any easy way to get the SQL code for a bex report?
    I appreciate any help with points,
    Regards,

    Hi Mike.
    Try TA RSRT -> Execute and debug -> Display SQL/BIA query.
    Hope it helps.
    BR
    Stefan

  • Approval Procedures Not Working for Gross Profit %

    Dear all expert,
    I have a problem about approval procedures. I make approval procedures for gross margin less than 0% (minus margin) that will ask approval to approve it. The problem is if I input 1 item that have minus margin, approval procedures run well but if there is more than 1 item that have minus margin, approval procedures is not run...Why this is happen ? Is there any one that use that term has faced same problem too
    Thanks for your help

    Hi,
    as far as i understand you prove if there is any magin less then 0% in a marketing document. So i think you run this approval for each line and that does not work. If you enter one line, the procedure works fine. But any other line will not be proved.
    There is no standard way for approvals based on lines.
    Regards Steffen
    P.S. Of course a bit of SDK will help, but you can not solve this without.

  • Report on most recent posting date

    Hi experts,
    My report needs to show the fields profit center and its posting date.posting date should have a selection variable for the user to enter a key date.The report should show only the last posting date for every profit center before the key date.
    my doubt is that the data in the infoprovider should be compared to get the last posting date. is it possible to read the data and get the recent posting date in the customer exit for the variable on posting date.
    Please suggest the possible ways of doing this.

    Hi Krishna,
    The recent posting date for the profit centre can not be stored as a transaction data in the cube and it can not be derived in the customer exit.
    You have to add a date field as the master data attribute of profit centre and populate that from the transaction cube data to get last posting date for each profit centre.
    You can then show is as the nav attaribute of profit centre in the report.
    Thanks,
    Krishnan

  • Aging report on top of Posting Date

    Dear All,
    We have one standard report Days Overdue Analysis (0FIAR_C03_Q005). The values for ranges (0-30,31-60 and all ) are getting calculating based on Net Due date.
    But I want to calculate that based on posting date.
    Can anyone plz tell how we can do this?
    I really appreciate your input on this.
    Regards,
    Rishit

    Hi Rishit:
    I did a similar custom report for Dispute Aging at my client site using Dispute creation date for aging calculations. I also had to change the buckets to 1 - 10, 11 - 30, 31 -90 instead of the standard 1 - 30, 31 - 60, 61 - 90 etc.
    All i did was copy the standard query, change the offset values to meet my user requirements and then change the characteristic for the due date variable to use document creation date instead of net due date. That is where ever i saw net due date characteristic i simply replaced it with document created date characteristic and used the same variable that was used on net due date in the standard query. I dont recall having to create duplicate variables because if i remember right, the variables on date characteristics are usually usable across different date characteristics.You might be able to do the same with posting date instead of net due date.
    Hope this helps.
    Let me know if you need more details.
    MP.

  • Attributes for the XI field , when it is posting data to a CLOB field in DB

    Hi all..
    In my scenario XI is posting data to a database using StoredProcedure, in which one of the fields is of CLOB type  and is declared as IN parameter.
    Now what are the attributes to be used in xi for this field.
    1) is it only isInput
    2) or both isInput and isOutput
    Thanks in advance
    Manohar.

    I have already declared it as String.
    As we are StoredProc at the database side,  the fields in XI should have the attributes like isInput,isOutput and type. and in SAP help library its given as CLOB is and (input and output parameter)
    now the problem is regarding the attributes and not the data type.

  • Report to get correct posting date of material document?

    I have material number (matnr) and plant (werks). Which report do I use to get posting date of material document (mkpf-budat) ? Thanks!

    Hi,
    Use MB51 or MB5B as per your convenience.U will get the Matl Doc,Mov Type & Posting Date.
    Award points if helpful
    Thanks & Regards
    Saeed Arif

  • Expense reports with respect to posting date

    Hi Folks,
    Kindly let us know if any statndard reports are available to extract trip details with respect to the trip posting date (prrw).
    Thanks,
    Nandagopal C

    Hi Folks,
    The posting date is maintained in the table PTRV_Doc_header. Using the table we have created a  query to fetch the posted trips according to  posting date.
    Thanks,
    Nandagopal C

  • Requirements about delay and bandwith for using OTV in Nexus 7000 between two data centers separated 25 miles?

    We have two Nexus 7000, and I need use them with OTV between two data Centers separated 25 miles, but I don´t know what are the optimal values about bandwidth and delay (ms) for extended VLANs IDs (production and DAG replication) for Microsoft Exchange environment. Can somebody tell me please which are the values required for operate OTV in optimal conditions in this case? We have about 35 000 users that will use that platform of email. Thanks a lot for your comments. Regards.

    We have two Nexus 7000, and I need use them with OTV between two data Centers separated 25 miles, but I don´t know what are the optimal values about bandwidth and delay (ms) for extended VLANs IDs (production and DAG replication) for Microsoft Exchange environment. Can somebody tell me please which are the values required for operate OTV in optimal conditions in this case? We have about 35 000 users that will use that platform of email. Thanks a lot for your comments. Regards.

  • SQL to count the number of days between two dates

    Does any one have or know how to count the number of days/weeks between 2 dates.
    I have thought about using MONTHS_BETWEEN, but do not know how to make it accurate down to one day?
    Any suggestions would be appreciated.

    here are the different queries I came up with to do this, you may want to check it for perticular cases involving Sun and Sat as start and end dates.
    select to_number(to_char(to_date('21-JUL-00','dd-mon-yy'), 'ww'))
    - to_number(to_char(to_date('10-JUL-00','dd-mon-yy'), 'ww')) from dual;
    select (Next_Day(to_date('21-JUL-00','dd-mon-yy')-1, 'Sunday')
    - Next_Day(to_date('10-JUL-00','dd-mon-yy')-1, 'Sunday'))/7 from dual;
    select (Next_Day(to_date('21-JUL-00','dd-mon-yy')-6, 'Sunday')
    - Next_Day(to_date('10-JUL-00','dd-mon-yy')-6, 'Sunday'))/7 from dual;
    null

  • Need Report for gross profit anaylsis for the month

    Hi gurus,
    i need this report coding as the client has not provided me much information regarding this.selection screen.Company code ,plant code,materialcode,material type,period,fiscal year.this report format should be in alv .
    Sp pls send me the coding for this.
    Urs
    pradeep

    Check below transaction codes and it may be useful
    Customer Analysis- Sales - MC+E
    Customer Analysis- Cr. Memo - MC+I
    Deliveries-Due list - VL04
    Billing due list - VF04
    Incomplete Billing documents - MCV9
    Customer Analysis-Basic List - MCTA
    Material Analysis(SIS) - MCTC
    Sales org analysis - MCTE
    Sales org analysis-Invoiced sales - MC+2
    Material Analysis-Incoming orders - MC(E
    General- List of Outbound deliveries - VL06f
    Material Returns-Analysis - MC+M
    Material Analysis- Invoiced Sales - MC+Q
    Thanks
    Seshu

  • ORA-00933 - Error in PL/SQL for Form with report.

    Hello,
    I am getting this error :
    failed to parse SQL query:
    ORA-00933: SQL command not properly ended
    and my PL/SQL function body returning SQL is as follows:
    Declare
    q varchar2(32767);
    w varchar2(4000);
    v_total varchar2(10);
    Begin
    v_total:='TOTAL' ;
    q:=' SELECT ASR_DB_CLIENT.CLIENT_NAME, ';
    q:=q||' ASR_DB_OIS.ACCT_NAME, ';
    q:=q||' ASR_DB_OIS.ACCT_NBR, ';
    q:=q||' ASR_DB_OIS.INCEPT_DT, ';
    q:=q||' asr_db_prod.MKT_CODE, ';
    q:=q||' asr_db_prod.asst_clss, ';
    q:=q||' ASR_DB_OIS.PROD_CODE, ';
    q:=q||' ASR_DB_OIS.GROUP_CODE, ';
    q:=q||' ASR_DB_PLAN.TAX_STAT, ';
    q:=q||' asr_db_clnt_type.clnt_type_name, ';
    q:=q||' asr_db_plan_type.plan_type_name, ';
    q:=q||' ASR_DB_OIS.ACCT_type, ';
    q:=q||' ASR_DB_PLAN.CNTRY_CODE, ';
    q:=q||' ASR_DB_OIS.DISCRET_FLAG, ';
    q:=q||' ASR_DB_OIS.ASST_BAL ';
    q:=q||' FROM ASR_DB_OIS, ASR_DB_PLAN, ASR_DB_CLIENT, ASR_DB_PROD, ';
    q:=q||' asr_db_plan_type, ';
    q:=q||' asr_db_Clnt_type ';
    q:=q||' WHERE';
    q:=q||' ASR_DB_OIS.PLAN_ID = ASR_DB_PLAN.PLAN_ID and ';
    q:=q||' ASR_DB_OIS.as_of_dt = ASR_DB_PLAN.as_of_dt and ';
    q:=q||' ASR_DB_PLAN.CLIENT_ID = ASR_DB_CLIENT.CLIENT_ID and ';
    q:=q||' ASR_DB_OIS.as_of_dt = ASR_DB_CLIENT.as_of_dt and ';
    q:=q||' asr_db_ois.prod_code = asr_db_prod.prod_code and ';
    q:=q||' ASR_DB_PLAN.plan_type_code = ASR_DB_PLAN_type.plan_type_code and ';
    q:=q||' ASR_DB_Client.clnt_type_code = ASR_DB_clnt_type.clnt_type_code and ';
    q:=q||' ASR_DB_OIS.AS_OF_DT = :p99_asofdate ';
    IF :P2_ROLLUPSLEEVE = 'RU'
    THEN
    q :=q||' and ASR_DB_OIS.PARENT_OIS_ID is null ';
    Else
    q :=q||' and ASR_DB_OIS.ACCT_TYPE like "%"'||v_total||'"%" ';
    q :=q||' and ASR_DB_OIS.PARENT_OIS_ID is not null ';
    END IF;
    return q;
    end;
    Why this is failing ?
    Is "%"'||v_total||'"%" '; incorrect ?
    P2_ROLLUPSLEEVE is a radio button.
    Please advise....
    Thanks,
    HM

    And
    Also, I get the following error when I try few other things like
    q :=q||' and ASR_DB_OIS.ACCT_TYPE = '||v_total||' ';
    or
    q :=q||' and ASR_DB_OIS.ACCT_TYPE = "||v_total||" ';
    failed to parse SQL query:
    ORA-00904: "TOTAL": invalid identifier
    And
    ORA-06550: line 43, column 41: PLS-00103: Encountered the symbol "TOTAL" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between || member SUBMULTISET_ The symbol "* was inserted before "TOTAL" to continue.
    When I try
    q :=q||' and ASR_DB_OIS.ACCT_TYPE = "'TOTAL'" ';
    Any helpful tips will be much appreciated.
    Thanks,
    HM

  • [SOLVED] SQL QUERY 22 (10pm) to 06 am between two dates for shift work

    i have done a query like this
    SELECT * FROM RCV_SHIPMENT_HEADERS
    WHERE TO_CHAR(CREATION_DATE,'DD-MON-YYYY HH24:MI:SS') BETWEEN '02-FEB-2011 22:00:00' AND '03-FEB-2011 06:00:00'
    ORDER BY 1,4
    i didn't get good result please help me
    Edited by: 950688 on Aug 9, 2012 10:41 PM

    I GOT SOLUTION
    SELECT * FROM rcv_shipment_headers          
    WHERE creation_date > TO_DATE('02-FEB-2011 22','DD-MON-YYYY HH24') --02-FEB-2011 22
    AND creation_date <= TO_DATE('02-FEB-2011 06','DD-MON-YYYY HH24')+1 --02-FEB-2011 06
    THANK YOU FOR YOUR ASSISTANCE
    Edited by: 950688 on Aug 9, 2012 10:40 PM

Maybe you are looking for