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_REUIREMENTS_CHANGE for usage probability

Former Member
0 Likes
1,758

Transaction MD62 (planned independent requirement change - schedule line) - I need to Maintain Usage Probability functionality for the characteristics. I am trying to use BAPI_REUIREMENTS_CHANGE, but it is not updating the usage probabilities. If anyone has worked on this BAPI then please suggest me how to maintain usage probabilities.

Jigisha

Transaction MD62 (planned independent requirement change - schedule line) - I need to Maintain Usage Probability functionality for the characteristics. I am trying to use BAPI_REUIREMENTS_CHANGE, but it is not updating the usage probabilities. If anyone has worked on this BAPI then please suggest me how to maintain usage probabilities.

Jigisha

7 REPLIES 7
Read only

Former Member
0 Likes
1,481

Hi,

use bapi_transaction_commit after your BAPI call.

just check FM docu,

from here i can see one thing...

you need delete old ones and cretae neew ones ,

new data to be passed to REQUIREMENTS_SCHEDULE_IN

Existing Schedule Lines/>

Existing schedule lines are deleted, and the system creates the schedule lines transferred in parameter REQUIREMENTS_SCHEDULE_IN again.

When parameter DELETE_OLD has initial value, the existing schedule lines are not changed if the transferred schedule lines with the same requirements date do not overwrite them.

Existing schedule lines must be deleted for the following items (DELETE_OLD = X'):

Items for which automatic splitting is carried out

Items for which configuration supporting points are created

Try to add BAPI_TRANSACTION_COMMIT or COMMIT WORK statement at the end of BAPI_REQUIREMENTS_CHANGE.

Perhaps it may help but you may not needed.

Hope this will help.

Regards

VAsanth

Read only

0 Likes
1,481

Hi Vasant,

I have selected the delete_old as 'X' and have also done a transaction commit but still the updates to the usuage probability are not happening.

Jigisha

Read only

Former Member
0 Likes
1,481

Hi,

Can u send ur snip of ur code.

Regards,

Naveen

Read only

0 Likes
1,481

Hi Naveen,

Here it is:

DATA: i_bapisshdin TYPE TABLE OF bapisshdin,

i_bapischarr TYPE TABLE OF bapischarr,

i_bapireturn1 TYPE TABLE OF bapireturn1.

DATA: wa_bapisshdin TYPE bapisshdin,

wa_bapischarr TYPE bapischarr,

wa_bapireturn1 TYPE bapireturn1.

wa_bapisshdin-date_type = '3'.

wa_bapisshdin-req_date = '05/01/2007'.

wa_bapisshdin-req_qty = '100.000'.

wa_bapisshdin-unit = 'EA'.

APPEND wa_bapisshdin TO i_bapisshdin.

wa_bapischarr-requ_date = '05/01/2007'.

wa_bapischarr-int_char = 'UNIT_SIZE'.

wa_bapischarr-char_value = '016'.

wa_bapischarr-ch_qty = '25'.

APPEND wa_bapischarr TO i_bapischarr.

CALL FUNCTION 'BAPI_REQUIREMENTS_CHANGE'

EXPORTING

material = '38AKS'

plant = '2000'

requirementstype = ' '

version = '00'

reqmtsplannumber = ' '

vers_activ = ' '

do_commit = 'X'

update_mode = 'X'

delete_old = 'X'

no_withdr = ' '

TABLES

requirements_schedule_in = i_bapisshdin

requirements_char_in = i_bapischarr

return = i_bapireturn1.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Jigisha

Read only

0 Likes
1,481

Hi,

I have tried using same BAPI, It is returning a message

"No authorization for changing in plant ".

so i think in my dev server i dont have authorisation to change the plant and its showing that message.

wats the BAPI is returning in ur case?

Revert back .

Regards

Naveen

Read only

0 Likes
1,481

Hi Naveen,

The BAPI is deleting the schedule line instead of updating the usage probability.

Jigisha

Read only

0 Likes
1,481

Hi Jigisha ,

When parameter DELETE_OLD has initial value, the existing schedule lines are not changed if the transferred schedule lines with the same requirements date do not overwrite them.

so try using delete_old = ' ' .

As DELETE_OLD = X, will delete that record.

Iam not sure wheteher it will work or not, coz i dont have authorisation to change PLANT in my server.

Regards,

Naveen

Message was edited by:

Naveen Deva