on 12-09-2015 7:34 AM
Hello Experts,
I have a requirement for replacing the existing BOM components with new components in uniform period automatically.
I have tried FM CSAP_MAT_BOM_MAINTAIN & CSAP_MAT_ITEM_MAINTAIN and asked my ABAPer to execute the same by using syntax for commit work but still i am unable to find the required result.
Please help me with a possible solution.
Thanks & Regards
Kiran Subudhi
Hi Kiran,
the documentation provided with CSAP_MAT_BOM_MAINTAIN function module is quoting an example (ABAP code) that is, among other things, also performing a component change in the BOM.
I have just give it a try, slightly modifying the AM example code to adapt it to my sandbox system peculiarities (materials code, plant, etc) and indeed it's working properly.
Here is the code I used:
REPORT zflatest.
*---- BOM header data structure
DATA: BEGIN OF tstk2.
INCLUDE STRUCTURE stko_api02.
DATA: END OF tstk2.
*---- BOM items table
DATA: BEGIN OF tstp3 OCCURS 0.
INCLUDE STRUCTURE stpo_api03.
DATA: END OF tstp3.
DATA: BEGIN OF tstko OCCURS 0.
INCLUDE STRUCTURE stko_api01.
DATA: END OF tstko.
*- Initialize database log
CALL FUNCTION 'CALO_INIT_API'
EXCEPTIONS
log_object_not_found = 1
log_sub_object_not_found = 2
other_error = 3
OTHERS = 4.
*- Fill item data
* Exception: items that can be identified uniquely via their item
* number
* 3. Item 0010: change component
CLEAR tstp3.
tstp3-id_item_no = '0010'. "Item identification
tstp3-component = '000000000000200149'.
APPEND tstp3.
*- Change BOM
CALL FUNCTION 'CSAP_MAT_BOM_MAINTAIN'
EXPORTING
material = '000000000004001280'
plant = '4000'
bom_usage = '1'
valid_from = '09.12.2015'
fl_bom_create = ' '
fl_new_item = ' '
i_stko = tstko
IMPORTING
o_stko = tstk2
TABLES
t_stpo = tstp3
EXCEPTIONS
OTHERS = 1.
IF sy-subrc EQ 1.
*---- Error
* Please see log
ENDIF.
Please go through it with your ABAPer and adjust it to your needs.
I do hope it will be of some help.
Thanks and regards,
Flavio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
What is the error message that you get ?
Best Regards,
Ameya B.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.