Académique Documents
Professionnel Documents
Culture Documents
Data transfer programs that use batch input or CALL TRANSACTION Batch input sessions Test data Function modules.
Steps to create a transaction recording 1. 2. 3. 4. 5. 6. 7. 8. Enter the transaction code SHDB. Enter a name for recording. Choose create button Enter the transaction code which we want to record Choose Continue Execute the transaction Choose Get Transaction if no errors occurred Choose next Transaction if we want to record any other transactions also. And continue the steps from 4 9. Save after the recording finished Steps to process a recorded transaction 1. 2. 3. 4. 5. 6. 7. Enter the transaction code SHDB Choose Overview Point your mouse to the corresponding recording Choose execute Enter the processing mode (A , E or N) Enter the update mode (A, S or L ) Press Enter
*************************************************************************************
Step1
Step2:
Continue
Select tick mark and Enter material desc and unit of mesure
Select program
- It is one of the BDC techniques for uploading legacy data into SAP - The data is transferring from the internal table to database table through sessions. - Data along with its action is stored in session. - When the program has finished generating the session, you can run the session to execute the transaction. - Unless session is processed, the data is not transferred to database tables.
1. BDC_OPEN_GROUP (Used to create the session) Import Parameters : USER - User Name CLIENT - Client GROUP - Name of the session HOLD - The date when you want to process the session KEEP - X retain session even after processing it ' ' - Delete the session after processing.
- Processing Steps
1. Generate the batch input session using function module BDC_OPEN_GROUP. 2. The proceed as follows for each transaction that the session contains: a. In the BDCDATA structure, enter the value for all screens and fields that must be processed in the transaction. b. Use BDC_INSERT to transfer the transaction and the BDCDATA structure to the session. 3. Close the batch input session with BDC_CLOSE_GROUP. 4. Start to process the generated session in T.Code SM35.
*&---------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001. PARAMETERS : p_fname TYPE localfile. SELECTION-SCREEN END OF BLOCK bk1.
TYPES: BEGIN OF t_mat, matnr type mara-matnr, mbrsh type mara-mbrsh, mtart type mara-mtart, maktx type MAKT-maktx, meins type mara-meins, END OF t_mat.
Internal Table Declaration for Customer data i_mat TYPE STANDARD TABLE OF t_mat, wa_mat TYPE t_mat,
*&---------------------------------------------------------------------* AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname. * F4 functionality for File Name CALL FUNCTION 'F4_FILENAME' EXPORTING program_name = syst-cprog dynpro_number = syst-dynnr field_name = ' ' IMPORTING file_name = p_fname.
start-of-selection.
v_fname = p_fname.
* Upload data from flat file and store it in an Internal table CALL FUNCTION 'GUI_UPLOAD' EXPORTING filename filetype = v_fname = 'ASC'
CALL FUNCTION 'BDC_OPEN_GROUP' EXPORTING client group keep user EXCEPTIONS client_invalid =1 = sy-mandt = 'ZCUST' = 'X' = sy-uname
IF sy-subrc <> 0. MESSAGE e000(zmsg) WITH 'Error while opening the session'. ENDIF. LOOP AT i_mat INTO wa_mat. CLEAR wa_bdcdata. REFRESH i_bdcdata[].
wa_mat-mtart. perform bdc_dynpro perform bdc_field using 'SAPLMGMM' '0070'. using 'BDC_CURSOR'
using 'MAKT-MAKTX'
wa_mat-meins. perform bdc_dynpro perform bdc_field using 'SAPLSPO1' '0300'. using 'BDC_CURSOR'
'=YES'.
CALL FUNCTION 'BDC_INSERT' EXPORTING tcode TABLES dynprotab EXCEPTIONS internal_error = 1 not_open queue_error =2 =3 = i_bdcdata[] = 'MM01'
tcode_invalid = 4
*&--------------------------------------------------------------------* FORM bdc_dynpro USING program dynpro. CLEAR wa_bdcdata. wa_bdcdata-program = program. wa_bdcdata-dynpro = dynpro. wa_bdcdata-dynbegin = 'X'. APPEND wa_bdcdata TO i_bdcdata. ENDFORM. "BDC_DYNPRO
*----------------------------------------------------------------------* FORM bdc_field USING fnam fval. IF fval <> space. CLEAR wa_bdcdata. wa_bdcdata-fnam = fnam. wa_bdcdata-fval = fval. APPEND wa_bdcdata TO i_bdcdata. ENDIF. ENDFORM. "BDC_FIELD
*****file******
MAT10 M
FERT
DESCP1 KG