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

BAPI_REQUIREMENTS_CHANGE: Data deleted

Hi

Any existing data in other weeks gets deleted. Why?

Week 1 to 5 exists.

I want to change week 2 and 5 but week 1 , 3 and 4 are overwritten/deleted.

    

TYPES : BEGIN OF tp_data,
          matnr LIKE bapisitemr-material,
          plant  Like BAPISITEMR-plant,
          week LIKE scal-week,
          qty(30),
        END OF tp_data

DATA : t_table TYPE STANDARD TABLE OF tp_data WITH HEADER LINE.

LOOP AT t_table.

 REFRESH i_requirements_schedule_in.

  perform populate_requirements_schedule.

CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE'
            EXPORTING
              material                = t_table-material
              plant                   = t_table-plant
              requirementstype        = 'VSF'
              version                 = 'AB'
              reqmtsplannumber        = '  '
              vers_activ              = 'X'
*         REQUIREMENT_PARAM              =
*         MRP_AREA                       =
*       IMPORTING
*         REQUIREMENT_ITEM_OUT           =
            TABLES
              requirements_schedule_in    = i_requirements_schedule_in
*         REQUIREMENTS_CHAR_IN           =
              return                         = return.

ENDLOOP.                


FORM populate_requirements_schedule.
  i_requirements_schedule_in-date_type = '2'.       " W C_day.
                                                                                call function 'WEEK_GET_FIRST_DAY'
    exporting
      week         = t_table-week
    importing
      date         = iweek
    exceptions
      week_invalid = 1
      others       = 2.
                                                                                i_requirements_schedule_in-req_date  = iweek
  i_requirements_schedule_in-req_qty   = t_table-qty .
 
  append i_requirements_schedule_in.
                                                                                ENDFORM.                    "populate_requirements_schedule                                                                                

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 Feb 19, 2008 at 09:59 AM

    Hi Giovanni,

    BAPI_REQUIREMENTS_CHANGE is used for changing the Planned Independent Requirements (PIR). However it does this by deleting the old data first

    corresponding to the Mateiral and Plant. This the reason why data for week 1 , 3, 4 and overwritten / deleted. However this bapi cannot be used to delete an independent

    requirement only.

    Thanks

    Vijay

    PLZ reward points if helpful

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi,

      i'm also facing the same problem as to how to delete the requirements.

      could you please tell as to how you got it resolved?

      i need to delete the requiremnets for a specific period.

      thanks,

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.