Application Development 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: 

Material master conversion using LSMW

Former Member
0 Kudos

Hi friends,

Here iam facing a small probelm while convertion the material master using LSMW.

here for every material i ahev to populate the material BASIC DATA TEXT in the BASIC DATA1 view. But i did not find any technical name for that long text for mapping. But in the technical information of that push button there is a technical information like

Function data :

Program : SAPLMGMM

Function : PB26

How to populate this one. Please help me out.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Long texts are not stored as other database fields in SAP. So their upload is also different. U can use Direct Input Program in LSMW for ur LONG text upload separately. Upload ur material master first and then use this direct input program to upload long text( it has to be in a separate file with the material no. & the text ).

Hope it hElps.

Regards,

Bikash

10 REPLIES 10

Former Member
0 Kudos

Hi,

Long texts are not stored as other database fields in SAP. So their upload is also different. U can use Direct Input Program in LSMW for ur LONG text upload separately. Upload ur material master first and then use this direct input program to upload long text( it has to be in a separate file with the material no. & the text ).

Hope it hElps.

Regards,

Bikash

0 Kudos

Hi Bikas,

Thanks for u r reply.

yes iam doing with another program

i have some confusion with the LSMW standard structures provided for this long text

first one -

Long text: Header

OBJECT - application object

NAME - Name

ID - Text ID

Longtext:Row

TEXTFORMAT - Tag column

TEXTLINE - Text line

where can i get the these fields information and how i should populate this fields ?

here in the TEXTLINE fieldi will populate the text but what about the remaining. Do i need to use any FM for them. Please guide me.

Thanks & Regards,

Naren.

0 Kudos

Hi Naren,

OBJECT

NAME

ID

to get these parameters, goto the location of the text in MM01/MM02, goto sapscript editor of the text( there is a button below), there GOTO-->HEADER..u ll c these parameters. Now ID & OBJECT are constant for all the texts here but NAME is a variable. if u observe, it depends on the material no. so from ur flat file,u get material no. and text. hardcode the other stuff n use it in ur LSMW.

bug me if u have more issues on this.

Regards,

Bikash

dunno y u r not getting the GOTO-->HEADER PART. ut anyways if u r uploading the long text in BASIC DATA TEXT, then , Language = sy-langu, Text ID = GRUN, Text Object = MATERIAL and TEXT NAME = ( ur material no. ) . put these values n try out....

Message was edited by: Bikash Agarwal

0 Kudos

Hi Bikas,

In MM01/MM02, i have gone to sapscript editor of the text( there is a button below), there i did not find any HEADER kind of function in GOTO i can see only BACK function is tehre any other awy to findout.

Thanks&Regards,

Naren.

0 Kudos

i have to upload the credit limit data using FD32. i have done everything. But still i have a small doubt while converting currency and date fields for customer do i need to use any FM's or with out any FM's also does it work fine.

0 Kudos

Use this BDC program then. Its working for me. Flat file needs to have matnr & long text ( tab separated).

report ZMM02_BASICDAT_UPLOAD

no standard page heading line-size 255.

data: begin of record OCCURS 0,

  • data element: MATNR

MATNR_001(018),

  • data element: MAKTX

MAKTX_002(180),

end of record.

DATA : W_MATNR like mara-matnr.

data : w_matnr1(70) type c.

DATA: W_LENGTH TYPE I.

tables: tline.

Data : i_tlines type tline occurs 0 with header line.

Data : l_mat_text(180) type c.

selection-screen begin of block bl1 with frame .

parameters: flatfile like rlgrap-filename .

selection-screen end of block bl1.

at selection-screen on value-request for flatfile.

perform get_filename.

start-of-selection.

  • To upload data from flat file into internal table:

perform upload_file.

LOOP AT RECORD.

********Conversion not needed for Material Code in Quality and

*Production Server

*CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

  • EXPORTING

  • INPUT = record-matnr_001

  • IMPORTING

  • OUTPUT = w_matnr

.

MOVE RECORD-MATNR_001 TO W_MATNR1.

MOVE RECORD-MAKTX_002 TO l_mat_text.

W_LENGTH = STRLEN( l_mat_text ).

i_tlines-tdformat = '*'.

i_tlines-tdline = l_mat_text+0(132).

Append i_tlines.

if l_mat_text+132(48) NE ' '.

i_tlines-tdformat = '*'.

i_tlines-tdline = l_mat_text+132(48).

Append i_tlines.

endif.

*move w_matnr to w_matnr1.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

FID = 'GRUN'

FLANGUAGE = sy-langu

FNAME = W_MATNR1

FOBJECT = 'MATERIAL'

SAVE_DIRECT = 'X'

  • FFORMAT = '*'

TABLES

FLINES = i_tlines

  • EXCEPTIONS

  • NO_INIT = 1

  • NO_SAVE = 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.

clear i_tlines[].

ENDLOOP.

*perform close_group.

*perform close_dataset using dataset.

&----


*& Form get_filename

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_filename .

call function 'WS_FILENAME_GET'

exporting

def_filename = space

def_path = flatfile

mask = ',.,..'

mode = 'O'

title = 'Choose file'

importing

filename = flatfile

exceptions

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

others = 5.

ENDFORM. " get_filename

form upload_file.

call function 'WS_UPLOAD'

exporting

filename = flatfile

filetype = 'DAT'

tables

data_tab = record

exceptions

conversion_error = 1

file_open_error = 2

file_read_error = 3

invalid_table_width = 4

invalid_type = 5

no_batch = 6

unknown_error = 7

others = 8.

write : 'WS_UPLOAD return code : ',sy-subrc.

endform. " UPLOAD_FILE

Hi NAren, Please Close the thread if ur problem is solved after awarding appropriate points.

Regards,

Bikash

Message was edited by: Bikash Agarwal

0 Kudos

Hi Bikas,

I had Run the LSMW program with the test data(matno,longtext).. The program result is showing " Successfully Transferred Long Texts" . But when i caeck with the material it is not actually getting populated.

0 Kudos

You should pass the material number in internal format which was commented out in the code provided by Bikas.

0 Kudos

To know the text ID, Object etc, you go to MM02, go to the place where you enter text. There should be an option there for long text(if not jsut double click on the text area). Once you are in the long text entry area(actually a SAP script text entry area), you can find the path mentioned by Bikas.

0 Kudos

Hi Bikas,

Thanks for u r help. Both LSMW and BDC's are working fine. The pblm was when updating customer i was not using conversion exit in both LSMW and BDC once i haev used both r working.

Thnks & Regards,

Naren.