Create Bdc Program Sap Abap

SAP BDC (Batch Data Communication). Writing BDC program; Creating Batch Input. In this method an ABAP/4 program reads the external data to the SAP System and. Dear SAP Community Member, In order to fully benefit from what the SAP Community has to. BDC Tutorial. Skip to end of. Select your recording and click create.

• Give the t-code shdb in the command field. • Click the new recording button. Give a name to the recording and the t-code you want to record. E.g.: Recording: Z_UPLOAD Transaction code: MM01 • When you click save, it takes you to t-code (MM01) you would like to do recording for upload. • Record carefully.

Create Bdc Program Sap AbapSample Abap Programs

Fill in the details you want to upload. In this case I have entered the material no, industry sector, material type, material description and basic unit of measure. • Then the Transaction recorder - edit recording Z_UPLOAD screen is displayed. You can edit your recording or just save it and click back button. Select your recording and click create program button.

• Enter the program name say Z_UPLOAD.Select the transfer from recording option. Save it.Give the program title, type as executable program and click source code button at the bottom. San Melody Rapidshare there. • The following piece of code is generated automatically. Report Z_UPLOAD no standard page heading line-size 255. Include bdcrecx1.

Perform open_group. Perform bdc_dynpro using 'SAPLMGMM' '0060'. Perform bdc_field using 'BDC_CURSOR' 'RMMG1-MATNR'. Perform bdc_field using 'BDC_OKCODE' '=AUSW'. Perform bdc_field using 'RMMG1-MATNR' 'MYMATERIAL10'. Driver Hp K5400 Windows 7 64. Perform bdc_field using 'RMMG1-MBRSH' 'P'.

Perform bdc_field using 'RMMG1-MTART' 'ZOH'. Perform bdc_dynpro using 'SAPLMGMM' '0070'. Perform bdc_field using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'. Perform bdc_field using 'BDC_OKCODE' '=ENTR'. Perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'.

Perform bdc_dynpro using 'SAPLMGMM' '4004'. Perform bdc_field using 'BDC_OKCODE' '=BU'.

Perform bdc_field using 'MAKT-MAKTX' 'MY MATERIAL10'. Perform bdc_field using 'BDC_CURSOR' 'MARA-MEINS'. Perform bdc_field using 'MARA-MEINS' 'G'. Perform bdc_field using 'MARA-MTPOS_MARA' 'NORM'.

Perform bdc_transaction using 'MM01'. Perform close_group. Now make the necessary changes highligted in blue color. Report Z_UPLOAD no standard page heading line-size 255. *types declaration......* types: begin of t_mat, matnr(20), desc(50), uom(5), end of t_mat.

*internal table and workarea declaration...* data: i_mat type table of t_mat. Data: wa_mat type t_mat. Include bdcrecx1. *moving the flat file content to internal table...* CALL FUNCTION 'UPLOAD' EXPORTING ** CODEPAGE = ' ' FILENAME = 'BDCDATA1' ' Name of the tab delimited flat file on desktop 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 = i_mat ' Name of internal table with data.

** 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.

Perform open_group. Loop at i_mat into wa_mat.

Perform bdc_dynpro using 'SAPLMGMM' '0060'. Perform bdc_field using 'BDC_CURSOR' 'RMMG1-MATNR'. Perform bdc_field using 'BDC_OKCODE' '=AUSW'. Perform bdc_field using 'RMMG1-MATNR' wa_mat-matnr. Perform bdc_field using 'RMMG1-MBRSH' 'P'. Perform bdc_field using 'RMMG1-MTART' 'ZOH'.