Change order quantity in VA01
Hi gurus!
I'd like to modify the value of 'order quantity' field while creating a sales order with VA01. I see that this value is maintained in several tables, not only xvbap. Could you please tell me the most indicated place (userexit), to insert my code and which tables must I update in order that new value is available within the following sales creation process?
thanks a lot.
Hi Hernandez,
You can use this user exits in program MV45AFZZ.
USEREXIT_MOVE_FIELD_TO_VBAP
USEREXIT_SAVE_DOCUMENT
and change internal table XVBAP.
Hope this will help.
Regards,
Ferry Lianto
Please reward points if helpful.
Similar Messages
-
Hi all,
In our system sales representatives creates sales orders. And cause of our sector order item quantities always changes. For example order item includes 10 quantity but after creation of order customer changes the quantity to 5 but at this time the 3 quantity of order has produced. For real order quantity we have to change the quantity as 5 and 3 of them produced. We have to see order balance as 2 and we hace to close the order but in current system we see 7 and we never be able to close the order.
Has it negative effects to the system or documents to change the quantity from 10 to 5 after 3 of them produced and delivered to the storage ? If it has no effects i will change the quantity and set the abgru field 99 (closed) to order line automatically.
Thanks,Yes KALYAN CH Thanks,
The flow as below,
- Create order. Order item quantity is 10.
- Produced 3 of order item.
- Then customer returns as changing quantity for 5.
- If i don't change the order balance seems 7, if i change it seems 2.
The problem is the order must be closed as 5, after produced 5 of them. But in current system it never closes because it has 5 balance cause of 10.
And a new question can i sign Rejection at all time. For example i produced 5 of order item as 10 quantity. And i dont continue to produce 5. Have i change order quantity or it needs no change for quantity?
Thanks, -
Change order quantity in sales order
Hi,
I have a sales order created. Now i want to change the Order qty depending on certain conditions through an ABAP Program. Can any one tell me how to change it? I tried bapi SD_SALESDOCUMENT_CHANGE ..but couldn't succeed. I tried passing field to req_qty in table ITEMS_EX and update flag in table ITEM_INX along with item number.please correct me where i went wrong?
Thanks,
Bhaskar.i stand in awe ... is such a thing legal in your country? you create a sales-order, probably sent a confirmation document (including quantities, prices and so on) to the customer and then you change the quantity according to some constructed logic?
would you care to describe what the business-process exactly demands at this stage? -
More that four decimals in Order quantity in VA01
In sales order i want to add four digits after the decimals. For example the order quantity is 23.2345 Kgs i should be able to enter, but system at present is allowing 23.456 Kg. If i enter 23.2345 KG the system is giving error that iput data format....
please adviseThis is not possible in standard, only possible by Abap programmers, But that would be risky as it has to be applicable to all the modules integrating.
Regards,
sudhir -
I need to make the ordered quantity field (RV45A-KWMENG) disabled in 'VA02'
Hi SAP COMMUNITY,
I have urgent requirement for which i did'nt worked before on this requirement. I hope you people can help me in this regerd.
My requirement is, I need to make the ordered quantity field (RV45A-KWMENG) disabled in the transaction code is VA01/VA02. User should not be able to edit this ordered quantity in VA01/VA02 Transaction.
Here the condition to disable this field ordered quantity is IF ORDER TYPE EQUAL TO OR AND IF ITEM CATEGORY EQUAL TO TANN in technical IF VBAK-AUART EQ OR AND IF VBAP-PSTYV EQ TANN then only the field (RV45A-KWMENG) ordered quantity should be disabled in that transaction VA01/VA02.
Correct me if iam wrong, I think in the program SAPMV45A and do we need to include any screen number which i have seen in VA02 is 4001. Do we need to write a code in Include MV45AFZZ (FORM USEREXIT_FIELD_MODIFICATION.). But i don't know what code i need to write here to disable this field.
I had searched in the forum some example code so please suggest me whether i can use this and if i can use this please suggest me how to write the condition and insert the code in that FORM. If this sample code is wrong then please suggest me what exact code should be given. Can anyone help. Quick response will be much appreciated.
Looking forward for ur prompt replies.As per my understanding , To disable the field RV45A-KWMENG based on the condition for Transaction VA01/VA02.
The conditions which i need to check is Order Type and item category.
I understand that this is the code which i need to insert for disabling the field but i have a question here, where is the condition here and how the system understand for this field RV45A-KWMENG it has to disable. I think we need give the condition as if RV45A-KWMENG....... Another one if iam not wrong we need check that it has to be done in VA01 and VA02 then only this condition should be executed.
IF VBAK-AUART EQ 'XXX' OR VBAP-PSTYV EQ TANN .
IF SCREEN-NAME = 'XXX'.
SCREEN-ACTIVE = 0
ENDIF.
ENDIF.
Please suggest me the better way how can i do it in the coding.
Awaiting for ur prompt reply. -
When processing a return, my users are creating the return using the full qty of the original sale. Then when processing the return delivery, they're adjusting for the actual returned amount. Wouldn't it be better to adjust for the actual returned qty on the return sales order and let the delivery/invoice qty's flow from there?
When you do return sales order with ref. to orginal bill inv. no.it will copy actual details from it,
You can change order quantity for quantity returned in order itself.
Whether order quantity is editable in sales order ? -
Unable to change the order quantity value during save of sales order
Hi Experts,
There is a need to change the order quantity value, based on some conditions, when pressed 'ENTER' or during 'SAVE' of the sales order (VA01, VA02).
We are trying to change the order quantity value (KWMENG) in table XVBAP in the subroutines userexit_field_modification, userexit_save_document and userexit_save_document_prepare of the user exit 'MV45AFZZ'. But the change is not replicated to field on GUI.
The order quantity value can be changed in subroutine 'userexit_move_field_to_vbap', but the subroutine is not getting triggered when user changes only the order quantity on screen.
Please help us in resolving this issue.
Regards,
SantoshThanks for your time guys. The issue is resolved.
SAP is not triggering the vbap user exit as the order quantity on screen is in structure RV45A.
There are two ways of resolving the issue.
1. Implement the SAP note #513342 - Quantity change and USEREXIT_MOVE_FIELD_TO_VBAP. But, it is SAP modification note.
2. Write the code in VBEP exit of MV45AFZZ. This user exit is called whenever the order quantity is changed. But, it is called multiple times in some cases. Hence, need to write code to limit our code execution only once e.g. maintain a global table with our quantity & uom. Check when the quantity and uom in our table is same as quantity on screen. If not, exit from user-exit.
Edited by: Santosh Kacham on Nov 11, 2011 6:37 AM -
Order quantity error in VA01 BDC please some one reply
i have done a bdc f.m for va01 with the items in import table but in all screen mode when the values for order quantity is entered it shows an information error to enter order quantity but as far as i know the coding is right...
my code is..
FUNCTION zfm_sales_ord_create2.
""Local Interface:
*" IMPORTING
*" VALUE(I_HEADER_DETAILS) LIKE ZVA01HEAD STRUCTURE ZVA01HEAD
*" EXPORTING
*" VALUE(SUBRC) LIKE SYST-SUBRC
*" TABLES
*" MESSTAB STRUCTURE BDCMSGCOLL OPTIONAL
*" IT_ITEM_DETAILS STRUCTURE ZVA01ITEM
DATA : ctu LIKE apqi-putactive VALUE 'X',
mode LIKE apqi-putactive VALUE 'A',
update LIKE apqi-putactive VALUE 'L',
group LIKE apqi-groupid ,
user LIKE apqi-userid ,
keep LIKE apqi-qerase ,
holddate LIKE apqi-startdate ,
nodata LIKE apqi-putactive VALUE '',
wa_item_details LIKE LINE OF it_item_details..
subrc = 0.
DATA : val TYPE i,
val = 1.
PERFORM bdc_nodata USING nodata.
PERFORM open_group USING group user keep holddate ctu.
PERFORM bdc_dynpro USING 'SAPMV45A' '0101'.
PERFORM bdc_field USING 'BDC_CURSOR'
'VBAK-AUART'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'VBAK-AUART'
i_header_details-order_type.
PERFORM bdc_field USING 'VBAK-VKORG'
i_header_details-sales_org.
PERFORM bdc_field USING 'VBAK-VTWEG'
i_header_details-distri_chann.
PERFORM bdc_field USING 'VBAK-SPART'
i_header_details-division.
LOOP AT it_item_details INTO wa_item_details .
IF val = 1.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=POAN'.
PERFORM bdc_field USING 'KUAGV-KUNNR'
i_header_details-sold_to_party.
PERFORM bdc_field USING 'KUWEV-KUNNR'
i_header_details-ship_to_party.
PERFORM bdc_field USING 'RV45A-KETDAT'
i_header_details-req_deliv_date.
PERFORM bdc_field USING 'RV45A-KPRGBZ'
i_header_details-delivery_date_type.
*perform bdc_field using 'VBKD-PRSDT'
PRSDT_009.
*perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(01)'.
PERFORM bdc_field USING 'RV45A-MABNR(01)'
wa_item_details-material_no.
perform bdc_field using 'RV45A-KWMENG(01)'
wa_item_details-order_quantity.
'22' .
ELSE.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=POAN'.
*perform bdc_field using 'KUAGV-KUNNR'
KUNNR_012.
*perform bdc_field using 'KUWEV-KUNNR'
KUNNR_013.
*perform bdc_field using 'RV45A-KETDAT'
KETDAT_014.
*perform bdc_field using 'RV45A-KPRGBZ'
KPRGBZ_015.
*perform bdc_field using 'VBKD-PRSDT'
PRSDT_016.
*perform bdc_field using 'VBKD-ZTERM'
ZTERM_017.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV45A-KWMENG(02)'.
PERFORM bdc_field USING 'RV45A-MABNR(02)'
wa_item_details-material_no.
**perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(02)'.
perform bdc_field using 'RV45A-KWMENG(02)'
wa_item_details-order_quantity.
'22'.
ENDIF.
val = val + 1.
ENDLOOP.
PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
*perform bdc_field using 'KUAGV-KUNNR'
KUNNR_020.
*perform bdc_field using 'KUWEV-KUNNR'
KUNNR_021.
*perform bdc_field using 'RV45A-KETDAT'
KETDAT_022.
*perform bdc_field using 'RV45A-KPRGBZ'
KPRGBZ_023.
*perform bdc_field using 'VBKD-PRSDT'
PRSDT_024.
*perform bdc_field using 'VBKD-ZTERM'
ZTERM_025.
*perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(02)'.
*perform bdc_field using 'RV45A-MABNR(02)'
MABNR_02_026.
*perform bdc_field using 'RV45A-KWMENG(02)'
KWMENG_02_027.
PERFORM bdc_transaction TABLES messtab
USING 'VA01'
ctu
mode
update.
IF sy-subrc <> 0.
subrc = sy-subrc.
EXIT.
ENDIF.
PERFORM close_group USING ctu.
ENDFUNCTION.
if i hard code that value '22' for RV45A-KWMENG its working fine, with out any error but when
get it from the WA it shows an error....Hi,
Check field length of 'RV45A-KWMENG and wa_item_details-order_quantity. Try changing wa_item_details-order_quantity to type CHAR. Alternatively use BAPI_SALESORDER_CREATE*
Cheers.
...Reward if useful. -
Changing of production order quantity not allowed
Dear Gurus
My client is converting production order from planned order .These planned orders have been generated from sales orders during mrp run. What my; client wants is that the production order quantity generated from the planned orders nobody can change that in either co02 or in co01. How can this be possible?
Regards
Sandip SarkarDear Sandeep,
u can do this Via SHD0
Plz find the below link & make the required field as output only
[https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/transactionVariant-AStepbyStepGuidefor+Creation]
Regards
kumar -
Delivery Order Quantity Change
Hi ,
I seem to be facing a very strange problem where in i am unable to change the delivery Order Quantity (lips_lfimg) in the Customer Exit MV50AFZ1 for VL01N Tcode.
I am trying to change the Quantity in the Subroutine USEREXIT_SAVE_DOCUMENT_PREPARE.
I do not know if the system does not allow you to change the Quantity .
I checked all the threads available but none of then seem to be helping me out on this.
Has anyone ever tried updating the Quantity in VL01N Tcode . If yes pls help me as to where the code should be written for the same.
Presently working on an 4.7 SAP system.Check Delivery Qty change at the creation and change of Delivery
Update all the fields as said. -
How to change Service order quantity using BAPI/FM
Hi All,
Can any body tell me how to change the Service Order quantity (in IW32) using a FM or a BAPI.
I tried using the BAPI: BAPI_ALM_ORDER_MAINTAIN but I am unable to change the quantity. May be I might be missing some parameter. If anybody has done this please let me know the parameters that needs to be passed or if there is any other way out.
Points will be rewarded to useful answers!!
Thanks,
Susanth.Hi!
I have used this BAPI.read the documentation properly and after calling this bapi call BAPI_TRANSACTION_COMMIT then only expected results com n get saved.
for ex:
call function 'BAPI_ALM_ORDER_MAINTAIN'
tables
it_methods = itab_methods
it_header = itab_header
IT_HEADER_UP =
it_header_srv = itab_header_srv
IT_HEADER_SRV_UP =
it_userstatus = itab_userstatus
it_partner = itab_partner
IT_PARTNER_UP =
it_operation = itab_operation
IT_OPERATION_UP =
it_relation = itab_relation
IT_RELATION_UP =
it_component = itab_component
IT_COMPONENT_UP =
it_objectlist = itab_objectlist
IT_OBJECTLIST_UP =
it_olist_relation = itab_olist_relation
it_text = itab_text
it_text_lines = it_text_lines
it_srule = itab_srule
IT_SRULE_UP =
it_tasklists = itab_tasklists
extension_in = itab_extension_in
return = itab_return
et_numbers = itab_et_numbers
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
IMPORTING
RETURN =
reward points if helpful. -
Help required in BAPI_ALM_ORDER_MAINFm to change the service order quantity
Hi,
Can any one tell me Fm To change the srvice order quantity??
I am using fmHi,
Can any one tell me Fm To change the srvice order quantity??
I am using fm -
Which enhancement to use change purchase order quantity ?
Hi all,
can u tell me
1) what is the enhancement to use to change the purchase order quantity with reference to the change in production order quantity?
Regards,
Naveen
Moderator Message: SEARCH!
Edited by: kishan P on Nov 29, 2010 11:09 AMHello,
In this case you should use the message PORDCH and BAPI method BAPI_PO_CHANGE but only exist as of release 4.7.
Function module BAPI_IDOC_INPUT1
Idoc Type PORDCH01
Message Type PORDCH
So check carefully the following OSS notes:
[Notes 589066 - BAPI_PO_CHANGE: Incorrect account assignment to network |https://service.sap.com/sap/support/notes/589066] (not be fooled by the description)
[ Notes 197958 - BAPIs for purchase orders - Missing Functions|https://service.sap.com/sap/support/notes/197958]
Regards,
Andrea
Edited by: Andrea Olivieri on Sep 3, 2009 10:17 AM -
Order Quantity in BAPI_Salesorder_change becomes zero when changed.
Hi,
As a requirement , I have to delete line item on a sales order and create one line item with the same data except delivering plant. I am using BAPI_SALESORDER_CHANGE.
I need to change ship to party and line item data. Ship to party and other line item details updates fine but order quantity remains zero.
Please find below used code.
{ Code
wa_order_item_in-itm_number = wa_vbap-posnr.
wa_order_item_in-plant = wa_vbap-werks.
wa_order_item_in-material = wa_vbap-matnr.
wa_order_item_in-target_qty = '1'.
clear wa_order_item_in.
*--Adding second line item
wa_order_item_in-plant = pa_werks.
wa_order_item_in-material = wa_vbap-matnr.
wa_order_item_in-target_qty = '1'.
wa_order_item_inx-itm_number = wa_vbap-posnr.
wa_order_item_inx-updateflag = c_delete.
clear wa_order_item_inx.
wa_order_item_inx-itm_number = wa_vbap-posnr.
wa_order_item_inx-updateflag = 'I'.
wa_order_item_inx-material = c_x.
wa_order_item_inx-plant = c_x.
wa_order_item_inx-target_qty = c_x.
wa_order_item_inx-target_qu = c_x.
append wa_order_item_inx to it_order_item_inx.
clear wa_order_item_inx.
-Partner function changes--
concatenate c_p wa_vbap-werks into lv_garage1.
wa_partnerchanges-updateflag = c_update.
wa_partnerchanges-document = wa_vbap-vbeln.
wa_partnerchanges-p_numb_new = lv_garage.
wa_partnerchanges-partn_role = c_shiptoparty.
wa_partnerchanges-p_numb_old = lv_garage1.
append wa_partnerchanges to lt_partnerchanges.
clear wa_partnerchanges.
Schedule Lines--
wa_schedule_lines-itm_number = wa_vbap-posnr.
wa_schedule_lines-req_qty = wa_vbap-kwmeng.
wa_schedule_lines-sched_line = '0001'.
append wa_schedule_lines to lt_schedule_lines.
clear wa_schedule_lines.
wa_schedule_linesx-itm_number = wa_vbap-posnr.
wa_schedule_linesx-updateflag = 'U'.
wa_schedule_linesx-req_qty = 'X'.
append wa_schedule_linesx to lt_schedule_linesx.
clear wa_schedule_linesx.
Thanks
Mohinder
Edited by: Mohinder Singh Chauhan on Dec 9, 2009 5:27 AM
Edited by: Mohinder Singh Chauhan on Dec 9, 2009 5:28 AMHi Mohinder,
Try giving schdule line number value also in wa_schedule_linesx sctructure.
wa_order_item_in-itm_number = wa_vbap-posnr.
wa_order_item_in-plant = wa_vbap-werks.
wa_order_item_in-material = wa_vbap-matnr.
wa_order_item_in-target_qty = '1'.
clear wa_order_item_in.
*--Adding second line item
wa_order_item_in-plant = pa_werks.
wa_order_item_in-material = wa_vbap-matnr.
wa_order_item_in-target_qty = '1'.
wa_order_item_inx-itm_number = wa_vbap-posnr.
wa_order_item_inx-updateflag = c_delete.
clear wa_order_item_inx.
wa_order_item_inx-itm_number = wa_vbap-posnr.
wa_order_item_inx-updateflag = 'I'.
wa_order_item_inx-material = c_x.
wa_order_item_inx-plant = c_x.
wa_order_item_inx-target_qty = c_x.
wa_order_item_inx-target_qu = c_x.
append wa_order_item_inx to it_order_item_inx.
clear wa_order_item_inx.
---Partner function changes-------------------------------------------
concatenate c_p wa_vbap-werks into lv_garage1.
wa_partnerchanges-updateflag = c_update.
wa_partnerchanges-document = wa_vbap-vbeln.
wa_partnerchanges-p_numb_new = lv_garage.
wa_partnerchanges-partn_role = c_shiptoparty.
wa_partnerchanges-p_numb_old = lv_garage1.
append wa_partnerchanges to lt_partnerchanges.
clear wa_partnerchanges.
--Schedule Lines------------------------------------------------------
wa_schedule_lines-itm_number = wa_vbap-posnr.
wa_schedule_lines-req_qty = wa_vbap-kwmeng.
wa_schedule_lines-sched_line = '0001'.
append wa_schedule_lines to lt_schedule_lines.
clear wa_schedule_lines.
wa_schedule_linesx-itm_number = wa_vbap-posnr.
wa_schedule_linesx-sched_line = '0001'. " Add this line and check
wa_schedule_linesx-updateflag = 'U'.
wa_schedule_linesx-req_qty = 'X'.
append wa_schedule_linesx to lt_schedule_linesx.
clear wa_schedule_linesx.
Regards,
Swarna Munukoti -
How to Change Delivery quantity after creating Transfer order
Hi
I created a transfer order for my delivery with LT03. There is already non-ordered quantity in my delivery.
delivery quantity is 5 but transfer order's quantity is 4.
i want to change my delivery quantity without confirming the transfer order.
Is it possible
is there any customization or function for that work ?
in se37, i tried BAPI_OUTB_DELIVERY_CHANGE. it returned the error "there is an unconfirmed transfer order"
Moved to SD froum from LE forum at the request of OP
Edited by: Csaba Szommer on Apr 18, 2011 1:21 PMIf you set "Copy WM quantity as delivery quantity into delivery" for your WH/wm-mvt combination in WM/Shipping interface, the delivery quantity will be always adjusted to the picking quantity ("1" in field V_T3333-WMMUE).
The same can be achieved manually as it was told you by Andrzej.
There's no separate function modul to do this.
When system is processing FCODE "KOMU_T" (manual process) the delivery quantity will be changed in include MV50AF0F_FCODE_KOMU in internal structure "lips":
IF xlips-pikmg > xlips-lfimg OR likpd-kzebu IS INITIAL.
PERFORM check_and_set_pikmg_lfimg CHANGING lf_subrc.
CHECK lf_subrc = 0.
ENDIF.
But this is one thing, there's some preparation before this step and and the change in "lips" will cause the change of "xlips" later on, etc.
So, it is related to several programs (includes) and forms.
Please contact your ABAPer if you are not familiar with technical things.
Edited by: Csaba Szommer on Apr 18, 2011 10:55 PM
Maybe you are looking for
-
How do I create a group in my contacts list?
I have a 4s and want to create a group in my contacts list and can't figure it out. Someone please help and tell me how I can do this. Thanks!
-
Non PeopleSoft data into EPM Warehouse
I've probably placed this question in the wrong forum and for that I apologize. I'm brand new to PeopleSoft in general and EPM in particular. We are in the process of installing the app to begin pulling data into EPM from our PeopleSoft module. But o
-
How do I enable the autofill/autocomplete on MAC please?
It used to work on hotmail login page but somehow this function has been disable and I couldn't get it work again. When I type the first letter of my email add it used to have a drop down option of all of the emails address I key in before, but now i
-
Hi I Created a List in SharePoint 2010 and my requirement is how i can change the color of list column so that it can display on list as a web part and its possible any out of box web part ?
-
Xcode for Mac OS X 10.6.8
Hi! I need to download the xcode for my system version (Mac OS X 10.6.8) and I can´t... CXcould anybody help me please? Thanks!