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

Document date in PO

former_member211992
Active Participant
0 Likes
2,279

Dear all

I need to control the document date in me21n ,what is the user-exit to control the document date when creating PO.

Thanks

Moderator message : Not enough re-search before posting, discussion locked.

Message was edited by: Vinod Kumar

1 ACCEPTED SOLUTION
Read only

former_member282968
Contributor
0 Likes
2,074

Hi Karthik,

All the exits related to PO are available in function group XM06:

for PO created date:

EXIT_SAPMM06E_017 include ZXM06U42

With regards,

Dear all

I need to control the document date in me21n ,what is the user-exit to control the document date when creating PO.

Thanks

Moderator message : Not enough re-search before posting, discussion locked.

Message was edited by: Vinod Kumar

10 REPLIES 10
Read only

AnjaneyaBhardwaj
Contributor
0 Likes
2,074

What do you mean by Document date ? Is it the creation date of Purchase order ? Why do want to alter the PO creation creation date ?

Thanks,

Anjan .

Read only

0 Likes
2,074

Thanks for ur reply anjaneya

when placing PO , user used to change doc date to previous period , so need to put the control in that , user can put the date that should be belongs to current months date for example sytem date is may25 user can give  the doc.date from may01 to may25 , other wise system should show the error.how to acheive this

Read only

0 Likes
2,074

Hi Karthik,

If the EXIT_SAPMM06E_017 is maintained in the project created in CMOD and if it is active on change of Document date this EXIT will be called.

You can also check with other EXITS in XM06

Logic for your requirement:

REPORT  ZTEST_IT.

PARAMETERS:DATE TYPE SY-DATUM.

DATA:LV_MONTH(6)     TYPE N,
           LV_MONTH_D(6)   TYPE N,
           LV_DATE(2)      TYPE N,
           LV_DATE_D(2)    TYPE N.


LV_MONTH   = SY-DATUM(6).
LV_MONTH_D = DATE(6).
LV_DATE   = SY-DATUM+6(2).
LV_DATE_D = DATE+6(2).



IF LV_MONTH = LV_MONTH_D.
  IF  LV_DATE_D >= 1 AND  LV_DATE_D <= LV_DATE.
    WRITE:'With in range'.
  ELSE.
    WRITE:'Out of range'.
  ENDIF.
ELSE.
  WRITE:'Out of range'.
ENDIF.

In the user -exit include program replace the parameters date ( in the above test program ) with I_EKKO-BEDAT and put the conditon only for ME21N or ME21 like below:

IF SY-TCODE EQ 'ME21N' OR SY-TCODE EQ 'ME21'.

endif.

With regards,

Read only

former_member282968
Contributor
0 Likes
2,075

Hi Karthik,

All the exits related to PO are available in function group XM06:

for PO created date:

EXIT_SAPMM06E_017 include ZXM06U42

With regards,

Read only

0 Likes
2,074

EXIT_SAPMM06E_017 include ZXM06U42 , its not working

Read only

0 Likes
2,074

Hi,

Have you created the user-exit inside a project and activated it ?If not please do it and check.

With regards,

Read only

Former Member
0 Likes
2,074

Hi Karthik,

user exit (SMOD)

MM06E005                                Customer fields in purchasing document

BADI (SE18)

ME_PROCESS_PO                           Enhancements for Processing Enjoy Purchase Order: Intern.

ME_PROCESS_PO_CUST                      Enhancements for Processing Enjoy Purchase Order:

Please reward points if helpful.

With Regards,

Sudhir S

Read only

0 Likes
2,074

DEAR ALL ,

Thanks for ur all reply , i got the sol thro  MM06E005 EXIT_SAPMM06E_012 , i have another doubt ,enhancement MM06E005 have 10 function exit , is ther any option to use remaining  exits in new cmod project

Read only

0 Likes
2,074

hi Karthik,

All the exits of a single enhancement can be assigned to only one project.

Several exits are combined into one Enhancement , that will be assigned

to a single project.

Regards...

Sultana

Read only

AnjaneyaBhardwaj
Contributor
0 Likes
2,074

ME_PROCESS_PO can't be used by customers.

Use BADI ME_PROCESS_PO_CUST and PROCESS_HEADER  and put the below code .

data: ls_mepoheader type mepoheader.

ls_mepoheader = im_header->get_data( ).

ls_mepoheader-AEDAT = sy-datum - 8 . @ Here u put the dates wyou want And it will also lead to a warning that DOC date is in past .

CALL METHOD im_header->set_data
  EXPORTING
    im_data = ls_mepoheader
    .
It should work

Thanks,

Anjan . .