06-28-2006 9:39 AM
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
06-28-2006 9:51 AM
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
06-28-2006 10:00 AM
Hi Jacek
I did the same, along with gwa_stpo-fldelete = 'X'.
i passed the item number also
Regards
MD
06-28-2006 9:54 AM
Hi Madhan ,
are u doing at the same time ?
first delete and then Upload new BOm.
Regards
Prabhu
06-28-2006 9:59 AM
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
06-28-2006 10:02 AM
hi Madhan ,
any comments on jaces Post ? check that one.
Regards
Prabhu
06-28-2006 10:04 AM
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>
06-28-2006 10:27 AM
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
06-28-2006 10:34 AM
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