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: 

CSAP_MAT_BOM_MAINTAIN

Former Member
0 Kudos

Hi All

I have created a RFC function module and inside that function module i am using CSAP_MAT_BOM_MAINTAIN. for BOM Change.

I am trying a scenorio

Where a line item 10 (Component A) should be deleted and a line item 10 should be added with new component (Component B).

I am passing the right values.

When executed, i am getting the new component (Component B) added in BOM, but the old component (Component A) is not getting deleted.

Can anyone help on the same

Regards

MD

8 REPLIES 8

Former Member
0 Kudos

HI , look at the below code

gwa_stpo-fldelete = 'X'.

CALL FUNCTION 'CSAP_BOM_ITEM_MAINTAIN'

EXPORTING

i_stpo = gwa_stpo

EXCEPTIONS

error = 1.

It works for us fine,

BR, Jacek

0 Kudos

Hi Jacek

I did the same, along with gwa_stpo-fldelete = 'X'.

i passed the item number also

Regards

MD

Former Member
0 Kudos

Hi Madhan ,

are u doing at the same time ?

first delete and then Upload new BOm.

Regards

Prabhu

0 Kudos

Hi Prabu

Yes i wanted to do both at the same time, but i tried doing seprately also.

But still it is not working

Regards

MD

0 Kudos

hi Madhan ,

any comments on jaces Post ? check that one.

Regards

Prabhu

0 Kudos

Hi madan ,

can u tell me u are in doing all the Operations in the same Open session ?, i have gone thru Documentation of that FM

<b>


FU CSAP_BOM_ITEM_MAINTAIN
Functionality
The function modules CSAP_MAT_BOM_OPEN, CSAP_BOM_ITEM_MAINTAIN, and CSAP_MAT_BOM_CLOSE belong together as one unit.

Function module CSAP_MAT_BOM_OPEN opens a BOM so that you can make changes. The BOM is imported as it stands on the valid-from date you enter, and is locked for other users. You see a table of items and the BOM header data, unless an error occurs opening the BOM.

Provided that the BOM is opened without errors, you can then use function module CSAP_BOM_ITEM_MAINTAIN to edit individual items.

Once you have made your changes, use function module CSAP_MAT_BOM_CLOSE to exit BOM processing. Your changes are saved, and the BOM is unlocked.

Current restrictions:

You can only edit one alternative or variant at a time. You cannot enter an alternative for function module CSAP_MAT_BOM_OPEN, so you always see alternative 01.
There is no function module for making changes to header data.
Please note:

If you see the message 'Item cannot be changed' in the log, this means one of the following:
- The item is not valid on the valid-from date you entered. The item
  becomes valid on a later date.
- The item has been changed on the valid-from date you entered, using
  a different change number.
You cannot change the item category of an existing item.
If you want to delete an item, set the deletion indicator for the item.
You can only edit each item once from when you open the BOM until when you close the BOM.
Example 

</b>

0 Kudos

Hi Prabhu

I am doing in the same way as described by Jacek, but still i am getting the same.

I am checking again

Regards

MD

0 Kudos

Hi Prabhu / Jacek

There was some problem in the program.

i was not clearing a variable.

Now it is working fine, thanks for your help

Regards

MD