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

BOM maintain.

Former Member
0 Likes
1,302

HI,

I am using the following function modules to change my BOM.

my sy-subrc value is 0 for fst two function modules

and for the third function module it is giving sy-subrc as '1'.

and gving message as "No BOM was opened or an error occurred opening the BOM".

As i opened my BOM successfully even i am getting the error.

Any inputs please

CALL FUNCTION 'CSAP_MAT_BOM_OPEN'

EXPORTING

material = gv_matnr

plant = gv_werks

bom_usage = gv_stlan

valid_from = gv_fdate

IMPORTING

o_stko = wa_stko2

TABLES

t_stpo = it_stpo

t_dep_data = it_dep_data

t_dep_descr = it_dep_descr

t_dep_order = it_dep_order

t_dep_source = it_dep_source

t_dep_doc = it_dep_doc

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc NE 0.

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

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

ENDIF.

CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN'

EXPORTING

material = gv_matnr

plant = gv_werks

bom_usage = gv_stlan

valid_from = gv_fdate

i_stko = wa_stko

IMPORTING

o_stko = wa_stko1

TABLES

t_stpo = it_stpo1

t_dep_data = it_dep

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

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

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

ENDIF.

CALL FUNCTION 'CSAP_MAT_BOM_CLOSE'

EXPORTING

fl_commit_and_wait = 'X'

IMPORTING

fl_warning = lv_y

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

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

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

ENDIF.

Edited by: Rasheed salman on Apr 15, 2009 8:33 AM

HI,

I am using the following function modules to change my BOM.

my sy-subrc value is 0 for fst two function modules

and for the third function module it is giving sy-subrc as '1'.

and gving message as "No BOM was opened or an error occurred opening the BOM".

As i opened my BOM successfully even i am getting the error.

Any inputs please

CALL FUNCTION 'CSAP_MAT_BOM_OPEN'

EXPORTING

material = gv_matnr

plant = gv_werks

bom_usage = gv_stlan

valid_from = gv_fdate

IMPORTING

o_stko = wa_stko2

TABLES

t_stpo = it_stpo

t_dep_data = it_dep_data

t_dep_descr = it_dep_descr

t_dep_order = it_dep_order

t_dep_source = it_dep_source

t_dep_doc = it_dep_doc

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc NE 0.

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

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

ENDIF.

CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN'

EXPORTING

material = gv_matnr

plant = gv_werks

bom_usage = gv_stlan

valid_from = gv_fdate

i_stko = wa_stko

IMPORTING

o_stko = wa_stko1

TABLES

t_stpo = it_stpo1

t_dep_data = it_dep

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

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

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

ENDIF.

CALL FUNCTION 'CSAP_MAT_BOM_CLOSE'

EXPORTING

fl_commit_and_wait = 'X'

IMPORTING

fl_warning = lv_y

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

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

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

ENDIF.

Edited by: Rasheed salman on Apr 15, 2009 8:33 AM

5 REPLIES 5
Read only

Former Member
0 Likes
1,008

Hello ,

No need to the FM CSAP_MAT_BOM_OPEN,CSAP_MAT_BOM_CLOSE and remove from the code.

The above FM's are used only when u wil use the FM CSAP_BOM_ITEM_MAINTAIN.

insted of the above u acn use the this FM CSAP_MAT_BOM_MAINTAIN . Before using this FM

Read the bom and pass the value to the above Fm , if you are changing the BOm.

Regards

Dinesh

Read only

0 Likes
1,008

Hi Dinesh

Welcome TO SDN.

but SAP Document clearly says to use all three Function modules together.

Please check the SAP Document Regarding these function modules.

Regards

Read only

0 Likes
1,008

Hi

Please use the below function modules.

CSAP_MAT_BOM_OPEN

CSAP_BOM_ITEM_MAINTAIN

CSAP_MAT_BOM_CLOSE

Cheers,

Hakim

Read only

Former Member
0 Likes
1,008

hi

check carfully is sy-subrc eq 0. then the bom is opened form the fst FM.

so it clear that is oppend u need check the final FM .

debugg it carefully u will get the solution.

Read only

Former Member
0 Likes
1,008

I solved by doing BDC