on 04-27-2006 11:41 PM
Hi All,
We have to Upload PO long text for Material through Tx MM02.We found BAPI <b>BAPI_MATERIAL_SAVEDATA</b>can be used in this purpose,but not able find the way how to append the long texts into the Table parameter BAPI_MLTX,also how to take them from the Excel with respect to a particular MATNR.
Can anyone help me out?
Regds,
Atrai.
T_LTXT LIKE BAPI_MLTX OCCURS 10 WITH HEADER LINE,
PREPARE THE PURCHASE TEXT
REFRESH: T_READTXT.
MOVE T_MARA-MATNR TO T_STR_SALES_TNAME-MATNR.
TNAME = T_STR_SALES_TNAME.
TID = 'BEST'.
TOBJECT = 'MATERIAL'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = TID
LANGUAGE = SY-LANGU
NAME = TNAME
OBJECT = TOBJECT
TABLES
LINES = T_READTXT
EXCEPTIONS
ID = 0
LANGUAGE = 0
NAME = 0
NOT_FOUND = 0
OBJECT = 0
REFERENCE_CHECK = 0
WRONG_ACCESS_TO_ARCHIVE = 0
OTHERS = 0.
IF SY-SUBRC <> 0.
MESSAGE I398(00) WITH 'No purchase text aintained for'
t_mvke-MATNR.
ENDIF.
LOOP AT T_READTXT.
MOVE TOBJECT TO T_LTXT-APPLOBJECT.
MOVE TNAME TO T_LTXT-TEXT_NAME.
MOVE TID TO T_LTXT-TEXT_ID.
MOVE SY-LANGU TO T_LTXT-LANGU.
MOVE T_READTXT-TDFORMAT TO T_LTXT-FORMAT_COL.
MOVE T_READTXT-TDLINE TO T_LTXT-TEXT_LINE.
APPEND T_LTXT.
CLEAR T_LTXT.
ENDLOOP.
ENDIF.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = WA_HEAD
CLIENTDATA = WA_MARA
CLIENTDATAX = WA_MARAX
PLANTDATA = WA_MARC
PLANTDATAX = WA_MARCX
FORECASTPARAMETERS = WA_MPOP
FORECASTPARAMETERSX = WA_MPOPX
PLANNINGDATA = WA_MPGD
PLANNINGDATAX = WA_MPGDX
STORAGELOCATIONDATA = WA_MARD
STORAGELOCATIONDATAX = WA_MARDX
VALUATIONDATA = WA_MBEW
VALUATIONDATAX = WA_MBEWX
WAREHOUSENUMBERDATA = WA_MLGN
WAREHOUSENUMBERDATAX = WA_MLGNX
SALESDATA = WA_MVKE
SALESDATAX = WA_MVKEX
STORAGETYPEDATA = WA_MLGT
STORAGETYPEDATAX = WA_MLGTX
FLAG_ONLINE = ' '
FLAG_CAD_CALL = ' '
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = T_DESCR
UNITSOFMEASURE = T_MARM
UNITSOFMEASUREX = T_MARMX
INTERNATIONALARTNOS =
<b> MATERIALLONGTEXT = T_LTXT</b> TAXCLASSIFICATIONS = T_MLAN
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
.
regards
vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you have to update only the long texts for the material, you can use SAVE_TEXT / COMMIT_TEXT.
You can upload the data in the file using the method GUI_UPLOAD in the class CL_GUI_FRONTEND_SERVICES into the internal table of your program.
However, there are quite a few long texts for Material, you need to know three important parameters for saving the long texts.
TDOBJECT -
TDID -
TEXTNAME - Material Name
When you go into texts of the material in full screen mode, in the menu GO TO --> Header, you can find the values for all these parameters.
Finally call the COMMIT_TEXT function and you are done.
Regards,
Ravi
Note :Please mark the helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.