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

BAPI_REQUIREMENTS_CHANGE: Data deleted

Former Member
0 Likes
2,579

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                                                                                

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,350

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

2 REPLIES 2
Read only

Former Member
0 Likes
1,351

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

Read only

0 Likes
1,350

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,