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

automatic data display in co01

Former Member
0 Likes
4,662

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,504

Hi Santosh,

Please use exit EXIT_SAPLCOKO1_004 ( Include   ZXCO1U18 ) to populate End date based on start date in CO01.

17 REPLIES 17
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
4,503

Hi Santosh

Can you please provide me the screen number and program name where this field is located. ?

Nabheet

Read only

0 Likes
4,503

hi nabheet,

  program - SAPLCOKO1

screen - 115

program subscreen - SAPLCOKO1

screen - 120

Read only

0 Likes
4,503

You can do an implicit enhancement

Read only

Former Member
0 Likes
4,505

Hi Santosh,

Please use exit EXIT_SAPLCOKO1_004 ( Include   ZXCO1U18 ) to populate End date based on start date in CO01.

Read only

0 Likes
4,503

dear chirdip ,

              In which enhancement this user-exit exists.

Read only

0 Likes
4,503

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

Read only

0 Likes
4,503

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.

Read only

0 Likes
4,503

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

Read only

0 Likes
4,503

Hi Nabheet,

I do not prefer implicit enhancements and get my work around with the tricks like one mentioned above. .

BR

Read only

0 Likes
4,503

Everything has pros and cons..

Read only

0 Likes
4,503

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.

Read only

0 Likes
4,503

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

Read only

0 Likes
4,503

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.

Read only

0 Likes
4,503

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.

Read only

0 Likes
4,503

thanks ankit, it's working fine now. it's displaying the end date.

              thanks a lot.

Read only

0 Likes
4,503

BR.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
4,503

Can you check method INITIALIZE of BAdI WORKORDER_UPDATE ?

Regards,

Raymond