Change System Status of SO item dynamically based on Reason for Rejection

Hi ppl,
Our SAP user has raised a requirement as described below:
In sales order (in creation mode (VA01) or change mode (VA02)), if at the item level, the reason for rejection is mentioned, then the system status for that item should be automatically set to Technically Complete SET (TECO); and if the user removes the reason for rejection for the item, then the system status Technically Complete should be RESET automatically.
We are looking for any user-exit or BADI available which would be allow this dynamic change of system status based on the reason for rejection field. (No manual interaction for setting or resetting the system status).
Technically, the functionality is based on the below fields:
Reason for Rejection: VBAP-ABGRU
System Status: JEST-STAT
Please provide suitable inputs.
Thanks,
Dawood
Edited by: Dawood.S.Ghasletwala on Jun 29, 2009 3:14 PM

program: SAPMV45A
User exit: USEREXIT_SAVE_DOCUMENT_PREPARE.
loop at xvbap where updkz NE 'D'.
  if not xvbap-abgru is initital.
    "set your system state here.
  else.
   "reset your system state here.
  endif.
endloop.
hmmm you can as well try if you got all you need to know already in userexit: USEREXIT_CHECK_VBAP.
Edited by: Florian Kemmer on Jun 29, 2009 11:53 AM

Similar Messages

  • Changing the status of the sales order item based on reason for rejection

    Hi All,
    When a Sales order item is rejected then the status at the item level is changed as 'TECO'.When the reason for rejection is removed the status 'Teco' is reset.This status change can be achieved using the user exit 'MV45AFZZ'.But the exit does not allow re-atp calculation whenver a blocked item is release.I have use the exit 'MV45AFZB' ,through this the status change as well as re-atp calculation takes place.But the status changed(Based on reason of rejection) does not appear in the same screen.The change gets reflected only when the sakes order is saved and i open it again.
    I want the status change to appear in the same screen.I am doing my code in the form 'userexit_check_vbap' of the exit 'MV45AFZB'. Please let me know if there are any user exits or BADI's available for the same(Changing the status of the sales order item based on reason for rejection ).
    Regards,
    S.Subasree

    Hi subburamaiah
    If you want the report you can create a separate SIS report . In that take the input field  as a Reason for rejection.. and ask for the output the list of sales orders .Now when you check this user defined report you will give the reason for rejection and check what all orders got rejected on that reason for rejection.
    Regards
    Srinath

  • Sales report based on Reason for Rejection

    Hi Guru's,
    I have a requirment to get the list of sales orders( Open/ Close) report based on Reason for Rejection.
    Please makesure it should be standard not customization and using tables.
    Thanks & Regards,
    Subbu.

    Hi subburamaiah
    If you want the report you can create a separate SIS report . In that take the input field  as a Reason for rejection.. and ask for the output the list of sales orders .Now when you check this user defined report you will give the reason for rejection and check what all orders got rejected on that reason for rejection.
    Regards
    Srinath

  • How to put Reason for  rejection to line item level?

    Hi
    I am updating the Sales order at line item and putting the reason for rejection but it didnt updates the database. Below is the code.
          LOOP AT LT_VBUP1 INTO WA_VBUP1.
             ON CHANGE OF  WA_VBUP1-VBELN.
              CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
                EXPORTING
                  SALESDOCUMENT    = WA_VBUP1-VBELN
                  ORDER_HEADER_INX = LV_ORDER_HEADER_INX
                TABLES
                  RETURN           = IT_RETURN
                  ORDER_ITEM_IN    = IT_ORDER_ITEM_IN
                  ORDER_ITEM_INX   = IT_ORDER_ITEM_INX.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                EXPORTING
                  WAIT = 'X'.
              CLEAR WA_TY_SOCLOSE.
              IF SY-SUBRC EQ 0.
                LT_TY_SOCLOSE-VBELN = LV_SALESDOCUMENT.
                LT_TY_SOCLOSE-STCLOSE = 'Y'.
              ELSE.
                LT_TY_SOCLOSE-VBELN = LV_SALESDOCUMENT.
                LT_TY_SOCLOSE-STCLOSE = 'N'.
              ENDIF.
              APPEND  LT_TY_SOCLOSE.
            ENDON.
            CLEAR: WA_ORDER_ITEM_IN,WA_ORDER_ITEM_INX.
            WA_ORDER_ITEM_IN-ITM_NUMBER =  WA_VBUP1-POSNR.
            WA_ORDER_ITEM_IN-REASON_REJ = 'Y1'. " Putting order of rejection for the archiving
            WA_ORDER_ITEM_INX-ITM_NUMBER = WA_VBUP1-POSNR.
            WA_ORDER_ITEM_INX-UPDATEFLAG = 'U'.
            WA_ORDER_ITEM_INX-REASON_REJ = 'X'.
            APPEND WA_ORDER_ITEM_IN TO IT_ORDER_ITEM_IN.
            APPEND WA_ORDER_ITEM_INX TO IT_ORDER_ITEM_INX.
            CLEAR WA_VBUP1.
          ENDLOOP.
    Correct me where I am putting wrong.
    Regards
    Mohinder

    LOOP AT LT_VBUP1 INTO WA_VBUP1.
    ON CHANGE OF WA_VBUP1-VBELN.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = WA_VBUP1-VBELN
    ORDER_HEADER_INX = LV_ORDER_HEADER_INX
    TABLES
    RETURN = IT_RETURN
    ORDER_ITEM_IN = IT_ORDER_ITEM_IN
    ORDER_ITEM_INX = IT_ORDER_ITEM_INX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'.
    CLEAR WA_TY_SOCLOSE.
    IF SY-SUBRC EQ 0.
    LT_TY_SOCLOSE-VBELN = LV_SALESDOCUMENT.
    LT_TY_SOCLOSE-STCLOSE = 'Y'.
    ELSE.
    LT_TY_SOCLOSE-VBELN = LV_SALESDOCUMENT.
    LT_TY_SOCLOSE-STCLOSE = 'N'.
    ENDIF.
    APPEND LT_TY_SOCLOSE.
    ENDON.
    CLEAR: WA_ORDER_ITEM_IN,WA_ORDER_ITEM_INX.
    WA_ORDER_ITEM_IN-ITM_NUMBER = WA_VBUP1-POSNR.
    WA_ORDER_ITEM_IN-REASON_REJ = 'Y1'. " Putting order of rejection for the archiving
    WA_ORDER_ITEM_INX-ITM_NUMBER = WA_VBUP1-POSNR.
    WA_ORDER_ITEM_INX-UPDATEFLAG = 'U'.
    WA_ORDER_ITEM_INX-REASON_REJ = 'X'.
    APPEND WA_ORDER_ITEM_IN TO IT_ORDER_ITEM_IN.
    APPEND WA_ORDER_ITEM_INX TO IT_ORDER_ITEM_INX.
    ***********************************************************************<<<<do this bit here
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = WA_VBUP1-VBELN
    ORDER_HEADER_INX = LV_ORDER_HEADER_INX
    TABLES
    RETURN = IT_RETURN
    ORDER_ITEM_IN = IT_ORDER_ITEM_IN
    ORDER_ITEM_INX = IT_ORDER_ITEM_INX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'.
    CLEAR WA_VBUP1.
    ENDLOOP.

  • Changing ISA Product Catalog VIEW ITEMS Dynamically - Read COMM_PCAT_VITM

    Hi,
    I need to change the ISA Product Catalog Items Dynamically. Depending on certain criteria, after the user logs into the ISA, the items in a User VIEW needs to be filtered.
    I found that the View Items are stored in table COMM_PCAT_VITM. Also after Debugging ISA, I found that the following FUnction Module is used to read the View details : COM_PCAT_VIEW_GETDETAIL_O
    However I did not find which FM is used to read the VIew ITEMS .. that is Table COMM_PCAT_VITM.
    If I can find the FM, I can enhance this FM to filter the Items Dynamically...
    Second Question is ...whats the GUID field in the Table COMM_PCAT_VITM ?
    Thanks

    Hello WDA Portal,
    In the ISA, the catalog search and display list are done through RFC calls to TREX directly. Only the attribute names and product detail are read from theCRM system. So, if you are trying to manipulate the Catalog search and results, you have to do it in the Java layer only.
    You have to extend / modify the web flow and work with the following classes.
    <li>Catalog Business Object,
    <li>WebCatInfo,
    <li>CatalogFilterFactory,
    <li>IFilter,
    <li>WebCatItemList,
    <li>IQueryStatement,
    <li>IQuery
    <br>
    The enhancement is not for the faint hearted. You must have a development environment setup and you must have good developers with you to do this type of stuff.
    Easwar Ram
    http://www.parxlns.com

  • FM for changing system status in Service Notification

    Hi all,
    I have a tough situation here.
    To change the system status in service notification, the system use "IQS4_CHANGE_STAT_NOTIFICATION".
    CALL FUNCTION 'IQS4_CHANGE_STAT_NOTIFICATION'
      EXPORTING
        i_qmnum                  =
        i_vrgng                  =
        I_CHECK_ONLY             = ' '
        I_SPRAS                  = SY-LANGU
        I_BEZDT                  = SY-DATUM
        I_BEZUR                  = SY-UZEIT
        I_POST                   = 'X'
        I_COMMIT                 = ' '
        I_WAIT                   = ' '
        I_REFRESH_COMPLETE       = 'X'
      IMPORTING
        E_VIQMEL                 =
        E_STTXT                  =
        E_ASTXT                  =
      TABLES
        RETURN                   =
    2 main fields are required; i_qmnum and i_vrgng.
    I am able to provide i_qmnum (as this is the service notification number that i need to change).
    However, i_vrgng is a field in table (TC33-VRGNG). The values in the table does not make sense to me.
    Example. To change the status to NOPR (Put in progress), the FM uses PPM2 or PPM6 for i_vrgng. If we take a look at the table TC33, it doesn't indicate in anyway how NOPR is related to PMM2 or PMM6.
    Is there a guideline (ie, to change status to OSTS, i use a certain value in TC33-VRGNG to run the FM)?
    Please see BAPI_SERVNOT_POSTPONE & BAPI_SERVNOT_PUTINPROGRESS for a clearer picture of what I'm saying.
    Thanks,
    Earl

    Please try using FM STATUS_CHANGE_INTERN for changing System Status as i was not able to find any link between status and the field provided in FM in ur post.
    This FM directly changes system status of any object.But this FM requires System Status Value not Text.
    NOPR, NOCO etc are system texts.The main table for system status  is TJ02T which will give u the status value for the status text.
    For eg NOPR status text will have status value as 'I0070'.
    Reward Points if useful
    Edited by: Pratyasha Shishodia on Mar 14, 2008 11:07 AM

  • Change the  sales order reason for rejection for line item

    Hi,
    i want to change the  sales order reason for rejection for line item.
    iam using bapi_salesorder_change.but i unable to change the sales order.
    if possible please provide me what are the fields necessary  for changing
    sales order reason for rejection for line item.
    Regards,
    Suresh

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

  • Reason for Rejection for blocking line item for delivery

    Hi All,
    I am working on this project where based on earlier configuration, by selection reason for rejection, delivery for line item is getting blocked.
    I want to change this settings because reason for rejection should not be controlling the blockage it should be merely be the reason. Delivery should be blocked if it is blocked by selecting delivery block field in schedule line for the line item.
    How can I change the settings for the reason for rejection?

    Dear ankit.k.agarwal      
    If you assign a reason for rejection system will block the particular sales order and that sales order shouldn't be used any longer.
    This is the standard SAP behavior and the program was written like that.
    Still if you want to do , you have to go for an enhancement to change the standard program(It is not suggestible)
    In stead you add a new field in sales order(field exit)  and convince your key/core users to maintain the reason for rejection in that field .
    Co ordinate with your technical team
    Thanks&Regards
    Raghu.k

  • Reason for Rejection at Sale sorder item - Not updating the quotation

    Dear All,
    I have quotation with 100 quantity and created 2 sales orders with reference to the quotation with qunatity 60 and 40.
    Next changed the first sales order with reason for rejection at item level for 60 quantity.
    But sales order status is still complete, where it should open and may create one sale sorder with 60.
    now, issue is when ever reason for rejection in sales order, it should update the status of quotation.
    Is this standard behavior???
    Thanks in Advance.

    Hi,
    When you put the reason for rejection in the sales order, it is SAP standard to put the sales order complete. When the sales order is complete, then I believe system considers the quotation to be complete as well.
    Try the below. It might help.
    a. Delete the line item with 60 qty. Now check if the quotation has opened up. If yes, then, there you go with a solution... Else,
    b. Check the configuration for sales order document type. Check what is the marking done for completion of the quotation. Put in the right one so that quotation is not marked (or updated) as complete when the reason for rejection is put in the sales order.
    Hope this helps
    Thanks
    Mukund S

  • Reason for rejection For open line items

    Hi Experts ..
    I Have checked in Google and in scn But Not able to find exact one
    How to achieve This Issue
    Created sales order line item ---150 qnty Now delivered---100 qnty PGI As well as
    Now Clint wants to give reason For rejection For 50 qnty
    Now Generally what we are doing is Just changing the qnty in sales order change mode VA02 --100
    But some times they have so many open line items are there and not possible to change in all line items exact number
    So now i trying to give reason for rejection Line item For full 150 qnty Because Automatically 50 qnty Will be reduced in MD04
    But when i am Giving reason For rejection To line item system is giving error msg that subsequent document is being processed
    So any Enhancement shall we do To skip this 
      Thank a lot

    Dear T.W Sir Thanks a lot For your replay
    But I can not see that the excess qty (not delivered) is being deducted from MRP, when Reason for Rejection is set.
    Sir we can see ...May be it will take 5 mnts time To be updated ( MD04)
    By the By , sir you have any idea To control This pop-up Message ( In your case it may be information msg But some times We are getting Error Msg )
    so Where we can control Warning to Error like this
    or it is related to enhancement issue 

  • Reason for rejection for completed item

    Hi All,
    How to give reajon for rejection for a completed item?
    Because after delivery of an line item the reason for rejection field is coming in grey mode.
    So how to make it in change mode so that i can put reasonf for rejcetion.
    Waiting for valuable advise.
    Regards
    Ashis

    Hi Ashis,
                      Why you want to set the reason for rejection for already rejected item. Is the Document still in Being processed sate even after billing and delivery? If it is then check the completion rule in the Item category deinition. If the Table has not got update then you can run the report "SDVBUK00" to make the document complete. Please not that this works only if the status in the data base is complete. Other wise If you want to set the reason for rejection for the items that have the completed status , you have to cancel the Inovice and reverse the goods Inssue(VL09) and then set the reason for rejection. Kindly please let me know If you need any more information on this.
    Regards
    Ram Pedarla

  • Reason for rejection for a completed item

    I have a maintenance contract where in there are two line items. One line item is completed and the other one is still open.
    The business requirement is a new maintenance contract with reference to the above mentioned contract. In the new maintenance contract, the completed line item from the reference contract is also coming. Is there any way to avoid this?
    We cannot give the reason for rejection in the old contract since the line item is completed and and the field is greyed out.
    Any suggestions welcome.
    Thanks,
    Bala

    Are you creating a new maintenance contract or want to deliver the second item. If your objective, then please use the release order
    In order to create a release order for a quantity contract, proceed as follows:
    1. In the initial screen, choose Logistics -Sales and Distribution -Sales.
    2. Choose Order -Create.
    3. Enter the order type and, if necessary, the organizational data.
    The values for sales organization, for distribution channel and the division are usually proposed from user-defined parameters. Entries for the sales office and the sales group are optional.
    4. Choose Sales document   Create with reference.
    A dialog box appears.
    5. Choose the Contract tab page.
    6. Enter the contract number and the number of the partner requesting the goods (the releasing partner).
    If the partner authorization check is activated in Customizing, the system checks whether the partner is authorized to release against the contract. If the partner is not authorized to release against the contract, you cannot continue processing the release order until you enter a partner who is authorized. If several ship-to parties are defined in the contract to which the release order refers, a dialog box containing the possible ship-to parties appears. You must select the ship-to party who is to receive the goods.
    7. Choose Selection list.
    The quantities (quantity contract) or values (value contract) that have not yet been released for the contract items are displayed here.
    8. Change the quantities/values for this release. If certain contract items should not be copied in this release, deselect these items.
    9. Choose Copy.
    10. Enter the purchase order number for the customer.
    11. If you want to enter further data for the header or items, select the corresponding menu entry. If you wish to change data for an item, select the item before you choose the menu entry.
    12. Enter all the necessary data.
    13. Save your document.
    If you want to create a new contract then the old contract should have expired in which case you can copy that contract to the new one and edit the changes and save it.
    regds
    Jude

  • Reason for rejection not changed in transaction MASS

    Hi everybody,
         I'm trying to update a sales order item with a reason for rejection (field VBAP-ABGRU) in transaction MASS but it doesn't work. I took a look in SAP notes and found similar problems but these notes (specially note 390105) don't apply to our version (4.7 support package 22). Before opening a note in SAP I would like to have someone's opinion about the issue.
         Thanks,
    Paulo

    Paul, it doesn't work because the field is not updated despite success message issued when the transaction is finished (I tried to change the field content from blank to other value). The field is available in transaction MASS and I have successfully tested it in another system (release 6.00). But now I found a note (regarding to the same problem in another field - MASSSDPOSVBKD-KURRF) that can be helpful. It's note 777746 and it applies to our release. So, I'm waiting for the basis team to implement it to see what happens.
    Thank you,
    Paulo

  • 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.

  • Short dump while marking Sales order Line item for Reason for rejection

    Hi All,
    Need your help in the following regards.
    In system Client is creating a sales order with 100+ line items and for each line item a project gets created automatically at the background as it is a make to order senario. Now what is happening is customer suddenly call's and tells to stop few line items tempororily till he gives go-ahead, so our client is marking it for reason for rejection, while doing this the network created for a project is getting deleted. Once we receive conformation for that line item agin to proceed we are removing the reason for rejection and it was suppose to create a new network, but system is taking huge time to do this and going for a shout dump saying time-out error, in few cases it is creating the network.
    Need your valuable inputs how we can address this issue to avoid the short dump. We have increased the buffer time to 30min also.
    Thanks
    regards
    kishore

    Hi,
    You can easily list out sales order that have been assigned reason for rejection..simple extract of table VBAP-ABGRU = not blank.
    This report should list out the sales order number along with some more details, as required.
    Now the report should allow to choose the documents i.e. like giving checkboxes in the left most side and once the user chooses the sales documents he wants to get processed--> the program should call change Sales Order FM or BAPI. Execute this in background.
    Regards,
    Raghu.

Maybe you are looking for