‎2008 May 19 11:55 AM
Hi,
In CO01 transaction,there are 2 fields finish date(GLTRP) and start date(GSTRP).When I enter values in these fields and save the changes in this transaction, in debugging mode control goes to a function module Z_SER_SERIALNO_GET_NEW which is present in user exit EXIT_SAPLIPW1_001.Now I am using a date1 field in this function module.This field should contain the value given in the start date field.Is there any way to populate the date1 field with the value given in startdate in CO01 transaction?
‎2008 May 19 12:27 PM
Hi Hema,
In the interface of this exit start date(GSTRP) does not exist. So what u ahve to do is EXPORT this date field from the exit where it is available and IMPORT the same in ur FM and use it.
U can use the exit EXIT_SAPLCOKO1_004 for EXPORTING the date field. There are 2 structures IS_HEADER_NEW and IS_HEADER_OLD. Check in which one u r getting correct data and EXPORT from here and IMPORT the same from ur FM.
Make sure that EXPORTING and IMPORTING memory IDs and
variable names should be same.
Thanks,
Vinod.
Edited by: Vinod Kumar Vemuru on May 19, 2008 4:59 PM
‎2008 May 19 12:02 PM
Hi hyma,
Read the start date field from the correpsonding table based on the importing paramter of the function module exit EXIT_SAPLIPW1_001.
Regards,
Sriram
‎2008 May 19 12:10 PM
‎2008 May 19 12:24 PM
hi hema,
try to use this exit for CO01.
EXIT_SAPLCOZV_001
EXIT_SAPLIPW1_001 does not contain the field you need in its parameter.
regards,
Peter
‎2008 May 19 12:27 PM
Hi Hema,
In the interface of this exit start date(GSTRP) does not exist. So what u ahve to do is EXPORT this date field from the exit where it is available and IMPORT the same in ur FM and use it.
U can use the exit EXIT_SAPLCOKO1_004 for EXPORTING the date field. There are 2 structures IS_HEADER_NEW and IS_HEADER_OLD. Check in which one u r getting correct data and EXPORT from here and IMPORT the same from ur FM.
Make sure that EXPORTING and IMPORTING memory IDs and
variable names should be same.
Thanks,
Vinod.
Edited by: Vinod Kumar Vemuru on May 19, 2008 4:59 PM
‎2008 May 19 12:55 PM
Hi,
The exit EXIT_SAPLCOKO1_004 is coming only in display mode.Now how can I give the export parameter here?
‎2008 May 19 3:23 PM
Hi Hema,
Then u have to put a break point in all available exits and see to what are all exits it is going. If u have date field in any exit then u can put ur code to EXPORT the date from there.
Put break point in all the exits where ever u have structure CAUFVD as IMPORTING parameter.
Check below enhancements and BADIs.
PPCO0017
PPCO0016
PPCO0015
PPCO0013
PPCO0012
PPCO0010
PPCO0018
STATTEXT
PPCO0100
PPCO0023
PPCO0022
PPCO0021
PPCO0019
PPCO0002
PPCO0001
COZF0002
COZF0001
COIB0001
CCOWB001
PPCO0003
PPCO0009
PPCO0008
PPCO0007
PPCO0004
PPCO0005
PPCO0006
BADIs.
AFABD_CHANGE
PPPI_SEL_ORD_EXT_REL
Thanks,
Vinod.
‎2008 May 20 5:24 AM
Hi Vinod,
The requirement is "When a Production Order is released, serial numbers get assigned to each finished goods unit. A serial number is a combination of the Plant, Month, Year and an indexed number. Sometimes, the month in the serial numbers assigned, is not consistent with the month in which the production is done. This is because the month in the serial number is the month in which the production order is released. To match these serial numbers to the month in which the units are produced, we have to modify the logic to take the order start date instead of the release date.
When a production order is released for a finished good, a user exit u2018EXIT_SAPLIPW1_001u2019 is called. This exit has a Function Module u2018Z_SER_SERIALNO_GET_NEWu2019 which takes plant and the current date as input and generates the serial number.
We have to modify this FM to pass the Production start date
[AFKO-GSTRP], instead of the production order release date, to match the serial numbers to the month in which the production is done".
In user exit EXIT_SAPLCOKO1_004 I found CAUFVD as IMPORTING parameter.Now how can I export the date field to the function module 'Z_SER_SERIALNO_GET_NEWu2019
‎2008 May 20 5:47 AM
Hi Hema,
In ur earlier reply u told EXIT_SAPLCOKO1_004 is called only in display mode! any ways if this is being called for ur requirement then put below piece of code in this FM includes.
DATA w_gstrp TYPE CAUFVD-GSTRP.
MOVE IS_HEADER_NEW-gstrp TO w_gstrp.
EXPORT w_gstrp TO MEMORY ID 'GSTRP'.
if new work area dont have correct date then check the old wa.
EXPORT IS_HEADER_OLD-gstrp TO MEMORY ID 'GSTRP'.
In ur FM write below statement.
DATA w_gstrp TYPE CAUFVD-GSTRP.
IMPORT w_gstrp FROM MEMORY ID 'GSTRP'.
Hope this will help u.
Thanks,
Vinod.
‎2008 May 20 6:21 AM
Hi,
I have given below code in FM Z_SER_SERIALNO_GET_NEW.
DATA w_gstrp TYPE CAUFVD-GSTRP.
IMPORT w_gstrp FROM MEMORY ID 'GSTRP'.
When I checked in debugging mode,w_gstrp is not getting populated with any value.What would be the reason?
‎2008 May 20 6:47 AM
Hi Hema,
Few questions...
1. Are u exporting the same in user exit where it is available.?
2.If yes then What is the sy-subrc value after EXPORT and IMPORT statements?
Another work around is try importing outside ur FM i.e inside user exit include. now add one parameter in ur FM interface to get the value inside this FM. Now pass the imported value to FM. Make sure the EXPORT and IMPORT PARAMETER name and MEMORY ID should be same. i.e give the name w_gstrp in both cases.
Thanks,
Vinod.
‎2008 May 20 8:01 AM
Hi,
In exit EXIT_SAPLCOKO1_004 under include ZXCO1U18 I have added this code.
break-point.
DATA : w_gstrp TYPE CAUFVD-GSTRP.
MOVE IS_HEADER_NEW-gstrp TO w_gstrp.
EXPORT w_gstrp TO MEMORY ID 'GSTRP'.
In transaction CO01 when I enter the value for finish date and click enter,control is coming to this breakpoint and IS_HEADER_NEW-gstrp is not getting populated with any value because start date(gstrp) is not entered .
But actually if there is no break-point set and if we enter finish date and click enter,then the start date will be shown on the screen in CO01 transaction.So what can I do for populating the IS_HEADER_NEW-gstrp field?
Regards,
Hema
‎2008 May 20 8:14 AM
Hi Hema,
This might be because of start date field is being populated some where else(May be in some other user exit) i saw there are somany user exits where we have this structure.
Check the place where it is being populated. Also check the user exit that is being called just before it isdisplaying the start date.
U can put a break point in all the exits available and execute ur transaction. Now check the EXIT FM parameters where ever control stops and if this start date is available or not. So if u find some place where u have start date then u can export from that place and import the same in exit FM where ur Z FM exist.
Thanks,
Vinod.