Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

user exit

Former Member
0 Likes
1,562

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?

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
1,446

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

12 REPLIES 12
Read only

Former Member
0 Likes
1,446

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

Read only

0 Likes
1,446

Hi,

Could you please give me an example ?

Read only

peter_ruiz2
Active Contributor
0 Likes
1,446

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

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,447

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

Read only

0 Likes
1,446

Hi,

The exit EXIT_SAPLCOKO1_004 is coming only in display mode.Now how can I give the export parameter here?

Read only

0 Likes
1,446

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.

Read only

0 Likes
1,446

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

Read only

0 Likes
1,446

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.

Read only

0 Likes
1,446

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?

Read only

0 Likes
1,446

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.

Read only

0 Likes
1,446

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

Read only

0 Likes
1,446

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.