cancel
Showing results for 
Search instead for 
Did you mean: 

Copy "Loading End (DALEN)" date to "Completion date (DTABF)"

Former Member
0 Kudos

Hi,

I have a requirement that when the shipment << Completion >> status is set, the field shipment completion date (VTTK-DTABF) should copy the same value (date) from shipment loading end date (VTTK-DALEN).

In order to do it, I have used the enhancement << V56FSTAT >> with the following logic.

However, it's not copying the value as expected.

Somebody knows if there is another user Exit to do it ?

Functional module: EXIT_SAPLV56F_011 - Shipment Processing: Activities for Setting a Status, Time 1

Include:

INCLUDE ZXV56U16.

low FROM tvarvc INTO lv_value

       
WHERE type = 'P' AND name = 'ZSD_EN_457_COPY_LE_DATE_SWITCH'.

IF sy-subrc = 0 AND lv_value EQ 'X'.

 
IF i_status = '5' .   "Shipment Completion

   
READ TABLE c_xvttk ASSIGNING <fs_vttk> INDEX 1.

   
IF sy-subrc = 0.

      <fs_vttk>
-dtabf = <fs_vttk>-dalen.

      <fs_vttk>
-uzabf = <fs_vttk>-ualen.

      I_NEW_STATUS_DATE
= <fs_vttk>-dalen.

      C_XVTTK_WA
-dtabf = <fs_vttk>-dalen.

   
ENDIF.

 
ENDIF.

Accepted Solutions (1)

Accepted Solutions (1)

mihailo_sundic
Active Contributor
0 Kudos

You can try these:
EXIT_SAPLV56F_012

EXIT_SAPLV56M_001

EXIT_SAPLV56M_002

EXIT_SAPLV56M_003

EXIT_SAPLV56U_002
EXIT_SAPLV56B_001

Just a note, you don't need to enter the code in all of these user exits, activate them and put breakpoints in them.

Then when you break, change the date manually and see if it affects the transaction.
In this way you will quickly find the appropriate user exit, and then you can code inside
that u-ex.

So don't write the code until you know what user exit you are using, and which tables/structures/fields
you have available in that user exit.

I'm sure this can be done easily, just try more user exits, and try manually changing the date during
debugging in those user exits to locate the right one.

Once that works, simply write code to do what you did manually...

Former Member
0 Kudos

Thank you for the quick answer.

We found out that the following FM is called during the change and copy the dates as we need:

EXIT_SAPLV56F_011

EXIT_SAPLV56F_012

However, later on the FM: SD_SHIPMENT_STATUS_COMPLETION is called and change back the date to the current date.

So, we applied an enhancement at this point :

-dtabf = i_new_status_date.

Then we keep de date we want:

-dtabf = <fs_vttk>-dalen.

Now it's working fine.

Thanks a lot

Answers (0)