Posted: Sat Oct 06, 2007 12:29 am Post subject: Creating Material With BAPI
Code:
*———————————————————————*
* Report Name : YGECICI
*———————————————————————*
* Author : Mehmet Avşar
* Location : @Altunizade - Uskudar / Istanbul
* Date / Time : 05 Jan 2007
* Subject : User Exits of Transaction Codes
*———————————————————————*
REPORT YGECICI MESSAGE-ID 00
No Standard Page Heading
Line-Size 200
Line-Count 65.
DATA:
BEGIN OF LSMW_MATERIAL_MASTER,
MATNR(018) TYPE C, “Material number
MTART(004) TYPE C, “Material type
MBRSH(001) TYPE C, “Industry sector
WERKS(004) TYPE C, “Plant
MAKTX(040) TYPE C, “Material description
DISMM(002) TYPE C, “Extra Field Added In the Program as itsrequired
MEINS(003) TYPE C, “Base unit of measure
MATKL(009) TYPE C, “Material group
SPART(002) TYPE C, “Division
LABOR(003) TYPE C, “Lab/office
PRDHA(018) TYPE C, “Product hierarchy
MSTAE(002) TYPE C, “X-plant matl status
MTPOS_MARA(004) TYPE C, “Gen item cat group
BRGEW(017) TYPE C, “Gross weight
GEWEI(003) TYPE C, “Weight unit
NTGEW(017) TYPE C, “Net weight
GROES(032) TYPE C, “Size/Dimensions
MAGRV(004) TYPE C, “Matl grp pack matls
BISMT(018) TYPE C, “Old material number
WRKST(048) TYPE C, “Basic material
PROFL(003) TYPE C, “DG indicator profile
KZUMW(001) TYPE C, “Environmentally rlvt
BSTME(003) TYPE C, “Order unit
VABME(001) TYPE C,
EKGRP(003) TYPE C, “Purchasing group
XCHPF(001) TYPE C, “Batch management
EKWSL(004) TYPE C, “Purchasing key value
WEBAZ(003) TYPE C, “GR processing time
MFRPN(040) TYPE C, “Manufacturer part number
MFRNR(010) TYPE C, “Manufacturer number
VPRSV(001) TYPE C, “Price control indicator
STPRS(015) TYPE C, “Standard price
BWPRH(014) TYPE C, “Commercial price1
BKLAS(004) TYPE C, “Valuation class
bwkey(004) type c,
*to store the input data
DATA:
BEGIN OF it_matmaster OCCURS 0.
INCLUDE STRUCTURE LSMW_MATERIAL_MASTER.
DATA:
END OF it_matmaster.
*for material description
DATA:BEGIN OF IT_MATERIALDESC OCCURS 0.
INCLUDE STRUCTURE BAPI_MAKT .
DATA:END OF IT_MATERIALDESC.
*FOR gross wt
data: begin of it_uom occurs 0.
include structure BAPI_MARM.
data:end of it_uom.
DATA: BEGIN OF IT_UOMX OCCURS 0.
INCLUDE STRUCTURE BAPI_MARMX.
DATA:END OF IT_UOMX.
data:begin of it_mean occurs 0.
include structure bapi_mean.
data:end of it_mean.
DATA:BEGIN OF IT_MLTX OCCURS 0.
INCLUDE STRUCTURE BAPI_MLTX.
DATA:END OF IT_MLTX.
*to return messages
DATA:BEGIN OF IT_RETURN OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA:END OF IT_RETURN.
************************************************************************
* SELECTION SCREEN *
************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-002.
PARAMETERS:P_FILE LIKE RLGRAP-FILENAME OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1 .
************************************************************************
* AT SELECTION SCREEN *
************************************************************************
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.
**********************************************************************
* TO UPLOAD THE DATA *
**********************************************************************
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.