Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1


Ratings: (0)|Views: 570|Likes:
Published by kattak2k
This Document Provides you sample code to uplaod the Material BOM using Transaction code CS01.

i Choose BDC boz BOM group is manditory in BAPI.
This Document Provides you sample code to uplaod the Material BOM using Transaction code CS01.

i Choose BDC boz BOM group is manditory in BAPI.

More info:

Published by: kattak2k on Nov 24, 2009
Copyright:Traditional Copyright: All rights reserved


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC or read online from Scribd
See more
See less


CS01 BOM BDC – Sample Code
XL File Format :
Header MaterialBOMComponentQtyUomScarp
FDIT004 Z7006300 100 KG 5FDIT004 Z7006230 200 KG 5FDIT004 Z7006210 5.981 KG 6
Sample Code:
*include bdcrecx1.
TABLES: t100.TYPES:BEGIN OFx_mat, matnr(18)TYPE c,  END OFx_mat,  BEGIN OFx_bom, matnr1(18)TYPE c, matnr2(18)TYPE c, qty(13)TYPE c, uom(3)TYPE c, scrap(5)TYPE c,
"Component Scrap % 
 END OFx_bom. DATA: t_internTYPE STANDARD TABLE OFalsmex_tabline , w_internTYPEalsmex_tabline.DATA: t_bdcdataTYPEbdcdataOCCURS 0 WITH HEADER LINE, messtabLIKEbdcmsgcollOCCURS 0 WITH HEADER LINE, w_bdcdataTYPEbdcdata.DATA: l_mstring(480). DATA: t_matTYPE STANDARD TABLE OFx_mat, t_bomTYPE STANDARD TABLE OFx_bom, w_matTYPEx_mat,w_bomTYPEx_bom.DATA: flag,idx1TYPEsy-tabix,
"loop index 
for table control
idn(4)TYPEn , fnam(30)TYPE c.
*&---------------------------------------------------------------------**& SELECTION 
- SCREEN *&---------------------------------------------------------------------*
Author: Katta Ravi Kiran
CS01 BOM BDC – Sample Code
PARAMETERS: p_pathTYPErlgrap-filenameDEFAULT 'C:\test data for BOM.x ls',p_modeTYPE c DEFAULT 'n', p_begcolTYPE i DEFAULT 1 NO-DISPLAY, p_begrowTYPE i DEFAULT 1 NO-DISPLAY, p_endcolTYPE i DEFAULT 100 NO-DISPLAY, p_endrowTYPE i DEFAULT 5000 NO-DISPLAY. SELECTION-SCREEN END OF BLOCKb1.
*&---------------------------------------------------------------------**& AT 
SELECTION-SCREEN *&---------------------------------------------------------------------*
ATSELECTION-SCREEN ON VALUE-REQUESTFORp_path.  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'  CHANGINGfile_name = p_path EXCEPTIONSmask_too_long =1 OTHERS=2.  IFsy-subrc <>0.  MESSAGE IDsy-msgidTYPEsy-msgtyNUMBERsy-msgno  WITHsy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF.INITIALIZATION. REFRESH: t_mat, t_bom,t_intern. CLEAR: w_mat,w_bom,w_intern,idn,flag.START-OF-SELECTION. CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'  EXPORTINGfilename = p_pathi_begin_col = p_begcoli_begin_row = p_begrowi_end_col = p_endcoli_end_row = p_endrow TABLESintern = t_intern EXCEPTIONSinconsistent_parameters =1upload_ole =2 OTHERS=3.  IFsy-subrc <>0.  MESSAGE IDsy-msgidTYPEsy-msgtyNUMBERsy-msgno  WITHsy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
Author: Katta Ravi Kiran
CS01 BOM BDC – Sample Code
 ENDIF. SORTt_internBYrow col.  LOOP ATt_internINTOw_intern..  CASEw_intern-col. WHEN 1. w_mat-matnr = w_intern-value.w_bom-matnr1 = w_intern-value. WHEN 2. w_bom-matnr2 = w_intern-value.
3.* w_bom-item = w_intern-value.
 WHEN 3. w_bom-qty = w_intern-value. WHEN 4. w_bom-uom = w_intern-value. WHEN 5. w_bom-scrap = w_intern-value. ENDCASE. AT END OFrow.  APPENDw_bomTOt_bom.  APPENDw_matTOt_mat.  CLEAR: w_bom,w_mat. ENDAT. ENDLOOP. SORTt_matBYmatnr.  DELETE ADJACENT DUPLICATES FROMt_matCOMPARINGmatnr.  SORTt_bomBYmatnr1.  DELETEt_bomWHEREmatnr2IS INITIAL.  REFRESHt_intern. LOOP ATt_matINTOw_mat.  REFRESH: t_bdcdata. CLEAR: w_bdcdata. PERFORMheader_details. CLEAR:idn. LOOP ATt_bomINTOw_bomWHEREmatnr1EQw_mat-matnr. idx1 = idx1 +1.idn = idx1 *10. IFidx1EQ 1.
Author: Katta Ravi Kiran

Activity (5)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Abu Rayhan liked this
Pulluri Venkat liked this
Sameer Kumar liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->