Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

bdc with session method

Former Member
0 Likes
449

hi all,

i need to upload these transactions(MB1A, MB31,MB1A )one after the other.i have the data in flat file(excel). I need to use BDC for this. I am prefering SESSION method for this.Can any one help me to acieve this. shall i record the transactions one after the othet and keep BDC_INSERT after the perform statements. will achieve this. Help me with a sample code for this

4 REPLIES 4
Read only

Former Member
0 Likes
428

Hi,

we can use multiple transactions in session method.

Suppose we have created recordings for the transactions 'MM01' 'XD01' and 'VA01'.

then we have to follow the steps.

bdc_open_group.

after this we have to fill the bdcdata structure for one transaction.here 'MM01'.

bdc_insert.

refresh bdcdata.

after this we have to fill the bdcdata structure for one transaction.here 'XD01'.

bdc_insert .

refresh bdcdata.

after this we have to fill the bdcdata structure for one transaction.here 'VA01'.

bdc_insert.

bdc_close_group.

Regards,

Raj.

Read only

0 Likes
428

thnak u for ur reply,

but the data present here for three t.codes in one internal table ,when i loop the internal table ,can i keep all the bdc_insert FM, in one loop, will it upload in parallel for this at a time , how should i use the loop of internal table with all records of three t.codes and bdc_insert Fm in the loop. Plz help me out with a sample code

Read only

0 Likes
428

hi experts,

one more thing i face a problem in uploading is when i give PO number in MB1A and go inside, i have items to be entered. here i can enter two items at a time, but i have eight items to be entered, how can i achieve this, plz help me out with a sample code

Read only

Former Member
0 Likes
428

Hi Kiran,

Upload data into internal table (itab) using the below function modules.And then by using session method populate that in the BDCDATA internal table as you generally do session method.

PARAMETERS: filename LIKE rlgrap-filename .

PARAMETERS: kzheader AS CHECKBOX.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

mask = '*.xls'

static = 'X'

CHANGING

file_name = filename.

START-OF-SELECTION.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = filename

i_begin_col = begcol

i_begin_row = begrow

i_end_col = endcol

i_end_row = endrow

TABLES

intern = itab

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Upload Error ', SY-SUBRC.

ENDIF.

Reward points if useful.

Thanks & Regards,

khan.

Edited by: Ahmed Khan on Apr 29, 2008 8:01 AM