Application Development 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: 

Reg: BDC for Multiple transaction,

Former Member
0 Kudos

HI Experts

I have one requirement .

i need develop bdc for hiring the new employee so in this bdc i need use two t codes

1.PA40.

2. PP01.

please can any tell me how use two tcode in one bdc .

how to write the bdc with two T codes.

if possible please send some sample code so that i can anlyze .

I will create bdc for my requirement.

here my question are.

1. If it is possible to create BDC with multople tcodes.

how maintain the flat file.???

2. is it one flat file or two flat file ?

Please suggest me how solve this .

Thanks in Adavnce.

Ramesh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

Follow this skeleton logic:

open_group for tran1

loop at it_data1.

*Populate bddata structures

bdc_insert. for tran1

endloop.

close_group. for tran 1

open_group for tran2

loop at it_data2.

*Populate bddata structures

bdc_insert. for tran2

endloop.

close_group. for tran 2

If you want to record for two transations then you will use same method as one transation.For example if you want to execute two transations like VA01(sales order) and VL01N(delivery).Here first you can record for both transactions seperately and in the function module calling you will call BDC_INSERT two times

First function module contains Tcode as VA01 and Bdcdata table as data for the va01 transaction and second table contains tcode as VL01N and Bdcdata table conatins data which contains the record data of the delivery recorded data.

PERFORM open_batch_session USING p_sessa.

LOOP AT ltcap_int

WHERE NOT tot_inc IS initial.

ltcap_int-adj = ltcap_int-adj * -1.

CONCATENATE ltcap_int-fund '/' ltcap_int-cfc INTO zuonr.

PERFORM fill_bdc_header.

PERFORM fill_bdc_lines.

PERFORM post_entries.

PERFORM insert_batch_session USING 'FB01'.

ltcap_int-adj = ltcap_int-adj * -1.

ENDLOOP.

PERFORM close_batch_session.

  • perform start_batch_session using p_sessa.

  • Budgets

WRITE p_fy TO c_fy.

PERFORM open_batch_session USING p_sessb.

LOOP AT ltcap_int

WHERE NOT tot_inc IS initial.

PERFORM rollup_header.

PERFORM rollup_line.

PERFORM rollup_save.

PERFORM insert_batch_session USING 'FR21'.

IF NOT ltcap_int-gsef_amt IS INITIAL.

PERFORM rollup_header_gsef.

PERFORM rollup_line_gsef.

PERFORM rollup_save.

PERFORM insert_batch_session USING 'FR21'.

ENDIF.

ENDLOOP.

PERFORM close_batch_session.

  • perform start_batch_session using p_sessb.

We can process more than 1 transactions in session method.

For this we will create the internal tables equilant to transactions and

Between BDC_open_group and BDC_close_group we will call the BDC_Insert the no.of transactions times and populate the internal tables which contains the data pertaining to diffrent transactions.

2 REPLIES 2

Former Member
0 Kudos

hi,

Follow this skeleton logic:

open_group for tran1

loop at it_data1.

*Populate bddata structures

bdc_insert. for tran1

endloop.

close_group. for tran 1

open_group for tran2

loop at it_data2.

*Populate bddata structures

bdc_insert. for tran2

endloop.

close_group. for tran 2

If you want to record for two transations then you will use same method as one transation.For example if you want to execute two transations like VA01(sales order) and VL01N(delivery).Here first you can record for both transactions seperately and in the function module calling you will call BDC_INSERT two times

First function module contains Tcode as VA01 and Bdcdata table as data for the va01 transaction and second table contains tcode as VL01N and Bdcdata table conatins data which contains the record data of the delivery recorded data.

PERFORM open_batch_session USING p_sessa.

LOOP AT ltcap_int

WHERE NOT tot_inc IS initial.

ltcap_int-adj = ltcap_int-adj * -1.

CONCATENATE ltcap_int-fund '/' ltcap_int-cfc INTO zuonr.

PERFORM fill_bdc_header.

PERFORM fill_bdc_lines.

PERFORM post_entries.

PERFORM insert_batch_session USING 'FB01'.

ltcap_int-adj = ltcap_int-adj * -1.

ENDLOOP.

PERFORM close_batch_session.

  • perform start_batch_session using p_sessa.

  • Budgets

WRITE p_fy TO c_fy.

PERFORM open_batch_session USING p_sessb.

LOOP AT ltcap_int

WHERE NOT tot_inc IS initial.

PERFORM rollup_header.

PERFORM rollup_line.

PERFORM rollup_save.

PERFORM insert_batch_session USING 'FR21'.

IF NOT ltcap_int-gsef_amt IS INITIAL.

PERFORM rollup_header_gsef.

PERFORM rollup_line_gsef.

PERFORM rollup_save.

PERFORM insert_batch_session USING 'FR21'.

ENDIF.

ENDLOOP.

PERFORM close_batch_session.

  • perform start_batch_session using p_sessb.

We can process more than 1 transactions in session method.

For this we will create the internal tables equilant to transactions and

Between BDC_open_group and BDC_close_group we will call the BDC_Insert the no.of transactions times and populate the internal tables which contains the data pertaining to diffrent transactions.

Former Member
0 Kudos

you can use session methods to use two Tcodes.

Here are the details about session mthod.

You can open a group, code for first BDC insert into the group, code for second BDC, insert to the same group and then close group. There are function module to open, insert and close a group.

Also you can use single file but you need to add a differentiator fields in the beginning of each record to know record belongs to which Transaction.

to simplify process, i will suggest you to have 2 separate files.

Hope this helps.

ashish