Mass change of reason for rejection
I need to show a list of all the orders on teh basis of sales order date.
the user will select few from the list and click "reject".
this will popup a window showing all the reasons.
after selecting a reason the program should change
all the line items from all the sales docu with the
selected reason of rejection.
The obvious choice will be to call VA02 in BDC session in the background.
But can it be done without BDC.
I have given it a shot using FUNCTION module 'SD_SALES_DOCUMENT_READ' but I am unable to send the new reason for rejection to the fn module . Also the fn module SD_BULK_CHANGE is not helping as for as my understanding goes.
TABLES: vbap, vbak, vbakkom.
DATA: BEGIN OF xvbap OCCURS 125.
INCLUDE STRUCTURE vbapvb.
DATA: END OF xvbap.
SELECT SINGLE * FROM vbak INTO vbak
WHERE vbeln = '0000012065'.
SELECT SINGLE * FROM vbap INTO vbap
WHERE vbeln = '0000012065'.
SELECT * FROM vbap INTO TABLE xvbap
WHERE vbeln = '0000012065'.
DATA wa_vbap LIKE LINE OF xvbap.
wa_vbap-abgru = '02'.
Alter all rows in one go
MODIFY xvbap FROM wa_vbap
TRANSPORTING abgru WHERE vbeln <> space.
EXPORT xvbap TO MEMORY ID 'XVBAP'.
vbap-abgru = wa_vbap-abgru .
CALL FUNCTION 'SD_SALES_DOCUMENT_READ'
EXPORTING
document_number = vbak-vbeln
IMPORTING
evbak = vbak
evbakkom = vbakkom
EXCEPTIONS
error_message = 01.
vbap-abgru = wa_vbap-abgru .
CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
EXPORTING
synchron = 'X'
status_buffer_refresh = ''
requisition_buffer_refresh = ''
IMPORTING
EVBAK =
TABLES
EFXVBEP =
efxvbap = xvbap[]
ATTR_TAB =
EFXVBPA =
COMMIT WORK.
Hi,
Look at the table ORDER_ITEM_IN
Regards.
Similar Messages
-
Mass change with Reason for Rejection.
Dear Gurus,
Pl tell me the process to close all the open orders at one go. I have tried with the t.code MASS, but I was unable to do that.
Pl give the step by step process.
Regds,
SreehariHari,
MASS transaction is useful, If you know what fields to change and in what documents/customers/vendors/.
In your case what fields is pretty clear (VBAP-ABGRU or MASSVBAP-ABGRU )
But what documents is not clear.
Points to consider.
You can the documents that are open by just writing some query or even you can get it from SE16 using VBAP table
and you can use these document numbers and enter in the MASS T.Code.
It looks simple but the main hurdle is not all of the items in these orders are open, right...so you can't enter the reason for rejection in an item which was already delivered, or scheduled to deliver.
So Unless you know that all the items of an order are open, its not feasible to use MASS T.code.
So my suggestion is to write an ABAP program that check whether the item in an order is open or not and then change the reason for rejection using BDC code.
Thats my suggestion. I hope you understood the reason for going to an ABAP program.
Regards,
Ajai.
Reward points if helpful. -
Sales Order Change BAPI - Reason for Rejection
Hi,
I want to update reason for rejection field for a particular sales order at item level. When I am executing the BAPI "BAPI_SALESORDER_CHANGE", I am getting the error "Field header_inx-updateflag is not an input field". I did not check this field as I'm not making any change in the header part.
Please help me in resolving this issue. Let me know if I have to provide any other information.
regards,
ravikiran.Found BAPI myself...... BAPI_SALESORDER_CHANGE
-
Price Inactive during change in reason for rejection
Hi ,
I am facing an issue while providing reason for rejection in VA02.The issue is the price shows as inactive if we cancel the reason of rejection for an item(we get pop-up to select if we want to have reason of rejection or not).As per configuration if reason for rejection(vbap-abgru) has a value then statistical field(vbap-kowrr) will also have value as 'X'.So during providing reason for rejection,if user selects cancel we clear both the values(abgru as well as kowrr).But at this moment the price shows as inactive,but if we press update or save the price shows active.
Please suggest how i can have the price as active after user input,all this is done through an exit 'MV45AFZB'.This is triggered when user provides values for reason for rejection,then popup appears if it satisfies certain conditions.
JetenHi,
Look at the table ORDER_ITEM_IN
Regards. -
REASONS FOR REJECTION - SALES ORDER
I would like to know if is it possible to change a reason for rejection that had already exist and it is not selected the item 'Not relevant for Billing'. I would like to select this item, this change influence on all sales orders that have already used this reason? If not, how can I reprocess all sales order that used this reason?
Waiting your comments,
RegardsHi
Use T-Code MASS
Object Type : BUS2032 Sale orders and Execute
Regards,
Prasanna -
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. -
Error V1 322 u2013 Delete Reason for rejection
Hi,
I have the following error when I trying to delete the reason for rejection in sales order position:
Error in building the index of the table XMVERF_POS / 0000396002 / 000010
Number message V1322
Internal Error
Where 0000396002 is the sale order number and 000010 is the sales order position. Please, any suggest?
Thanks
EnriqueHi
Thanks for the reply. Sorry, the error is when i trying to change the reason for rejection in saler order position to for example "10 - Unreasonable request" to blank.
Thanks
Enrique -
Problem in adding "Reason for Rejection" using BAPI_SALESORDER_CHANGE
Hi all,
I have a requirement to stop further processing of sales order by changing the reason for rejection at line item. I have done the code and passed the reason code in the item table to BAPI. The return message says the sales order ammended successsfully, but when i go and see the sales order I dont see it getting updated. when i go to check the order its throwing an error message "Update was terminated" Could some one please help in getting this solved.
The code is shown below
Populate the headerX details
it_bapisdh1x-updateflag = 'U'.
it_bapisdh1x-sales_org = 'X'.
it_bapisdh1x-distr_chan = 'X'.
it_bapisdh1x-division = 'X'.
it_bapisdh1x-purch_no_c = 'X'.
it_bapisdh1x-cust_group = 'X'.
Populate the header details
it_bapisdh1-sales_org = '1298'.
it_bapisdh1-distr_chan = '95'.
it_bapisdh1-division = '00'.
it_bapisdh1-purch_no_c = 'Test1'.
Partner Roles
it_bapiparnr-partn_role = 'AG'.
it_bapiparnr-partn_numb = '9820000049'.
it_bapiparnr-itm_number = '00000'.
APPEND it_bapiparnr.
it_bapiparnr-partn_role = 'WE'.
it_bapiparnr-partn_numb = '9820000049'.
it_bapiparnr-itm_number = '000000'.
APPEND it_bapiparnr.
it_bapisditmx-itm_number = '00010'.
it_bapisditmx-updateflag = 'U'.
it_bapisditmx-material = 'X'.
it_bapisditmx-cust_group = 'X'.
it_bapisditmx-reason_rej = 'X'.
APPEND it_bapisditmx.
it_bapisditm-itm_number = '00010'.
it_bapisditm-material = 'YAG'.
it_bapisditm-reason_rej = '01'.
APPEND it_bapisditm.
BREAK-POINT.
salesd = '4000004045'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = salesd
order_header_in = it_bapisdh1
order_header_inx = it_bapisdh1x
behave_when_error = ' '
int_number_assignment = ' '
TABLES
order_item_in = it_bapisditm
order_item_inx = it_bapisditmx
partners = it_bapiparnr
return = it_bapiret2.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
endif.When using BAPI_SALESORDER_CHANGE, you set the fields your are updating to 'X'. In the example you gave, you are trying to change the header data, material number, etc.
Try slimming it down to:
Populate the headerX details
it_bapisdh1x-updateflag = 'U'.
it_bapisditmx-itm_number = '00010'.
it_bapisditmx-updateflag = 'U'.
it_bapisditmx-reason_rej = 'X'.
APPEND it_bapisditmx.
it_bapisditm-itm_number = '00010'.
it_bapisditm-reason_rej = '01'.
APPEND it_bapisditm.
BREAK-POINT.
salesd = '4000004045'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = salesd
order_header_in = it_bapisdh1
order_header_inx = it_bapisdh1x
behave_when_error = ' '
int_number_assignment = ' '
TABLES
order_item_in = it_bapisditm
order_item_inx = it_bapisditmx
return = it_bapiret2.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
endif.
I hope this helps,
Mark -
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,
PauloPaul, 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 -
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 PMprogram: 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 -
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.SubasreeHi 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 -
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,
SureshThis is the standard config to supress printing on the rejected item. Are you using standard programs or customised ?
-
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.SaravananHi 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. -
User Exists In Sales Order Creation Program for adding "Reason For Reject"
Hi gurus
I have following requriement
As New Sales Order created (VA01) by default or at the time of saving the sale order, perticular "Reason for Rejection" should be set to each line item.
This is then can be removed in change (VA02) with Mass change.
We need this to review the sales order / block sales order from MRP run.
Please let me know how to manage this or is there any user exist for the same.
Thanks
Sunil KHi,
As per my knowledge the automatic creation of rejection order is not possible, still will check out and know.
but for urgent use you will have to follow the manual way of changing the line items from OK to blocked for apporoval so you can achieve their not passing on to MRP.
manual way is what is described below:
You can either reject the whole sales document or individual items.
Reject all items:
If you want to reject all the items, choose Reject document in the change modus for the sales document.
The system automatically selects all the items and you can enter a reason for rejection in the following dialog box.
Enter the appropriate reason for rejection and choose Copy.
The system assigns the same reason for rejection to all the selected items.
Reject individual items:
If you only want to reject some of the items, select those items in the item overview screen and choose Edit - Fast change of... - Reason for rejection.
A dialog box appears in which you can enter the appropriate reason for rejection.
Enter the appropriate reason for rejection and choose Copy.
The system assigns the same reason for rejection to all the selected items.
Reject individual items with different reasons of rejection:
If you want to enter different reasons for rejection for the items, choose the Reason for rejection tab page from the overview screen when changing the sales document.
You can enter a different reason for rejection for each item in the Reason for rejection field.
regards,
Siddharth.
Edited by: SD on Mar 15, 2008 10:22 AM -
BAPI_SALESORDER_CHANGE to update reason for rejection of sales order item
Hi,
The FM BAPI_SALESORDER_CHANGE is not working properly as I am getting below error when try to update the reason for rejection at sales order item level.
The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?
error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010 ready for input"
Request your suggestions to avoid this error.
Thanks>
anikaushi wrote:
> Hi,
> The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?
>
> error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010 ready for input"
>
>
> Thanks
Yes, Most likely.. You can confirm this by trying to change a order without delivery and see if it goes thru (to ensure that you have passed correct parameters)...
you may have to delete the delivery (and if billing document exist, cancel it), before you can reject the line item... it would be safer to raise an error message and let the users manually delete delivery document as long as you don't have large volumes of this scenario..
Please see the SDN thread for how you can avoid this error...
Re: Cancel Sale Order after Issued Billing
Maybe you are looking for
-
Library empty: live App and content viewer
Hi, I'm facing a serious problem as our folios of elektrospieler aren"t shown in the App (which is live on the store) nor the content viewer any more. Library is updating within the branded App "Cannot actualize Library - An error occured" (Bibilioth
-
Error in MII 12.1.2 Animated Object
Hi All, I am using MII 12.1.2 and have a problem with animated or SVG object. I have downloaded animated objects for MII 12.x from below link: "https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/webcontent/uuid/70e0837a-b080-2a10-878b-f83574a09db
-
3d bevel and emboss, the other side Deboss
I am trying to make an edging on a coin/icon. I want it to look like the photo. How do I create a debossed look in Illustrator. Thanks for the help.
-
Hi, in the past, changes made in LR 1.4 where instantly visible when opening RAWs in ACR/CS3. LR2 introduces new tools that are NOT visible/usable in ACR. Will there be a new ACR for CS3 to be compatible with LR2 XMP again? Thanks!
-
when i power up my macbook it begins loudly beeping 3 times. it wont boot and the screen is white and blank. Any suggestions?It never stops beeping 3 times.