Application Development 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: 

BOM Allocataion Deletion RFC

Former Member
0 Kudos

Hi Everybody,

Who had used the BOM Allocation Deletion Function Module: CSAP_MAT_BOM_ALLOC_DELETE ?

I use this FM to delete the BOM Allocation of plant: 0498 and BOM: '98-000122'

code:as below :

REFRESH: T_PLANT.

CLEAR:T_PLANT.

T_PLANT-PLANT = '0498'.

APPEND T_PLANT.

CALL FUNCTION 'CSAP_MAT_BOM_ALLOC_DELETE'

EXPORTING

MATERIAL = '98-000122'

PLANT = '0498'

BOM_USAGE = '8'

ALTERNATIVE = '01'

  • FL_NO_CHANGE_DOC = ' '

FL_COMMIT_AND_WAIT = 'X'

  • IMPORTING

  • FL_WARNING =

  • BOM_NO =

TABLES

T_PLANT = T_PLANT

EXCEPTIONS

ERROR = 1

OTHERS = 2

.

when I run the programme, the result is the system variant sy-subrc is 0 . but when I used Tcode: cs08 to display the Bom allocation , the alloction of plant: 0498 and bom: '98-000122' is also exist. I don't konw where the problem is.

Anyone who can help me ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try passing the Material in Internal Format. Use Conversion Routine Funtion Module and then pass to FM.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'

EXPORTING

INPUT = GV_IT_S600-MATNR

IMPORTING

OUTPUT = GV_IT_S600-MATNR.

CALL FUNCTION 'CSAP_MAT_BOM_ALLOC_DELETE'

EXPORTING

MATERIAL = GV_IT_S600-MATNR

PLANT = '0498'

BOM_USAGE = '8'

ALTERNATIVE = '01'

  • FL_NO_CHANGE_DOC = ' '

FL_COMMIT_AND_WAIT = 'X'

  • IMPORTING

  • FL_WARNING =

  • BOM_NO =

TABLES

T_PLANT = T_PLANT

EXCEPTIONS

ERROR = 1

OTHERS = 2

.

If still it doesnt work, try to convert all the values to internal format and use in FM...

Hope it helps!!

Rgds,

Pavan

3 REPLIES 3

Former Member
0 Kudos

Hi,

Try passing the Material in Internal Format. Use Conversion Routine Funtion Module and then pass to FM.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'

EXPORTING

INPUT = GV_IT_S600-MATNR

IMPORTING

OUTPUT = GV_IT_S600-MATNR.

CALL FUNCTION 'CSAP_MAT_BOM_ALLOC_DELETE'

EXPORTING

MATERIAL = GV_IT_S600-MATNR

PLANT = '0498'

BOM_USAGE = '8'

ALTERNATIVE = '01'

  • FL_NO_CHANGE_DOC = ' '

FL_COMMIT_AND_WAIT = 'X'

  • IMPORTING

  • FL_WARNING =

  • BOM_NO =

TABLES

T_PLANT = T_PLANT

EXCEPTIONS

ERROR = 1

OTHERS = 2

.

If still it doesnt work, try to convert all the values to internal format and use in FM...

Hope it helps!!

Rgds,

Pavan

0 Kudos

Dear Pavan ,

Thanks for your answer. But there some question in your answer.

first, if you want to convert the external material no to internal material no maybe the FM: CONVERSION_EXIT_MATN1_INPUT will be better.

second. when I convert the material to internal material no the FM return the error message: Data is incomplete.

so I think maybe this is not the piont. But I also want to thanks for your answer .

Former Member
0 Kudos

My problem is solved. The problem is caused by the BOM material releated other material. When I create a new BOM and allocation the plant to this new BOM and then I use this FM to delete the BOM allocation . that's successful.