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

Regarding FM

Former Member
0 Likes
1,684

Hi aLL,

1) I am trying to modify 'Production schduler(MARC-FEVOR)

using 'BAPI_MATERIAL_SAVEDATA' FM. When I run the

below codings there is no effect(FEVOR not modified)

Can u plz let me know the bug in below prgm.?

CLEAR: v_headdata,v_plantdata,

t_return.

*Fill the data for the FM

v_headdata-material = t_alv_output-matnr.

v_headdata-work_sched_view = 'X'.

v_plantdata-plant = t_alv_output-werks.

v_plantdatax-plant = t_alv_output-werks.

v_plantdata-production_scheduler = p_fevor.(New value)

v_plantdatax-production_scheduler = 'X'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = v_headdata

  • CLIENTDATA =

  • CLIENTDATAX =

plantdata = v_plantdata

plantdatax = v_plantdatax

  • FORECASTPARAMETERS =

  • FORECASTPARAMETERSX =

  • PLANNINGDATA =

  • PLANNINGDATAX =

  • STORAGELOCATIONDATA =

  • STORAGELOCATIONDATAX =

  • VALUATIONDATA =

  • VALUATIONDATAX =

  • WAREHOUSENUMBERDATA =

  • WAREHOUSENUMBERDATAX =

  • SALESDATA =

  • SALESDATAX =

  • STORAGETYPEDATA =

  • STORAGETYPEDATAX =

  • FLAG_ONLINE = ' '

  • FLAG_CAD_CALL = ' '

  • IMPORTING

  • RETURN =

  • TABLES

  • MATERIALDESCRIPTION =

  • UNITSOFMEASURE =

  • UNITSOFMEASUREX =

  • INTERNATIONALARTNOS =

  • MATERIALLONGTEXT =

  • TAXCLASSIFICATIONS =

returnmessages = t_return

  • PRTDATA =

  • PRTDATAX =

  • EXTENSIONIN =

  • EXTENSIONINX =

.

LOOP AT t_return INTO v_return.

WRITE: v_return-message.

ENDLOOP.

2) I want to modify production schuduler in MD12(planned order) transaction, but prod sche(FEVOR) is in display mode and not able to modify. all other fields except FEVOR are in change mode. Any idea y, plz?

Regards

Rakesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,527

Hi,

if you are using BAPI's , you need to Use BAPI_TRANSACTION_COMMIT .

then only the changes will reflect or else no changes will be updated.

check the return table for success message type and then call the BAPI_TRANSACTION_COMMIT

it will commit the changes.

Regards

Vijay

Hi aLL,

1) I am trying to modify 'Production schduler(MARC-FEVOR)

using 'BAPI_MATERIAL_SAVEDATA' FM. When I run the

below codings there is no effect(FEVOR not modified)

Can u plz let me know the bug in below prgm.?

CLEAR: v_headdata,v_plantdata,

t_return.

*Fill the data for the FM

v_headdata-material = t_alv_output-matnr.

v_headdata-work_sched_view = 'X'.

v_plantdata-plant = t_alv_output-werks.

v_plantdatax-plant = t_alv_output-werks.

v_plantdata-production_scheduler = p_fevor.(New value)

v_plantdatax-production_scheduler = 'X'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = v_headdata

  • CLIENTDATA =

  • CLIENTDATAX =

plantdata = v_plantdata

plantdatax = v_plantdatax

  • FORECASTPARAMETERS =

  • FORECASTPARAMETERSX =

  • PLANNINGDATA =

  • PLANNINGDATAX =

  • STORAGELOCATIONDATA =

  • STORAGELOCATIONDATAX =

  • VALUATIONDATA =

  • VALUATIONDATAX =

  • WAREHOUSENUMBERDATA =

  • WAREHOUSENUMBERDATAX =

  • SALESDATA =

  • SALESDATAX =

  • STORAGETYPEDATA =

  • STORAGETYPEDATAX =

  • FLAG_ONLINE = ' '

  • FLAG_CAD_CALL = ' '

  • IMPORTING

  • RETURN =

  • TABLES

  • MATERIALDESCRIPTION =

  • UNITSOFMEASURE =

  • UNITSOFMEASUREX =

  • INTERNATIONALARTNOS =

  • MATERIALLONGTEXT =

  • TAXCLASSIFICATIONS =

returnmessages = t_return

  • PRTDATA =

  • PRTDATAX =

  • EXTENSIONIN =

  • EXTENSIONINX =

.

LOOP AT t_return INTO v_return.

WRITE: v_return-message.

ENDLOOP.

2) I want to modify production schuduler in MD12(planned order) transaction, but prod sche(FEVOR) is in display mode and not able to modify. all other fields except FEVOR are in change mode. Any idea y, plz?

Regards

Rakesh

10 REPLIES 10
Read only

Former Member
0 Likes
1,527

Hi,

Production schedular and MRP controller are customizing entries.

Production Schedular customizing can be found in spro IMG.

Production-> SHop floor control-> Production controller.

Thanks

Ganesh.S

Read only

Former Member
0 Likes
1,527

Hello,

After calling the fm put the following:

IF test = ''.

LOOP AT tbl_msg WHERE type CA 'EAX'. EXIT. ENDLOOP.

IF sy-subrc NE 0.

LOOP AT tbl_msg WHERE type CA 'ISW'. EXIT. ENDLOOP.

ENDIF.

IF tbl_msg-type CA 'ISW '.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

ENDIF.

ENDIF.

It will commit in case of no errors.

Dont forget to reward!!

Gabriel

Read only

0 Likes
1,527

Hi,

After calling this FM, my msg table is empty and subrc = 0.

Regards

Divakar

Read only

Former Member
0 Likes
1,527

Hi,

After your 'BAPI_MATERIAL_SAVEDATA' success put 'BAPI_TRANSACTION_COMMIT'.

Regards,

Raghav

Read only

Former Member
0 Likes
1,528

Hi,

if you are using BAPI's , you need to Use BAPI_TRANSACTION_COMMIT .

then only the changes will reflect or else no changes will be updated.

check the return table for success message type and then call the BAPI_TRANSACTION_COMMIT

it will commit the changes.

Regards

Vijay

Read only

Former Member
0 Likes
1,527

hi

good

go through this EXAMPLE link about , BAPI_MATERIAL_SAVEDATA' .

http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm

THANKS

MRUTYUN^

Read only

0 Likes
1,527

Hi,

After using BAPI commit also it is not updated.

but subrc = 0 and return table is empty.

Ragrds

Divakar

Read only

0 Likes
1,527

Thanks a lot, it is solved.

points rewared to all

Read only

0 Likes
1,527

hi,

Can you post your code here...

Regards

vijay

Read only

Former Member
0 Likes
1,527

Hi,

Planned order table PLAF...in that take PLGRP (Production Schedular) (FEVOR is not a field it is a

data element) ...check data in PLAF table with plgrp take this field in selection screen for table..

For this settings> list for selection> select the field check box and save.

with this data we try....

MD12 is nothing but change planned order...

After that we use COMMIT ..nothing but save in database.

Rollback is nothing but stop the database changes...

in BAPI's The F.m is BAPI_TRANSACTION_COMMIT...

Thanks & Regards,

Padmaja