BAPI_GOODSMVT_CREATE - Batch Expiry Date......
HI Im,
using this BAPI to post a goods movement from one location to another in the same plant.
The stock is being posted to a specific Batch. When I do this the material document gets created okay and the stock moves.
The problem is that the batch expiry date is not updating. The stock I'm moving has a later expiry date than the current date. If I do this manually in MIGO it works fine and updates the batch expiry date with the later date.
Has anyone else experienced this or know of a work around ?
Hi
I am populating the item data like:
*- Populate item data
LOOP AT i_items_trans.
CLEAR ibapigm_item.
*- Convert the matnr backto 18 char form (External)
CALL FUNCTION 'CONVERSION_EXIT_MATN2_INPUT'
EXPORTING
input = i_items_trans-matnr
IMPORTING
output = i_items_trans-matnr
EXCEPTIONS
number_not_found = 1
length_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ibapigm_item-material = i_items_trans-matnr.
ibapigm_item-plant = x_user-werks.
ibapigm_item-stge_loc = x_user-lgort.
ibapigm_item-move_type = '101'. "Goods Receipt
ibapigm_item-mvt_ind = 'B'. "Goods Movement for PO
ibapigm_item-po_number = i_items_trans-ebeln.
ibapigm_item-po_item = i_items_trans-ebelp.
ibapigm_item-gr_rcpt = sy-uname.
ibapigm_item-quantity = i_items_trans-ktmng.
ibapigm_item-base_uom = i_items_trans-meins.
ibapigm_item-entry_qnt = i_items_trans-ktmng.
ibapigm_item-entry_uom = i_items_trans-meins.
ibapigm_item-batch = i_items_trans-charg.
APPEND ibapigm_item.
ENDLOOP.
Header data like:
MOVE: sy-datum TO bapigm_head-pstng_date,
sy-datum TO bapigm_head-doc_date,
sy-uname TO bapigm_head-pr_uname,
v_mblnr TO bapigm_head-ref_doc_no,
con_bfwms_bestand TO bapigm_head-ext_wms.
*- Document Header Text
IF NOT v_bktxt IS INITIAL.
*- Preceed "INV=" to the Invoice number entered
CONCATENATE 'INV='(003) v_bktxt INTO v_bktxt
SEPARATED BY space.
bapigm_head-header_txt = v_bktxt.
ENDIF.
MOVE gmcode_01 TO bapigm_code-gm_code.
And calling the BAPI as:
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = bapigm_head
goodsmvt_code = bapigm_code
IMPORTING
goodsmvt_headret = bapigm_headret
TABLES
goodsmvt_item = ibapigm_item
return = ibapigm_ret.
*- Commit on Success
IF NOT bapigm_headret-mat_doc IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Havent faced any problem so far...
Did you populate <b>EXPIRYDATE</b> in structure <b>BAPI2017_GM_ITEM_CREATE</b>? If yes, see in debugging, whatz happening to this value.
Regards,
Raj
Similar Messages
-
Querry Based Approval-AR Invocice-Batch Expiry Date
Hi All,
I want to set a query based approval which will check the expiry date of the batch no of the item being sold in AR Incoice. If the diffrence between the expiry date and today's date is less than or equal to 60, the AR Invoice should go for approval.
CAn anybody please help me with the querry??
Edited by: Philip Eller on Jun 9, 2008 11:22 AM
Edited by: Philip Eller on Jun 26, 2008 10:24 AM*
Edited by: Rui Pereira on Aug 6, 2008 4:18 PMHi,
try this query approval:
IF @transaction_type = 'A' AND @object_type = '13'
BEGIN
IF EXISTS (SELECT T0.DocNum FROM Oinv T0 INNER JOIN inv1 T1
ON T0.docentry = T1.docEntry inner join ibt1 t2 on t1.itemcode = t2.itemode and t2.whscode = t1.whscode inner join oibt t3 on t2.batchnum = t3.batchnum
WHERE (T3.ExpDate - getdate()) <= 60 and T0.DOCENTRY = @list_of_cols_val_tab_del)
BEGIN
SELECT @Error = 1, @error_message = 'expire date less/equal than 60'
END
END
Rgds, -
Hi all,
Is it possible to set Expiry date for Item. if so, how?
Plz let me know,
thanks in advance
KumarHi,
There is no Expiry date field available in the Item Master Data. However, you can check the option of the Validity dates in Item Master Data or if your item is a batch managed item, then you can have the batch expiry date.
Kind Regards,
Jitin
SAP Business One Forum Team -
Same Batch with different expiry dates
Dear all,
My vendor produced the same batch Y28 at an interval of 3 days eg 10/10/2008 , 11/10/2008, 12/10/2008 with an expiry date of 1year.
He sent in the batch Y28 to me with the following expiry date 10/10/2009, 11/10/2009 and 12/10/2009.
During GR, I need to enter the expiry date. However, I realised that the Batch Master for the same batch can only have 1 expiry date. I end up with the latest expiry date of 12/10/2009.
Could anyone advise on how the above scenario sould be handled?
Can I maintain 3 different expiry date for the same batch?
Is it a norm that the same batch can have different expiry date?
Thank youYou should create a separate batch per day, if you really think that the exact date of expiry matters for a material that has a shelf life of one year.
-
Sales report with Batch number & expiry dates
Hello friends,
would any one please help me to frame this query to achieve the above ..
my query is as bellow, but I want to add the batch number & expiry dates along with the other information.....
SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode] >=[%0] AND T1.[ItemCode] <=[%1] AND T0.[DocDate] >=[%2] AND T0.[DocDate] <=[%3]
So which table to join to get the batch & expiry...
Rgds
SumanHI
Batch table is OIBT, IBT1,OBTN
SELECT distinct T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T4.[ExpDate] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry inner join
IBT1 T2 on T1.ItemCode = t2.ItemCode and T0.objtype=T2.basetype and T2.baseentry=T1.Docentry inner join
oitm T3 on T1.Itemcode=T3.Itemcode inner join OIBT T4 on T1.Itemcode=T4.Itemcode WHERE T1.[ItemCode] >=[%0] AND T1.[ItemCode] <=[%1] AND T0.[DocDate] >=[%2] AND T0.[DocDate] <=[%3]
group by T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity],T4.[ExpDate]
Thanks
Mohammad Imran -
Batch shelf life expiry date at Plant level
Hi All,
We have a requirement from the client to maintain Batch shelf life at plant level.
Current process: Batch shelf life expiry date is maintained at the global level.
Requirement: Shelf life data to be maintained at Global level and plant level both.We want flexibility to maintain shelf life both at Global level and plant level .
If any one has worked in this scenario then kindly throw some light to resolve this issue.And also let me know if we move ahead to maintain shelf life data at global n plant level then which all the area it will get effected in other stream reagrding shelf life best before date.
This is very critical requirement from client prospective as we have legacy system involved like LIMS & COREDB.
Your valuable input will be highly appreciated.
Thanks n Regards,
Vikas Soni.Hi Vikas,
A doubt out of your query,
How the expiry date is maintained Globally .
Whenever a GR is done then the expiry date will be tagged to the particulat batch & the expiry date is valid for the batch in the particulat plant. Am I right?
Thanks & regards
Mahesh -
Reg blocking of batch on expiry date
Dear all,
What are the selections to be done in QA07 for blocking a batch on expiry date which is 3 days from today, we also have batch status active.
Thanks in advance
MadhavHi
In QA07 select
1. Block batch at lot creation.
2.Initial Run in days : 3 or maore
3.click on the check box of Block batch
Also Mainatin shelf life data in MM and keep expiry date 3 days later.
schedule the batch run in the background.
I hope this will add some values
Regards
Sujit -
In the packing list, batch number and expiry date is not appearing for a ma
Dear Friends,
I have an issue in the packinglist.
In the packing list, batch number and expiry date is not appearing for a material.
But in the delivery the batch number and expiry date is appearing.
Why this has triggered and how to solve this?
With regardsHi Vamsi,
Please go through the output type Smart form or script programe of the packing list and check with the abaper If is there any Bug.
Regard's
Murali. -
Batch selection as per expiry date
Hi,
Please have alook at my requirement and suggest the possible solution.
We have raw material which is handles in batches. Let's say a raw material has three batch in the stock M1, M2 and M3.
M1 expiry date is on march10, M1 expiry date is on april10, M1 expiry date is on June 10.
So when i create a process order system should always pick a batch for which expiry date is close. That is it should select batch M1.
Please let me know if it is possible.
Thanks,
DuttaHi Debasish,
Please follow the given below link. I hope this will serve your purpose.
Re: BATCH SELECTION DURING ISSUE
Regards,Kundan -
Issue regarding Batch determination in Production order as per Expiry date.
Dear all,
first of all happy Navratri.
I have issue regarding batch determination in production order.
I have to compare P.O header materialu2019s expiry date and issuing components expiry date at the time of batch determination.
lets take example, Material having self life is u201CXu201D years and batch determination against PO is based on FEFO with the help of self life we can determine Expiry date of manufacturing material suppose it is u201CYu201D I have to introduce restriction at the time of good issue if expiry date of issuing components u201CZu201D is less than expiry date u201CYu201D.
Please give your valuable suggestions either standard or through SAP enhancements.
thanks & Regards
SIVADear
Thanks for your reply, i am layman about batch derivation can u elaborate it.
Thanks & Regard -
A/R Invoice PLD - Expiry Date, Mfg Date, Batch No.
Hi,
We are using SAP 2007A.
We have customized the Print Layout. for the Delivery and A/R Invoice documents. In both docs, we have used system variables for batch, exp date & mfg date.
When we create an invoice directly (i.e. without a base document), then print it, we are able to get the batch, exp and mfg date perfectly.
However, when we create the Invoice from the base document i.e. Delivery, and then try to print it, we are unable to print the batch, exp & mfg. When we print the Delivery, it prints the batch, exp & mfg just fine.
We need to be able to create a/r invoice from delivery & print the batch, exp & mfg on the Invoice.
Please advise.
Thanks.Hi Afzal,
Gordon is very much right,
Atually PLD is very basic tool , one time its ilnk with only one marketing document either delivery, invoice or sales order etc.
when someone prints invoice , PLD related to invoice will ativate so data fron Delivery is no where in any case as when u copy the invoice from delivery the concern data is copied fron delivery (odln,dln1.....)tables to oinv,inv1....... tables from which pld took the data , so u can use UDF and apply formateed search on invoice to fill the batch no or all other field u want , u an also take help of sdk as on making of invoice from delivery the specified data should copied.
You an use crystal report and geet all data as u want .
rgds,
Premraj -
Report for expiry date of the material
All SAP Gurus,
We have certain Materials which are expirable.
These Materials are batch managed, and each batch is having different expiry date.
Is there any standard report available which can give is the days remaining to reach the expiry date (for that material)?
Regards,Hi,
Try MB5M,
here
Field name Field value
Material Enter the material code to which the report is desired.
Plant Enter the plant in which the report is to be generated.
Storage Location Enter the storage location in which the report is to be generated. Optional entry. Leave it blank.
Batch Batch number to be displayed. Optional entry. Leave it blank.
Remaining shelf life Minimum amount of time for which the material must keep upon goods receipt for the goods receipt to be accepted by the system. Optional entry.
Remaining shelf life warehouse Indicates that the remaining shelf life of a batch in
Total remaining shelf life Indicates that the system displays the total remaining shelf life of a batch.
The total remaining shelf life is calculated from the shelf life
Expiration date minus the current date. Select this radio button.
Indicates that the system also displays materials with zero stock. Optional, leave it blank.
Display of remaining shelf life in days. Select this radio button to display the remaining shelf in days in the report.
Regards,
Pardeep Malik -
Report with expiry date.
In MB51, I cannot find the expiry date for the batch.
Is there any report where I can find list of batch with PO and also the expiry date?
Please advice.HI,
MB5M is the perfect report as suggested by jurgen.The criteria is, in Material master the plant data
storage view u have give the shelf life.It will work perfectly.Pl try.Give shelf life as one for the
material .Goto MSC2N and change the manfactured as 17/06/09 and press enter .The expiration date
will be calculated automatically by the system.Now goto MB5M the system will dislay the shelf life
expiration date.
Is there any report where I can find list of batch with PO-For this u can use MB51 report
regards
murugan
Edited by: Murugan mgl on Jun 19, 2009 6:16 AM -
Report for recieved, expiry dates of shelf life of materials
Dear Gurus,
I did nt find the solution in MB5M, because i want report for shelf life of materials based on recived date, expiry date, please share.Hi,
When ever a material is having a shelf life , based upon the manyfactring date and the receiving date , the remaining shelf life can be found . If you want have a report which says the shelf life and receve date of a perticular batch and what should be the remaining shlef life or whather expired , once come into the plant , if not utilized , can be done through a ZREPORT or a query for the same .
Regards, -
Batch expiration date check when goods issue
Dear expert,
In batch expiration date check, we have a requirement that when do goods issue with delivery note we should have a expiration date check for expired batch(the system needs to give a warning message when we want to pick a expired batch(in WM) or to issue a expired batch). But I checked OMJ5 and found that there is no check for movement type 601, 641, 643 or 647. Do we have a standard function for this requirement? Thanks.
LeoHi,
In SD batch determination normally happens during Delivery creation for a Sales Order, Check for batch determination is maintained for a combination of sales org, order type - system determines Search Procedure at this level (here a check box also controls the batch check against selelction rules in case somebody puts a batch manually)
later on through selection class and sort rules batch expiry is check during determination
so all checks are applied before an actual goods issue is made so std SAP doesn't provide this check indicator at mvt type level
Hope this helps
Reg
Dheeraj
Maybe you are looking for
-
How to make top level navigation not refresh
Hello Guys, I have a question concerning on my External Facing Portal, my boss wants that when I click on a tab or a link in the Top Level Navigation , to load the content in the Content Area without refreshing the whole page, What I want is that whe
-
Hi all, I am on BW 3.5. I have an inventory cube which uses the BX,BF and UM extractor to populate. It is working fine (or as well as those extractors ever work). However, when I run a report by month, it shows me inventory totals for the end o
-
Subcontracting subsequent adjustment - MIGO
Hi All - when posting a subcontracting subsequent adjustment for an over consumption in transaction MIGO a 543 movement type is posted. When doing the similar posting for an under consumption the system uses a 546 movement. During the check functio
-
Movie start points in a session
In addition to my previous post, i have a problem with Movie start points and tempo changes as well. Please correct me if i am wrong but in Logic 7 it was possible to set a movie smpte point (say 10.20.17.22) as Bar 1 of the arrangement thus meaning
-
Is there a way to get detailed info on numbers dialed and received? Seems my phone stores about 2 months of this information. Thanks.