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

Loading text using LSMW

Former Member
0 Likes
394

Hello,

Has anyone used LSMW to load text? I need to use transaction MM02 to add text to the Basic data text area of the Basic data 1 view.

Regards,

JR

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
352

I've used BAPI to do that..

LOOP AT it_mara.

clfrsh : materialdescription,materiallongtext.

headdata-material = it_mara-niin.

headdata-ind_sector = 'M'.

headdata-matl_type = 'UNBW'.

headdata-basic_view = 'X'.

clientdata-size_dim = it_mara-sizes.

clientdatax-size_dim = 'X'.

materialdescription-langu = 'E'.

materialdescription-langu_iso = 'EN'.

materialdescription-matl_desc = it_mara-desc+0(40).

appclr materialdescription.

materiallongtext-applobject = 'MATERIAL'.

materiallongtext-text_name = it_mara-niin.

materiallongtext-text_id = 'GRUN'.

materiallongtext-langu = 'E'.

materiallongtext-langu_iso = 'EN'.

materiallongtext-format_col = '*'.

materiallongtext-text_line = it_mara-desc.

appclr materiallongtext.

  • plantdata-plant = 'PICA'.

  • plantdatax-plant = 'PICA'.

*

  • storagelocationdata-plant = 'PICA'.

  • storagelocationdata-stge_loc = 'PICA'.

  • storagelocationdatax-plant = 'PICA'.

  • storagelocationdatax-stge_loc = 'PICA'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = headdata

clientdata = clientdata

clientdatax = clientdatax

  • plantdata = plantdata

  • plantdatax = plantdatax

  • storagelocationdata = storagelocationdata

  • storagelocationdatax = storagelocationdatax

TABLES

returnmessages = returnmessages

materialdescription = materialdescription

materiallongtext = materiallongtext.

  • UNITSOFMEASURE = UNITSOFMEASURE

  • UNITSOFMEASUREx = UNITSOFMEASUREx

  • extensionin = extensionin

  • extensioninx = extensioninx.

CLEAR returnmessages.

appclr returnmessages.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

CALL FUNCTION 'COMMIT_TEXT'.

ENDLOOP.

LOOP AT returnmessages.

WRITE:/ returnmessages-message.

ENDLOOP.

Thanks

Sarath.

1 REPLY 1
Read only

Former Member
0 Likes
353

I've used BAPI to do that..

LOOP AT it_mara.

clfrsh : materialdescription,materiallongtext.

headdata-material = it_mara-niin.

headdata-ind_sector = 'M'.

headdata-matl_type = 'UNBW'.

headdata-basic_view = 'X'.

clientdata-size_dim = it_mara-sizes.

clientdatax-size_dim = 'X'.

materialdescription-langu = 'E'.

materialdescription-langu_iso = 'EN'.

materialdescription-matl_desc = it_mara-desc+0(40).

appclr materialdescription.

materiallongtext-applobject = 'MATERIAL'.

materiallongtext-text_name = it_mara-niin.

materiallongtext-text_id = 'GRUN'.

materiallongtext-langu = 'E'.

materiallongtext-langu_iso = 'EN'.

materiallongtext-format_col = '*'.

materiallongtext-text_line = it_mara-desc.

appclr materiallongtext.

  • plantdata-plant = 'PICA'.

  • plantdatax-plant = 'PICA'.

*

  • storagelocationdata-plant = 'PICA'.

  • storagelocationdata-stge_loc = 'PICA'.

  • storagelocationdatax-plant = 'PICA'.

  • storagelocationdatax-stge_loc = 'PICA'.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = headdata

clientdata = clientdata

clientdatax = clientdatax

  • plantdata = plantdata

  • plantdatax = plantdatax

  • storagelocationdata = storagelocationdata

  • storagelocationdatax = storagelocationdatax

TABLES

returnmessages = returnmessages

materialdescription = materialdescription

materiallongtext = materiallongtext.

  • UNITSOFMEASURE = UNITSOFMEASURE

  • UNITSOFMEASUREx = UNITSOFMEASUREx

  • extensionin = extensionin

  • extensioninx = extensioninx.

CLEAR returnmessages.

appclr returnmessages.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

CALL FUNCTION 'COMMIT_TEXT'.

ENDLOOP.

LOOP AT returnmessages.

WRITE:/ returnmessages-message.

ENDLOOP.

Thanks

Sarath.