Skip to Content
author's profile photo Former Member
Former Member

regarding BDC session to run immediately after creation

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 06:36 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 08:38 AM

    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]

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.