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

calling 2 diff transactions in bdc

Former Member
0 Likes
1,068

hi experts,

I have one small doubt can u pls clarify it.

can we call 2 diff transactions in the in the call traasaction in BDC if yes can u give the example.

Poits Reworded

5 REPLIES 5
Read only

Former Member
0 Likes
664

Hi,

Multiple transaction is possible using session method.

Have one BDC_OPEN_GROUP, multiple BDC_INSERT s and one BDC_CLOSE_GROUP.

You should have multiple BDC_INSERT s for multiple transactions.

call function BDC_OPENGROUP.

Build BDC data and cal lBDC_INSERT for transaction 1

Build BDC data and cal lBDC_INSERT for transaction 2

Build BDC data and cal lBDC_INSERT for transaction 3

paas the tcodes to bdc_insert.

call function BDC_CLOSE_GROUP.

Reward points if useful.

Thanks,

Madhura

Read only

manubhutani
Active Contributor
0 Likes
664

with cal transaction method..

only one transaction can be called

in session method multiple transactions can be called

as you just need to fill an uinternal table

and pass that to bdc_insert

pleaese reward poiints

Read only

Former Member
0 Likes
664

Hi,

You can call a two separate transactions from a single BDC program one after the other.

Create two separate recordings for ur txns and get the code required.

Then create a another program and copy the code you wanted from the generated programs into the new one.

For this you should fetch the data from a single file or you can mention two separate fields on the selection screen for the data fields and put the same data in the corresponding internal table and loop through these internal tables and prepare the BDCDATA table and pass that to call txn statement while calling the txn. And repeat the same for next txn in the same pgm.

Reward points if it is useful.

Regards,

Prasanna

Read only

Former Member
0 Likes
664

Hi

You can use two T codes in one BDC

after the processing XD01 and you can modify the customer using XD02 based on the customer created by first T code

regards

Shiva

Read only

Former Member
0 Likes
664

Hi,

A simple example for 2 tcodes: LPK1 and LPK2.

parameters: p_mappe like APQI-GROUPID

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = p_mappe

KEEP = 'X'

USER = SY-UNAME.

"For LPK1:

PERFORM call_dynpro USING: 'X' 'SAPMMPKR' '0091',

' ' 'RMPKR-MATNR' i_tab-field_01,

' ' 'RMPKR-WERKS' i_tab-field_02,

' ' 'RMPKR-PRVBE' i_tab-field_03,

' ' 'bdc_okcode' '/11'.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'LPK1'

TABLES

DYNPROTAB = BDC_TAB.

"For LPK2

PERFORM call_dynpro USING: 'X' 'SAPMMPKR' '0092',

' ' 'RMPKR-MATNR' i_tab-field_01,

' ' 'RMPKR-WERKS' i_tab-field_02,

' ' 'RMPKR-PRVBE' i_tab-field_03,

'X' 'SAPMMPKR' '0093',

' ' 'PKHD-BERKZ' i_tab-field_07,

' ' 'PKHD-LGNUM' i_tab-field_04,

' ' 'PKHD-LGTYP' i_tab-field_05,

' ' 'PKHD-LGPLA' i_tab-field_06,

' ' 'bdc_okcode' 'DELE',

'X' 'SAPLSPO1' '0300',

' ' 'bdc_okcode' '=YES'.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'LPK2'

TABLES

DYNPROTAB = BDC_TAB.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

If you will accordingly then easily you can acheive your requirement.

Please reward if useful.

Regards,

Ramesh