Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > SAP Forum > SAP ABAP HR Forum


Delimiter for BDC Program


Reply
Views: 1519  
Thread Tools Rate Thread
  #1  
Old 05-22-2009, 05:04 AM
bholus7
Guest
 
Posts: n/a
Default Delimiter for BDC Program

Can anybody tell me, if we are using excel sheet as a data provider for BDC Program, then how to define a delimiter so that my BDC programe should automatically split the field.

You either save the excel sheet as Tab delimited file or .csv file. and declare your internal table to get the corresponding the contents from the file. Then when its tab delimited or .csv, SPLIT the contents into respective fields.

Here is a sample for CSV file :

*declaration of internal tables.
DATA : BEGIN OF IT_DUMMY OCCURS 0,
TEXT(500),
END OF IT_DUMMY.

DATA : BEGIN OF IT_MAIN OCCURS 0,
MATNR LIKE RMMG1-MATNR, "material selection to change
DISLS LIKE MARC-DISLS, "lot size key
END OF IT_MAIN.

*uploading the input file********************************************** *
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = INPUT
TABLES
DATA_TAB = IT_DUMMY
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
OTHERS = 6.

*appending it_main by splitting the uploaded file
LOOP AT IT_DUMMY.
SPLIT IT_DUMMY AT ',' INTO IT_MAIN-MATNR IT_MAIN-DISLS.
APPEND IT_MAIN.
ENDLOOP.

Reply With Quote
Reply

New topics in SAP ABAP HR Forum





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)