Skip to Content
0
Former Member
May 15, 2013 at 07:06 PM

Unable to interpret ' ' as number

135 Views

Hello all,

Plead go throuh below program for reference as have done only for four views namely basic data1 basic data 2 mrp1 and mrp2

But it's showing me following error " unable to interpret ' ' as a number .

Please advice how to resolve this issue .

Fwd: Code

M

mangesh ambilkar

to me

2 days agoDetails

REPORT zmm_rec_mm04

NO STANDARD PAGE HEADING LINE-SIZE 255.

DATA : BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr, "Material Number

mbrsh LIKE mara-mbrsh, "Industry sector

mtart LIKE mara-mtart, "Material type

werks LIKE marc-werks, "Plant

lgort LIKE mard-lgort, "Storage location

vkorg LIKE mvke-vkorg, "Sales Organization

vtweg LIKE mvke-vtweg, "Distribution Channel

maktx LIKE makt-maktx, "Material description

meins LIKE mara-meins, "Base Unit of Measure

matkl LIKE mara-matkl, "Material group

spart LIKE mara-spart, "Division

mtpos_mara LIKE mara-mtpos_mara, "General item category group

dwerk LIKE mvke-dwerk, "Delivering Plant (Own or External)

taxm1 LIKE mlan-taxm1, "Tax classification material

taxm2 LIKE mlan-taxm2, "Tax classification material

taxm3 LIKE mlan-taxm3, "Tax classification material

taxm4 LIKE mlan-taxm4,

ktgrm LIKE mvke-ktgrm, "Account assignment group for this material

mtpos LIKE mvke-mtpos, "Item category group from material master

* MTVER LIKE MARC-MTVER, "Export/import material group

mtvfp LIKE marc-mtvfp, " Availability Check

tragr LIKE mara-tragr, "Transportation group

ladgr LIKE marc-ladgr, "Loading group

prctr LIKE marc-prctr, "Profit Center

ekgrp LIKE marc-ekgrp, "Purchasing group

* BSTME LIKE MARA-BSTME, "Order unit

ekwsl LIKE mara-ekwsl, "Purchasing Value Key

dismm LIKE marc-dismm, "MRP Type

dispo LIKE marc-dispo, "MRP controller

disls LIKE marc-disls, "Lot size (materials planning)

* PLIFZ LIKE MARC-PLIFZ, "Planned delivery time in days

fhori LIKE marc-fhori, "Scheduling Margin Key for Floats

strgr LIKE marc-strgr, "Planning strategy group

* AUSME LIKE MARC-AUSME, "Unit of issue

bklas LIKE mbew-bklas, "Valuation Class

vprsv LIKE mbew-vprsv, "Price control indicator

* VERPR LIKE MBEW-VERPR, "Moving Average Price/Periodic Unit Price

* STPRS LIKE MBEW-STPRS, "Standard price

peinh LIKE mbew-peinh,

END OF itab.

DATA : bdcdata TYPE bdcdata OCCURS 0 WITH HEADER LINE.

DATA : fnnam TYPE rlgrap-filename.

DATA : i_msgtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'UPLOAD'

EXPORTING

* CODEPAGE = ' '

filename = 'FNAM'

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 = itab

* EXCEPTIONS

* CONVERSION_ERROR = 1

* INVALID_TABLE_WIDTH = 2

* INVALID_TYPE = 3

* NO_BATCH = 4

* UNKNOWN_ERROR = 5

* GUI_REFUSE_FILETRANSFER = 6

* OTHERS = 7

.

IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

break abap1.

LOOP AT itab .

REFRESH bdcdata.

PERFORM bdc.

CALL TRANSACTION 'MM01' USING bdcdata MODE 'A'

MESSAGES INTO i_msgtab.

ENDLOOP.

*&amp;---------------------------------------------------------------------*

*&amp; Form BDC

*&amp;---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

FORM bdc.

******1ST SCREEN**************

PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMMG1-MTART'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=AUSW'.

PERFORM bdc_field USING 'RMMG1-MATNR'

itab-matnr.

PERFORM bdc_field USING 'RMMG1-MBRSH'

itab-mbrsh.

PERFORM bdc_field USING 'RMMG1-MTART'

itab-mtart.

*********** SELECTION OF VIEWS *****************

PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(12)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(02)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(04)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(05)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(06)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(09)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(10)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(11)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(12)'

'X'.

PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(14)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=DEF_SAVE'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(10)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(11)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(13)'

'X'.

PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(14)'

'X'.

PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=SCHL'.

**********SELECTION OF ORGANIZATIONAL DATA******************

PERFORM bdc_dynpro USING 'SAPLMGMM' '0080'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RMMG1-VTWEG'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_field USING 'RMMG1-WERKS'

itab-werks.

PERFORM bdc_field USING 'RMMG1-LGORT'

itab-lgort.

PERFORM bdc_field USING 'RMMG1-VKORG'

itab-vkorg.

PERFORM bdc_field USING 'RMMG1-VTWEG'

itab-vtweg.

********** BASIC DATA1*********************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARA-MTPOS_MARA'.

PERFORM bdc_field USING 'MARA-MEINS'

itab-meins.

PERFORM bdc_field USING 'MARA-MATKL'

itab-matkl.

PERFORM bdc_field USING 'MARA-SPART'

itab-spart.

PERFORM bdc_field USING 'MARA-MTPOS_MARA'

itab-mtpos_mara.

PERFORM bdc_field USING 'MARA-GEWEI'

'KG'.

********** BASIC DATA 2*******************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MAKT-MAKTX'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

********************** SALES ORG1********************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'BDC_CURSOR'

'MVKE-DWERK'.

PERFORM bdc_field USING 'MARA-MEINS'

itab-meins.

PERFORM bdc_field USING 'MARA-SPART'

itab-spart.

PERFORM bdc_field USING 'MVKE-DWERK'

itab-dwerk.

PERFORM bdc_field USING 'MARA-MATKL'

itab-matkl.

PERFORM bdc_field USING 'MVKE-SKTOF'

'X'.

PERFORM bdc_dynpro USING 'SAPLMGMM' '4200'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'BDC_CURSOR'

'MG03STEUER-TAXKM(04)'.

PERFORM bdc_field USING 'MG03STEUER-TAXKM(01)'

itab-taxm1.

PERFORM bdc_field USING 'MG03STEUER-TAXKM(02)'

itab-taxm2.

PERFORM bdc_field USING 'MG03STEUER-TAXKM(03)'

itab-taxm3.

PERFORM bdc_field USING 'MG03STEUER-TAXKM(04)'

itab-taxm4.

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'MARA-MEINS'

itab-meins.

PERFORM bdc_field USING 'MARA-SPART'

itab-spart.

PERFORM bdc_field USING 'MVKE-DWERK'

itab-dwerk.

PERFORM bdc_field USING 'MARA-MATKL'

itab-matkl.

PERFORM bdc_field USING 'MVKE-SKTOF'

'X'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MG03STEUER-TAXKM(01)'.

********************SALES ORG2*****************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'BDC_CURSOR'

'MVKE-MTPOS'.

PERFORM bdc_field USING 'MVKE-KTGRM'

itab-ktgrm.

PERFORM bdc_field USING 'MARA-MTPOS_MARA'

itab-mtpos_mara.

PERFORM bdc_field USING 'MVKE-MTPOS'

itab-mtpos.

*******************SALES ORG 3*************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'MARA-MEINS'

itab-meins.

PERFORM bdc_field USING 'MARA-GEWEI'

'KG'.

PERFORM bdc_field USING 'MARC-MTVFP'

itab-mtvfp.

PERFORM bdc_field USING 'MARA-TRAGR'

itab-tragr.

PERFORM bdc_field USING 'MARC-LADGR'

itab-ladgr.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARC-PRCTR'.

PERFORM bdc_field USING 'MARC-PRCTR'

itab-prctr.

********************MRP1****************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'MARA-MEINS'

itab-meins.

PERFORM bdc_field USING 'MARC-EKGRP'

itab-ekgrp.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARC-DISMM'.

PERFORM bdc_field USING 'MARC-DISMM'

itab-dismm.

*********************MRP2***************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MAKT-MAKTX'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'MARC-BESKZ'

'X'.

*****************MRP3*****************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'MARC-PERKZ'

'M'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARC-MTVFP'.

PERFORM bdc_field USING 'MARC-MTVFP'

itab-mtvfp.

********************MRP4****************************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MAKT-MAKTX'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

************************PLANT DATA / STORAGE1**********************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MAKT-MAKTX'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'MARA-MEINS'

itab-meins.

PERFORM bdc_field USING 'MARA-IPRKZ'

'D'.

**********PLANT/DATA STORAGE2************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'MARA-GEWEI'

'KG'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MARC-PRCTR'.

PERFORM bdc_field USING 'MARC-PRCTR'

itab-prctr.

******************ACCOUNTING1**********************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_field USING 'MARA-MEINS'

itab-meins.

PERFORM bdc_field USING 'MARA-SPART'

itab-spart.

PERFORM bdc_field USING 'BDC_CURSOR'

'MBEW-BKLAS'.

PERFORM bdc_field USING 'MBEW-BKLAS'

itab-bklas.

PERFORM bdc_field USING 'MBEW-PEINH'

'1'.

********************ACCOUNTING2************************************

PERFORM bdc_dynpro USING 'SAPLMGMM' '4000'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MAKT-MAKTX'.

PERFORM bdc_field USING 'MAKT-MAKTX'

itab-maktx.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=YES'.

ENDFORM. "BDC

*----------------------------------------------------------------------*

* Start new screen *

*----------------------------------------------------------------------*

FORM bdc_dynpro USING program dynpro.

CLEAR bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

ENDFORM. "bdc_dynpro

*----------------------------------------------------------------------*

* Insert field *

*----------------------------------------------------------------------*

FORM bdc_field USING fnam fval.

IF fval <> bdcdata.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDIF.

ENDFORM.

Thanks and regards ,

Prasad krishna Naralkar