BAPI for AFS BOM Creation through Cost Sheet
Hello Experts,
Is there any way to create the AFS BOM through BAPI.
Client requirement is to create the automatic AFS BOM through Cost Sheet (KKE1), I already developed custom Cost Sheet as per the requirement .
When we create the Cost Sheet Using KKE1 / ZKKE1, automatically AFS BOM should be create in the system with all grid values of component.
I'm not getting how should I create the AFS BOM using all the components in the Cost Sheet with Grid values.
There is no issue in creation of simple BOM using Bapi but for AFS BOM I'm facing problem.
Please suggest and also tell the possibility.
Thanks & Regards
Prajyot.D
Hi! Thanks for your help. I used CS_BI_BOM_CREATE_BATCH_INPUT1 and was able to create the BOMs successfully. My problem now is on the change. I tried using CS_BI_BOM_CHANGE_BATCH_INPUT but I kept running into various errors. I think it has something to do with the fields that I am populating in the structures and tables that are being passed to the BAPI. I tried researching for CS_BI_BOM_CHANGE_BATCH_INPUT but could not find any match. The function module documentation is not available as well. If you have used this FM in the past, will appreciate if you could share some inputs on how you were able to make this work. Thanks a lot!
Similar Messages
-
BAPI for AFS Delivery creation
Hi all,
Does anyone know which BAPI can be used for creating Delivery for AFS items with ref to Sales Order ?
I tried BAPIs like BAPI_OUTB_DELIVERY_CREATE_SLS but there's no field to input schedule line number. So all content I input is not to SL-level but only to Sales order item level.
Thanks!
Edited by: George Sung on May 27, 2010 12:16 PMDear Kumar/All
Is it possible to create AFS PO using bapi_po_create1 with delivery schedules
if you done that , kindly let me know it will be of great help.
thanks
Prabhu Shanmugham -
Dear all,
Trying to create AFS PO by using BAPI_PO_CREATE1
Passing grid size in field SCH_SIZE (J_3ASIZE) in AFS_POSCHEDULE and after commiting transaction the purchase order is getting created with all info except grid size,
Where we need to pass the grid size inorder to update the same in delivery schedule tab of PO (EKET table)
Anyone, please throw a light on this issue and help us.
Thanks in advance,
KumarDear Kumar/All
Is it possible to create AFS PO using bapi_po_create1 with delivery schedules
if you done that , kindly let me know it will be of great help.
thanks
Prabhu Shanmugham -
Hi All,
Is there any BAPI for Order BOM
PLS can you help me
thanks
marsHi,
Check ds BAPI..
BAPI_MATERIAL_BOM_GROUP_CREATE Creation of a material BOM group
BAPI_MAT_BOM_EXISTENCE_CHECK Check whether BOM for material exists
CSUL CRM Upload of BOM Data
BAPI_BOM_UPLOAD_SAVE Main Module for BOM Update (Upload from CRM)
Code_
DATA: BEGIN OF i_bom OCCURS 0,
matnr(18),
werks(4),
stlan(1),
stlal(2),
stktx(40),
bmeng(16),
menge(16),
posnr(4),
postp(1),
meins(3),
datuv(10),
fmeng(1),
idnrk(18),
potx1(40),
ausch(7),
END OF i_bom.
Extracting Document and Doc type for POSTP = D.
DATA : BEGIN OF i_stpo OCCURS 1,
doknr(25),
dokar(3),
posnr(4),
stlnr LIKE mast-stlnr,
END OF i_stpo.
Local work area
DATA: g_my_rec_in LIKE i_bom.
Declare internal table for Call Transaction and BDC Session
DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Global Variables *
DATA: g_counter(2) TYPE n,
g_field_name(18) TYPE c,
zc_yes TYPE syftype VALUE 'X'.
Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
PARAMETERS: p_fname1 TYPE localfile .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
PARAMETERS: p_rloc1 AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-005.
PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZBOM'.
SELECTION-SCREEN END OF BLOCK c.
SELECTION-SCREEN END OF BLOCK b.
SELECTION-SCREEN END OF BLOCK a.
**WRITE the report header
TOP-OF-PAGE.
INCLUDE zheading.
Start of selection *
START-OF-SELECTION.
Load Input file
PERFORM f_load_input_file.
Create BDC records.
PERFORM create_bdc_records .
*& Form Create_BDC_records
text:* perform the BDC for the records in the internal table
--> p1 text
<-- p2 text
FORM create_bdc_records .
DATA: v_stlnr LIKE mast-stlnr.
DATA: v_postp(1) VALUE 'D'.
IF NOT i_bom[] IS INITIAL.
Open BDC session
PERFORM open_bdc_session.
SORT i_bom BY matnr werks posnr.
SELECT SINGLE stlnr INTO v_stlnr
FROM mast
WHERE matnr = i_bom-matnr
AND werks = i_bom-werks.
SELECT doknr dokar posnr stlnr
INTO TABLE i_stpo
FROM stpo
FOR ALL ENTRIES IN i_bom
WHERE postp = v_postp
AND posnr = i_bom-posnr
AND stlnr = v_stlnr.
SORT i_stpo BY posnr stlnr.
LOOP AT i_bom.
g_my_rec_in = i_bom.
READ TABLE i_stpo WITH KEY posnr = i_bom-posnr
stlnr = v_stlnr
BINARY SEARCH.
AT NEW matnr.
CLEAR i_bdc_table[].
PERFORM insert_screen_header.
ENDAT.
Setting up counter for 20 line items
IF g_counter = 20.
g_counter = 1.
ENDIF.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
*next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-FMENG(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
CONCATENATE 'RC29P-POSNR(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-posnr.
CONCATENATE 'RC29P-IDNRK(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-idnrk.
CONCATENATE 'RC29P-MENGE(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-menge.
CONCATENATE 'RC29P-MEINS(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-meins.
CONCATENATE 'RC29P-POSTP(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-postp.
CONCATENATE 'RC29P-FMENG(' g_counter ')' INTO g_field_name.
PERFORM bdc_field USING g_field_name i_bom-fmeng.
*next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
Check the Item category to direct the screen flow accordingly.
CASE i_bom-postp.
WHEN 'B'.
PERFORM item_text_insert.
WHEN 'Z'.
PERFORM item_text_insert.
WHEN 'T'.
PERFORM item_text_insert.
WHEN 'N'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-AUSCH'.
PERFORM bdc_field USING 'RC29P-AUSCH' i_bom-ausch.
next screen
PERFORM item_text_insert.
*next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0133'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RC29P-EKORG' ' '.
WHEN 'D'.
PERFORM bdc_field USING 'RC29P-DOKNR' i_stpo-doknr.
PERFORM bdc_field USING 'RC29P-DOKAR' i_stpo-dokar.
next screen
PERFORM item_text_insert.
When POSTP = X, L.
WHEN OTHERS.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-AUSCH'.
PERFORM bdc_field USING 'RC29P-AUSCH' i_bom-ausch.
next screen
PERFORM item_text_insert.
ENDCASE.
g_counter = g_counter + 1.
next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-POSNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE' '=FCBU'.
AT END OF matnr.
PERFORM insert_bdc_new.
ENDAT.
ENDLOOP.
CLEAR i_bom[].
PERFORM close_bdc_session.
Release the BDC sessions created
PERFORM release_bdc.
ENDIF.
ENDFORM. " open_group
*& Form bdc_dynpro_start
Initialize the screen
-->P_G_PROGRAM_1
-->P_G_SCREEN
FORM bdc_dynpro USING p_g_program_1
p_g_screen.
CLEAR i_bdc_table.
i_bdc_table-program = p_g_program_1.
i_bdc_table-dynpro = p_g_screen.
i_bdc_table-dynbegin = 'X'.
APPEND i_bdc_table.
ENDFORM. " bdc_dynpro_start
*& Form bdc_field
Insert field *
FORM bdc_field USING f_name f_value.
CLEAR i_bdc_table.
i_bdc_table-fnam = f_name.
i_bdc_table-fval = f_value.
APPEND i_bdc_table.
ENDFORM. "bdc_insert_field
*& Form open_bdc_session
Open the BDC session
FORM open_bdc_session .
Open BDC session and creat and update condition records
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
DEST = FILLER8
group = p_group
HOLDDATE = FILLER8
keep = 'X'
user = sy-uname
RECORD = FILLER1
PROG = SY-CPROG
IMPORTING
QID =
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " create_bdc_session
*& Form insert_screen_header
Insert the Header data into the screens
FORM insert_screen_header .
g_counter = 1.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29N-STLAL'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RC29N-MATNR' g_my_rec_in-matnr.
PERFORM bdc_field USING 'RC29N-WERKS' g_my_rec_in-werks.
PERFORM bdc_field USING 'RC29N-STLAN' g_my_rec_in-stlan.
PERFORM bdc_field USING 'RC29N-STLAL' g_my_rec_in-stlal.
PERFORM bdc_field USING 'RC29N-DATUV' g_my_rec_in-datuv.
next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0110'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29K-BMENG'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'RC29K-STKTX' g_my_rec_in-stktx.
PERFORM bdc_field USING 'RC29K-BMENG' g_my_rec_in-bmeng.
*next screen
PERFORM bdc_dynpro USING 'SAPLCSDI' '0111'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29K-LABOR'.
ENDFORM. " insert_screen_header
*& Form insert_bdc
Insert the BDC session
FORM insert_bdc_new .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'CS01'
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
SIMUBATCH = ' '
CTUPARAMS = ' '
TABLES
dynprotab = i_bdc_table
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR i_bdc_table[].
ENDFORM. " insert_bdc
*& Form close_bdc_session
Close the BDC session
FORM close_bdc_session .
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " close_bdc_session
*& Form f_load_input_file
Load the file into the Internal table
FORM f_load_input_file.
IF p_rloc1 = zc_yes.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_fname1
filetype = 'DAT'
TABLES
data_tab = i_bom
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
STOP.
ENDIF.
ENDIF.
ENDFORM. " f_load_input_file
*& Form release_bdc
Release BDC session
FORM release_bdc.
SUBMIT rsbdcsub WITH mappe EQ p_group
WITH von EQ sy-datum
WITH bis EQ sy-datum
WITH fehler EQ '.'
EXPORTING LIST TO MEMORY
AND RETURN.
ENDFORM. " release_bdc
*& Form item_text_insert
Repetitive code in the screen flow
FORM item_text_insert.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'BDC_CURSOR' 'RC29P-POTX1'.
PERFORM bdc_field USING 'RC29P-POTX1' i_bom-potx1.
ENDFORM. " item_text_insert
Reward If Helpfull
regards,
Mehul -
IDOC/BAPI for Production order creation from Legacy system
Hi all
We are using an interface to create Production orders from legacy to SAP. Would you recommend an IDOC or a BAPI to create Production orders. If IDOC or BAPI then could you please mention which one?
thanks a bunchHi John,
For your purposes, please use BAPI for production order creation from legacy system. There is no standard inbound IDoc available to use. SAP has an IDoc for outbound interface only (message type LOIPRO).
If there is an inbound IDoc available, I would recommend to use an IDoc.
IDoc technology has excellent error handling and will allow you to reprocess an error (if any).
BAPI is also good approach to use and fast in term of processing.
For BAPI approach, you can use BAPI BAPI_PRODORD_CREATE.
Hope this will help.
Regards,
Ferry Lianto -
Can u tell me any predefined BAPI for change and creation of Material
Hi,
Can anybody tell me predefined BAPI for change and creation of Materialmasterand Pricing?
Thanks & regards,
Gopianne.you can use the BAPI to BAPI_MATERIAL_SAVEDATA create as well as to change material master.
When changing material master data, you need enter only the material
number.
In the header data, you must select at least one view for which data is
to be created. Depending on the view selected, you must maintain other
required parameters. If you do not enter values for all of the required
parameters, the method is ended with an error message.
The corresponding fields in the tables (such as CLIENTDATA) must first
be supplied with data by the calling program. An indicator must also be
set for each of these fields so that the data is written to the database
by the method. This requires the calling program to supply the
corresponding field with the indicator in a checkbox table (for example,
CLIENTDATAX). Checkbox tables exist for tables that do not contain any
language-dependent texts (MAKT, MLTX), International Article Numbers
(MEAN), or tax classifications (MLAN). Several data records for a
material can be created in these tables.
regards
vivek
reward points if it helps -
BAPI for Outbound Delivery Creation with reference to Sales Order
Dear all,
I'm on R/3 4.6B platform and to develop an RFC for outbound Delivery creation instead of using the standard VL01N transaction.
I've review BAPI for Outbound Delivery Creation with reference to Sales Order - VL01N thread which suggest BAPI_DELIVERYPROCESSING_EXEC .
However, in 4.6B, that function module doesn't exist. Appreciate any suggestion and or workaround.
Thanks.
Steven
Edited by: Steven Khoo on Mar 25, 2010 7:13 AM
Edited by: Steven Khoo on Mar 25, 2010 7:14 AMNot required anymore
-
BAPI for Service order creation
Hi ,
Please tell me if any Bapi for service order creation , T-code : IW31
regards,
PrakashHi Prakash,
Have a look on the following BAPIs:
BAPI_ISUSMORDER_CREATEMULTIPLE - Create Service Orders
BAPI_ALM_CONF_CREATE - Create confirmation for maintenance/service order
WTY04_CREATE_SERVICE_ORDER - Create Service order via function module.
Hope this will help.
Regards,
Nitin. -
Is there any Bapi for Physical Sample creation
Hi Folks,
Is there any Bapi for physical sample creation. My scenario is like this I have the data in the table (material, plant, batch, type,vendor, vendorbatch ). For each material i have to create a physical sample......
Any ideas or suggestions would be appreciated..
thanks
chaithanya.HI Chaitanya,
You can use : BAPI_BATCH_CREATE
it has import paramaters like Material, Plant , batch , Batch Attributes ( Vendor No, Vendor Batch etc)... I guess this is what you are looking for.
Regards,
-Venkat. -
Please Tell me the Standard Bapi for Purchase Order Creation
Hi,
Please tell me the standard BApi for the PO creation. How to excute the standard Bapi. Please help me.
Regrads
MohanHi Mohan,
Use this BAPI BAPI_PO_CREATE1.
Check this post, you have program aswell
https://forums.sdn.sap.com/click.jspa?searchID=7294168&messageID=1172796
Regards,
Satish -
BAPI for delivery doc creation required
Hi All,
I need to develop a program wherein I need to create a sales order, delivery order, PGI(post goods issue) and invoice.......I have identified the bapi for sales order creation as bapi_sales_order_create..
I request u to kindly help with the others....lemme know the relevant bapis for the others...Hi,
Chk the FM's given below..Hope this will help you...
BAPI For Delivery Order
BAPI_DELIVERYPROCESSING_EXEC
BAPI to post a Goods issue
BAPI_OUTB_DELIVERY_CONFIRM_DEC "inbound Delivery
Filling HEADEWR_DATA-DELIV_NUMB, HEADER_CONTROL-DELIV_NUMB, DELIVERY with the delivery number and HEADER_CONTROL-POST_GI_FLG with 'X' does the job.
BAPI_OUTB_DELIVERY_CONFIRM_DEC " outboung Delivery
Reward Points if helpful.
Regards,
Harini.S -
FM or BAPI for Transfer Order creation in eWM
Hello ALL,
Please provide any FM or BAPI for Transfer Order creation in eWM. i know how to create transfer order in ERP.I tried to find out a FM or BAPI in SCM eWM but failes to get one.
Kindly help.
BR,
Anil..Hi,
Try using FM WS_LM_TRANSFER_ORDER_CREATE.
I hope this is available in ur system
Thanks -
Is there any standard BAPI to create Equipment BOM? Tcode - IB01
Hello,
I use that bapi for create BOM but not equipement BOM.
I find on forum, response wiche can help you :
Equipment BOM Upload BAPI
RFC / BAPI for Equipment BOM - IB01
http://wiki.sdn.sap.com/wiki/display/ABAP/ECCstandardBatchInputprograms
Thierry -
BAPI for automatic Pr creation witth multiple files from excel sheet
I have written a programm for automatic PR creation with the help of bapi , where its picks data from excel sheet and makes PR .It is picking excel files from one folder(Files) for PR creation and moving to another folder(Files sucess).
now the problem is if Folder (Files) contains one excel sheet ,PR is created fine , but if the Folder(Files) have multiple excel sheet ,its is creating 1st PR right, but next PR's contains all the line item of 1st PR , 2nd PR and so on .can anyone suggest me where is the problem in codes.
types : begin of x_file ,
key1(10),
pur_grp(4),
maktx(40),
plant(4) ,
req(10),
s_qty(13),
wbs(24),
gl(10),
trackno(10),
supl(4),
deladd(255).
types : end of x_file .
data : str5 type char10.
data : mm type char2.
data : yyyy type char4.
data : dd type char2.
data : str9 type char10.
data : str6 type char10.
data : month type char2.
data : year type char4.
year = sy-datum+0(4).
month = sy-datum+4(2).
dd = sy-datum+6(2).
yyyy = sy-datum+0(4).
mm = sy-datum+4(2).
dd = sy-datum+6(2).
clear str6 .
clear str5.
concatenate dd'.' month '.' year into str5 .
concatenate yyyy mm dd into str6 .
DATA : file type rlgrap-filename .
data : it_file type table of x_file .
data : wa_file type x_file .
data : it_header type table of x_file .
data : wa_header type x_file .
*& Internal Table For Define Row and Coloum Postion
data: col_start type i value 1 ,
row_start type i value 2,
col_end type i value 256 ,
row_end type i value 65000 .
*& Internal Table For Retrieve Data From Excel
*data: excel_bdcdata like kcde_cells occurs 0 with header line.
*data: excel_bdcdata1 like kcde_cells occurs 0 with header line.
data: excel_bdcdata like ALSMEX_TABLINE occurs 0 with header line.
data: excel_bdcdata1 like ALSMEX_TABLINE occurs 0 with header line.
data: it_index type i.
DATA : IT_INDEX1 TYPE I.
*& Define Field Symbol
field-symbols: <fs> .
data : bdcdata like bdcdata occurs 0 with header line.
data : messtab like bdcmsgcoll occurs 0 with header line.
data : req_items type table of bapiebanc .
data : wa_req_items type bapiebanc .
data : req_acc_asg type table of bapiebkn.
data : wa_req_acc_asg type bapiebkn.
DATA : RETURN LIKE BAPIRETURN OCCURS 0 WITH HEADER LINE .
*data : return type table of bapireturn.
*data : wa_return type bapireturn .
data : number type ebeln .
*****************************MOVE FILES******************************
data : xsource type string .
data : xdestin type string .
data : destin1 type string .
data : destin2 type string .
DATA : DEST1 TYPE STRING.
DATA : DEST11 TYPE STRING.
DATA : DEST2 TYPE STRING.
DATA : DEST22 TYPE STRING.
data : sou_dir_name like SALFILE-LONGNAME.
data : tar_dir_name like SALFILE-LONGNAME.
data : tar_dir_name1 like SALFILE-LONGNAME.
data : sou_filename like EDI_PATH-PTHNAM .
data : tar_filename like EDI_PATH-PTHNAM .
data : filename1 type string .
data : tar_filename1 like EDI_PATH-PTHNAM .
data : file_itab like SALFLDIR occurs 0 with header line.
data : wa_file_itab like SALFLDIR.
data : file_count type i .
data : dir_count type i.
data : dir_table like sdokpath occurs 0 with header line.
data : file_table like SDOKPATH occurs 0 with header line.
data : wa_file_table like sdokpath.
data : strr type string ,
str1 type string ,
str2 type string ,
str3 type string .
DATA : PA_VAL TYPE CHAR1.
sou_dir_name = 'D:\barcodes\files\'.
tar_dir_name = 'D:\barcodes\files-success\'.
"success folder.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = sou_dir_name
FILTER = '.'
IMPORTING
FILE_COUNT = file_count
DIR_COUNT = dir_count
TABLES
FILE_TABLE = file_table
DIR_TABLE = dir_table
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
loop at file_table into wa_file_table.
clear : strr , str1 , str2 , str3 .
strr = wa_file_table-PATHNAME .
concatenate sou_dir_name strr into str1 .
concatenate tar_dir_name strr into str2 . " success
concatenate tar_dir_name1 strr into str3 . " failed
FILE = STR1 .
*start-of-selection.
*& Function For Retrieve Data From Excel
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = FILE
i_begin_col = col_start
i_begin_row = row_start
i_end_col = col_end
i_end_row = row_end
tables
intern = excel_bdcdata
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF sy-subrc NE 0.
WRITE : / 'File Error'.
EXIT.
ENDIF.
loop at excel_bdcdata.
translate excel_bdcdata to upper case .
move excel_bdcdata-col to it_index.
assign component it_index of structure wa_file to <fs> .
move excel_bdcdata-value to <fs>.
at end of row.
append wa_file to it_file .
clear wa_file.
endat.
endloop.
sort it_file by key1. "pur_grp maktx plant .
it_header[] = it_file[].
delete adjacent duplicates from it_header comparing key1 pur_grp maktx
plant .
data : h_item(5) type n .
data : h_pack(10) type n .
data : line_no(5) type n .
data : ln_no(5) type n .
loop at it_header into wa_header .
ln_no = 1.
h_item = h_item + 10.
h_pack = h_pack + 1.
wa_req_items-preq_item = h_item .
wa_req_items-doc_type = 'BOM'.
wa_req_items-pur_group = wa_header-pur_grp .
wa_req_items-MATERIAL = wa_header-maktx .
wa_req_items-plant = wa_header-plant .
wa_req_items-pckg_no = h_pack .
wa_req_items-deliv_date = str6 .
wa_req_items-item_cat = '0'.
wa_req_items-acctasscat = 'P'.
*wa_req_items-distrib = '2' .
**wa_req_items-gr_ind = 'X'.
wa_req_items-ir_ind = '2'.
wa_req_items-purch_org = 'TISL' .
wa_req_items-QUANTITY = wa_header-s_qty.
wa_req_items-PREQ_NAME = wa_header-req.
wa_req_items-SUPPL_PLNT = wa_header-supl.
wa_req_items-trackingno = wa_header-trackno.
append wa_req_items to req_items .
clear wa_req_items.
wa_req_acc_asg-preq_item = h_item .
wa_req_acc_asg-g_l_acct = wa_file-gl .
WA_req_acc_asg-wbs_elem = wa_header-wbs .
append wa_req_acc_asg to req_acc_asg .
clear wa_req_acc_asg.
h_pack = h_pack + 1 .
endloop.
clear ln_no .
***BREAK-POINT.
*& BAPI FUNCTION
call function 'BAPI_REQUISITION_CREATE'
importing
number = number
tables
requisition_items = req_items
requisition_account_assignment = req_acc_asg
return = return .Can someone please give me sol........
-
BAPI for Purchase Order Creation
Hi All,
Purchase Order creation through BAPI, Auto Po creation. Please advise program.
The requirement is: when we delivery the goods from one plant to another plant,PO should create in second plant with goods what delivered from first plant.
Pranitha
Moderator message : Spec/requirements dumping is not allowed. Thread locked.
Edited by: Vinod Kumar on Sep 30, 2011 3:37 PMHi,
As per u r requirement
you can use : BAPI => BAPI_PO_CREATE with suitable Document Type ( Stock trasnfert : STO )
IF u want to auto po must be created after each delivry in this case you need to use BADI
'MB_MIGO_BADI; In This BAPI There is method : POST_DOCUMENT
In this method u can write code for Auto PO Creation by using BAPI .
Hope This will Resolve u r query.
Thanks and Regads
Santosh
Maybe you are looking for
-
Single Record Form: fields display with the wrong width
I'm laying out fields on a single record form and notice that the width of the fields displayed when I run the form is less than the width I specify on the "Edit Page Item" page. Here are 3 examples: field 1: Display as=text, Width=100, Maximum Width
-
How do I invert meter in labview with needle pointing downwards
Hi, I need to invert meter in labview with needle pointing downwards . Can somebody guide me?
-
Call a stop() function
Hi, i dont know if the title makes much sense, but heres what im trying to do.. i'm practicing abit on playing and stopping the play head, heres what im working on: http://icg.awardspace.com/FLA the way it works now is, on rollover the logo spins, an
-
GRC V10: BRFplus rule transport
Hi experts, how is it possible to transport a brfplus rule. we generate a function module via SE37 and afterwards the rule. Are the decision table and all brfplus rule settings in the transport of the function module? Or should I transport the rule a
-
SAP Portal 7.31 - Fiori integration
Dear All, We are planning to configure Portal –Fiori. Portal is totally with BI reports. Should we need to do any SSO for Fiori ?? Current Portal level is 7.31 SP20. There are many docs in detailed on only particular area but I didn't see any step b