Upload Material Text in MM02
Hi ,
I want to Uplaod Material text in MM02 . Around more than upto 2000 materials.
i m trying to uplaod using call function 'CREATE_TEXT'. But it gives error in mm02 like, no text maintained.
give me proper solution,
thnxs
Regards,
Swapnil Vaidya
Swapnil
Check whether you are passing correct Text ID, Text Object and Text Name to the function module..
Thanks
Amol Lohade
Similar Messages
-
How to upload material text in mm02 using bdc table control
i have problem to upload material Description in mm02 using bdc.
my text file is like
2000251 AF A12345
2000251 AR B12345
2000251 BG C12345
2000252 AF F12345
2000252 AR G12345
2000252 AF H12345
i want to upload material number, language, and material description, how can i upload pls help me.Hi,
Try with bapi , bapi_material_save_data.. didn't exactly remember it,Please check the same.
Regards,
Nagaraj -
Upload material description in mm02
i want to upload material description in mm02 using bdc but i dont know how to upload it. Moderator Message: This is not a training forum and we cant help you there
my text file is like
2000251 AF A12345
2000251 AR B12345
2000251 BG C12345
2000252 AF F12345
2000252 AR G12345
2000252 AF H12345
in same material number there r more then one text then how can i upload .
'SKTEXT-MAKTX(02)'.
clear COUNTER.
counter = 1.
LOOP AT IT_TAB INTO WA_TAB WHERE MATNR = WA_ITAB-MATNR.
counter = counter + 1.
CONCATENATE 'MAKT-SPRAS(0' COUNTER ')' INTO V_CHAR. "(02)
PERFORM BDC_FIELD USING V_CHAR
WA_TAB-SPRAS.
CLEAR V_CHAR.
CONCATENATE 'MAKT-MAKTX(0' COUNTER ')' INTO V_CHAR. "(02)
perform bdc_field using V_CHAR
WA_TAB-MAKTX.
*perform bdc_field using 'SKTEXT-SPRAS(02)'
'AF'.
*perform bdc_field using 'SKTEXT-SPRAS(03)'
'BG'.
*perform bdc_field using 'SKTEXT-SPRAS(04)'
'CS'.
*perform bdc_field using 'SKTEXT-MAKTX(02)'
'avani'.
*perform bdc_field using 'SKTEXT-MAKTX(03)'
'avani1'.
*perform bdc_field using 'SKTEXT-MAKTX(04)'
'avani2'.
clear wa_tab.
ENDLOOP.
Edited by: kishan P on Nov 13, 2010 2:32 PMin mm02 Basic Data -> additional data -> material description and language
i want to upload language and material description -
UPLOAD PO TEXT - MM01, MM02
HI experts,
is there anyway to upload Material PO TEXT in Material master (ie. in mm01 or mm02)?
I tried through SHDB but it is not at all working...
The recorder doesn't record the text entered in that Editor.
Here my Keyuser wants to upload this text for certain materials only..(mass upload)
PLs help ASAP.
Regards SnehalHello Snehal,
The Texts are normally created/uploaded using the Function Module CREATE_TEXT.
They can be retrieved using READ_TEXT.
Pls reward if the info helps you.
With Regards
Vijay Gajavalli -
Hi Experts,
We are trying to upload sales text in MM02 transaction, which does not have screen field. Please advise whether I can use SAVE_TEXT or BAPI to change material. Sample code will be very much helpful.
Thanks in advance.Hi
You have to use the CREATE_TEXT fun module and to pass the paramters OBJECT,ID, OBJECTNAME and LANGUAGE correctly after declaring them correctly
see the sample code for long text creation
REPORT zmm_longtext
NO STANDARD PAGE HEADING
LINE-SIZE 255.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab1 OCCURS 0,
matnr LIKE mara-matnr, " Material
text1 LIKE tline-tdline, " Long Text
text2 LIKE tline-tdline, " Long Text
text3 LIKE tline-tdline, " Long Text
text4 LIKE tline-tdline, " Long Text
text5 LIKE tline-tdline, " Long Text
text6 LIKE tline-tdline, " Long Text
text7 LIKE tline-tdline, " Long Text
text8 LIKE tline-tdline, " Long Text
text9 LIKE tline-tdline, " Long Text
text10 LIKE tline-tdline, " Long Text
text11 LIKE tline-tdline, " Long Text
text12 LIKE tline-tdline, " Long Text
text13 LIKE tline-tdline, " Long Text
text14 LIKE tline-tdline, " Long Text
text15 LIKE tline-tdline, " Long Text
text16 LIKE tline-tdline, " Long Text
text17 LIKE tline-tdline, " Long Text
text18 LIKE tline-tdline, " Long Text
text19 LIKE tline-tdline, " Long Text
text20 LIKE tline-tdline, " Long Text
text21 LIKE tline-tdline, " Long Text
text22 LIKE tline-tdline, " Long Text
text23 LIKE tline-tdline, " Long Text
text24 LIKE tline-tdline, " Long Text
text25 LIKE tline-tdline, " Long Text
END OF itab1.
Internal Table for Upload of Long Texts Data
DATA: BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr, " Material
text LIKE tline-tdline, " Long Text
END OF itab.
To create Long Text lines for CREATE_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
Variable declarations for CREATE_TEXT function module
DATA : dl_name TYPE thead-tdname, " Object Name
dl_lan TYPE thead-tdspras, " Language
gv_matnr TYPE matnr.
Constants
CONSTANTS:
Object ID for Long Text of Material Basic Data 1
c_best TYPE thead-tdid VALUE 'GRUN',
c_material TYPE thead-tdobject VALUE 'MATERIAL'. " Object
Parameters
PARAMETERS p_file LIKE rlgrap-filename.
At selection-screen on Value Request for file Name
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Get the F4 Values for the File
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_file.
Start Of Selection
START-OF-SELECTION.
*To Upload Flat file
CALL FUNCTION 'UPLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab1
EXCEPTIONS
conversion_error = 1
invalid_table_width = 2
invalid_type = 3
no_batch = 4
unknown_error = 5
gui_refuse_filetransfer = 6
OTHERS = 7.
SORT itab1 BY matnr.
LOOP AT itab1.
CLEAR gv_matnr.
SELECT SINGLE matnr INTO gv_matnr
FROM mara WHERE bismt = itab1-matnr.
IF itab1-text25 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text25.
APPEND itab.
ENDIF.
IF itab1-text24 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text24.
APPEND itab.
ENDIF.
IF itab1-text23 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text23.
APPEND itab.
ENDIF.
IF itab1-text22 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text22.
APPEND itab.
ENDIF.
IF itab1-text21 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text21.
APPEND itab.
ENDIF.
IF itab1-text20 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text20.
APPEND itab.
ENDIF.
IF itab1-text19 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text19.
APPEND itab.
ENDIF.
IF itab1-text18 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text18.
APPEND itab.
ENDIF.
IF itab1-text17 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text17.
APPEND itab.
ENDIF.
IF itab1-text16 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text16.
APPEND itab.
ENDIF.
IF itab1-text15 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text15.
APPEND itab.
ENDIF.
IF itab1-text14 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text14.
APPEND itab.
ENDIF.
IF itab1-text13 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text13.
APPEND itab.
ENDIF.
IF itab1-text12 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text12.
APPEND itab.
ENDIF.
IF itab1-text11 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text11.
APPEND itab.
ENDIF.
IF itab1-text10 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text10.
APPEND itab.
ENDIF.
IF itab1-text9 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text9.
APPEND itab.
ENDIF.
IF itab1-text8 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text8.
APPEND itab.
ENDIF.
IF itab1-text7 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text7.
APPEND itab.
ENDIF.
IF itab1-text6 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text6.
APPEND itab.
ENDIF.
IF itab1-text5 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text5.
APPEND itab.
ENDIF.
IF itab1-text4 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text4.
APPEND itab.
ENDIF.
IF itab1-text3 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text3.
APPEND itab.
ENDIF.
IF itab1-text2 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text2.
APPEND itab.
ENDIF.
IF itab1-text1 NE ' '.
itab-matnr = gv_matnr.
itab-text = itab1-text1.
APPEND itab.
ENDIF.
CLEAR itab.
ENDLOOP.
DELETE itab WHERE matnr EQ ' '.
Upload the Texts
SORT itab BY matnr.
LOOP AT itab.
dt_lines-tdformat = 'ST'.
dt_lines-tdline = itab-text.
APPEND dt_lines.
dl_lan = sy-langu.
dl_name = itab-matnr.
Call the Function Module to Create Text
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = c_best
flanguage = dl_lan
fname = dl_name
fobject = c_material
save_direct = 'X'
fformat = '*'
TABLES
flines = dt_lines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Long Text Creation failed for Material'(001),
itab-matnr.
ELSE.
WRITE:/ 'Long Text Created Successfully for Material'(002),
itab-matnr.
ENDIF.
AT END OF matnr.
REFRESH dt_lines.
ENDAT.
ENDLOOP.
<b>Reward points for useful Answers</b>
Regards
Anji -
hello,
I hv upload Material Text Function Using CREATE_TEXT. But it disply in single line
i want to disply some on the other line
ex. abcdefg
12244545
swapnil
like this
pl. give suggestion for this
regards,
swapnilHi
As if i want to enter matrial text , its diaply like Material number, name, description
but i want to display in this manner
Material number
Name
Description
it wont take to the next like ...it displays all in single line -
How to upload PO text of material master ?
dear gurus,
how to upload PO text in material master in mass , can i use LSMW or BDC ? if yes then how?
I have done the recording but LSMW is not working for PO text.
Upesh khairnar.Hi!
try using Purchasing Inforecord for this. in here you maintain master data linkage for Material Master and Vendor Master. You will just have to input the Material Number, the Vendor Account, and the Purchasing Org. In here you can maintain the PO text defaulted per Material Number. After the maintenance of Inforecord, the PO text will be reflected on the PO document.
Here is the ff Transaction Code:
- ME11 (Create Inforecord)
- ME12 (Change Inforecord)
- ME13 (Display Inforecord)
Hope this helps, Thank you.
Mik -
Upload Material master with long text using LSMW
Hello,
i want ot upload material master data via MM01 using LSMW in following views: basic data 1 ,2, purchasing, purchase order text, plant data 1,2.
i have to upload long text in purchase order text with length more then 132 char. (approx 700 char long text). and i have text file in which long text is maintained in a single row. then how can i do it without formating text file or anyother possible solution.
please help.ca u clarify how can i do it.
suppos i have longtext "Air cooled type air-conditioning unit complete with following components & distance between indoor & outdoor unit is 10 RMT. A).Indoor evaporating unit comprising of cooling coils,insulated drain tray,20 micron HDPE washable filters,blower,motor,electical junction box etc. B).Outdoor condensing unit comprising of hermatic/semiharmetic compressor's.condenser coils,propeller/axial fans,motors,pressure switches/cutout etc.C).Charging of refrigerant gas & oil.D).Inter connecting refrigerating piping of copper duly insulated with EXPANDED POLYETHYLENE tubing.E).Complete electical power wiring of AL.&Control wirng of copper required from indoor & outdoor units.Earthing of the complete system with 8 G G.I.wire. F).Electrical panel will be completed with necessary starter,fuses,switches,timers,over-load relays,contactors,push button and indicating lamps,single phasing preventer etc..and also with remote control with cording. G).The panel should have 1 no.potential free contactor to connect with central fire detection system.The panel should have voltage scanner to ensure stabilized power input to the machine.H).Outdoor unit shall be mounted on MS angle base frame structure duly black painted with synthetic epoxy paint.I).The frame structure shall be mounted on MS plate & serrated rubber pads."
then what i have to do changes in lsmw.? -
Uploading sales text and Purchase order text for material master
Hi,
I have created, material master with LSMW byt not updated SALES TEXT and Purchase order text with LSMW now i want to uplaod the sales and po text for material master can you give some link or ref. code to upload the text i have near 1000 items for which i want to uplaod text when i have done the recording with SHDB i have not found filed in recording.
regards,
zafarHi,
I have made the code in se38
as below but still it is not working
REPORT ZTEST_TEXT.
data: headerl like thead occurs 0 with header line.
data itab3 like tline occurs 0 with header line.
headerl-tdobject = 'MATERIAL'.
headerl-tdname = '00000000000LSMW123'. "(Material : 000000000300000560, Sorg : 0001, Dist channel: 01)
headerl-tdid = 'BEST'.
headerl-tdspras = 'E'.
append headerl.
move '*' to itab3-tdformat.
move 'Testing PO text' to itab3-tdline.
append itab3.
call function 'SAVE_TEXT'
exporting
header = headerl
insert = ' '
savemode_direct = ' '
tables
lines = itab3
exceptions
id = 1
language = 2
name = 3
object = 4
others = 5.
IF SY-SUBRC = 0.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = headerl-tdobject
NAME = headerl-tdname.
ENDIF.
break-point.
regards,
zafar -
Upload sales text for material master using LSMW direct input method
Hello Experts,
I was trying to upload sales text for a material master using LSMW direct input method.
I followed the following steps for the same
Tab dlimited Text file format
MATNR LONGTEXT LINE
MATERIAL1 LONGTEXT FOR MATERIAL MATERIAL1 1
Step1 -> Maintain object attributes
Object -> 0001
Method-> 0001
Program name -> /SAPDMC/SAP_LSMW_IMPORT_TEXTS
Program type -> D
Step2 -> Maintain Source Structure
Source structure -> LONG_TEXT Source structure for long text
Step 3-> Maintain souce file
Source Fields
ZLONG_TEXT Source structure for long text
MATNR C(018) MATNR
LTEXT C(132) LTEXT
Step 4-> Maintain structure relationship
Structure Relations
/SAPDMC/LTXTH Long Texts: Header <<<< ZLONG_TEXT Source structure for long text
Select Target Structure /SAPDMC/LTXTH .
/SAPDMC/LTXTL Long Texts: Row <<<< ZLONG_TEXT Source structure for long text
Select Target Structure /SAPDMC/LTXTL .
Step 5-> Maintain Field mapping and conversion rules
Here i have assigned constan rules to couple of them like
/SAPDMC/LTXTH Long Texts: Header
Fields
OBJECT Texts: Application Object
Rule : Constant
Code: /SAPDMC/LTXTH-OBJECT = 'MVKE'.
NAME Name
Source: ZLONG_TEXT-MATNR (MATNR)
Rule : Transfer (MOVE)
Code: /SAPDMC/LTXTH-NAME = ZLONG_TEXT-MATNR.
ID Text ID
Rule : Constant
Code: /SAPDMC/LTXTH-ID = '0001'.
SPRAS Language Key
Rule : Constant
Code: /SAPDMC/LTXTH-SPRAS = 'E'.
/SAPDMC/LTXTL Long Texts: Row
Fields
TEXTFORMAT Tag column
Rule : Constant
Code: /SAPDMC/LTXTL-TEXTFORMAT = '/'.
TEXTLINE Text Line
Source: ZLONG_TEXT-LTEXT (LTEXT)
Rule : Transfer (MOVE)
Code: /SAPDMC/LTXTL-TEXTLINE = ZLONG_TEXT-LTEXT.
Step6 -> Specify file
Legacy Data On the PC (Frontend)
Data D:\Sales_Longtext.txt
Step7 -> Assign File
ZLONG_TEXT Source structure for long text
Data D:\Sales_Longtext.txt
Step8 -> Read data
Output result
Source Structure Read Written Not Written
ZLONG_TEXT 1 1 0
Transactions Read: 1
Records Read: 1
Transactions Written: 1
Records Written: 1
Step 8 -> Display read data
Field Name Field Text Field Value
MATNR MATNR MATERIA1
LTEXT LTEXT SALES TEXT FOR Material MATERIAL1
Step 9 -> Convert data
File Read: ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.read
File Written: ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
Transactions Read: 1
Records Read: 1
Transactions Written: 1
Records Written: 2
Step 10 -> Display converted data
1 /SAPDMC/LTXTH 1MVKE MATERIAL1 0001E
2 /SAPDMC/LTXTL 2/ SALES TEXT FOR Material MATERIAL1
Step 11 -> Start direct input program
Output result for the same
Legacy System Migration Workbench
Project: ZNRD_PRJ1 ORH
Subproject: ZNRD_SUBPRJ2 Upload long text
Object: ZNRD_LTEXT Long text tru direct input
File : ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
Long Texts in Total: 1
Successfully Transferred Long Texts: 1
Non-Transferred Long Texts: 0
Now when i check the material master sales view -> sales text it is empty.
Please help me with the same.
Regards,
Ranjith NHello Experts, I was trying to upload sales text for a material master using LSMW direct input method.
I followed the following steps for the same
Tab dlimited Text file format
MATNR LONGTEXT LINE
MATERIAL1 LONGTEXT FOR MATERIAL MATERIAL1 1 *************************************************************************************************************
Step1 -> Maintain object attributes
Object -> 0001
Method-> 0001
Program name -> /SAPDMC/SAP_LSMW_IMPORT_TEXTS
Program type -> D
Step2 -> Maintain Source Structure
Source structure -> LONG_TEXT Source structure for long text
Step 3-> Maintain souce file Source Fields
ZLONG_TEXT Source structure for long text
MATNR C(018) MATNR
LTEXT C(132) LTEXT
Step 4-> Maintain structure relationship
Structure Relations
/SAPDMC/LTXTH Long Texts: Header <<<< ZLONG_TEXT Source structure for long text
Select Target Structure
/SAPDMC/LTXTH . /SAPDMC/LTXTL Long Texts: Row <<<< ZLONG_TEXT Source structure for long text
Select Target Structure /SAPDMC/LTXTL .
Step 5-> Maintain Field mapping and conversion rules
Here i have assigned constan rules to couple of them like
/SAPDMC/LTXTH Long Texts: Header
Fields
OBJECT Texts: Application Object
Rule : Constant
Code: /SAPDMC/LTXTH-OBJECT = 'MVKE'.
NAME Name
Source: ZLONG_TEXT-MATNR (MATNR)
Rule : Transfer (MOVE)
Code: /SAPDMC/LTXTH-NAME = ZLONG_TEXT-MATNR.
ID Text ID
Rule : Constant
Code: /SAPDMC/LTXTH-ID = '0001'.
SPRAS Language Key
Rule : Constant
Code: /SAPDMC/LTXTH-SPRAS = 'E'.
/SAPDMC/LTXTL Long Texts: Row
Fields
TEXTFORMAT Tag column
Rule : Constant
Code: /SAPDMC/LTXTL-TEXTFORMAT = '/'.
TEXTLINE Text Line
Source: ZLONG_TEXT-LTEXT (LTEXT)
Rule : Transfer (MOVE)
Code: /SAPDMC/LTXTL-TEXTLINE = ZLONG_TEXT-LTEXT.
Step6 -> Specify file Legacy
Data On the PC (Frontend)
Data D:\Sales_Longtext.txt
Step7 -> Assign File ZLONG_TEXT
Source structure for long text
Data D:\Sales_Longtext.txt
Step8 -> Read data
Output result
Source Structure Read Written Not Written
ZLONG_TEXT 1 1 0
Transactions Read 1
Records Read: 1
Transactions Written: 1
Records Written: 1
Step 8 -> Display read data
Field Name Field Text Field Value
MATNR MATNR MATERIA1
LTEXT LTEXT SALES TEXT FOR Material MATERIAL1
Step 9 -> Convert data
File Read: ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.read
File Written: ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
Transactions Read: 1
Records Read: 1
Transactions Written: 1
Records Written: 2
tep 10 -> Display converted data
1 /SAPDMC/LTXTH 1 MVKE MATERIAL1 0001 E
2 /SAPDMC/LTXTL 2/ SALES TEXT FOR Material MATERIAL1
Step 11 -> Start direct input program
Output result for the same
Legacy System Migration Workbench Project:
ZNRD_PRJ1 ORH
Subproject: ZNRD_SUBPRJ2 Upload long text
Object: ZNRD_LTEXT Long text tru direct input
File : ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
Long Texts in Total: 1
Successfully Transferred Long Texts: 1
Non-Transferred Long Texts: 0
Now when i check the material master sales view -> sales text it is empty. Please help me with the same.
Regards,
Ranjith N -
Error during BAPI while uploading Material data through MM01
Hi all,
i am facing one problem when uploading Material data thorough BAPI in MM01.i am attaching the code below and the error given.
but in the debugger all the value is being stored.
REPORT ZFINISHED_MAT.
Data: Begin of legacy_data occurs 0,
MATNR LIKE MARA-MATNR,
MBRSH LIKE MARA-MBRSH, "Industry Sector
MTART LIKE MARA-MTART, "Matl Type
WERKS LIKE MARD-WERKS, "Plant
LGORT LIKE MARD-LGORT, "Storage location
VKORG LIKE MVKE-VKORG,
VTWEG LIKE MVKE-VTWEG,
MAKTX LIKE MAKT-MAKTX, "Matl Desc.
MEINS LIKE MARA-MEINS, "Base UOM
MATKL LIKE MARA-MATKL, "Matl.Grp
* BISMT LIKE MARA-BISMT,
SPART LIKE MARA-SPART, "Division
* BRGEW LIKE MARA-BRGEW, "Gross weight
GROES LIKE MARA-GROES,
FERTH LIKE MARA-FERTH,
ZEINR LIKE MARA-ZEINR,
TAXKM1 LIKE MLAN-TAXM1,
TAXKM2 LIKE MLAN-TAXM2,
TAXKM3 LIKE MLAN-TAXM3,
TAXKM4 LIKE MLAN-TAXM4,
KTGRM LIKE MVKE-KTGRM,
* GEWEI LIKE MARA-GEWEI, "Weight unit
* NTGEW LIKE MARA-NTGEW, "Net weight
* KLART LIKE RMCLF-KLART,
MTVFP LIKE MARC-MTVFP, "Availibility Check
* XGCHP LIKE MARA-XGCHP,
XCHPF LIKE MARA-XCHPF, "Batch Management
TRAGR LIKE MARA-TRAGR,
LADGR TYPE MARC-LADGR,
VPRSV LIKE MBEW-VPRSV, "Price Control
VERPR LIKE MBEW-VERPR,
* SPRAS LIKE MAKT-SPRAS,
END OF LEGACY_DATA.
DATA: BEGIN OF IT_MAKT OCCURS 0.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF IT_MAKT.
*--- BAPI structures
DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control Information
BAPI_MAKT LIKE BAPI_MAKT, " Material Description
BAPI_MARA1 LIKE BAPI_MARA, " Client Data
BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
BAPI_MARD1 LIKE BAPI_MARD,
BAPI_MARDX1 LIKE BAPI_MARDX, " Checkbox Structure for BAPI_MARD
BAPI_MARC1 LIKE BAPI_MARC, " Plant View
BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
BAPI_MVKE1 LIKE BAPI_MVKE,
BAPI_MVKEX1 LIKE BAPI_MVKEX, " Checkbox Structure for BAPI_MVKE
BAPI_MLAN1 LIKE BAPI_MLAN,
BAPI_MLANX1 LIKE bapi_mlan1, " Checkbox Structure for BAPI_MLAN
BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
BAPI_RETURN LIKE BAPIRET2. " Return Parameter
* $PARAMETERS DECLARATION$
SELECTION-SCREEN BEGIN OF BLOCK B11
WITH FRAME TITLE TEXT-001.
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME. " DEFAULT 'C:\TEST1.XLS'.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN END OF BLOCK B11 .
* $DATA DECLARATION$
*DATA : BDC_DATA LIKE STANDARD TABLE OF BDCDATA WITH HEADER LINE.
DATA : IT_EXCEL TYPE STANDARD TABLE OF ALSMEX_TABLINE INITIAL SIZE 0 WITH HEADER LINE,
IT_EXCEL_DUMMY TYPE ALSMEX_TABLINE.
DATA : MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA : L_MSTRING(480).
DATA :L_SUBRC LIKE SY-SUBRC.
DATA: V_FILE TYPE STRING.
* $AT-SELECTON SCREEN DECLARATION$
AT SELECTION-SCREEN ON P_FILE.
IF P_FILE IS INITIAL.
MESSAGE E398(00) WITH 'FILE NAME NEEDS TO BE SPECIFIED'.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
* DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE
start-of-selection.
perform data_fetch_to_xls.
perform insertion.
*& Form data_fetch_to_xls
* text
* --> p1 text
* <-- p2 text
FORM data_fetch_to_xls .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = 1
I_BEGIN_ROW = 2
I_END_COL = 25
I_END_ROW = 2
TABLES
INTERN = IT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 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.
WRITE: /'ERROR UPLOADING XLS FILE FROM PRESENTATION SERVER !' ,
/'RETURN CODE : ', SY-SUBRC.
ELSE.
*************NOW FILL DATA FROM EXCEL INTO FINAL LEGACY DATA ITAB----LEGACY_DATA***************
IF NOT IT_EXCEL[] IS INITIAL.
CLEAR LEGACY_DATA.
REFRESH LEGACY_DATA[].
LOOP AT IT_EXCEL.
IT_EXCEL_DUMMY = IT_EXCEL.
AT NEW COL.
CASE IT_EXCEL_DUMMY-COL.
WHEN 1.
LEGACY_DATA-MATNR = IT_EXCEL_DUMMY-VALUE(18).
WHEN 2.
LEGACY_DATA-MBRSH = IT_EXCEL_DUMMY-VALUE(1).
WHEN 3.
LEGACY_DATA-MTART = IT_EXCEL_DUMMY-VALUE(4).
WHEN 4.
LEGACY_DATA-WERKS = IT_EXCEL_DUMMY-VALUE(4).
WHEN 5.
LEGACY_DATA-LGORT = IT_EXCEL_DUMMY-VALUE(4).
WHEN 6.
LEGACY_DATA-VKORG = IT_EXCEL_DUMMY-VALUE(4).
WHEN 7.
LEGACY_DATA-VTWEG = IT_EXCEL_DUMMY-VALUE(2).
WHEN 8.
LEGACY_DATA-MAKTX = IT_EXCEL_DUMMY-VALUE(40).
WHEN 9.
LEGACY_DATA-MEINS = IT_EXCEL_DUMMY-VALUE(3).
WHEN 10.
LEGACY_DATA-MATKL = IT_EXCEL_DUMMY-VALUE(9).
WHEN 11.
LEGACY_DATA-SPART = IT_EXCEL_DUMMY-VALUE(2).
WHEN 12.
LEGACY_DATA-GROES = IT_EXCEL_DUMMY-VALUE(32).
WHEN 13.
LEGACY_DATA-FERTH = IT_EXCEL_DUMMY-VALUE(18).
WHEN 14.
LEGACY_DATA-ZEINR = IT_EXCEL_DUMMY-VALUE(22).
WHEN 15.
LEGACY_DATA-TAXKM1 = IT_EXCEL_DUMMY-VALUE(1).
WHEN 16.
LEGACY_DATA-TAXKM2 = IT_EXCEL_DUMMY-VALUE(1).
WHEN 17.
LEGACY_DATA-TAXKM3 = IT_EXCEL_DUMMY-VALUE(1).
WHEN 18.
LEGACY_DATA-TAXKM4 = IT_EXCEL_DUMMY-VALUE(1).
WHEN 19.
LEGACY_DATA-KTGRM = IT_EXCEL_DUMMY-VALUE(2).
WHEN 20.
LEGACY_DATA-MTVFP = IT_EXCEL_DUMMY-VALUE(2).
WHEN 21.
LEGACY_DATA-XCHPF = IT_EXCEL_DUMMY-VALUE(1).
WHEN 22.
LEGACY_DATA-TRAGR = IT_EXCEL_DUMMY-VALUE(4).
WHEN 23.
LEGACY_DATA-LADGR = IT_EXCEL_DUMMY-VALUE(4).
WHEN 24.
LEGACY_DATA-VPRSV = IT_EXCEL_DUMMY-VALUE(1).
WHEN 25.
LEGACY_DATA-VERPR = IT_EXCEL_DUMMY-VALUE(14).
APPEND LEGACY_DATA.
CLEAR LEGACY_DATA.
ENDCASE.
ENDAT.
AT END OF ROW.
ENDAT.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " data_fetch_to_xls
*& Form insertion
* text
* --> p1 text
* <-- p2 text
FORM insertion .
LOOP AT legacy_data.
* Header
BAPI_HEAD-MATERIAL = legacy_data-MATNR.
BAPI_HEAD-IND_SECTOR = legacy_data-MBRSH.
BAPI_HEAD-MATL_TYPE = legacy_data-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-SALES_VIEW = 'X'.
BAPI_HEAD-STORAGE_VIEW = 'X'.
*BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
* Material Description
REFRESH IT_MAKT.
*IT_MAKT-LANGU = legacy_data-SPRAS.
IT_MAKT-MATL_DESC = legacy_data-MAKTX.
APPEND IT_MAKT.
BAPI_MARD1-PLANT = legacy_data-WERKS.
BAPI_MARD1-STGE_LOC = legacy_data-LGORT.
BAPI_MARDX1-PLANT = legacy_data-WERKS.
BAPI_MARDX1-STGE_LOC = legacy_data-LGORT.
** Client Data - Basic
BAPI_MARA1-MATL_GROUP = legacy_data-MATKL.
*bapi_mara1-OLD_MAT_NO = legacy_data-bismt.
BAPI_MARA1-BASE_UOM = legacy_data-MEINS.
BAPI_MARA1-PROD_MEMO = LEGACY_DATA-FERTH.
BAPI_MARA1-SIZE_DIM = LEGACY_DATA-GROES.
BAPI_MARA1-DOCUMENT = LEGACY_DATA-ZEINR.
BAPI_MARA1-BATCH_MGMT = LEGACY_DATA-XCHPF.
*BAPI_MARA1-UNIT_OF_WT = legacy_data-GEWEI.
BAPI_MARA1-TRANS_GRP = legacy_data-TRAGR.
BAPI_MARA1-DIVISION = legacy_data-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
*BAPI_MARAX-OLD_MAT_NO = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-PROD_MEMO = 'X'.
BAPI_MARAX-SIZE_DIM = 'X'.
BAPI_MARAX-DOCUMENT = 'X'.
BAPI_MARAX-BATCH_MGMT = 'X'.
*BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-TRANS_GRP = 'X'.
BAPI_MARAX-DIVISION = 'X'.
*SALES
BAPI_MVKE1-SALES_ORG = legacy_data-VKORG.
BAPI_MVKE1-DISTR_CHAN = legacy_data-VTWEG.
*BAPI_MVKE1-DELYG_PLNT = legacy_data-DWERK.
BAPI_MVKE1-ACCT_ASSGT = legacy_data-KTGRM.
BAPI_MVKEX1-SALES_ORG = legacy_data-VKORG.
BAPI_MVKEX1-DISTR_CHAN = legacy_data-VTWEG.
*BAPI_MVKEX1-DELYG_PLNT = 'X'.
BAPI_MVKEX1-ACCT_ASSGT = 'X'.
** Plant - Purchasing
BAPI_MARC1-PLANT = legacy_data-WERKS.
BAPI_MARC1-LOADINGGRP = legacy_data-LADGR.
BAPI_MARC1-AVAILCHECK = legacy_data-MTVFP.
*BAPI_MARC1-MRP_GROUP = legacy_data-disgr.
BAPI_MARCX-PLANT = legacy_data-WERKS.
BAPI_MARCX-LOADINGGRP = 'X'.
BAPI_MARCX-AVAILCHECK = 'X'.
*BAPI_MARCX-MRP_GROUP = 'X'.
* Accounting
BAPI_MBEW1-VAL_AREA = legacy_data-WERKS.
BAPI_MBEW1-PRICE_CTRL = legacy_data-VPRSV.
BAPI_MBEW1-STD_PRICE = legacy_data-VERPR.
*BAPI_MBEW1-VAL_CLASS = legacy_data-BKLAS.
*BAPI_MBEW1-STD_PRICE = legacy_data-STPRS.
*BAPI_MBEW1-PRICE_UNIT = legacy_data-PEINH.
BAPI_MBEWX-VAL_AREA = legacy_data-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
*BAPI_MBEWX-VAL_CLASS = 'X'.
* TAX JURISDICTION CODE
BAPI_MLAN1-TAXCLASS_1 = LEGACY_DATA-TAXKM1.
BAPI_MLAN1-TAXCLASS_2 = LEGACY_DATA-TAXKM2.
BAPI_MLAN1-TAXCLASS_3 = LEGACY_DATA-TAXKM3.
BAPI_MLAN1-TAXCLASS_4 = LEGACY_DATA-TAXKM4.
BAPI_MLAN1-TAXCLASS_1 = 'X'.
BAPI_MLAN1-TAXCLASS_2 = 'X'.
BAPI_MLAN1-TAXCLASS_3 = 'X'.
BAPI_MLAN1-TAXCLASS_4 = 'X'.
*--- BAPI to create material
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
*PLANTDATA = BAPI_MARC1
*PLANTDATAX = BAPI_MARCX
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
VALUATIONDATA = BAPI_MBEW1
VALUATIONDATAX = BAPI_MBEWX
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA = BAPI_MVKE1
* SALESDATAX = BAPI_MVKEX
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = IT_MAKT
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
* RETURNMESSAGES =
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,legacy_data-maTNR.
ELSEIF BAPI_RETURN-TYPE = 'S'.
WRITE: 'Successfully created material' ,legacy_data-maTNR.
ENDIF.
ENDLOOP.
ENDFORM. " insertion
The error: The field MARC-MTVFP/BAPI_MARC-AVAILCHECK is defined as a required field; it does not contain an entr
suggestion will be vry helpful,
Kind Regards,
Edited by: Prasenjit Sengupta on Nov 16, 2009 9:11 AMHi Prasenjit,
Did you get any solution for this as I am getting same error from BAPI to update MRP controller in MARC table.
Regards,
Suruchi -
Problem in uploading material master data using BDC?
Hi all,
I am using BDC call transaction method to upload material data. Here i am facing a problem that a value in the flat file is going to the wrong screen field . But my recording done properly.
In recording, after entering the data in the view BASIC DATA1 and trying to enter the text . For this i need to scroll down the scroll bar and after that i am clicking on basic data text and entering the text. Here i am not touching the languge field.
But the problem is the text to be entered into the basic data text is storing in language and giving error.
Please help me by specifying the reason and solution for this problem? Whether i did any mistake in recording in scrolling?
Thanks,
Vamshi.Hi
Go with BAPI for such huge transactions and screens. Use BAPI: BAPI_MATERIAL_SAVEDATA.
Regards,
Vishwa. -
Uploading Sales Text Through BDC
hi friends,
i want to upload Material Sales Text Through BDC Program.
Please let me know how to do this.
regards,
srinivashi friends,
i want to upload Material Sales Text Through BDC Program.
Please let me know how to do this.
regards,
srinivas -
Hi All,
can any one tell me how to write LSMW for uploading PO text, as I am having only material no and po text I want to modify all material and update po text only
thanksHi
look at this..
<b>http://help.sap.com/saphelp_erp2005/helpdata/en/e1/c6d30210e6cf4eac7b054a73f8fb1d/frameset.htm</b>
Reward if useful
Anji -
Error message uploading 0material text and attributes.
Dear all,
i have received an error message when uploading 0material text and attributes.
Error message is as follows:
RSDMD 194
Data record 512 & with the key '000000000000000081T &' is invalid in
value '000000000000000081 &' of the attribute/characteristic 0MATERIAL
The system has recognized that the value mentioned above is invalid, and
has processed this general error message. A subsequent message may give
you more information on the error. This message refers to the same
value, even though it does not state this explicitly.
any help?
thanksHi john mcquade,
Your error message says it all!
You have your 0material with wrong info to be loaded, check your PSA the records with error (should begin in record 512) and see what is inserted as 0material (probably you're missing some zeros before the number).
You could compare that record with another one (less than the record 512) to see an example of a material that has the right input and this one that exists here with errors.
Diogo.
Maybe you are looking for
-
Passing parameters to Transactions from Web dynpro Application through ITS
Hi, i need to call a transaction from Web dynpro through ITS. On action from web dynpro application, i am concatenating the respective parameters mentioned below along with URL. The problem is one parameter(VARIANT) is being passed to the t-code CAT3
-
After installing Mavericks, computer will not boot up.
Have gone back to previous OS, deleted and re-downloaded install file and attempted to install Mavericks 5 times to same result. Ran disk utility, all okay. Keep getting a screen saying that a problem was encountered on booting up, hit a key, etc. co
-
CD not burning and no error messages... it just isn't burning
I am having a similar problem to Ol Buddy (http://discussions.apple.com/thread.jspa?threadID=729061&tstart=0). I burnt 2 CDs a couple of months ago. But, since then I've upgraded to iTunes 7. Today, first message I got was that the playlist was too b
-
HTML snippet does not show on my webpage?
the html snippet (from PayPal) shows up just fine in my iWeb page. But it disappears after uploading to my webpage. I use Fetch which is an independent uploader. I have iWeb version 3.0.4 and the iWeb page I am working on creates an "html" document b
-
Firefox seems to be very slow today in loading is there any performance test on line?
Browsing through web pages I see it is much slower than usual-is there any on line application test available?