2009 Apr 15 7:32 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
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
2009 Apr 15 8:21 AM
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
2009 Apr 15 9:44 AM
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
2009 Apr 15 10:01 AM
Hi
Please use the below function modules.
CSAP_MAT_BOM_OPEN
CSAP_BOM_ITEM_MAINTAIN
CSAP_MAT_BOM_CLOSE
Cheers,
Hakim
2009 Apr 15 1:27 PM
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.
2009 Dec 29 4:44 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |