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: 

BADI or Exit for MFBF Tcode

former_member823006
Participant
0 Kudos

Hi Experts,

I need to do difference calculation in posting date and document date. I have made the code but not able to find exact BADI or exit for MFBF tcode.

BADI i searched - RM_BFLUSH_GOODSMVT

EXIT ???

Please suggest, where I have to put below code so that when user put dates into this, then it will not allow him to get more than 7 days.


data:  d_days like po347-scrdd,
	budat like mkpf-budat,
	bldat like mkpf-bldat.

budat = rm61b-budat.
bldat = rm61b-bldat.

CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
  EXPORTING
    I_DATUM_BIS                   = budat
    I_DATUM_VON                   = bldat
   I_STGMETH                     = '2'
 IMPORTING
   E_TAGE                        = d_days
          .

if d_days > 7 .
  message 'date exceeds' type 'E'.
  elseif d_days < 0.
  message 'document date should be greater than posting date' type 'I'.
endif.

Please suggest experts,

Thanks.

Deepanshu

2 REPLIES 2

former_member823006
Participant
0 Kudos

Please advice experts.

Thanks.

Former Member
0 Kudos

Hi,

Include - LBARMFS1

FORM - FORM get_hr_data .

Create a implicit enhancement in the beginning of above mentioned form FORM get_hr_data and put below code inside that.

FORM get_hr_data.
ENHANCEMENT 1 ZTEST_TEST.
data:  d_days like po347-scrdd,
	budat like mkpf-budat,
	bldat like mkpf-bldat.
 
budat = rm61b-budat.
bldat = rm61b-bldat.
 
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
  EXPORTING
    I_DATUM_BIS                   = budat
    I_DATUM_VON                   = bldat
   I_STGMETH                     = '2'
 IMPORTING
   E_TAGE                        = d_days
          .
 
if d_days > 7 .
  message 'date exceeds' type 'E'.
  elseif d_days < 0.
  message 'document date should be greater than posting date' type 'I'.
endif.
ENDENHANCEMENT.

BR,

Vijay