09-20-2005 7:50 AM
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
09-20-2005 7:52 AM
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.
09-20-2005 2:08 PM
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
09-20-2005 2:18 PM
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
09-20-2005 3:01 PM
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
09-22-2005 1:39 PM
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