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: 

regarding BDC session to run immediately after creation

Former Member
0 Kudos

Hi Abapers,

Please help me out from the following situation.

I need to run the BDC session immediately after creating. I beleive using RSBDCSUB we can achieve it.

If it so please let me know how can we use this.....

Please let me know if any other solutions.

Thanx in advance.

will reward with points for the usefull answers.

3 REPLIES 3

Former Member
0 Kudos

Yes. You can achieve that by useing the Standard Program RSBDCSUB.

Refer this code:-

SUBMIT rsbdcsub WITH mappe = p_sesion(your session name)

WITH von = sy-datum

WITH bis = sy-datum

WITH z_verarb = 'X' AND RETURN.

Reward if useful.

0 Kudos

Hi sravan,

It really solved my problem. i rewarded u points. Thanx for the valuable replies.

Former Member
0 Kudos

Hi Sir ,

Please have a look below .Hope it is suitable and simpler solution for your question.

Please do reward if useful.

Thankx.

If user want BDC in foreground use a CALL TRANSACTION and don't create a BDC butt fill a BDCDATA structure table and then

codeCALL TRANSACTION 'transaction' USING itab[/code]

You can specify the way to process in OPTIONS and MODE parameters.

Look at

Using CALL TRANSACTION USING for Data Transfer

something like

if foreground is initial.

BDC_OPEN_GROUP

endif.

fill bdcdata

if foreground is initial.

BDC_INSERT

BDC_CLOSE_GROUP

SUBMIT RSBDCSUB WITH MAPPE = group_name

else.

CALL transaction USING data MODE mode.

endif.

CODE --->

code

DATA : w_nom TYPE apq_grpn ,

w_kbetr(16) ,

w_datab(10) ,

w_datbi(10) ,

w_kpein(5) ,

w_kmein(3) .

CHECK is_data-flag EQ 'A' OR

is_data-flag EQ 'B' OR

is_data-flag EQ 'C'.

REFRESH itg_bdcdata.

Batch-input name.

CONCATENATE 'Hauss_'

sy-uzeit

is_data-knumh+4(6)

INTO w_nom.

Open Batch-input.

PERFORM p_open_bdc USING w_nom.

Choix type cond.

PERFORM p_bdc_dynpro USING 'SAPMV13A'

'0100'.

PERFORM p_bdc_field USING 'BDC_OKCODE'

'=ANTA'.

PERFORM p_bdc_field USING 'RV13A-KSCHL'

gw_kschl.

Choix de la clef.

PERFORM p_bdc_dynpro USING 'SAPLV14A'

'0100'.

PERFORM p_bdc_field USING 'BDC_OKCODE'

'=WEIT'.

PERFORM p_bdc_field USING 'RV130-SELKZ(01)'

'X'.

Enregistre la nouvelle condition.

PERFORM p_bdc_dynpro USING 'SAPMV13A'

'1510'.

PERFORM p_bdc_field USING 'BDC_OKCODE'

'=SICH'.

PERFORM p_bdc_field USING 'KOMG-VKORG'

is_data-vkorg.

PERFORM p_bdc_field USING 'KOMG-VTWEG'

is_data-vtweg.

PERFORM p_bdc_field USING 'KOMG-KUNNR'

is_data-kunnr.

PERFORM p_bdc_field USING 'KOMG-MATNR'

is_data-matnr.

PERFORM p_bdc_field USING 'KOMG-WERKS'

is_data-werks.

PERFORM p_bdc_field USING 'KOMG-AUART_SD'

is_data-auart_sd.

PERFORM p_bdc_field USING 'KOMG-INCO1(01)'

is_data-inco1.

WRITE is_data-kbetr2 TO w_kbetr.

PERFORM p_bdc_field USING 'KONP-KBETR(01)'

w_kbetr.

WRITE is_data-kpein TO w_kpein.

PERFORM p_bdc_field USING 'KONP-KPEIN(01)'

w_kpein.

WRITE is_data-kmein TO w_kmein.

PERFORM p_bdc_field USING 'KONP-KMEIN(01)'

w_kmein.

WRITE is_data-datab TO w_datab.

PERFORM p_bdc_field USING 'RV13A-DATAB(01)'

w_datab.

WRITE is_data-datbi TO w_datbi.

PERFORM p_bdc_field USING 'RV13A-DATBI(01)'

w_datbi.

Save the transaction.

PERFORM p_insert_bdc USING 'VK11'.

Close the Batch-input..

PERFORM p_close_bdc.

  • COMMIT WORK AND WAIT.

SUBMIT rsbdcsub WITH mappe = w_nom

WITH von = sy-datum

WITH bis = sy-datum

EXPORTING LIST TO MEMORY

AND RETURN.[/code]