2016 Jul 06 1:44 PM
Hi there,
I'm trying to clear some values of a bill of material (MBOM) with the function module CSAP_MAT_BOM_MAINTAIN. To achieve this I leave the fields empty - the fields are stko-alt_text, stko-bom_text and stpo-item_text1.
But as a result my values are completely ignored. They won't be updated.
If I try to fill the fields with not-empty-values, they are updated indeed and everything works fine.
My question: what do I have to do to clear the fields? Is there a special character to indicate that I want to change the value to emptiness? I'm very grateful for every advice.
Thanks
Here are some excerpts from my coding:
´ * clear header data
CLEAR: ls_stko1-alt_text,
ls_stko1-bom_text.
* clear position data
LOOP AT lt_stpo INTO ls_stpo.
CLEAR ls_stpo-item_text1.
MODIFY lt_stpo FROM ls_stpo.
ENDLOOP.
...
CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN'
EXPORTING
material = ls_mast-matnr
plant = ls_mast-werks
bom_usage = ls_mast-stlan
alternative = ls_mast-stlal
change_no = ls_mast-aennr
i_stko = ls_stko1
TABLES
t_stpo = lt_stpo
EXCEPTIONS
error = 1.
2016 Jul 11 10:30 AM
I found a solution to the problem myself. The FM that initializes the logging (CALO_INIT_API) has a parameter called "data reset sign". When you fill this with a special character (for example "!") you can use this as a delete indicator in the structures of CSAP_MAT_BOM_MAINTAIN.
It doesn't work in S4. Any other solutions in S4?
2016 Jul 06 7:27 PM
As per the FM documentation,
Restrictions:
To date, changes to the BOM header are not yet supported.
Please note:
The item to be changed can be identified in two ways:
via the fields item category, item number, sort string, and object (depending on the item category, this can be material, document data, or class data).
The names of these identifying fields begin with 'ID_' and are contained in structure CSIDENT_02. Structure CSIDENT_02 is part of structure STPO_API03.
You can use any combination of these fields to identify the item, provided the fields identify the item uniquely. Otherwise you see the error message 'Item cannot be identified uniquely'.
via the BOM node and BOM item counter
These fields are only known to the system if you have read the BOM before. If you identify the item in this way, you should therefore use function modules CSAP_MAT_BOM_OPEN, CSAP_BOM_ITEM_MAINTAIN, or CSAP_MAT_BOM_CLOSE to change the BOM.
And it has provided a detailed example. Please follow that.
For e.g.,
*-- to change the quantity
clear tstp3.
tstp3-id_item_no = '0010'. "Item identification
tstp3-comp_qty = '5.000'.
append tstp3.
2016 Jul 07 7:40 AM
Hi,
thanks for your reply... but like I wrote in my description, I am able to change existing values (header AND position by the way) to new values.
My problem only appears when I want to CLEAR the fields so that as a result my fields are EMPTY.
Maybe my description is not fully clear: I am trying to change existing BOM structures. Therefore I first read the existing BOM with the FM CSAP_MAT_BOM_READ. In the next step I only change my three fields and transfer the structures to CSAP_MAT_BOM_MAINTAIN.
2016 Jul 07 8:44 PM
Ok, got it. Instead of CLEAR, can you try pass an empty value and check? I'm not sure if it works though!!
For e.g, ls_stko1-alt_text = ' '.
2016 Jul 08 12:08 PM
Hi ravi,
yes I also tried passing an empty value. But it has the same effect.
2016 Jul 11 10:30 AM
I found a solution to the problem myself. The FM that initializes the logging (CALO_INIT_API) has a parameter called "data reset sign". When you fill this with a special character (for example "!") you can use this as a delete indicator in the structures of CSAP_MAT_BOM_MAINTAIN.
2023 Jul 26 10:50 AM
Hi Sven
Thank you very much for such as useful and helpful answer!!!
2016 Aug 17 6:55 AM
Thanks so so so much! We came accross this problem several months ago. No alternative solution found In these month until today.Helps a lot.
2025 Mar 06 7:55 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |