2008 Jun 18 5:41 AM
Hi,
I'm using FM CS_BI_BOM_CREATE_BATCH_INPUT1 for Bill-of materials creation.can anyone tell me what parameters need to be passed to the following import parameters.
BDC_FLAG
CLOSE_GROUP
COMMIT_WORK
NEW_GROUP
TCODE_MODE
TCODE_UPDATE
Thanks in advance.
Nitu
2008 Jun 18 5:51 AM
Hi,
BDC_FLAG - Pass 'X' if you want to use call transaction by session method.
CLOSE_GROUP - Pass 'X' For session method
COMMIT_WORK - Pass 'X' for updating
NEW_GROUP - space
TCODE_MODE - Pass 'B' for background processing and 'A' for foreground
TCODE_UPDATE -Pass 'S' for synchronous update of database.
2008 Jun 19 10:58 PM
Hi ,
can you explain in detail what does each indicator do ? i.e what effect they will have in the BOM creation processs ? i'm not familiar with the technical stuff.
Thank You
2008 Jun 18 5:54 AM
Hi,
use this function module "BAPI_MATERIAL_BOM_GROUP_CREATE" for creating BOM for any material.
Regards,
Venkat N
2008 Jun 18 5:55 AM
Hi,
Check the following.
FORM process_bom_create_rfc
TABLES
bom_item STRUCTURE bicsp
bom_sub_item STRUCTURE bicsu
CHANGING
bom_header LIKE bicsk
e_return LIKE cad_return-value
e_message LIKE message-msgtx.
*- definition of local fields
DATA: l_msgid LIKE t100-arbgb,
l_msgno LIKE t100-msgnr,
tcode_mode(1) TYPE c,
lf_error(1) TYPE c.
*- convert date valid from
IF bom_header-aennr IS INITIAL AND
NOT ( bom_header-datuv IS INITIAL ).
DATA: lf_dat LIKE sy-datum. "HW 441712
MOVE bom_header-datuv TO lf_dat. "HW 441712
WRITE: lf_dat TO bom_header-datuv DD/MM/YYYY. "HW 441712
ENDIF.
*- clear date when change number and date is set
IF NOT ( bom_header-aennr IS INITIAL ) AND
NOT ( bom_header-datuv IS INITIAL ).
CLEAR: bom_header-datuv.
ENDIF.
*- set CAD flag to memory
EXPORT cad_flag TO MEMORY ID 'CAD'.
tcode_mode = 'N'.
*- call BATCH-INPUT
CALL FUNCTION 'CS_BI_BOM_CREATE_BATCH_INPUT1'
EXPORTING
bdc_flag = space
bom_header = bom_header
commit_work = 'X'
group_data = bgr00
tcode_mode = tcode_mode
tcode_update = 'A'
IMPORTING
msgid = l_msgid
msgno = l_msgno
msgty = hlp_msgty
msgv1 = hlp_msgv1
msgv2 = hlp_msgv2
msgv3 = hlp_msgv3
msgv4 = hlp_msgv4
TABLES
bom_item = bom_item
bom_sub_item = bom_sub_item
EXCEPTIONS
OTHERS = 1.
note 394776: clear memory id
CLEAR cad_flag.
EXPORT cad_flag TO MEMORY ID 'CAD'.
cad_flag = 'X'.
*- error -> exit without message
IF sy-subrc <> 0.
EXIT.
ENDIF.
hlp_msgid = l_msgid.
hlp_msgno = l_msgno.
*- get message string
CALL FUNCTION 'WRITE_MESSAGE'
EXPORTING
msgid = hlp_msgid
msgno = hlp_msgno
msgty = hlp_msgty
msgv1 = hlp_msgv1
msgv2 = hlp_msgv2
msgv3 = hlp_msgv3
msgv4 = hlp_msgv4
msgv5 = space
IMPORTING
error = lf_error
messg = gs_msg
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0. ENDIF.
*- set return code
IF gs_msg-msgty = 'E' OR NOT ( lf_error IS INITIAL ).
e_return = c_error.
ELSE.
e_return = c_ok.
ENDIF.
e_message = gs_msg-msgtx.
*- import BICSK from memory (to return the given alternative)
IF e_return = c_ok.
CLEAR bicsk.
IMPORT bicsk FROM MEMORY ID cad_bom_memid.
MOVE-CORRESPONDING bicsk TO bom_header.
ENDIF.
ENDFORM.
Regards,
Raj.
2008 Jun 18 6:01 AM
Hi,
Use the Function module 'CSAI_BOM_CREATE' inorder to create the BOM.
I think this would help you.
2008 Jun 18 6:06 AM
Hi Nitu
Try this......
BDC_FLAG = 'X' " this for yes indication(for catching exceptions )
CLOSE_GROUP "leave it blank or uncommented.
COMMIT_WORK = 'X' " this for yes indication(commit work will b executed by the calling program)
NEW_GROUP = 'X'
TCODE_MODE = 'N' "Processing mode for CALL TRANSACTION USING
TCODE_UPDATE = 'S' "Synchronous or asynchronous update(U can put "A" also here, yr wish )
Good day.
Rward points if found helpful.