Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

in data transfer

Former Member
0 Kudos

hi

while transfering data to MM01 transaction , how many views you can use? what are the other problems we have to face ?

3 REPLIES 3

varma_narayana
Active Contributor
0 Kudos

Hi Jyothsna..

In case of MM01 the view selection depends on the Material type like ROH, FERT .

To handle the Views in MM01 we can use the FM <b>MATERIAL_BTCI_SELECTION_NEW</b>

<b>reward if helpful.</b>

Former Member
0 Kudos

Dear Jyothsna,

Please go through the following BDC Program pertaining to MM01.

REPORT ZSOURCE.

TABLES: EORD,

EINA,

MARC.

  • Batch Input Name

PARAMETERS P-BTCHSN(12) DEFAULT 'ME01'.

  • Vendor Code

PARAMETERS P-LIFNR LIKE LFA1-LIFNR DEFAULT 'XXXXX'.

  • Material Group

PARAMETERS P-MATKL LIKE MARA-MATKL DEFAULT 'XXXXXXX'.

  • Plants

PARAMETERS P-WERKS LIKE EORD-WERKS DEFAULT 'XX'.

  • Tick Block/Untick Unblock

PARAMETERS P-NOTKZ LIKE EORD-NOTKZ DEFAULT 'X'.

  • Auto / Manual run the Batch Input Program

PARAMETERS P-RUN AS CHECKBOX DEFAULT 'X'.

  • INTERNAL TABLE FOR DATA

DATA: BEGIN OF ULTAB OCCURS 50,

MATNR LIKE EORD-MATNR, "Material No.

WERKS LIKE EORD-WERKS, "Plants

ZEORD LIKE EORD-ZEORD, "NO

LIFNR LIKE EINA-LIFNR, "Vendor Code

END OF ULTAB.

  • INTERNAL TABLE FOR BATCH INPUT DATA

DATA: BEGIN OF IPUTTAB OCCURS 50.

INCLUDE STRUCTURE BDCDATA.

DATA: END OF IPUTTAB.

  • INTERNAL TABLE FOR BATCH INPUT ERROR MESSAGE.

DATA: BEGIN OF MESSTAB OCCURS 50.

INCLUDE STRUCTURE BDCMSGCOLL.

DATA: END OF MESSTAB.

DATA: C_TAXKM LIKE MG03STEUER-TAXKM VALUE '1',

W-LINE-NO TYPE I.

REFRESH ULTAB.

SELECT * FROM EINA WHERE LIFNR = P-LIFNR

AND LOEKZ = SPACE.

SELECT SINGLE * FROM MARC WHERE MATNR = EINA-MATNR

AND WERKS = P-WERKS.

CHECK MARC-LVORM = SPACE.

CLEAR ULTAB.

SELECT * FROM EORD WHERE MATNR = EINA-MATNR

AND WERKS = P-WERKS

AND LIFNR = P-LIFNR.

ULTAB-MATNR = EORD-MATNR.

ULTAB-WERKS = EORD-WERKS.

ULTAB-ZEORD = EORD-ZEORD.

ULTAB-LIFNR = EORD-LIFNR.

APPEND ULTAB.

ENDSELECT.

IF SY-SUBRC = 4.

ULTAB-MATNR = EINA-MATNR.

ULTAB-WERKS = P-WERKS.

ULTAB-ZEORD = ''.

ULTAB-LIFNR = EINA-LIFNR.

APPEND ULTAB.

ENDIF.

ENDSELECT.

  • CHECK WHETHER TABLE IS EMPTY

IF ULTAB[] is initial.

WRITE: / 'TABLE EMPTY'.

ENDIF.

  • Create Batch session

PERFORM CRE-BATCH-SESS.

    • LOOP TABLE TO CREATE SCREEN INPUT

SORT.

LOOP AT ULTAB.

REFRESH IPUTTAB.

PERFORM SCREEN1.

PERFORM SCREEN2.

PERFORM PRN_ULTAB.

PERFORM CLOSE-SESS.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

  • END OF MAIN PROGRAM

FORM SCREEN1.

  • SCREEN #1: INITAL SCREEN FOR MAINTAINING SOURCE LIST

CLEAR IPUTTAB.

IPUTTAB-PROGRAM = 'SAPLMEOR'.

IPUTTAB-DYNPRO = '200'.

IPUTTAB-DYNBEGIN = 'X'.

APPEND IPUTTAB.

  • Source List : Material No.

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'EORD-MATNR'.

IPUTTAB-FVAL = ULTAB-MATNR.

APPEND IPUTTAB.

  • Source List : Plants.

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'EORD-WERKS'.

IPUTTAB-FVAL = ULTAB-WERKS.

APPEND IPUTTAB.

ENDFORM.

  • FORM : SCREEN1 *

FORM SCREEN2.

  • Modify screen for SOURCE LIST

CLEAR IPUTTAB.

IPUTTAB-PROGRAM = 'SAPLMEOR'.

IPUTTAB-DYNPRO = '205'.

IPUTTAB-DYNBEGIN = 'X'.

APPEND IPUTTAB.

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'EORD-VDATU(1)'.

IPUTTAB-FVAL = '01.01.2001'.

APPEND IPUTTAB.

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'EORD-BDATU(1)'.

IPUTTAB-FVAL = '31.12.9999'.

APPEND IPUTTAB.

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'EORD-LIFNR(1)'.

IPUTTAB-FVAL = P-LIFNR.

APPEND IPUTTAB.

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'EORD-EKORG(1)'.

IPUTTAB-FVAL = 'ALL'.

APPEND IPUTTAB.

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'EORD-NOTKZ(1)'.

IPUTTAB-FVAL = P-NOTKZ.

APPEND IPUTTAB.

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'EORD-AUTET(1)'.

IPUTTAB-FVAL = '1'.

APPEND IPUTTAB.

  • Specify that we are now done with this screen (Save it with F11)

CLEAR IPUTTAB.

IPUTTAB-FNAM = 'BDC_OKCODE'.

IPUTTAB-FVAL = '/11'.

APPEND IPUTTAB.

ENDFORM.

  • FORM : CLOSE-SESS *

  • DESCRIPTION : CLOSE THE SESSION *

FORM CLOSE-SESS.

  • closing the session.

IF P-RUN = 'X'.

  • Auto run the Batch Input Program

CALL TRANSACTION 'ME01'

USING IPUTTAB

MODE 'E'

UPDATE 'S'

MESSAGES INTO MESSTAB.

ELSE.

  • Maual run the Batch Input Program

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'ME01'

TABLES

DYNPROTAB = IPUTTAB.

ENDIF.

ENDFORM.

  • FORM : PRN-ULTAB *

  • DESCRIPTION : PRINT OK TABLE *

FORM PRN_ULTAB.

WRITE: / ULTAB-MATNR, ULTAB-WERKS, ULTAB-ZEORD, ULTAB-LIFNR.

W-LINE-NO = W-LINE-NO + 1.

WRITE: ' RECORD# ', W-LINE-NO.

ENDFORM.

  • FORM : CRE-BATCH-SESS *

  • DESCRIPTION : CREATE BATCH SESSION *

FORM CRE-BATCH-SESS.

    • Create BTCI session **

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = P-BTCHSN

USER = SY-UNAME

KEEP = 'X'.

ENDFORM.

Regards,

Abir

*************************************

  • Don't forget to reward points *

Former Member
0 Kudos

hi

Sap has provided standard program RMDATIND.. to upload material data.

so generally lsmw with direct input method is used to upload the material master data...

hence there is no concept of selecting the views while uploading material data.

in fact we often upload material master data in sap r/3 database

we follow the above procedure to upload material data

regards

sree