how to create bdc for sales order ? if any one kow the
steps plz mail me at toamitshri@gmail.com

Answer Posted / mallik

report ZTEST_BDC_MA
no standard page heading line-size 255.

*DATA: ld_file LIKE rlgrap-filename.
DATA: gd_file type string.

*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
AUART LIKE VBAK-AUART,
VKORG LIKE VBAK-VKORG,
VTWEG LIKE VBAK-VTWEG,
SPART LIKE VBAK-SPART,
KUNNR LIKE KUAGV-KUNNR,
KUNNR1 LIKE KUAGV-KUNNR,
MATNR LIKE MARA-MATNR,
PRCTR LIKE COBL-PRCTR,
END OF t_record.

DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL
SIZE 0,
wa_record TYPE t_record.

*Text version of data table
TYPES: BEGIN OF t_uploadtxt,
AUART LIKE VBAK-AUART,
VKORG LIKE VBAK-VKORG,
VTWEG LIKE VBAK-VTWEG,
SPART LIKE VBAK-SPART,
KUNNR LIKE KUAGV-KUNNR,
KUNNR1 LIKE KUAGV-KUNNR,
MATNR LIKE MARA-MATNR,
PRCTR LIKE COBL-PRCTR,
END OF t_uploadtxt.

*Used to store BDC data
DATA: BEGIN OF bdc_tab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdc_tab.

*Used to stores error information from CALL TRANSACTION
Function Module
*DATA: BEGIN OF messtab OCCURS 0.
* INCLUDE STRUCTURE bdcmsgcoll.
*DATA: END OF messtab.

gd_file = ' Your workstation file name'.

CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = gd_file
has_field_separator = 'X' "file is TAB delimited
TABLES
data_tab = it_record
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.

IF sy-subrc NE 0.
write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD
FM'.
skip.
endif.

include bdcrecx1.

start-of-selection.

perform open_group.

Loop at it_record into wa_record.

perform bdc_dynpro using 'SAPMV45A' '0101'.

perform bdc_field using 'VBAK-AUART'
wa_record-auart.
perform bdc_field using 'VBAK-VKORG'
wa_record-vkorg.
perform bdc_field using 'VBAK-VTWEG'
wa_record-vtweg.
perform bdc_field using 'VBAK-SPART'
wa_record-spart.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KUAGV-KUNNR'
wa_record-kunnr.
perform bdc_field using 'KUWEV-KUNNR'
wa_record-kunnr1.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG(01)'.
perform bdc_field using 'RV45A-MABNR(01)'
wa_record-matnr.
perform bdc_field using 'RV45A-KWMENG(01)'
' 1'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=ITEM'.
perform bdc_field using 'KUAGV-KUNNR'
wa_record-kunnr.
perform bdc_field using 'KUWEV-KUNNR'
wa_record-kunnr1.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(01)'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\07'.
perform bdc_field using 'BDC_CURSOR'
'RV45A-KWMENG'.
perform bdc_field using 'RV45A-KWMENG'
' 1,000'.
perform bdc_field using 'VBAP-VRKME'
'TA'.
perform bdc_field using 'RV45A-ETDAT'
'10.04.2010'.
perform bdc_field using 'RV45A-PRGBZ'
'D'.
perform bdc_field using 'VBKD-PRSDT'
'10.04.2010'.
perform bdc_dynpro using 'SAPMV45A' '4003'.
perform bdc_field using 'BDC_OKCODE'
'=T\06'.
perform bdc_field using 'BDC_CURSOR'
'VBAP-ABGRS'.
perform bdc_field using 'DKACB-FMORE'
'X'.
perform bdc_dynpro using 'SAPLKACB' '0002'.
perform bdc_field using 'BDC_CURSOR'
'COBL-PRCTR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTE'.
perform bdc_field using 'COBL-PRCTR'
wa_record-prctr.
perform bdc_dynpro using 'SAPMV45A' '5003'.
perform bdc_field using 'BDC_OKCODE'
'/EBACK'.
perform bdc_field using 'BDC_CURSOR'
'KOMV-KSCHL(07)'.
perform bdc_dynpro using 'SAPMV45A' '4001'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_field using 'KUAGV-KUNNR'
wa_record-kunnr.
perform bdc_field using 'KUWEV-KUNNR'
wa_record-kunnr1.
perform bdc_field using 'BDC_CURSOR'
'RV45A-MABNR(02)'.
perform bdc_transaction using 'VA01'.

endloop.

perform close_group.

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between sap script and report?

750


What are the layers of data description in r/3? : abap data dictionary

642


What are the two ways for restricting the value range for a domain? : abap data dictionary

532


How many secondary indexes can we create in a table?

622


If A is the super class of B. And both the classes have constructor. We create an object of class B. Then which constructor will be called? If both then in which order?

931






Have you set up a back ground job? How to create a background job without a variant ? : abap bdc

599


What is the syntex used to call a screen as dialog box (pop up)?

727


Define abap/4 layer? : abap data dictionary

601


how to track records from data dictionary?

1655


What are the uses of secondary indexes?

553


Write the bdc table structure? : abap bdc

598


What are system fields for secondary lists?

613


What are the two statements which are required in an abap program to output an icon using a write statement?

770


WHAT ARE THE MANDATORY FIELDS TO BE FILLED FROM TABLES BAPIITEMIN, BAPIPARTNR, BAPIITEMEX, BAPICUCFG, BAPICUINS, BAPICUPRT, AND BAPICUVAL IN BAPI 'BAPI_QUOTATION_CREATEFROMDATA

2042


What is tcode se16? For what is it used.

590