‎2007 Sep 19 2:50 PM
Hi everyone...
I have a small doubt.If we use a transaction MM01 for BDC data insertion,should we provide a new screen number in the perform statement.
Can we provide any screen number we wanted.
Also.....i can be thankful to you if u can say me abt an inernal subroutine.
Subroutines(call by ref) and passing tables to a subroutine are also requested.
Thanks in advance
Ranjith
‎2007 Sep 19 2:59 PM
Hi!
No, you have to use the screen number, which contains the given field.
Just create a recording with SM35 transaction (click on the recordings button). Then generate the program from the recording and you can see the exct screen numbers and fields.
For subroutines you can use the FORM - ENDFORM statements to define.
You can call the with PERFORM statement and the tables with the TABLES keyword.
Regards
Tamá
‎2007 Sep 19 2:57 PM
&----
*& Report ZSAG_BS *
*& *
&----
*& *
*& *
&----
REPORT ZSAG_BS .
********TABLES
TABLES : MARA,MAKT .
*******INTERNAL TABLE
DATA : BEGIN OF ITAB OCCURS 0 ,
MATNR LIKE MARA-MATNR,
MBRSH LIKE MARA-MBRSH,
MTART LIKE MARA-MTART ,
MAKTX LIKE MAKT-MAKTX,
MEINS LIKE MARA-MEINS ,
END OF ITAB.
DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE .
********WS_UPLOAD
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = 'C:\DAT1.TXT'
FILETYPE = 'DAT'
TABLES
DATA_TAB = ITAB .
****************BDC_OPEN_GROUP
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'CHANDU'
KEEP = 'X'
USER = SY-UNAME
PROG = SY-CPROG .
LOOP AT ITAB .
REFRESH BDCTAB .
*********FIRST SCREEN
BDCTAB-PROGRAM = 'SAPLMGMM'.
BDCTAB-DYNPRO = '0060'.
BDCTAB-DYNBEGIN = 'X' .
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'RMMG1-MATNR' .
BDCTAB-FVAL = ITAB-MATNR .
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'RMMG1-MBRSH' .
BDCTAB-FVAL = ITAB-MBRSH .
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'RMMG1-MTART' .
BDCTAB-FVAL = ITAB-MTART .
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'BDC_OKCODE'.
BDCTAB-FVAL = '=AUSW' .
APPEND BDCTAB .
CLEAR BDCTAB.
********SECOND SCREEN
BDCTAB-PROGRAM = 'SAPLMGMM'.
BDCTAB-DYNPRO = '0070'.
BDCTAB-DYNBEGIN = 'X' .
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'MSICHTAUSW-KZSEL(01)' .
BDCTAB-FVAL = 'X' .
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'BDC_OKCODE'.
BDCTAB-FVAL = '=ENTR' .
APPEND BDCTAB .
CLEAR BDCTAB.
***************THIRD SCREEN
BDCTAB-PROGRAM = 'SAPLMGMM'.
BDCTAB-DYNPRO = '4004'.
BDCTAB-DYNBEGIN = 'X' .
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'MAKT-MAKTX' .
BDCTAB-FVAL = ITAB-MAKTX.
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'MARA-MEINS'.
BDCTAB-FVAL = ITAB-MEINS .
APPEND BDCTAB .
CLEAR BDCTAB.
BDCTAB-FNAM = 'BDC_OKCODE'.
BDCTAB-FVAL = '=BU' .
APPEND BDCTAB .
CLEAR BDCTAB.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MM01'
TABLES
DYNPROTAB = BDCTAB .
ENDLOOP .
CALL FUNCTION 'BDC_CLOSE_GROUP' .
regards,
srinivas
‎2007 Sep 19 2:59 PM
Hi!
No, you have to use the screen number, which contains the given field.
Just create a recording with SM35 transaction (click on the recordings button). Then generate the program from the recording and you can see the exct screen numbers and fields.
For subroutines you can use the FORM - ENDFORM statements to define.
You can call the with PERFORM statement and the tables with the TABLES keyword.
Regards
Tamá