‎2005 Nov 01 12:45 AM
BAPI_OUTB_DELIVERY_CHANGE does not update delivery document. I need to update delivery quantity with the actual pick quantity right after picking is done.
Would definitely award points to speedy responses.
Thank You
‎2005 Nov 01 8:31 PM
Hello
You can try to update the quantity in program MV50AFZ1
in form userexit_save_document_prepare.
Let me know if you need any help on this
Regards
Shounak
‎2005 Nov 01 1:37 AM
Hello
Have you tried implementing the BADI LE_SHP_DELIVERY_PROC.
This BADI has several methods like "FILL_DELIVERY_ITEM" and "CHANGE_DELIVERY_ITEM" which maybe useful for your case.
Regards
Shounak
‎2005 Nov 01 3:49 PM
Thank You for your input. To answer your question.
No I haven't and I really don't know about it. I would like to know how to proceed on this BADi implementation your inputs would definitely be appreciated.
Regards
Message was edited by: Lorie Mouklas
‎2005 Nov 01 4:11 PM
Hi Lorie,
Regarding the BADI, go the Transaction SE18 Initial Definition Maintenance Screen and check whether that BADI is already defined in your system or not. If its not defined, then you have to define it and then later on you have to Implement the BADI using the Transaction SE19 and mention the interface and class method you are using. Click the Class Method tab and it will take you to the class builder. Provide your logic program in here between method and endmethod, and you are all set to use that BADI.
Let me know if you need further more help.
Thanks and Regards,
-Ash Patel
‎2005 Nov 01 4:28 PM
‎2005 Nov 01 4:37 PM
Hi Shounak
we are on
Component version: SAP R/3 Enterprise
SAP_BASIS 620, SAP_ABA 620 release
Thank you for the inputs I am trying to make sense of the BADI documentation.
‎2005 Nov 01 4:49 PM
Hi Lorie,
You can find more information about the BADI implementation and Definition with the links below.
Let me know if you need any further information.
http://help.sap.com//saphelp_470/helpdata/EN/eb/3e7cee940e11d295df0000e82de14a/frameset.htm
http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
Thanks and Regards,
-Ash Patel
‎2005 Nov 01 5:18 PM
Hello Ash
I created a Z implementation in SE18 and am trying to see if I can update the delivery quantity with the pick quantity in the delivery document within the method CHANGE_DELIVERY_ITEM.
method IF_EX_LE_SHP_DELIVERY_PROC~CHANGE_DELIVERY_ITEM.
if not ( CS_LIPSD-PIKMG = 0 or CS_LIPSD-PIKMG is initial ).
if CS_LIPS-LFIMG <> CS_LIPSD-PIKMG.
CS_LIPS-LFIMG = CS_LIPSD-PIKMG.
endif.
endif.
but I am not able to do it. Is there something I am missing here. Your answer has been very helpful really appreciate your help.
endmethod.
‎2005 Nov 01 5:48 PM
Hi Lorie,
If you are updating the delivery quantity with that of pick quantity in the delivery documents, I think the code you have given should work. But maybe sometimes, you need to write in another method or something. Just check it once again and give it a go.
Let me know how it goes...
Thanks and Regards,
-Ash Patel..
‎2005 Nov 01 7:47 PM
I have been trying to update and have tested with one line item having a pick quantity less than the delivery quantity quite a few times and have been debugging the transaction flow but I seem to be missing something either an update flag or an update to the internal table or an append or something. The CS_LIPS and CS_LIPSD are structures though. I think I need some help on this.
Message was edited by: Lorie Mouklas
‎2005 Nov 01 8:01 PM
Hi Lorie,
You have to mark CS_LIPSD-updkz = 'U' after you make the quantity change.
I read your first mail and I suggest you should try to split the delivery instead of reducing the quantity to be equal to pick quantity using BAPI_OUTB_DELIVERY_SPLIT_DEC. That way you will only a delivery with pick qty = del item qty.
thanks
Srini
‎2005 Nov 01 8:26 PM
The process flow is as follows. A sales order is created. Next a delivery is created and at the time of creation of delivery there will not be delivery number so I am not sure if the updkz should be 'U' I think it should remain as 'I' for creation. The business does not want to split the delivery instead wants to update the delivery quantity with the pick quantity.
I tried the above suggestion and I think you are quite right. But I now get an express document into my inbox which has the following message.
Transaction.. VL01N
Update key... 55E9143FE8C940AC864BB383069E5834
Generated.... 01.11.2005, 15:33:21
Completed.... 01.11.2005, 15:33:21
Error info... VL 502: Error during UPDATE LIPS
‎2005 Nov 01 8:30 PM
How is the picking carried out? Is this process Warehouse Managed or the user merely inputs the pick quantity to subsequently process the PGI?
‎2005 Nov 01 8:31 PM
Hello
You can try to update the quantity in program MV50AFZ1
in form userexit_save_document_prepare.
Let me know if you need any help on this
Regards
Shounak
‎2005 Nov 01 8:35 PM
Hello Shounak
Would I need to request an access key to change this program? Please tell how I should proceed if I need to add code to the userexit_save_document_prepare.
Business Requirement:
The Business requires that all pick shortages be automatically cancelled out after the order has been picked. Pick omits/shortages are any line items where SAP confirms on the Sales Order and delivery note, but cannot be found in the warehouse when picking occurs. The delivery quantity on the delivery note must be updated to reflect the correct pick quantity for these line items prior to goods issue. In addition, the sales order line item must be rejected with the "Pick Omit" reason for rejection code. I am kind of a little confused here with which solution to take but I guess whichever one works would be the one to go with.
Message was edited by: Lorie Mouklas
‎2005 Nov 01 8:40 PM
Lorie,
You'll run into same issue with updkz = 'I' even while using MV50AFZ1. I need to know how the Picking is run? Normally, I have never done delviery creation and delivery picking in the same operation.
‎2005 Nov 01 9:14 PM
Lorie,
I tried to understand your business case.
So, Picking is run in the WH and I am assuming TO is created without any reference to TR or Delivery but, is created with SONUM field as Sales Order and line item. So you determine the pick quantity from the TO. Is this correct?
If this is correct, then during delivery save MV50AFZ1 (yes, you'll to register this object with OSS and get the registration key to alter the code), look for form userexit_save_document_prepare. You can then loop at xlips and then change the pick quantity and delivery item quantity and proceed.
‎2005 Nov 01 9:44 PM
The copy pick qty to del qty works only with one delivery document. But in collective processing it doesn't eg. Tcode VL10C or one of the collective processing tcodes. Because in a real scenario we might not do delivery after a sales order or a pick right after a delivery. By having this check or code in place it will happen whenever the code gets invoked. Hope I can resolve this. It doesn't seem complicated but I gues it is.
Regards
Message was edited by: Lorie Mouklas
‎2005 Nov 01 9:57 PM
Hi Lorie,
1. How is the picking run?
2. How do you get he pick quantity?
‎2005 Nov 01 10:08 PM
Hi Srinivas
There are 2 types of picking:
1. Night Picks: these orders go to a 3rd party system for picking. The picking quantity on the delivery note is updated by an interface from this system.
2. Day Picks: these orders do not go to a picking system. The orders are picked manually and the delivery note pick quantity will be updated by the confirmation of a transfer order.
A workable theory is as follows:
1. Once picked, the picked qty (LIPS-PIKMG) will be updated by interface or TO confirmation.
2. A new delivery output condition type which has a transmission medium of 8 will have a prg which needs to compare the two qty fields del & pick and update the del qty with the pick qty if different.
3. also to update z field on del line item to indicate update.
4. that delivery needs to change/update sales order for that line item and put a reason code for the field VBAP-ABGRU.
5. Once all sales order line items have been updated for that delivery note, post goods issue.
I am trying out different things so please give a workable solution as it looks like this thread is going in multiple directions. But that is okay atleast at the end of it will be a workable solution which will be useful for everyone.
Message was edited by: Lorie Mouklas
‎2005 Nov 02 3:53 AM
OK...
Here is the possible solution
1. During the updation of PICK qty (Day or night), the code in MV50AFZ1 gets triggered reagrdless. Add the following code
Loop at xlikp where updkz <> 'I'.
" this ensures code consistency even via VL10
loop at xlips where vbeln = xlikp-vbeln and pikmg > 0.
if xlips-lfimg <> xlips-pkimg.
xlips-lfimg = xlips-lfimg_flo = xlips-pkimg.
*if qty changes XVBFA also needs to change
read table xvbfa with key vbelv = xlips-vgbel
posnv = xlips-vgpos
vbeln = xlips-vbeln
posnn = xlips-posnr
stufe = 0.
if sy-subrc = 0.
xvbfa-rfmng = xlips-lfimg.
modify xvbfa.....
endif.
endif.
xlips-zfield = new flag.
xlips-updkz = 'U'.
modify xlips....
endloop.
endloop.
This will eliminate the need for output condition.
2. Create an entry in SWETYPV (TRXN) for OBJECT Type 'LIKP' and event 'CHANGED' and attach a Receiver Function Module 'Z_CHANGE_SALESORDER'.
3. Add code in this new FM for rejection (VBAP-ABGRU)
‎2005 Nov 02 6:57 PM
Hello Srinivas
You sure seem to know this process quite well.
I am not sure if the solution you have outlined will work here until I test it out. I am going to try it out but I think it involves quite a few things and I am not sure yet as to how I can modify the include MV50AFZ1 without getting an access key. Because earlier in this message thread Shounak mentioned that I don't need an access key so I am wondering how I can proceed on that.
Hello Shounak
Currently exploring the BADI option.
I seem to be getting a dump if I change the UPDKZ field to 'U' which is correct as I am still creating a delivery note. The whole process needs to be rethought and I guess we need to go back to square one and start thinking this process through till the end. I really appreciate all of your inputs. Sorry for the late reply but was tied up with trying out different things for this. I will watch out for your reply now.
‎2005 Nov 02 8:19 PM
you'll definitely need the reg key to change MV50AFZ1 (if no one has already done that before ).
You SHOULD not change the PICK quantity during creation of the delivery. You will break the VBUP status fields. As I understand from your logic, PICKing is a change delivery process. So, keep it that way. Donot attempt to create the delivery and update pick quantity in the same step.
‎2005 Nov 07 10:32 PM
Hello Srinivas
I am still on this and felt I must continue updating this message thread so that someone with a similar requirement can get a complete picture of what the possibilities are and benefit from it.
I am trying out your suggested solution but am unsure of the FM which needs to be attached to the event tcode with the LIKP event CHANGED. That is one area I will need your feedback and help. Might be very helpful if I had your case scenario too and the FM code to see if it can be reused.
Also I didn't understand the reason for the new field flag?
xlips-zfield = 'X'. " new FLAG.
Did you mean for me to add a new field to LIPS to keep track of pick omit line items? And kind of use it like a flag and reset it once I am done processing or something like that?
In the TCode SWETYPV
BOR Object Type LIKP CHANGED WS12300004 No errors
BOR Object Type LIKP CREATE_IBDLV WS12300004 No errors
But not sure if that is the right way. I am trying to look up more documentation on this but not finding any.
Meetings within the department have definitely given a deeper view of the requirements....
While updating the pick omits delv. qty is the first step the next step is to rej the line item with a reason code. The discussions also revealed more points which were seeming to fit into this jigsaw with a little addition. The additional functionality is to consolidate all like items to one line item, prior to order going to warehouse for picking. This will aid in picking at the warehouse as well as in the customer invoice not reflecting more than one line item for the same material. In the case where the customer has truly ordered more than 1 case and additional 2 EA (eaches) the documents in SAP will still reflect 2 lines.
Regards
‎2005 Nov 01 8:36 PM
Hello again,
I guess you would need to try out different scenarios where a combination of the BADI and the user-exit form routines would have to be used. Put some code in both and see which one is called first. ( i am assuming the BADI).
In that case you can store the pick quantity in memory and use it the form later to update the delivery qty (something along those lines).
Let me know.
Regards
Shounak
‎2005 Nov 01 8:40 PM
You will not need a key. It will only give an information popup. After that the code will be editable. In the form you have the following structures are available amongst others:
xlips
xlikp
Also T180-TRTYP would indicate if the document is being created or changed (H for create, V for change).
You would need to modify xlips.
Shounak
‎2005 Nov 07 11:44 PM
Hello Shounak
I am kind of going on the track to change the include MV50AFZ1 of program SAPMV50A. There seems to be some problem with the BAPI not doing an update possibly due to an update task being called within the same LUW.
Regards
‎2005 Nov 01 9:05 PM
Hello
Just an additional info. There is a function in VL02N which will allow you to update the delivery qty with the pick qty. I think its under EDIT -> Update Delivery Qty With Pick Qty (something like that).
Regards
Shounak