Application Development 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: 

Change contract start and end date at item level

0 Kudos
1,054

Hi Gurus,

My Query is:

When I enter the contract start and end date at header level (transaction code VA41), it automatically gets populated at the item level.

I want to delay the date at item level by one month.

Please help me to achieve the functionality.

Thanks & Regards

Dheeraj

Edited by: DheerAcc on Dec 21, 2011 11:45 AM

Edited by: DheerAcc on Dec 21, 2011 11:48 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
320

You can use userexit_move_field_to_vbap in MV45AFZZ to manipulate VEDA-VBEGDAT / VENDDAT as they default from header.

5 REPLIES 5

Former Member
0 Kudos
321

You can use userexit_move_field_to_vbap in MV45AFZZ to manipulate VEDA-VBEGDAT / VENDDAT as they default from header.

0 Kudos
320

Hi Vishnu,

Thanks for your reply.

I have tried using the exit, but in the further processing the data again gets replaced in MODULE VBAP_BEARBEITEN_ENDE ON CHAIN-REQUEST with the data in the header values.

Kindly suggest if any possibility.

Regards

Dheeraj

0 Kudos
320

You can also check MV45AFZB if it helps you.

Thanks,

Pawan

0 Kudos
320

I just checked this module you can implement enhancment spot ES_SAPFV45P to infoluence the dates and it will work

Nabheet

0 Kudos
320

Hi All..

Thanks for your inputs..

The query was solved by using the Implicit enhancement in the Include LV45WF0C.

The code is as below:

data: lv_posnr type veda-vposn,

lv_vari type c length 14 value '(SAPMV45A)VBAK'.

data: lv_date like vbak-guebg,

lv_kunnr like vbak-kunnr.

data: lv_zactive like zscope_sd_datdel-zactive.

data: lv_vbund like KNA1-vbund.

FIELD-SYMBOLS: <ls_vbak> type vbak.

ASSIGN (lv_vari) to <ls_vbak>.

  • select trading partner w.r.t customer

select single vbund from kna1 into lv_vbund

where kunnr = <ls_vbak>-kunnr.

  • Set flag for date delay using the entries maintained in the custom table maintained

select single zactive from zscope_sd_datdel into lv_zactive

where vkorg = <ls_vbak>-vkorg and

auart = <ls_vbak>-auart and

kunnr = <ls_vbak>-kunnr and

vbund = lv_vbund.

if lv_zactive = 'X'.

LOOP at screen.

if screen-name = 'VEDA-VBEGDAT'

or screen-name = 'VEDA-VENDDAT'.

screen-input = 0.

MODIFY SCREEN.

endif.

endloop.

lv_date = <ls_vbak>-guebg + 0100.

if veda-vposn <> '000000' and veda-vbegdat <> lv_date.

CALL FUNCTION 'BKK_ADD_MONTH_TO_DATE'

EXPORTING

months = 01

olddate = <ls_vbak>-guebg

IMPORTING

NEWDATE = veda-vbegdat.

CALL FUNCTION 'BKK_ADD_MONTH_TO_DATE'

EXPORTING

months = 01

olddate = <ls_vbak>-gueen

IMPORTING

NEWDATE = veda-venddat.

gv_posnr = veda-vposn.

endif.

endif.

ENDENHANCEMENT.

Thanks & Regards

Dheeraj.

Rewards points expected if thread seems useful...

Edited by: DheerAcc on Dec 26, 2011 12:13 PM