Approval Query when a Sales Return Document is Created.

Hi all,
When i post a Sale Return Document , the following Approval Query is not working when i try to work out for Approval of a New Sales Return document is Created.
Select 'TRUE' From ORDN T0 Where T0.DocStatus='O' And Datediff(dd,T0.DocDate,Getdate())=0
Is there any wrong with this Query?

Just Opened the Recently Added Return Document with all the other window closed.
Then, Tools -->Queries --> User Queries --> Approval Procedure (Category where my above sales return query is placed in the Query Manager) --> Sales Return (Return Query)
When clicking on it...the query Generator window opens with TRUE as the result.
But When adding the Return Document the REMARKS Window which always Opens for all the Approval Documents isn't Opening

Similar Messages

  • Split sales return document line items by price

    Hi,
      I need to dynamically split line items in a sales return document based on certain conditions. The added line items would have the same material and details of the first line item but would be different only on return price.
    I tried to add lines to xvbap in USEREXIT_MOVE_FIELD_TO_VBEP(in MV45AFZZ. Note that xvbap is not populated at userexit_move_field_to_vbap)but this approach does not produce the desired results. I have also tried it at userexit_save_document_prepare and at userexit_check_vbap but it's not possible to modify xvbap correctly in these exits.
    Do you know of a way to handle this?
    Regards,
    Aravind

    Hi Aravind ,
    first thing is Clear and refresh XVBAP table and add ur own data , i think in this case XVBAP will take the new data.
    Regards
    Prabhu

  • Delete SC line item when a follow-on document is created

    Hi
    We are working in a classic scenario.
    When a shopping cart is created from a catalog, it automatically creates a Purchase order in ECC.
    However, users are able to delete the line items of the cart when a follow-on document is created and vendor is ready to supply the material.
    How to restrict the users deleting the SC line items?
    PV.

    Hi Azad,
    Thanks for your quick reply.
    We are on to SRM5.0 (SRMSERVER 550 SP11).
    Even though it is standard functionality, still it is behaving the way explained.
    Tried to look for OSS notes and could not find one for my version. We may take up with SAP.
    Meanwhile, as this is causing lot of problem to business, I may have to achieve this by any means.
    Please throw your tips.
    pv

  • When processing sales returns

    hi,
    sap gurus,
    when i am processing sales returns for my client with billing reference it is taking the price which is there in billing document
    which is referenced.  but here if you press for update button then it is taking the new price which is there in the condition
    record.
    my requriment here is:
    when ever we take the reference of billing document and create a sales returns and even through we press update button the
    price which is there in the referenced billing document should not get changed.  Is there any solution for this.
    in cooy controls from billing to billing docuemnt that is RE to F2, i have mentioned D-copy pricing unchaged,  but i am not able to
    stop it if i go for update button it is considering the latest price.
    plz help me in this regard.
    regqards,
    balajit

    Hi
    To control the Pricing behaviour in Sales order & Billing document, we use "Pricing type".
    To control in Billing document, you can specify the "Pricing Type" from two places,
    - in the Copy control at item level there is a field "Pricing type'.
    - in the document at Header level & item level through the "Update" button.
    You should use any one of the two and not both.
    If you will choose the "Update" button, system will give you a pop-up with all the "Pricing Type" from where you canchoose one which is required for your purpose.
    As Mr. Lakhsmipathi has rightly said, if you will choose Pricing Type "B", then only system will take latest Price. That is the property of Pricing Type "B".
    For your requirement, it is better to go for "Copy control" and assign Pricing type "D", so that whatever price in the source document (F2) will be copied to Target document (RE).

  • Problem with Top N Query when no rows returned (takes forever)

    I have a table with 100 Million rows and I want to get the latest N records using:
    SELECT * FROM
    (SELECT * FROM tablename WHERE columnA= 'ABC' ORDER BY TIME DESC)
    WHERE rownum <= N;
    This works fine and is very fast when there are rows with columnA= 'ABC' but when there are no rows with columnA= 'ABC' the query takes forever.
    The strange things is that the inner query returns immediately when run on it's own when no rows with columnA= 'ABC' exist e.g.
    SELECT * FROM tablename WHERE columnA= 'ABC' ORDER BY TIME DESC
    So why does it take for ever for to run:
    SELECT * FROM (no rows inner query) WHERE rownum <= N;
    I have also tried using:
    SELECT * FROM
    (SELECT columnA, rank() over(ORDER BY TIME DESC) time_rank
    FROM tablename WHERE columnA='ABC')
    WHERE time_rank <= N;
    which returns instantly when there are now rows but takes much longer than the first query when there are rows.

    I cannot see a real difference:With histogram we can see a difference on the elapse when no row returned and into explain plan.
    SQL> drop table tablename
      2  /
    Table dropped.
    Elapsed: 00:00:00.03
    SQL>
    SQL> create table tablename
      2  as
      3  select sysdate - l time
      4         , decode(trunc(dbms_random.value(1,10)),1,'ABC',2,'DEF',3,'GHI',4,'JKL','MNO') as columnA
      5    from (select level l from dual connect by level <= 1000000)
      6  /
    Table created.
    Elapsed: 00:01:19.08
    SQL>
    SQL> select columnA,count(*) from tablename group by columnA
      2  /
    COL   COUNT(*)
    ABC     110806
    DEF     111557
    GHI     111409
    JKL     111030
    MNO     555198
    Elapsed: 00:00:05.05
    SQL>
    SQL> create index i1 on tablename(time)
      2  /
    Index created.
    Elapsed: 00:00:34.08
    SQL>
    SQL> create index i2 on tablename(columna)
      2  /
    Index created.
    Elapsed: 00:00:30.08
    SQL>
    SQL> exec dbms_stats.gather_table_stats(user,'TABLENAME',cascade=>true)
    PL/SQL procedure successfully completed.
    Elapsed: 00:01:18.09
    SQL>
    SQL> set autotrace on explain
    SQL> SELECT * FROM
      2  (SELECT * FROM tablename WHERE columnA= 'ABC' ORDER BY TIME DESC)
      3  WHERE rownum <= 10
      4  /
    TIME     COL
    17/09/06 ABC
    12/09/06 ABC
    08/09/06 ABC
    07/09/06 ABC
    25/08/06 ABC
    22/08/06 ABC
    13/08/06 ABC
    08/07/06 ABC
    14/06/06 ABC
    01/05/06 ABC
    10 rows selected.
    Elapsed: 00:00:01.04
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2364 Card=10 Bytes=120)
       1    0   COUNT (STOPKEY)
       2    1     VIEW (Cost=2364 Card=200000 Bytes=2400000)
       3    2       SORT (ORDER BY STOPKEY) (Cost=2364 Card=200000 Bytes=2400000)
       4    3         TABLE ACCESS (FULL) OF 'TABLENAME' (Cost=552 Card=200000 Bytes=2400000)
    SQL>
    SQL> SELECT * FROM
      2  (SELECT * FROM tablename WHERE columnA= 'MNO' ORDER BY TIME DESC)
      3  WHERE rownum <= 10
      4  /
    TIME     COL
    20/09/06 MNO
    19/09/06 MNO
    16/09/06 MNO
    14/09/06 MNO
    13/09/06 MNO
    10/09/06 MNO
    06/09/06 MNO
    05/09/06 MNO
    03/09/06 MNO
    02/09/06 MNO
    10 rows selected.
    Elapsed: 00:00:02.04
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2364 Card=10 Bytes=120)
       1    0   COUNT (STOPKEY)
       2    1     VIEW (Cost=2364 Card=200000 Bytes=2400000)
       3    2       SORT (ORDER BY STOPKEY) (Cost=2364 Card=200000 Bytes=2400000)
       4    3         TABLE ACCESS (FULL) OF 'TABLENAME' (Cost=552 Card=200000 Bytes=2400000)
    SQL>
    SQL> SELECT * FROM
      2  (SELECT * FROM tablename WHERE columnA= 'PQR' ORDER BY TIME DESC)
      3  WHERE rownum <= 10
      4  /
    no rows selected
    Elapsed: 00:00:01.01
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=2364 Card=10 Bytes=120)
       1    0   COUNT (STOPKEY)
       2    1     VIEW (Cost=2364 Card=200000 Bytes=2400000)
       3    2       SORT (ORDER BY STOPKEY) (Cost=2364 Card=200000 Bytes=2400000)
       4    3         TABLE ACCESS (FULL) OF 'TABLENAME' (Cost=552 Card=200000 Bytes=2400000)
    SQL> set autot off
    SQL>
    SQL> EXECUTE DBMS_STATS.GATHER_TABLE_STATS(user,'TABLENAME',METHOD_OPT => 'FOR COLUMNS SIZE 250 columna')
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:09.08
    SQL>
    SQL> set autotrace on explain
    SQL> SELECT * FROM
      2  (SELECT * FROM tablename WHERE columnA= 'ABC' ORDER BY TIME DESC)
      3  WHERE rownum <= 10
      4  /
    TIME     COL
    17/09/06 ABC
    12/09/06 ABC
    08/09/06 ABC
    07/09/06 ABC
    25/08/06 ABC
    22/08/06 ABC
    13/08/06 ABC
    08/07/06 ABC
    14/06/06 ABC
    01/05/06 ABC
    10 rows selected.
    Elapsed: 00:00:01.03
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1434 Card=10 Bytes=120)
       1    0   COUNT (STOPKEY)
       2    1     VIEW (Cost=1434 Card=110806 Bytes=1329672)
       3    2       SORT (ORDER BY STOPKEY) (Cost=1434 Card=110806 Bytes=1329672)
       4    3         TABLE ACCESS (FULL) OF 'TABLENAME' (Cost=552 Card=110806 Bytes=1329672)
    SQL>
    SQL> SELECT * FROM
      2  (SELECT * FROM tablename WHERE columnA= 'MNO' ORDER BY TIME DESC)
      3  WHERE rownum <= 10
      4  /
    TIME     COL
    20/09/06 MNO
    19/09/06 MNO
    16/09/06 MNO
    14/09/06 MNO
    13/09/06 MNO
    10/09/06 MNO
    06/09/06 MNO
    05/09/06 MNO
    03/09/06 MNO
    02/09/06 MNO
    10 rows selected.
    Elapsed: 00:00:02.05
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=6219 Card=10 Bytes=120)
       1    0   COUNT (STOPKEY)
       2    1     VIEW (Cost=6219 Card=555198 Bytes=6662376)
       3    2       SORT (ORDER BY STOPKEY) (Cost=6219 Card=555198 Bytes=6662376)
       4    3         TABLE ACCESS (FULL) OF 'TABLENAME' (Cost=552 Card=555198 Bytes=6662376)
    SQL>
    SQL> SELECT * FROM
      2  (SELECT * FROM tablename WHERE columnA= 'STU' ORDER BY TIME DESC)
      3  WHERE rownum <= 10
      4  /
    no rows selected
    Elapsed: 00:00:00.00
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=6 Card=1 Bytes=12)
       1    0   COUNT (STOPKEY)
       2    1     VIEW (Cost=6 Card=1 Bytes=12)
    3 2 SORT (ORDER BY STOPKEY) (Cost=6 Card=1 Bytes=12)
    4 3 TABLE ACCESS (BY INDEX ROWID) OF 'TABLENAME' (Cost=5 Card=1 Bytes=12)
    5 4 INDEX (RANGE SCAN) OF 'I2' (NON-UNIQUE) (Cost=4 Card=1)
    SQL> Nicolas.

  • Automatically Trigger a Idoc when a sale order Document is changed

    Hi Experts,
    Currently Idoc is pushed manually through sale order change transaction " VA02 " menu path
    " extras - > output - > header - > edit "
    I have done the nace settings for output types & condition records . Now that the Idoc gets triggered automatically
    when a document is created in VA01 transaction. Is there any other settings required such that the IDoc can be sent automatically once the document is changed and saved through VA02 transaction also.
    Or do I need to process the IDoc through user exit of VA02. Kindly advice how to proceed with it.
    sathish
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on Mar 17, 2011 12:48 PM

    In Partner profile(WE20), you can make one mor entry similar to  existing record with check box enable, under Message control tab.means maintain the below details, Application, message type, process code and enable the change check box.
    After making entry in WE20, you can change sales order and save the application.It may work.

  • Reverse Sales return document

    Hi,
    A return sales order was created and the credit memo is generated. now for some reason the return sales order needs to be cancelled. VF11 has reversed the credit memo and when we tried vl09 to reverse pgi it is showing error as Movement type 651 not defined in WM. the account document is reversed upon cancelling the credit memo. how to get around this. Any help is appreciated.

    Hi,
    That means no return delivery created for that just only credit memo created. So any way you have reveresed the credit memo. So now u just need to reverse the return sales order.
    For this, just go to change mode of that return sales order and select the line items and delete all the line items and then save.
    Regards
    Sankar

  • Approval procedure when update sales order that hasn't been approved

    Dear Experts
    I need some advice
    Example:
    - BP credit limit = 100
    - Create New Sales order with amount 90, doesnu2019t need trigger approval procedure, because the amount is still under limit
    - Update the SO amount to be 110, approval procedure should be triggered
    But in SBO, approval procedure is not triggered for update transaction even for SO has not yet been approved, is it a bug? Will it be improved in SBO 8.8?
    Is there any other way to trigger approval procedure in update mode? May be through store procedure or add on?
    Really appreciate your help
    Best Regards
    JeiMing

    Dear Gordon
    I understand the concept for approval will not be triggered anymore for approved SO, because once a transaction has been approved, user will not be allowed to make any changes that related with the approval. And SBO has been made restriction for that. It is good
    But, It doesn't make sense, for SO that even the approval has not been yet executed. And SBO still allow user to make any changes such as quantity and total amount. And SBO do not trigger the approval if the modification meet approval condition
    If SBO was designed not trigger approval in update mode  to avoid endless loop as what you said, why SBO still allow user to make any changes in unapproved SO ? it makes user can avoid the approval
    Don't you think this is a bug ?
    Please advice
    Best Regards
    JeiMing

  • Accounting documents not cleared - sales return being procced

    Dear Experts,
    In sales return process, material was received by Movt.651, credit memo raised, while seeing the document flow the sales return document showing as "being processed" and Accounting documents showing as "not cleared". how to clear the  accouting document.
    J.Francis

    Hi experts,
    Withholding tax was deducted, challan was prepared by j1inchln, bank challan was updated by j1inbank, checked all details are flowing in j1inmis. while printing the tds certificate  tds-basic and ecess amounts are not appearing in the certificate. Can you suggest what could be the reason.
    J.Francis

  • How can I put Service charge to receive money from customer in Sales Return

    My company will receive the Restocking fee from customer when customer want to return the goods.
    I create a Sales Return Document for sales return but I can't put the service charge to charge my customer in the sales return document.
    If there is any possibile way to create billing document for return and AR in one billing document.

    I can't put the service charge to charge my customer in the sales return document.
    Why not ??  If you dont want to show the service charge in return sale order but to show only in credit memo, this can be achieved.  Assign routine 24 in your pricing procedure against this service charge condition type.
    G. Lakshmipathi

  • Credit for returns document

    Hi,
    During returns process, we create returns sales order type ZRE which is thereby blocked for billing. Now when we remove the block from VA02 and then prepare the credit note RE via VF01, it gets created irrespective of the returns delivery and Post goods receipt.
    Now my client's requirement is that they want to create the credit note with reference to the Sales returns document only but they want the Post goods receipt to be made mandatory so that with out creating returns delivery and posting the goods receipt credit note does not get created.
    Please help me.

    Dear Pavi ranjan,
    If the business needs RE to be created with reference to the RETURNS ORDER , but it has to check for the PGR, then
    its better to make the copy control from ORDER to DELIVERY and make RE a delivery related billing.
    So that Credit memo wont be created without the PGR.
    Now if the RE is created based on the return order and CREDIT NOTE RE should not be created without PGR, then it means that business doesnt want order related billing at all.
    Please discuss with the business on this and revert back.
    Thanks & Regards,
    Hegal K Charles

  • Cancel a Goods Return/Sales Return Based on a GRPO

    Hello Experts,
    A wrong Sales Return document has been registerd, this document is based on a GRPO.
    What is the best way to supress the Sales return and cancel it's effect on the system. (SAP 2007 A Pl 41)
    Thanks in advance.
    Amin

    hi,
    Below statement is correct ????
    A wrong Sales Return document has been registerd, this document is based on a GRPO.
    What is the best way to supress the Sales return and cancel it's effect on the system. (SAP 2007 A Pl 41)
    Apply authorization to Sales Return as Read only / No authorization.
    To cancel effect of sales return,Create a delivery document,this will issue stock & correct JE postings
    created by sales return.
    Edited by: Jeyakanthan A on Jun 11, 2009 2:34 PM

  • Re-Issue Sales Return Material

    Hi,
    Can anyone help me to address the following scenario in SAP B one.
    I have Finished Item say "A". the customer returns this item after few days. For this i have to enter the Sales Return document which is standard functionality.
    This return FG item will be reused in Bill of Material of "A" with other raw material.
    Since same Item "A" will not be allowed as child item in the BOM i have created new Item called as " A   Ret" and added Sales return for this item and stock taken in Return warehouse.
    for this return item i have the price which is mentioned in the Return document.
    if i create production order as shown below
    Parent :   -
    Item A
    Child:  -
    Item A   Ret
    Child: -
    RM1
    Child: -
    RM2
    In this case to produce the Item A again i require to consider only the cost of the raw material added and not the "Item A Ret" since this item is already produce and reused in the production.
    can anyone help to manage since in standard Production module it is considering cost for the Return item also which is having major impact on the cost for the Item A.
    we are stuck with the entries for this scenario can anyone help please

    Hi Deepak,
    Thanks for your inputs.
    we are implementing in pharma company. As per your suggestion the product which we are taking in as Return material is say for example a tablet which i cannot take in as dissamble production order which is not posssible.
    So a thought to enter as separate item. I know this will affect inventory. ANy suggestion for this.
    Because after tatking this as return item we have to book Incoming Excise invoice and then Credit memo to adjust the customer balance.
    Any suggestion how to follow the steps in SAP. Your help will be very useful.

  • HUM vs. sales return

    Dear All,
    We did the following process:
    1. SO for materialA
    2. Delivery refering to the SO
    3. Pack materialA with mat_pack, based on configuration delivery item was created for mat_pack automatically.
    4. Picking (WM picking for materialA and normal picking for mat_pack)
    5. PGI (mvt 601 for materialA, mvt 621 V for mat_pack)
    6. Return sales order (RE) refering to the original SO
    7. Packing, but no automatic item determination > the packaging material was not generated
    So, mat_pack got to return. pack. special stock to customer (special stock "V").
    I checked SAP help:
    - I can create SO (order type AT) > delivery (type: LR) will be created for packaging material with item category LAN
    - no information in SAP online help or in SCM660 how sales return for HUs should be done (I haven't found anything).
    - I tried to assign item category LAN for delivery type LR for VERP items in SPRO > LE > Shipping > Deliveries > Delivery Item Category Determination - the problem is that the delivery item category LAN ( document category J ) and delivery type LR are not allowed to be linked (error message: VLCU001)
    My questions:
    - I cannot assign LAN to LR (error message). SAP can: if it creates the delivery for AT sales order type. (SAP creates LR-type delivery with LAN del. item category for packmat with SO of AT type). Why does it work so?
    - What is the standard sales return process with handling unit + returnable packaging)? I would prefer to pack the return item and get the packing item on the delivery - and reduce special stock "V" by posting GR.
    Thanks,
    Csaba
    Edited by: Csaba Szommer on Oct 27, 2008 5:20 PM
    Edited by: Csaba Szommer on Oct 27, 2008 5:23 PM
    Problem solved by one of my colleague:
    1. sales order item category TAL was copied > ZEL > "returns" indicator checked
    2. delivery item category TAL was copied > ZEL > document type "T"
    3. delivery type LR > Item requirement: 202, Default order type: DL
    4. delivery item category determination: LR VERP PACK ___ ZEL
    Edited by: Csaba Szommer on Nov 7, 2008 4:13 PM

    Normally the Sales Return Order is created with reference to the billing document of the original sales order. You can get the billing document number from the table VBRP (field VBELN).
    VBRP-AUBEL = VBAK-VBELN = VBAP-VBELN
    VBRP-AUPOS = VBAP-AUPOS
    The Sales Return Order can be fetched from the table VBAP (field VBELN)
    VBRP-VBELN = VBAP-VGBEL
    VBRP-POSNR = VBAP-VGPOS
    Hope this helps.
    Regards,
    Manoj

  • Create inspection lot in sales return

    Hi Experts,
    When doing sales return (VA01) and return delivery order (VL01N), if I need to create inspection lot for QA guys, what is required to set?
    I have tried using SAP standard inspection type 06 or 10, no inspection lot is created.
    Please help!
    Regards,
    Daniel

    Hi
    Sales return inspection mainly deals with two scenarios: stock relevant and non stock relevant. 06 inspection origin/type is for non-stock relevant and the preferred one.
    The basic setting is already explained in previous post. Now few things to done are:
    1. Activate inspection type 06 for the materials
    2. Make sure tick box is not checked for movement type 651 in QCC0Q-inspection-Insp lot creation-insp for good movement--deactivate quality
    3. in Tcode VOV6, select schedule line category DN and check that movement type maintained in 651
    4. Check your inspection plan usage is correct as per your inspection type setup.
    Now your settings are completed for customer return inspection with 06 origin. Once any return delivery is done, a non-stock relevant lot will be created in SAP.

Maybe you are looking for

  • How to allow users to mount a Samba shares on a WXP

    Through lots of reading I've managed to get an understanding of how to mount SMB shares at bootup by placing the proper edits in /etc/fstab. While having the shares of the server, running Contribs.org SME Server 6.01 (recently known as Mitel SME Serv

  • System Admin and Admin Problem...

    Can any one tells me the different between system admin and admin? It seems like system admin is messing up my file permissions, and it seems like system admin has more control than the admin (me)... I had this experience today: everytime when I crea

  • Unable to Cancel/Suspend few processes in NWA

    Hi All, I have few processes in which the Context Data is missing and I am unable to Cancel/Suspend such processes. I have remove the task from users work list for which I am trying to Cancel this processes.Can anyone please let me know how to do the

  • How can Maximum Display Time in Chart Recorder be increased to hours/days?

    Error message displayed when Recorder Display Time (X-Axis) is increased beyond ~0.25 hours, saying maximum display time has been reached.  MUST be able to display time in range of days - although since data display rate (not Dasylab sampling rate, d

  • Failed to create "ejb/collaxa/system/FinderBean" bean; exception reported i

    I am unable to invoke BPEL service from an OA framework page. I am getting following error when I am trying to Invoke. oracle.apps.fnd.framework.OAException: java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception repo