2013 Nov 19 7:14 AM
dear experts,
i have one requirement for tcode - co01. based on the order type.
user want to calculate the end date automatically.
suppose, in general tab we enter a start date. when we hit enter the end date field should automatically show the end date.
end date = start date + 60 days.
how to do this. using badi or userexit ?
is there any user exit or badi . plz suggest me.
2013 Nov 19 11:35 AM
Hi Santosh,
Please use exit EXIT_SAPLCOKO1_004 ( Include ZXCO1U18 ) to populate End date based on start date in CO01.
2013 Nov 19 7:21 AM
Hi Santosh
Can you please provide me the screen number and program name where this field is located. ?
Nabheet
2013 Nov 19 11:12 AM
hi nabheet,
program - SAPLCOKO1
screen - 115
program subscreen - SAPLCOKO1
screen - 120
2013 Nov 19 11:52 AM
2013 Nov 19 11:35 AM
Hi Santosh,
Please use exit EXIT_SAPLCOKO1_004 ( Include ZXCO1U18 ) to populate End date based on start date in CO01.
2013 Nov 19 11:54 AM
2013 Nov 19 11:58 AM
You will not be able to solve using the above mentioned exit as it for only checking the changes not to default the values..that is why you will need to go with impliciut enhacement at the place where this exit is called as shown in the screen shot
2013 Nov 19 12:21 PM
Hi Santosh,
It is correctly mentioned by Chirdip.
I have shown the steps below. Catch here is it will be triggered while Change in PO header.
1)
2)
3) Implement the Second one
4)
5)
6)
Ask if anything is not clear.
BR.
2013 Nov 19 12:27 PM
Hi Ankit..
You are correct using assign you can do anything. Point to note is exit does not have changing fields... using assign you can.
Thanks
Nabheet
2013 Nov 19 12:31 PM
Hi Nabheet,
I do not prefer implicit enhancements and get my work around with the tricks like one mentioned above. .
BR
2013 Nov 19 12:33 PM
2013 Nov 20 6:57 AM
dear ankit,
in this include , after entering the start date value i am trying to read the start date value.
based on that it will calculate the end date. the start date value is not reading here when i am debugging my code.
2013 Nov 20 7:05 AM
start date is in is_header_new-gstrp. use the code mentioned by Ankit and change
<FS_GLTRP> = is_header_new-gstrp + 60.
Rest all remains same
2013 Nov 20 7:54 AM
Dear nabheet,
below is my code.
TABLES : CAUFVD.
FIELD-SYMBOLS : <FS_GLTRP> TYPE ANY.
CONSTANTS : LC_GLTRP TYPE CHAR50 VALUE '(SAPLCOK01)CAUFVD-GLTRP'.
DATA : LC_GSTRP TYPE CAUFVD-GSTRP. " START DATE
MOVE : IS_HEADER_NEW-GSTRP TO LC_GSTRP.
ASSIGN (LC_GSTRP) TO <FS_GLTRP>. ." here value is not getting assig to <FS_GLTRP>
IF <FS_GLTRP> IS ASSIGNED.
<FS_GLTRP> = LC_GSTRP + 60.
ENDIF.
2013 Nov 20 8:08 AM
Hey Santosh,
Can you try pasting this code exactly for step 6.
*-- Screen Programming.
FIELD-SYMBOLS : <fs_gstrp> TYPE ANY,
<fs_gltrp> TYPE ANY.
*-- read start date on screen
CONSTANTS lc_gstrp TYPE char50 VALUE '(SAPLCOKO1)CAUFVD-GSTRP'.
ASSIGN (lc_gstrp) TO <fs_gstrp>.
IF <fs_gstrp> IS ASSIGNED.
ENDIF.
*-- Calculate the end date - if start date is populated
CONSTANTS lc_gltrp TYPE char50 VALUE '(SAPLCOKO1)CAUFVD-GLTRP'.
ASSIGN (lc_gltrp) TO <fs_gltrp>.
IF <fs_gstrp> IS ASSIGNED.
<fs_gltrp> = <fs_gstrp> + 60.
ENDIF.
-> This should work.
BR.
2013 Nov 20 8:16 AM
thanks ankit, it's working fine now. it's displaying the end date.
thanks a lot.
2013 Nov 20 9:22 AM
2013 Nov 19 12:23 PM