How to sets the Reason for Rejection of the Open Sales Order Lines

Hello gurus,
          I want to set the Reason for Rejection of the Open Sales Order Lines, Case is like :
If current date is exeed the Auto Void Confirmed Back Order Days(for item level) +  date (last responding from customer), then reason for rejection should be set, So i want the logic to find out the date is exceed or not.
Thanks
Anjana

Hello anjana,
   Actually your question is some confusing, but if u want to get eldest change as active sales order then logic is as follows:
1.  On base of OBJNR u have to get UDATE from JCDS table
2. then write logic as:
SORT i_jcds BY objnr stat chgnr DESCENDING.
      LOOP AT i_jcds INTO wa_jcds1.
        CLEAR lv_stat.
        lv_stat = wa_jcds1-stat.
        AT NEW objnr.
          AT NEW stat.
            CLEAR: wa_tab.
            wa_tab-objnr = wa_jcds1-objnr.
            wa_tab-stat = lv_stat.
          ENDAT.
        ENDAT.
        IF wa_jcds1-inact = 'X'.
          CLEAR lv_tabix.
          IF sy-tabix > 1.
            lv_tabix = sy-tabix - 1.
          ELSE.
            lv_tabix = 1.
          ENDIF.
          READ TABLE i_jcds INTO wa_jcds2 INDEX lv_tabix.
          IF sy-subrc = 0.
            wa_tab-chgnr = wa_jcds2-chgnr.
            wa_tab-udate = wa_jcds2-udate.
            wa_tab-utime = wa_jcds2-utime.
            APPEND wa_tab TO i_tab.
          ENDIF.
          CONTINUE.
        ELSE.
          wa_tab-chgnr = wa_jcds1-chgnr.
          wa_tab-udate = wa_jcds1-udate.
          wa_tab-utime = wa_jcds1-utime.
        ENDIF.
        AT END OF objnr .
          AT END OF stat.
            APPEND wa_tab TO i_tab.
          ENDAT.
        ENDAT.
      ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM i_tab COMPARING objnr stat.
      SORT i_tab BY objnr stat udate utime.
      DELETE ADJACENT DUPLICATES FROM i_tab COMPARING objnr.
3. now in i_tab table u'll get eldest UDATE
Hope its work for u.
Thanks & Regards,
Sumit Joshi

Similar Messages

  • BDC Program to Set Reason for Rejection in VA02 in Sales Order Change

    Hi i have a requirement i have to set "reason for rejection" in random line items of Change mode of sales order VA02.
    I have to develope BDC for this task and i have the list of all open line items which displays in VA05, can any of them can guide me how to develop BDC which will randomly select line items and set reason for rejection in VA02 Sales Order Change transaction.
    With Regards,
    S.Saravanan

    Hi Saravanan,
    As mentioned in the previous reply, you can use the FM:SD_SALESDOCUMENT_CHANGE and set the reason code for the line item like for eg:  move '03' to IT_INPUT-REASON_REJ. and also set 'U' for update flag in the header structure,
    move 'U' to HEAD_INPUT_INX-UPDATEFLAG
    this will be best and easy method.
    for this, FM,you need to pass the below parameters:
    CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
    EXPORTING    
       salesdocument                   = old_order
           order_header_in             = head_input
            order_header_inx           = head_input_inx
          TABLES
            return                      = return
           item_in                     = it_input
           item_inx                    = ii_input_inx
           schedule_in                 = schedule_input
           schedule_inx                = schedule_inputx
    declare all these structure and internal tables as per documentation of the FM.
    hope this helps.let me know if you need more information.
    Thanks,
    Srini.

  • Quotations with reason for rejection still appears in sales order creation

    Hi,
    when i create a sales order with open quotations and if i want to display the list of these quotations, the system displays even the quotations with a reason for rejection. do somebody knows how to customize it in order to have only the open quotations in the list (without reason for rejection)
    thaks a lot
    Zak

    This is the standard config to supress printing on the rejected item. Are you using standard programs or customised ?

  • How can I disable the Reason for Rejection field in VA02 line items

    Hi,
      I dont want the users to be able to change the reason for rejection field in the sales order line items. Can someone please suggest a tried and tested way of doing this
    Thanks for reading.

    Set up an auth object for the field.  In userexit field modification check the auth object and set the field to be grayed out if they don't have authority.  Users can then not change the value of the field  Sample code
    IF screen-name = 'VBAP-ABGRU'.
           AUTHORITY-CHECK OBJECT 'Z_BLK_REAS'
                   ID 'ABGRU' DUMMY.
          IF sy-subrc EQ 0.
            screen-input = 1.
          ELSE.
            screen-input = 0.
          ENDIF.
      ENDIF.

  • How To Add a new column for ZPR0 price in open sales order report ??

    HI,
    my requirement is To Add a new column for ZPR0 price in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

    k

  • To Add a new column for ZPR0 prce in open sales order report

    HI,
    my requirement is To Add a new column for ZPR0 prce in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

    HI,
    my requirement is To Add a new column for ZPR0 prce in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

  • How to enable field "reason for rejection" of view "status" in CRMD_ORDER

    Hello Everyone
    I need to activate/enable field "Reason for Rejection" in view "Status" of transaction CRMD_ORDER though a delivery document is created for the sales order.
    Can some one pls let me know where do I need to code to make field "Reason for Rejection" enabled.
    FYI, the same logic was applied for VA02 as well and the logic is written in userexit "USEREXIT_FIELD_MODIFICATION" which is working fine.
    Apprecriate your quick response.
    Thanks
    Dharma

    Hi Raj,
    Usually we use function module CRM_STATUS_UPDATE to
    change user status in document. But if you want to
    trigger next process or change from certain user status to next status interactively by the system, you can
    use Badi CRM_ORDER_STATUS (here you have after and before
    method).
    Hope this could help.
    Rgds,
    Gun.

  • REMOVE REASON FOR REJECTION FROM THE SALES ORDER

    Hi,
    When i am trying to change status of items 130+140 from net cancellation to "open"  (remove reason for rejection), saving is not possible because of this error message!
    Item 000130 :Target qty of reference: 1 PC (total referenced: 2 PC).
    Also an information message: Subsequent documents already exist for item 000140.

    Thanks for your help. =)
    I also realized that I forgot to add the SO Item # into the T_ORDER_ITEM_INX-ITM_NUMBER fields.
    But now it works.

  • How to set a condition type to inactive/statistical during sales order crea

    Hi
    There is a manual header condition (Z0L1) in one our pricing procedure which I want to set to inactive or make it statistical during sales order (doc type Z9) creation in some scenarios.
    How can I achieve?
    Can I use user exit USEREXIT_PRICING_CHECK (Program MV61AFZA) and what code should I write here. Any help would be highly appreciated
    Regards,
    Javed

    Thanks for your replies. Basically this condition type is a manual condition type which will be entered in sales order and then will be available in billing document. But when there is a return order created with reference to that billing document then I want that the manual condition is not deteremined in the return order.
    I tried by assigning a requirement to the condition type in pricing procedure but seems to be pricing requirement don't work for manual header conditions. Then I tried to assign a condition value formula and tried to set the value to zero in case of return orders but that also did not work.
    Then I also tried to apply the same logic in user exit USEREXIT_PRICING_CHECK  in the following programs
    LV69AFZZ
    MV61AFZA
    But still it did not work. Any help would be highly appreciated
    Regards
    Javed

  • How to include ZPR0 pricing condition in an exisiting open sales order

    Hi...
    i have an existing open sales order report. i wanted to include a column of ZPR0 condition in the existing ALV grid..i hav to add this ZPR0 pricing consition for intercompany STO...The delivery plant is LFA1-WERKS. how do i proceed.??? plz help me!!

    For sales order..
    vbap-werks WAS MY REFERNCE IN THIS...
    i fetched (VKORG,VTWEG) from t001w.. with that i gt KNUMH(FROM A004) table.. with the knumh(condition record number i gt KBETR AND KONWA from KONP.....
    Similarly i gta do it with an STO.
    LFA1-WERKS is the delivery plant.
    how shud i proceed in this

  • Deleting Partners from the Customer Master that are on Open Sales Orders.

    Does SAP handle removing the Partner from Open Sales Orders when a Partner is deleted in the Customer Master.  For us, this is not happening, this there some config that must be turned on for this to happen ? 
    Or do we have place in code in a User Exit in the Customer Master to check for Open Sales Orders and if so, block the Deleting of the Partner ?  If so, what User Exit should be used ?
    Looking to see how others have handled this.
    Thanks,
    David

    Hi David,
    Try this user exit.
    RFDRRANZ  User exits: Accounts Receivable Information System
    Regards,
    Vijay

  • Changing the Availability Check key in an existent Sales Order line

    Hello gurus.
    Is it possible to modify the Availability Check key (VBAP-MTVFP) of a material in an existent Sales Order line?
    I changed it in the material master, but since documents are not automatically updated, I wanted to modify this value in an existing sales order line. I am not even able to find the field in it.
    I had to delete the order line and create it again, but then I have troubles getting the exact same confirmed date that I had before.
    Any help? Thank you.

    You cant see at item level.  To see in sale order, click from top menu bar, Environment -- Availability.   Now you can see the availability check on top of the screen.
    Meanwhile, I dont think, this field will be in editable mode once partial delivery is made in which case, LSMW also wont help you.
    If your requirement is desperate to change the availability check, to me the available option is close the existing sale orders, create fresh orders after changing the availability check in material master.  On the other hand, if you want to change only in sale order, then the option is LSMW as you cant even succeeed in TCode MASS
    thanks
    G. Lakshmipathi

  • How to set property nodes for each of the multiple y-axes?

    In Labview 6i, I have set up multiple y-axes on an xy graph. I want to change certain properties of each of the 2 y-axes independently. I believe I can do this using "property node".
    However, after I have created a property node for the xy graph, I realised that there is only 1 y-axis selectable from the list of properties. How can I set the property of the other y-axis then?
    Thanks for the help!

    I believe there is a property called "active graph"... this allows you to
    select the active graph to apply the property changes to...
    Later...
    meng118230 wrote in message
    news:[email protected]..
    > In Labview 6i, I have set up multiple y-axes on an xy graph. I want to
    > change certain properties of each of the 2 y-axes independently. I
    > believe I can do this using "property node".
    >
    > However, after I have created a property node for the xy graph, I
    > realised that there is only 1 y-axis selectable from the list of
    > properties. How can I set the property of the other y-axis then?
    >
    > Thanks for the help!

  • What is the Reason for Rejected Materials from SO still reflecting in MD04.?

    Hello Expert,
    Just a question
    I know the solution about this but want to know the reason why the rejected Materials from SO still reflecting in MD04? Is it standard program issue or need to implement any exit to avoid this issue?
    I think the table VBBE was not updated properly while rejecting those material so still reflecting in MD04 but not sure.
    If anybody can explain in details it would be great for me .. Thanks

    Hi Depika,
    Refer the SAP Note 1149556 - Characteristic ... has no master data for "..."
    Hope this helps.
    Regards,
    Hari.

  • Need to know the reason for rejection

    Hi Team,
    One of my doc( year old one) was rejected with normal message like see the rules of engagement.
    Forum where my doc was rejected - Business Content and Extractors.
    As my guess this is the only one document which was exist on scn about the data sources(FI_SL_XX_TT). Even i shared  my doc along with help of  sap link(reference) as well.Am not sure whether its violated scn rule or not. if its violated please let me know the reason so that we can keep in mind while creating docs/blogs to avoid such incidents.
    Possibility to rejection:
    I heard some users voice about comments(Like thank you or thanks for sharing, well done, etc) at comment section nothing adding value to the docs/blogs. so moderators (or some one may used alert moderator) took my docs/blogs into moderation and delete the unuseful(which are not added value to content) comments. after the actions they released to public review.in that process still 2 or 3 more docs/blogs(mine) in moderation queue. Recently moderators are changed at BW forum, As pending issues at moderation queue they might be rejected.
    So thats why i asked here to know the exact reason.
    Thanks for your time.
    Raman

    H ,
    Thank you colin.
    Its surprised to see my doc now. its visible when clicked on it.
    FI-SL Generated data source 3FI_SL_XX_TT
    But its not showing at my content tab.
    Thanks

Maybe you are looking for