Problem in updating delivery date in va02
hi abapers,
my requirement is to update the delivery date in va02 at header level. i have this code in sapmv45a, include is mv45afzz,
written code in move_fields_to_vbak.
when ever iam running the va02 tcode i am getting my updated delivery date , when iam saving again this exit triggering so that again delivery date is updatting.
here x is the updated date getting from z function module. iam pasing this value to below statement
vbak-vdatu = x.
so that how to stop triggering the code while saving.
hi abapers i posted the code, here the problem iam facing is that, when ever iam opening the va02 tcode updated delivery date is coming but when ia msaving again this is triggering so that first updated date is again updating .
here x is the day no comes from function module in below code , iwll compare x with following zroutern function module .
suppose .
updated date is 17.12.2010 so that i will push to vbak-vdatu = 17.12.2010. but here again date_compute_day is again calcultaing day from 17.12.2010 so that again that day which is stored is x again compared to zroutern function module .
here i aim is when ever i get updated date then it shuold come out of this application .
plese suggest .
READ TABLE XVBAP INDEX 1.
READ TABLE XVBPA WITH KEY VBELN = XVBAP-VBELN
"POSNR = XVBAP-POSNR
PARVW = 'WE'.
IF SY-SUBRC = 0.
L_KUNNR = XVBPA-KUNNR.
ENDIF.
IF SY-UZEIT+0(2) >= 15.
E_RDD = SY-DATUM + 2.
ELSE.
E_RDD = SY-DATUM + 1.
ENDIF.
IF E_RDD > VBAK-VDATU.
OP_RDD = E_RDD.
ELSE.
OP_RDD = VBAK-VDATU.
endif.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
DATE = OP_RDD
IMPORTING
DAY = X.
CALL FUNCTION 'ZROUTESCHEDULE'
EXPORTING
KUNNR = L_KUNNR
VSBED =
VSTEL = VBAP-VSTEL
ROUTE = VBAP-ROUTE
IMPORTING
ZRETURN = IT_RETURN.
READ TABLE IT_RETURN INTO WA_RETURN INDEX 1 .
IF WA_RETURN-MONDAY = 'X'.
wa_days-num = '1'.
append wa_days to it_days.
ENDIF.
IF WA_RETURN-TUESDAY = 'X'.
wa_days-num = '2'.
append wa_days to it_days.
ENDIF.
IF WA_RETURN-WEDNESDAY = 'X'.
wa_days-num = '3'.
append wa_days to it_days.
ENDIF.
IF WA_RETURN-THURSDAY = 'X'.
wa_days-num = '4'.
append wa_days to it_days.
ENDIF.
IF WA_RETURN-FRIDAY = 'X'.
wa_days-num = '5'.
append wa_days to it_days.
ENDIF.
IF WA_RETURN-SATURDAY = 'X'.
wa_days-num = '6'.
append wa_days to it_days.
ENDIF.
IF WA_RETURN-SUNDAY = 'X'.
wa_days-num = '7'.
append wa_days to it_days.
ENDIF.
SORT IT_DAYS BY NUM.
CLEAR WA_DAYS.
IF NOT IT_DAYS[] IS INITIAL. "#1 CHECKING
READ TABLE IT_DAYS INTO WA_DAYS WITH KEY NUM = X.
IF SY-SUBRC <> 0.
IF NOT IT_DAYS[] IS INITIAL.
LOOP AT IT_DAYS INTO WA_DAYS.
IF WA_DAYS-NUM GT X.
Z = ( WA_DAYS-NUM ) - X.
UP_DATE = OP_RDD + Z.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
SORT IT_DAYS BY NUM DESCENDING.
IF UP_DATE IS INITIAL.
IF NOT IT_DAYS IS INITIAL.
READ TABLE IT_DAYS INTO WA_DAYS INDEX 1.
Y = X - WA_DAYS-NUM.
UP_DATE = OP_RDD + 7 - Y.
ENDIF.
ENDIF.
VBAK-VDATU = UP_DATE.
ENDIF.
CLEAR: X,UP_DATE,Y.
ENDIF. "#1 CHECKING
ENDIF. "1 YVBAK
ENDIF.
Similar Messages
-
Problem while updating Delivery date uisng BAPI_PO_CHANGE
Hi friends,
Iam facing a problem while updating delivery date of a purchase order using the bapi BAPI_PO_CHANGE
After the bapi is getting triggered iam geting sy-subrc = 0
But in the return parameters iam getting 3 error messages so iam unable to update the delivery date..
Error meesage which iam getting are
a) Purchase order still contains faulty items
b) Enter Tax Code
c) Instance 1000001 of object type PurchaseOrder could not be changed.
How can i correct it..
Please find my code below
LOOP AT it_eket INTO wa_eket.
wa_poschedule-po_item = wa_eket-ebelp.
wa_poschedule-sched_line = wa_eket-etenr.
wa_poschedule-delivery_date = wa_eket-eindt.
APPEND wa_poschedule TO poschedule.
wa_poschedulex-po_item = wa_eket-ebelp.
wa_poschedulex-sched_line = wa_eket-etenr.
wa_poschedulex-po_itemX = 'X'.
wa_poschedulex-sched_lineX = 'X'.
wa_poschedulex-delivery_date = 'X'.
APPEND wa_poschedulex TO poschedulex.
READ TABLE IT_EKPO INTO WA_EKPO WITH KEY EBELN = WA_EKET-EBELN
EBELP = WA_EKET-EBELP.
IF SY-SUBRC = 0.
WA_POITEM-PO_ITEM = WA_EKPO-EBELP.
APPEND WA_POITEM TO POITEM.
WA_POITEMX-PO_ITEM = WA_EKPO-EBELP.
WA_POITEMX-PO_ITEMX = 'X'.
APPEND WA_POITEMX TO POITEMX.
ENDIF.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = wa_eket-ebeln
TABLES
return = t_bapiret2
POITEM = POITEM
POITEMX = POITEMX
poschedule = poschedule
poschedulex = poschedulex.
READ TABLE t_bapiret2 INTO wa_bapiret2 WITH KEY type = 'E'.
IF sy-subrc NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =.
IF sy-subrc = 0.
WRITE : 'DELIVERY DATE UPDATED'.
ENDIF.
ENDIF.
how can i correct it...
Regards
KumarHi,
Pass the following values...
POACCOUNT LIKE BAPIMEPOACCOUNT...
poaccount-TAX_CODE = ? (value)....
That should take care of the missing field.
Regards,
Madan.. -
HOW TO FIND THE REQUIRED DELIVERY DATE IN VA02
hi
HOW TO FIND THE REQUIRED DELIVERY DATE IN VA02.
i want to display this field in my report. what is the fieldname and in which table it is ?Hi Jyothsna,
There are 2 dates when you say Requested Delivery Date
1. Header level in VBAK-VDATU is the field
2. At item level it is in the schedule line. VBEP-EDATU.
The relationship between item (VBAP ) and schedule line ( VBEP )is 1 to many. But there will be mutiple schedule lines only if you are using the scheduling functionality. Also note to check for confirmed quantity (VBEP-BMENG) to be greater than 0 and use that schedule lines EDATU date as Requested delivery date.
regards,
Advait Gode. -
Function Module or BAPI to update Delivery Date (LIKP-lfdat)
Hello friends,
I have a requirement to update Delivery Date (LIKP-lfdat) , is there any Function Module or BAPI to do that? any sample codes are appreciated.
Thanks a lot!
Edited by: Qiwei Yin on Dec 11, 2008 8:50 AMhi
try this
BAPI_SALESORDER_CHANGE
hope this helps
regards
Aakash Banga -
Bapi to update delivery date in confirmation tab in purchase order me22n tc
Hi All,
I am writing a BDC to update the data in confirmation tab for puchase orders for enjoy transaction.
Please let me know how to updated delivery date in confirmation tab in purchase order(ME22N) using a bapi.
I tried using BAPI_PO_CHANGE but found no parameter related to confirmations tab. this BAPI has every thing to update like header data, item data, scheduling data..... except confirmation.
So please let me know how to update the data in confirmation.
We need to use only enjoy transaction ME22N not ME22 in BDC thats why we are looking for a BAPI.
Regards,
VenkatHi
Check the table parameter POCONFIRMATION in BAPI_PO_CHANGE
U can see the field DELIV_DATE in the structure BAPIEKES.
DELIVERY_DATE in the structure BAPIMEPOSCHEDULE as well.
Regards,
Dwaraka.S
Edited by: Dwarakanath Sankarayogi on Feb 5, 2009 7:57 AM -
Problem updating delivery date onto quotation
Hi All-
We have process, After creating sales order, will convert that into purchase req and again convert purchase req into STO's..
Problem here is, if we make change delivery date onto STO's, should be reflect onto Purchase Req and also onto sales order...
Anyone if you know the solution, please reply to my question and also let me know if there any user-exits to the sameissue...
Thanks,
SonyHi,
Pass the following values...
POACCOUNT LIKE BAPIMEPOACCOUNT...
poaccount-TAX_CODE = ? (value)....
That should take care of the missing field.
Regards,
Madan.. -
Inbound idoc for updating delivery date of purchase order
Hi All,
Our vendor sends a delivery file consisting of delivery date and quantity(could be partial) for line items of a purchase order.
I need to update the Purchase order line item with the delivery date and quantity sent from the Vendor. It should add a new confirmation line with custom confirmation category in the confirmation tab of the line item in the Purchase order.
Each time we get a delivery file we need to add a new confirmation line in the confirmation tab of the purchase order line item.
How can I get this working using inbound idoc processing? Which Idoc type should I use to solve my issue. Will ORDERSP work for my scenario?
Thank you,
Sonali.>
sonali ashi wrote:
> We have all EDI set up done for ORDERSP idoc in our system. Problem when I use this idoc type by default system is always adding confirmation catgeory 'AB' but we want our custom category to be added instead of 'AB'.
> Edited by: sonali ashi on Dec 23, 2010 9:47 PM
Confirmation category used for order acknowledgement is define in configuation. You can change that from AB to your custom condition and EDI should pickup that.
SPRO->Material Management->Purchasing->Confirmation->Define Internal Confirmation Category
>
sonali ashi wrote:
> I have also noticed that 'AB' confirmation accepts only full quantity order acknowledgement through Idoc processing.
> Manually I can add a "AB" confirmation for partial quantity but in the idoc processing it fails.
> Edited by: sonali ashi on Dec 23, 2010 9:47 PM
Check tolerance limit defined for confirmation category in 'Conformation Control' Node in SPRO at same level as above.
Regards,
Pawan. -
Updating delivery date on Purchase order line items Urgent
Hi,
I have same problem with update the Delivery date in ME22N transaction. I have used BAPI_PO_CHANGE function module. but it does not working properly. Can anybody please send the sample code.
my maild id is [email protected]
it_POSCHDULE-PO_ITEM = '10'. "PO item number
it_POSCHDULE-DELIVERY_DATE = '08/28/2007'. "changed delivery date
it_POSCHDULE-SCHED_LINE = '1'.
append it_POSCHDULE.
IT_POSCHDULEX-PO_ITEMX = 'X'. "PO item number
IT_POSCHDULEX-DELIVERY_DATE = 'X'. "changed delivery date
IT_POSCHDULEX-SCHED_LINEX = 'X'. "schedule line
append IT_POSCHDULEX.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = '4500232997'
TABLES
RETURN = return
POSCHEDULE = IT_POSCHDULE
POSCHEDULEX = IT_POSCHDULEX
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
is any more parameters i have to pass for update the delivery date
Thanks
Gopal.This is my code.
it_POSCHDULE-PO_ITEM = '00010'. "PO item number
it_POSCHDULE-DELIVERY_DATE = '08.28.2007'. "changed delivery date
it_POSCHDULE-SCHED_LINE = '0001'.
append it_POSCHDULE.
it_poschdulex-po_item = '00010'.
IT_POSCHDULEX-SCHED_LINE = '0001'.
IT_POSCHDULEX-PO_ITEMX = 'X'. "PO item number
IT_POSCHDULEX-DELIVERY_DATE = 'X'. "changed delivery date
IT_POSCHDULEX-SCHED_LINEX = 'X'. "schedule line
append IT_POSCHDULEX.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = '4500002299'
TABLES
RETURN = return
POSCHEDULE = IT_POSCHDULE
POSCHEDULEX = IT_POSCHDULEX
commit work.
and messages in RETURN are
TYPE ID NUMBER MESSAGE
I 0 Changing of PO using Enjoy BAPI unsuccessful
E MEPO 0 Purchase order still contains faulty items
I VD 345 Date 08.28.2007 period D is not valid
E 6 70 Enter a quantity
E MEPO 43 Please enter an order quantity -
How can I update the delivery date in Purchase Order after getting confirmation from vendor ? If I update item delivery date, I loose the original delivery date.
Hi,
You have to use this ASN or inbound delivery functionality for your requirement.
If you change the delivery date in PO it becomes a amended PO
Thanks
suresh -
Program to update Delivery dates of STO based on Material availability
Hi,
We have requireement in which, we need to material availability check for the materials on daily basis. This is only for Stock Trasnfer orders.
Suppose there is STO ( Stock Transfer Order) 1 that has been created for material M1 for qty 20. The scheduled delivery date for the material is tomorrow. Now I create another STO 2 today for the same material and same quantity. The scheduled delivery date that was proposed was 7 days from today.
Some one deletes the STO 1. Now Material M1 with qty 20 is avaiable to use. I then go in the system, open STO 2 in change mode. Select the line item and click on Material availability check. When I do this, the new delivery dates are proposed.
This is standard sap functionality.
We have required to do this programmatically. Is there any standard SAP program which will check all the STO's by there creation date and do the material avaibility check automatically and re-set STO dates.
Regards,
ShahuInstead of all that, you could just use stock transport scheduling agreements. MRP can update those automatically during its processing.
-
Update Delivery date programatically for inbound delivery
Hi all,
I need to update the delivery date in the inbound delivery programatically...How cna i do that?any FM available?
The field to be updated is LIKP-LFDAT.
Thanks.Check WS_DELIVERY_UPDATE , BAPI_INB_DELIVERY_SAVEREPLICA
ALso check how to change delivery date (LFDAT) in a inbound delivery -
Updating delivery date on Purchase order line items
Hi,
I am using BAPI_PO_CREATE1 to create purchase order. It is creating fine except I want the delivery date on line item to be overwritten instead of system determining from MRP view of material on each line item.
I am passing delivery date to DELIVERY_DATE parameter of POSCHEDULE table of the BAPI, but instead of taking the value that I passed it is calculating from material master.
Is there any other parameter for BAPI that I need to set ?
Please suggest me a solution.
Thanks,
Sonali.Thank You!
My problem is solved regarding DELIVERY_DATE but I am getting new problem .
I am getting error message
"Control indicators for controlling area UPS do not exist"
when I use BAPI BAPI_PO_CREATE1 . 'UPS' is the new controlling area that in which I am creating the Purchase order.
Please suggest me some solution.
Thanks,
Sonali. -
To update Delivery date in PR through IW32
Hi All,
I have a requirement to update Reqt.date whihc i achieved by writitng the logic to update RESB table in WORKORDERupdate BADI.
whenever i create new order or change a existing orders and add components and try to save. the Reqt date get changed based on the calculation i have written .. i.e . for checking the planned delivery time/days..
this was automatically getting reflected for delivery date field when PR was created.
Once PR is released and i try to add component and save, PR gets created automatically and the requirement date is also updated but Delivery date field is not gettin update in PR.
Please suggest ideas.Hi,
To modify the delivery dates as per our logic the below user exit might be suitable :-
COZF0002 Change purchase req. for externally procured component
Note :- If the component has material master record then system will take Planner delivery time into consideration for calculation of delivery time into consideration for calculation of delivery date i believe so
You can also check BADI :-IWO1_PREQ_BADI BAdI for Manipulation of P.Reqs from Orders + Networks
regrds
pushpa -
Problem with updating pricing date using BAPI_SALESORDER_CHANGE
Hi,
I need to update pricing date on sales order (but only on item level).
I have been trying to use BAPI_SALESORDER_CHANGE but nothing changes.Bapi returns no errors, ends with success.
I hoped that bapi would change not only pricing date but also recalculate things the date affected.
Here is my code:
ls_head_inx-updateflag = 'U'.
ls_bapisdls-pricing = 'C'.
ls_item-itm_number = sales_order_posnr
ls_item-price_date = new_price_date
APPEND ls_item TO lt_item.
ls_item_inx-itm_number = sales_order_posnr
ls_item_inx-updateflag = 'U'.
ls_item_inx-price_date = 'X'.
APPEND ls_item_inx TO lt_item_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = sales_order
order_header_inx = ls_head_inx
logic_switch = ls_bapisdls
TABLES
return = lt_return
order_item_in = lt_item
order_item_inx = lt_item_inx
Thanks & Regards,
MarioMario,
I run same code as yours and work for me fine, able to update ITEM pricing date.
I suppose you are using BAPI_TRANSACTION_COMMIT after your BAPI call, then only it will work.
Also note that VBKD table stores this date for header and item. In my system, there are generally only header rows in that table, but a new item row gets generated when I change the item date with the BAPI to some other date. Also, this BAPI sometimes issues a W message instead of ERROR for something like non-existing items, so carefully check your RETURN table too.
'Item 000002 does not exist' as WARNING message, so might be considering it as a success.
If nothing works, try to do the same thing for the same data using VA02 and check . If that works, BAPI will work surely.
Regards,
Diwakar -
MASS update delivery date in Sales Order
Hi All,
I want to add the field VBEP-EDATU to the MASS function object type BUS2032, table name MASSVBAP,
I've added it using the SM30 successfully, but I cannot see it under the "select fields" function in the MASS Maintenance : Sales Order screen.
My steps:
1. SM30 maintain the table MASSFLDLST
2. add the object type BUS2032, table MASSVBAP, Field name EDATU.
Please help.
TerryHi ,
Take help of ur ABAPer to change the delivery date by using BDC.We can do this easily by using recording method in BDC.
Hope it helps.
Regards,
Pasapula.
Edited by: Pasapula on Jul 23, 2009 10:15 AM
Maybe you are looking for
-
SC history update problem:PO from PR not getting displayed in SC history
Hi We are on EBP 3.5,Classic scenario. PR's get created in R/3 backend and then are manually converted into PO.This entire cycle is shown in EBP SC history tab.However for some of the SC's we are seeing status only up to PR stage(PO no. is not gettin
-
Solution Documentation: Define WMB and ATG in solution Manager
Hello, I am working on solution docuemtnation. and looking for some help to define the NOn SAP system like WMB or ATG in solution manager landscape defination. Solution Manager version is 7.1 Regards, BA
-
SPML Webservice OIM 11g - Urgent
Hi All, I would need to create/update/delete user in OIM using SPML Webservice. Please help in providing the steps to do this. I have gone through the OIM11g documentation, but haven't got any steps to deploy webservice. It would be great if someone
-
For a while now I have had a pretty big issue... Any application that needs to wake my Mac (for example, Awaken for alarms and EyeTV3 for recordings) just won't. This applies to ANY and ALL apps that need to wake it up. This obviously is a system wid
-
Hi All, Texts in rebate agreement not activated. Now i would like to enter some texts in rebare agreement. How can i activate taxts in rebate agreement. Go to > Texts > Agreement texts. Request please help on this. Thanks in advance. Regards, Govind.