Upload Purchase order text using BDC while updating Material Master MM02
Hi All,
Please help me out with sample code upload PO Txt ( long text...which is more than 72 chars)using MM02. Its very urgent
I am not able to pass data into following fields seen in recording,
RSTXT-TXLINE(02),
RSTXT-TXLINE(03),
RSTXT-TXLINE(04),
RSTXT-TXLINE(05), as we can see only RSTXT-TXLINE field in the RSTXT structure......
how to split the long text into 72 chrs each and pass into data into the RSTXT-TXLINE(02), RSTXT-TXLINE(03), RSTXT-TXLINE(04)....correspondingly........
Thanks in advance.....
Reagards,
Prasad KR.
Hi
see the sample program
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.
Reward points for useful Answers
Regards
Anji
Similar Messages
-
Doubt in uploading purchase order data using BDC
Hi friends,
how to upload purchase order data.
1) In both BDC and BAPI which one is preferable?
2) for suppose if it is through BDC, how to use? what are the transactions that we can use(SHDB, ME21N,ME21)?
3) To execute the job in background, is it possible for both call transaction and session method.
Thanks in advance
Sreenivas kIt really depends on the number of records you have. Still for a set of 5,000 records my answer to your questions will be:
1) In both BDC and BAPI which one is preferable? - <b>Go with BDC</b>
2) for suppose if it is through BDC, how to use? what are the transactions that we can use(SHDB, ME21N,ME21)? - <b>Yes, its SHDB for recording, SE38 for abap program and ME21 for PO. Avoid SAP Enjoy transactions for recording as you may end up having problems wiht it.</b>
3) To execute the job in background, is it possible for both call transaction and session method. - <b>If you use call transaction method then you have to schedule the job to run in background or simply run it through F9 instead of F8. In case of session method you can chose to process the session in background. However I would suggest you go with BDC Session method for this.</b>
- Guru
Reward points for helpful answers -
Using supplier to update material master (MM02)
Hi,
We have a supplier that manufactures for us and we are asking that they pass certain MARA fields to us, so that we can automatically update the material master. The primary fields are weights and dimensions. We are using EDI and the MATMAS message type and basic type. However, we only want 6 or 7 fields allowed to pass to MARA, but we are getting all fields that are included in MATMAS, which is passing a null value to MARA and overwriting our existing data.
Does anyone know how to only pass certain fields using the MATMAS basic/message type? Should we be using another basic/message type to pass material master information from a supplier?
Your help is greatly appreciated.
Regards,
Vicki Smith
PHEHi,
This requires external program interface. Through web portal, your supplier can upload directly all relevant material master data.
Hope this information will be useful.
Bye,
Muralidhara -
Upload Purchase order text tab using BDC
Is it possible to upload Purchase order text tab in material master (tcode mm01) using a BDC.
If so pls tell me how to upload the same, what is the field name of the box.
Regards,
Senthilu need to use READ_TEXT or SAVE_TEXT or WRITE_TEXT or COMMIT_TEXT to upload text into SAP.
-
Upload purchase order text through LSMW
Please tell me procedure for uploading sales order & purchase order text in material master through lsmw
Hi
Long Texts are stored in STXH table with 4 parameters TEXTNAME,OBJECT,ID and LANGUAGE
You can't find the complete text in any table
You will find these 4 parameters in the table STXH.
Texts are created using the fun module CREATE_TEXT and SAVE_TEXT and these texts are fetched using READ_TEXT fun module
For uploading these long texts using LSMW see
for Long texts Upload
Please take a look at this..
http://help.sap.com/saphelp_erp2005/helpdata/en/e1/c6d30210e6cf4eac7b054a73f8fb1d/frameset.htm
<b>Reward points for useful Answers</b>
Regards
Anji -
How to upload Purchase oder text through BDC. or BAPI
Hi...
I wish to know how to upload purchase oder text wich is in MM01 t-code and has a screen number 4040 and program name SAPLMGMM, i want to migrate a material master data to another client by this fields, Basic, Purchasing, Purchase oder text ( long text), general plant date/storage1 and accounting. for that i am suspicious about uploading a purchase oder text with bdc...if i am true how i can have this by bapi or another means...please help me
...thaking you....Hi,
Use FM - BAPI_PO_CREATE1
It will fetch both HEADER and ITEM text.
This module is used to create a PO and as u r involved in a data migration, I can suggest to use this one.
Hope It'll help.
Thanks & Regards,
Ankur -
Material Mater Purchase Order Text in Display Mode in T.Code MM02
Dear Experts,
In some code when I want to change the PO text in Material master it reflect in Display mode but maximum code display in change mode plz explain where is the setting.
RCRHI,
To change the settings of any field in transaction to display, change, required, or hide, u have to pick the field selection group from OMSR and then go to OMS9, select your transaction and then change the settings.
Hopw this helps,
Swapnil -
Purchse Order Text using SECATT
Dear all
I am using SECATT for material master uploading. I want to upload Purchase Order Text using SECATT
Please suggest me how can I upload same using SECATT.
VipinHi,
According to my knowledge with help of SECATT purchase order text cannot be uploaded. Because purchase order text is not stored in any table. Its better to follow BDC program to upload thr purchase order text. Ihope this will help you. thanks. -
Hi All,
I want to take report of "Purchase order text" which is stored in material master.
Any Idea pls let me know....
Thanks
HariDear Hari,
You can use BAPI_PO_GETDETAIL1 or BAPI_PO_GETDETAIL to retrieve the data in your program.Enter the PO number and tick the item text and header text indicator.
Regards,
w1n -
Upload of purchase order text in the material master
Now we have information of Purchase order text for all the material.
Is it possible to upload the Purchase order text using LSMW.
Some friends were telling that LSMW is not possible for Purchase Order text.
Can anyone suggest how I can upload this purchase order text for all 1000
material using LSMW program.
/if not LSMW is there any other method to upload it
thanks in advance
deepak.s.gouraDear Deepak,
there is standard direct upload i believe
go to lsmw
Execute 1st option
then inLSMW:Object Attribute screen
in standard batch/ direct input
firsr radio button
select object 005
and method 003
Program name RSTXLITF.
Then go by normal process i.e source field , field mapping...
In this way u can also upload Text in the Material master.
Rewards if helpful
Regards
Sanjay L -
Upload of purchase order details using LSMW
Hi friends,
I encountered a problem while uploading purchase order details using LSMW . in the field mapping I could not able to fine the field TCODE. as a result I could not assign the transaction code ME21. could you please suggest me a solution.
thanksHai
Check with the following
Select fifth Radio button then follow the bellow step
<b>5) select radio-Button 5 and execute
Maintain Field Mapping and Conversion Rules
Select the Tcode and click on Rule button there you will select constant
and press continue button
give Transaction Code : ME21 and press Enter</b>
Thanks & regards
Sreenivasulu P -
Updating Material master purchase order text -LSMW
Dear Experts
How can update Purchase order Text through LSMW, while am doing recording system is not recording this field from material master
Regards
Ajeesh.sDear Expert
Please throw some light on this issue
Regards
Ajeesh.s -
Hi,
Please Help me in uploading Purchase Order Text into SAP.
I heard that CODE or theh same is available .please send me that document.
Thanks
shreyaHi,
I prefer to load this by LSMW with following object:
Object 0001 Long texts
Method 0001 (No selection)
Program name /SAPDMC/SAP_LSMW_IMPORT_TEXTS
Program type D Direct input
Best Regards, Murugesh AS -
hi friends
how to upload purchasing order text in mm01 transaction.
when i record purchasing order text it is storing in as a module pool program screen when i watch in the after recording , it does not have field and table name.
how to upload it?
thanks®ards
deepikaHi,
You can use the function module CREATE_TEXT for uploading the long text in the purchase order but this one has to be done after you have created the Purchase order succesfully. To use the above function module use the following steps.
1) Upload the longtext seperately into an internal table using GUI_UPLOAD and then use the following code to upload that text.
TYPES : BEGIN OF ty_upload,
matnr(18) TYPE c,
txline(5000) TYPE c,
END OF ty_upload.
DATA : it_upload TYPE STANDARD TABLE OF ty_upload,
wa_upload TYPE ty_upload.
DATA : v_tdid TYPE tdid,
v_tdobject TYPE tdobject,
v_en TYPE spras VALUE 'EN'.
CALL FUNCTION 'IQAPI_WORD_WRAP'
EXPORTING
textline = wa_upload-txline
outputlen = '132' ( Give the length depending upon your requirement)
TABLES
out_lines = it_outlines
EXCEPTIONS
outputlen_too_large = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
v_sno = 1.
CLEAR it_outlines.
LOOP AT it_outlines.
READ TABLE it_outlines INDEX v_sno .
IF sy-subrc = 0.
it_tlines-tdline = it_outlines-tdline.
APPEND it_tlines.
CLEAR: it_tlines,it_outlines.
v_sno = v_sno + 1.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = v_tdid
flanguage = v_en
fname = v_matnr
fobject = v_tdobject
save_direct = 'X'
fformat = '*'
TABLES
flines = it_tlines
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
IF sy-subrc = 0.
Here if sy-subrc is Zero means the text is updated successfully.
Here for getting the tdid and tdobject go to the Tcode ME21 and there inside that one get the values for them and in the PO text of the header text tab.
Hope this one will help you.
Regards,
Venkat. -
Long text in PURCHASE order text view in program RMDATIND
hi all,
ive to upload data for material master iam doing this using lsmw & standard object 0020 program RMDATIND.purchase order text.In this iam unable to upload purchase order text in Purchase order text view can anyone plz tell me how to do tht??? its a bit urgent
points will be awarded!
rgds
Message was edited by:
abbaper
Message was edited by:
abbaperHi
In LSMW
for Long texts Upload
Please take a look at this..
http://help.sap.com/saphelp_erp2005/helpdata/en/e1/c6d30210e6cf4eac7b054a73f8fb1d/frameset.htm
Regards
Anji
Maybe you are looking for
-
Report Generation - Build an exe from a PC with different Office Version
Hi, I want to build an exe from a VI that uses Report Generation Toolkit. The application has to be deployed on several PCs that use Office 2000. During development phase I installed on my PC, Office 2000 and everything was ok. After I was done with
-
ERROR IN ORACLE STORED PROCEDURE in JDBC RECIEVER
Hi all i have an FILE2JDBC2FILE sync scenario.have configured this w/o BPM.i need to call an stored procedure which will return me the output in the outpur parameters.input out put parametrs of the stored procedure are. p_api_version
-
Wish list and bug reports?
In my short acquaintance with xcelsius 2008 (fix pack 2 now) I have come across a number of bugs (not saying how big a number...) and come up with a number of new features suggestions which I consider crucial (sure, maybe noone else does) but I don't
-
How do I maximize the chance of a successful p2p connection?
I understand that the p2p connection may not be possible, and sometimes even the stratus connection may not be possible, but I would like to know any steps I can take to help improve the probability of success. Are there any recommendations on guidel
-
I can't download a PDF from my browser. I work with Mac OS 10.10.1 and Safari 8.0.2 When I see a PDF on a website and want to download it, I get the message: Adobe Acrobat Voordat u verdergaat moet u Adobe Acrobat starten en de gebruikersovereenkomst