Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

LSMW

Former Member
0 Likes
460

Hii I am Sachin

How can i transfer excel and word data through LSMW or BDC

Hii I am Sachin

How can i transfer excel and word data through LSMW or BDC

2 REPLIES 2
Read only

Former Member
0 Likes
443

Hi,

How to upload data from excel sheet into an internal table

Refer the below code:

REPORT ZUPLOAD.

TYPE-POOLS: truxs.

PARAMETERS: p_file TYPE rlgrap-filename.

TYPES: BEGIN OF t_datatab,

col1(30) TYPE c,

col2(30) TYPE c,

col3(4069) TYPE c,

END OF t_datatab.

DATA: it_datatab type standard table of t_datatab,

it_words type table of tdline with header line,

wa_datatab type t_datatab.

DATA: it_raw TYPE truxs_t_text_data.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

field_name = 'P_FILE'

IMPORTING

file_name = p_file.

***********************************************************************

*START-OF-SELECTION.

START-OF-SELECTION.

CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'

EXPORTING

i_line_header = 'X'

i_tab_raw_data = it_raw " WORK TABLE

i_filename = p_file

TABLES

i_tab_converted_data = it_datatab[] "ACTUAL DATA

EXCEPTIONS

conversion_failed = 1

OTHERS = 2.

IF sy-subrc ne 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

***********************************************************************

*END-OF-SELECTION.

LOOP AT it_datatab INTO wa_datatab.

WRITE:/ wa_datatab-col1,

wa_datatab-col2,

wa_datatab-col3.

ENDLOOP.

Reward if found helpfull,

Cheers,

Chaitanya.

Read only

Former Member
0 Likes
443

Hi,

Use this document.. this is a step by step guide for using LSMW.

http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc

1) save the Excel as *.csv with a delimiter e.g. semi-colon (',')

2) read the CSV-file as plain text file

3) split the line at the delimer (',')

LSMW :

Enter Project Name => Module Name (Material Management)

Enter Subproject => Transaction Group (Master Data)

Enter Object Name => Transaction (Vendor Master)

Press Create / Change

Enter Projects Descriptions

Continue (F8)

Maintain Object Attributes

Execute (Ctrl+F8)

Press Display Changes button

Select Batch Input Recording (Radio Button)

Press Recordings – Overview button – (SHDB for Transaction Recording)

Press Create Recording

Enter Recording Name & Description

Enter Currently Using Transaction Code

Enter Needed Fields (Ex. Account Group for Vender Master)

Enter Values for All Uploading Field

Save

Press Default All Button

Maintain Source Structures

Press Display Changes button

Enter Source Structure Name & Description

Save

Maintain Source Fields

Press Display Changes button

Save

Enter Field Names & Length

Maintain Structure Relations

Press Display Changes button

Save

Maintain Field Mapping and Conversion Rules

Select or Auto set Fields to Real Fields

Save

Maintain Fixed Values, Translations, User-Defined Routines

Optional

Specify Files

Select Uploading File

Save

Assign Files

Press Display Changes button

Save

Read Data

Enter No of Transactions to View Data Summary

Display Read Data

Enter No of Transactions to View Data List

Convert Data

Optional

Display Converted Data

Optional

Create Batch Input Session

Run Batch Input Session

Regards,

Omkaram.