Sie sind auf Seite 1von 3

1.

Structure used in BDC program:


Bdcdata
Bdcmsgcoll
2. how to get the flat file in excel format?
Through the function module "ALSM_EXCEL_TO_INTERNAL_TABLE"
3. How to declare the input help for getting flat file?
Functional module: F4_FILENAME
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME
= 'P_FILE'
IMPORTING
FILE_NAME
= P_FILE.

"f4 help for file name

FORM EXCEL_UPLOAD .
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME
= P_FILE
I_BEGIN_COL
= V_BCOL
I_BEGIN_ROW
= V_BROW
I_END_COL
= V_ECOL
I_END_ROW
= V_EROW
TABLES
INTERN
= TA_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE
= 2
OTHERS
= 3.
ENDFORM.
" EXCEL_UPLOAD

4. Write logic to convert the excel file to SAP file format?? why we need conversion???
Usually, while we are getting the file in excel format through the function module, the table is in the
format of row, column and value.
So we need to convert them in internal table format. for that below coding is used:

Sort ta_excel by row col.


Clear wa_excel.
Clear wa_flatfile.
Loop at ta_excel into wa_excel.
Move wa_excel-col to v_index.
Assign component v_index of structure wa_flatfile to <fs>.
If sy-subrc = 0.
Move wa_excel-value to <fs>.
Endif.
At end of row.
Append wa_flatfile to ta_flatfile.
Clear wa_flatfile.
Endat.

5. How to create a message?


Through coding: MESSAGE 'XXX' TYPE 'E'.
Through message class & call message through coding:
Se91 @ create messages @ message e000 (messageclass_name)
6. Code for BDC uploads:
Call transaction 'IW32' USING BDCDATA MODE 'N' UPDATE 'S' MESSAGES INTO BDCMSGCOLL.
7. Different types of mode in BDC:
i. front end - A
ii. show only errors -E
iii. Background-N
8. Different type of Update in BDC-call transaction:
i. Asynchronous update - A(default)
ii. Synchronous update - S
iii. Task update - L

9. How to display error messages in bdc upload?


While doing BDC, pass all the messages into bdcmsgcoll and format the messages using function module
'FORMAT MESSAGE' & Display using write statement.

Das könnte Ihnen auch gefallen