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: 

BDC SESSION ISSUE

Former Member
0 Kudos
70

Hi ,

Any body will tell ,how we can insert data for more than one transaction code in SESSION METHOD.

Good answers will be Appreciated by rewarding point.

regards & thanks

Sanjeev

5 REPLIES 5

Former Member
0 Kudos
48

BDC_OPEN_GROUP.

LOOP at

BDC_INSERT_GROUP.

ENDLOOP.

BDC_CLOSE_GROUP.

You can insert as many transactions before closing the seesion in the LOOP.

Former Member
0 Kudos
48

Hi,

Try this -

Call function 'BDC_OPEN_GROUP' "<- OPEN SESSION

Loop at <itab>.

CALL FUNCTION 'BDC_INSERT'

EXPORTING TCODE = TCODE "<- YOU HAVE TO PASS TRANSACTION CODES HERE

TABLES DYNPROTAB = BDCDATA.

Endloop.

Call Function 'BDC_CLOSE_GROUP' "<- CLOSE SESSION

Former Member
0 Kudos
48

hi

call the bdc insert function in between open group and close group as many times as you want

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = C_SESSION

USER = L_USER

KEEP = C_X.

CALL FUNCTION 'BDC_INSERT'

EXPORTING TCODE = 'VK01'

TABLES DYNPROTAB = BDCDATA1.

CALL FUNCTION 'BDC_INSERT'

EXPORTING TCODE = 'MM01'

TABLES DYNPROTAB = BDCDATA2.

CALL FUNCTION 'BDC_INSERT'

EXPORTING TCODE = 'VA01'

TABLES DYNPROTAB = BDCDATA3.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

cheers,

sasi

Former Member
0 Kudos
48

Sanjeev - try something like:


* Actuals
  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'.
  endloop.
  perform close_batch_session.
* perform start_batch_session using p_sessb.

Rob

Former Member
0 Kudos
48

Hi,

If you want to upload data for two transactions in one BDC,

then do one thing go to shdb tcode , give the tcode and start. once you finished with this , SAP will show a screen showing all the values you entered. now click on RECORD Button. it will ask for a new tcode for which you want to do recording and upload. This will be added below the first run tcode and the required internal table contains all the fields of both the tcode which you have input.

Thanks and regards

Gurpreet Singh