Skip to Content
author's profile photo Former Member
Former Member

Automatically SLED field population when production date is changed in COR2 transaction

Hi Friends,

I have one requirement.

IN COR2 transaction I have written code to update production date of PON batch with production date of material master data if material type is 'BULK' through BAPI.

In MSC2N transaction changes have been made by someone to calculate and populate expiry date field automatically.

I want this same functionality in COR2 transaction, when I am making the changes to update production date as i said in first line.

I tried to find FM which calculates expiry date i.e SLED. But got nothing.

Kindly help me how it can be implemented via BDC or any FM.

Any help will be appreciated

Capture.JPG (72.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 23, 2014 at 11:02 AM

    Hi Friends,

    to be more clear,

    i am updating production date in the attached screenshot through bapi BAPI_BATCH_CHANGE.

    and i want SLED to be calculated and populated automatically when i update production date through BAPI.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Friends,

      I used FM inside the same customer exit after fetching production date to calculate expiry date by passing rounding rule, shelf life, production date, and s structure with some required values.

      Below is the code:

      CALL FUNCTION 'VB_MAINTAIN_MHD'

      EXPORTING

      i_iprkz_hbd = lwa_expiry-iprkz

      i_rdmhd = lwa_expiry-rdmhd

      i_geshb = lwa_expiry-geshb

      i_hsdat = lwa_jcds-udate

      i_bncom = bncom

      check = lc_space

      calc = lc_x

      IMPORTING

      o_mhdat = lw_expiry

      EXCEPTIONS

      sled_le_production_date = 1

      ref_date_lower_prod_date = 2

      OTHERS = 3.

      IF sy-subrc <> 0.

      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

      ENDIF.

      And requirement is completed.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.