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

simple bdc call transaction program

pls give me code, how to write simple call transaction program

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Sep 08, 2009 at 11:46 AM

    Hello Vikas,

    SAP has lots of demo program. Please check the program DEMO_PROGRAM_CALL_TRANSACTION.

    Anyways search in SDN for details.

    BR,

    Suhas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2009 at 12:05 PM

    Hi, first fallow the steps.

    Step 1

    Execute transaction recorder, transaction SHDB.

    Step 2

    Enter name for recording (XD01).

    Step 3

    Enter transaction to be executed.

    Step 4

    The transaction will now be executed, simply perform the actions that are mandatory

    Step 5

    Once you have finished the recording and selected the save button or exited the transaction you

    Will be presented with the following information. This details the screens and fields that have been

    Processed during the recording and will be used as a basis to create BDC ABAP program.

    Step 6

    Select your record in SHDB and click on program and then give program name and select radio button "Transfor from recording" and then create you will get some code on your program.

    Step 7

    Double click on the include "bdcrecx1" select display and then copy the the required code.

    &----


    *& Report Z_VIJAY_BDC

    *&

    &----


    *&

    *&

    &----


    REPORT Z_VIJAY_BDC_XD01.

    DATA : BEGIN OF ITAB OCCURS 1,

    F1 TYPE KUNNR,

    F2 TYPE KTOKD,

    F3 TYPE BUKRS,

    F4 TYPE VKORG,

    F5 TYPE VTWEG,

    F6 TYPE SPART,

    F7 TYPE NAME1,

    F8 TYPE LAND1,

    F9 TYPE SPRAS,

    END OF ITAB.

    DATA : BDCDATA TYPE BDCDATA OCCURS 1 WITH HEADER LINE.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = 'C:\VIJAY.TXT'

    FILETYPE = 'ASC'

    HAS_FIELD_SEPARATOR = 'X'

    • HEADER_LENGTH = 0

    • READ_BY_LINE = 'X'

    • DAT_MODE = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • CHECK_BOM = ' '

    • IMPORTING

    • FILELENGTH =

    • HEADER =

    TABLES

    DATA_TAB = ITAB.

    **LOOP AT ITAB.

    **WRITE : / ITAB-F1,

    • ITAB-F2,

    • ITAB-F3,

    • ITAB-F4,

    • ITAB-F5,

    • ITAB-F6,

    • ITAB-F7,

    • ITAB-F8.

    **ENDLOOP.

    **

    LOOP AT ITAB.

    REFRESH BDCDATA.

    PERFORM BDC_DYNPRO USING 'SAPMF02D' '0100'.

    PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RF02D-REF_KUNNR'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'.

    PERFORM BDC_FIELD USING 'RF02D-KUNNR' ITAB-F1.

    PERFORM BDC_DYNPRO USING 'SAPMF02D' '7100'.

    PERFORM BDC_FIELD USING 'RF02D-KTOKD' ITAB-F2.

    PERFORM BDC_FIELD USING 'RF02D-KUNNR' ''.

    PERFORM BDC_FIELD USING 'RF02D-BUKRS' ITAB-F3.

    PERFORM BDC_FIELD USING 'RF02D-VKORG' ITAB-F4.

    PERFORM BDC_FIELD USING 'RF02D-VTWEG' ITAB-F5.

    PERFORM BDC_FIELD USING 'RF02D-SPART' ITAB-F6.

    PERFORM BDC_DYNPRO USING 'SAPMF02D' '0110'.

    PERFORM BDC_FIELD USING 'BDC_CURSOR' 'KNA1-SPRAS'.

    PERFORM BDC_FIELD USING 'BDC_OKCODE' '=UPDA'.

    PERFORM BDC_FIELD USING 'KNA1-NAME1' ITAB-F7.

    PERFORM BDC_FIELD USING 'KNA1-LAND1' ITAB-F8.

    PERFORM BDC_FIELD USING 'KNA1-SPRAS' ITAB-F9.

    CALL TRANSACTION 'XD01' USING BDCDATA MODE 'A'.

    ENDLOOP.

    ----


    • Start new screen *

    ----


    FORM BDC_DYNPRO USING PROGRAM DYNPRO.

    CLEAR BDCDATA.

    BDCDATA-PROGRAM = PROGRAM.

    BDCDATA-DYNPRO = DYNPRO.

    BDCDATA-DYNBEGIN = 'X'.

    APPEND BDCDATA.

    ENDFORM.

    ----


    • Insert field *

    ----


    FORM BDC_FIELD USING FNAM FVAL.

    IF FVAL <> SPACE.

    CLEAR BDCDATA.

    BDCDATA-FNAM = FNAM.

    BDCDATA-FVAL = FVAL.

    APPEND BDCDATA.

    ENDIF.

    ENDFORM.

    This is the sample code for XD01 please go through this.

    Thanks & Regards,

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2009 at 11:54 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 08, 2009 at 12:03 PM
    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.