0% found this document useful (0 votes)
122 views3 pages

Upload PO Long Text

This document describes a report that uploads a 3-column input file and inserts the text into material master records in transaction MM02. It defines internal tables to hold the uploaded data and long text. Forms are used to upload the file, place the text in the transaction by calling the CREATE_TEXT function, and create text records for different material types.

Uploaded by

Huseyn Ismayilov
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views3 pages

Upload PO Long Text

This document describes a report that uploads a 3-column input file and inserts the text into material master records in transaction MM02. It defines internal tables to hold the uploaded data and long text. Forms are used to upload the file, place the text in the transaction by calling the CREATE_TEXT function, and create text records for different material types.

Uploaded by

Huseyn Ismayilov
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

*&---------------------------------------------------------------------*

*&ReportZMM_INSERT_LONGTEXT
*&
*&---------------------------------------------------------------------*
*&
*& 3 kolonlu input dosyasi lazimdir
*&---------------------------------------------------------------------*
REPORTZMM_INSERT_LONGTEXT.
*Internaltabletoholdlongtext...
DATA:
BEGINOFT_UPLOADOCCURS0,
MATNRLIKEMARA-MATNR,"Materialnumber
ID(2)TYPEC,"Identification
LTEXTLIKETLINE-TDLINE,"Longtext
ENDOFT_UPLOAD,
*Internaltabletoholdlongtext....
T_LINELIKETLINEOCCURS0WITHHEADERLINE.
DATA:
W_GRUNLIKETHEAD-TDID,"Toholdid
W_OBJECTLIKETHEAD-TDOBJECTVALUE'MATERIAL',
"Toholdobjectid
LV_VALUE(70)."Valuetoholdmaterialnumber
START-OF-SELECTION.
*Thisperformisusedtouploadthefile
PERFORMUPLOAD_FILE.
*ThisperformisusedtoplacethetextinMM02transaction
PERFORMPLACE_LONGTEXT.
*&---------------------------------------------------------------------*
*&Formcreate_text
*&---------------------------------------------------------------------*
*ThisroutineusedtocreatetextinMM02transaction
*----------------------------------------------------------------------*
*Passedtheparameterw_gruntoP_C_GRUN
*andlv_valuetoP_LV_VALUE
*----------------------------------------------------------------------*
FORMCREATE_TEXTUSINGP_C_GRUN
P_LV_VALUE.
DATA:
L_IDLIKETHEAD-TDID,
L_NAME(70).
MOVE:P_C_GRUNTOL_ID,
P_LV_VALUETOL_NAME.
CALLFUNCTION'CREATE_TEXT'
EXPORTING
FID=L_ID
FLANGUAGE=SY-LANGU
FNAME=L_NAME
FOBJECT=W_OBJECT
*SAVE_DIRECT='X'
*FFORMAT='*'

TABLES
FLINES=T_LINE
EXCEPTIONS
NO_INIT=1
NO_SAVE=2
OTHERS=3
.
IFSY-SUBRC<>0.
CLEARLV_VALUE.
ELSE.
DELETET_LINEINDEX1.
ENDIF.
ENDFORM."create_text
*&---------------------------------------------------------------------*
*&Formupload_file
*&---------------------------------------------------------------------*
*Thisroutineisusedtouploadfile
*----------------------------------------------------------------------*
*Nointerfaceparametersarepassed
*----------------------------------------------------------------------*
FORMUPLOAD_FILE.
CALLFUNCTION'UPLOAD'
EXPORTING
*CODEPAGE=''
*FILENAME=''
FILETYPE='DAT'
*ITEM=''
*FILEMASK_MASK=''
*FILEMASK_TEXT=''
*FILETYPE_NO_CHANGE=''
*FILEMASK_ALL=''
*FILETYPE_NO_SHOW=''
*LINE_EXIT=''
*USER_FORM=''
*USER_PROG=''
*SILENT='S'
*IMPORTING
*FILESIZE=
*CANCEL=
*ACT_FILENAME=
*ACT_FILETYPE=
TABLES
DATA_TAB=T_UPLOAD
EXCEPTIONS
CONVERSION_ERROR=1
INVALID_TABLE_WIDTH=2
INVALID_TYPE=3
NO_BATCH=4
UNKNOWN_ERROR=5
GUI_REFUSE_FILETRANSFER=6
OTHERS=7
.
IFSY-SUBRC<>0.
*MESSAGEIDSY-MSGIDTYPESY-MSGTYNUMBERSY-MSGNO
*WITHSY-MSGV1SY-MSGV2SY-MSGV3SY-MSGV4.
ENDIF.

SORTT_UPLOADBYMATNRID.
ENDFORM."upload_file
*&---------------------------------------------------------------------*
*&Formplace_longtext
*&---------------------------------------------------------------------*
*ThisroutineplacesthetextinMM02transaction
*----------------------------------------------------------------------*
*Nointerfaceparametersarepassed
*----------------------------------------------------------------------*
FORMPLACE_LONGTEXT.
LOOPATT_UPLOAD.
T_LINE-TDFORMAT='ST'.
T_LINE-TDLINE=T_UPLOAD-LTEXT.
APPENDT_LINE.
IFT_UPLOAD-IDEQ'BT'.
MOVET_UPLOAD-MATNRTOLV_VALUE.
MOVE'GRUN'TOW_GRUN."TestIDforBasicdatatext
PERFORMCREATE_TEXTUSINGW_GRUNLV_VALUE.
ENDIF.
IFT_UPLOAD-IDEQ'IT'.
CLEARW_GRUN.
MOVET_UPLOAD-MATNRTOLV_VALUE.
MOVE'PRUE'TOW_GRUN."TestIDforInspectiontext
PERFORMCREATE_TEXTUSINGW_GRUNLV_VALUE.
ENDIF.
IFT_UPLOAD-IDEQ'IC'.
CLEARW_GRUN.
MOVE:T_UPLOAD-MATNRTOLV_VALUE,
'IVER'TOW_GRUN.
"TestIDforInternalcomment
PERFORMCREATE_TEXTUSINGW_GRUNLV_VALUE.
ENDIF.
ENDLOOP.
ENDFORM."place_longtext

You might also like