Ads

BDC Call Transaction Method Program in SAP ABAP

BDC Call Transaction Method Program in SAP ABAP

BDC is Bach data communication program which is used to migrate data from legacy(Non-SAP) system to SAP ABAP System.Call Transaction Method is one of the Techniques of BDC.

In call Transaction Method ,we have to record the Transaction using SHDB Transaction code to get the screen fields and related Program that is include bdcrecx1.


Go to SHDB Transaction Code and Click on New Recording.


BDC Call Transaction Method Program in SAP ABAP
Give the Record name and Transaction code and click on Start New Recording Button.
BDC Call Transaction Method Program in SAP ABAP
Now enter the Bank country and Key
BDC Call Transaction Method Program in SAP ABAP
Now enter the Bank name ,City ,country and street. 
BDC Call Transaction Method Program in SAP ABAP
Now Save the Recording .
BDC Call Transaction Method Program in SAP ABAP
Now select the created record and click on Program.
BDC Call Transaction Method Program in SAP ABAP
Now give the program title and select radio button transfer from recording.

BDC Call Transaction Method Program in SAP ABAP
Now give the program title and click on source code button.

BDC Call Transaction Method Program in SAP ABAP
Now save it as Local object.
BDC Call Transaction Method Program in SAP ABAP
Now BDC program will be created automatically and you can find the structures and dynpro and dynfield subroutines in Include BDCRECX1 main program.Copy them and paste in your source code.
BDC Call Transaction Method Program in SAP ABAP
Now ,you can see the whole code in the below.

report ZBDC_CALLTRNS_PRO4
       no standard page heading line-size 255.

*include bdcrecx1.


types : begin of ty_bnka,
         banks type bnka-banks,
         bankl type bnka-bankl,
         banka type bnka-banka,
        stras type bnka-stras,
        ort01 type bnka-ort01,
         end of ty_bnka.

         data : it_bnka type table of ty_bnka,
                wa_bnka type ty_bnka.
         data : it_bdcdata type table of bdcdata,
                wa_bdcdata type bdcdata.

         data : bdcmsg type table of bdcmsgcoll.
         data : file type string.




         parameters : p_file type rlgrap-filename.


start-of-selection.

         if  p_file is not initial.
           file = p_file.
           ENDIF.
           CALL FUNCTION 'GUI_UPLOAD'
             EXPORTING
               FILENAME                      = file
              FILETYPE                      = 'ASC'
              HAS_FIELD_SEPARATOR           = 'X'
*              HEADER_LENGTH                 = 0
*              READ_BY_LINE                  = 'X'
*              DAT_MODE                      = ' '
*              CODEPAGE                      = ' '
*              IGNORE_CERR                   = ABAP_TRUE
*              REPLACEMENT                   = '#'
*              CHECK_BOM                     = ' '
*              VIRUS_SCAN_PROFILE            =
*              NO_AUTH_CHECK                 = ' '
*            IMPORTING
*              FILELENGTH                    =
*              HEADER                        =
             TABLES
               DATA_TAB                      = it_bnkA
*            EXCEPTIONS
*              FILE_OPEN_ERROR               = 1
*              FILE_READ_ERROR               = 2
*              NO_BATCH                      = 3
*              GUI_REFUSE_FILETRANSFER       = 4
*              INVALID_TYPE                  = 5
*              NO_AUTHORITY                  = 6
*              UNKNOWN_ERROR                 = 7
*              BAD_DATA_FORMAT               = 8
*              HEADER_NOT_ALLOWED            = 9
*              SEPARATOR_NOT_ALLOWED         = 10
*              HEADER_TOO_LONG               = 11
*              UNKNOWN_DP_ERROR              = 12
*              ACCESS_DENIED                 = 13
*              DP_OUT_OF_MEMORY              = 14
*              DISK_FULL                     = 15
*              DP_TIMEOUT                    = 16
*              OTHERS                        = 17
                     .
           IF SY-SUBRC <> 0.
* Implement suitable error handling here
           ENDIF.

*perform open_group.
LOOP AT IT_BNKA INTO WA_BNKA.
perform bdc_dynpro      using 'SAPMF02B' '0100'.
perform bdc_field       using 'BDC_CURSOR'
                              'BNKA-BANKL'.
perform bdc_field       using 'BDC_OKCODE'
                              'ENTER'.
perform bdc_field       using 'BNKA-BANKS'
                              WA_BNKA-BANKS.
perform bdc_field       using 'BNKA-BANKL'
                              WA_BNKA-BANKL.
perform bdc_dynpro      using 'SAPMF02B' '0110'.
perform bdc_field       using 'BDC_CURSOR'
                              'BNKA-ORT01'.
perform bdc_field       using 'BDC_OKCODE'
                              'ENTER'.
perform bdc_field       using 'BNKA-BANKA'
                              WA_BNKA-BANKA.

perform bdc_field       using 'BNKA-STRAS'
                              WA_BNKA-STRAS.
perform bdc_field       using 'BNKA-ORT01'
                              WA_BNKA-ORT01.

CALL TRANSACTION 'FI01' USING IT_BDCDATA MODE 'A' UPDATE 'A' MESSAGES INTO BDCMSG.

*perform close_group.
ENDLOOP.


DATA : WA_BDCMSG LIKE LINE OF BDCMSG.
IF BDCMSG IS NOT INITIAL.
  LOOP AT BDCMSG INTO WA_BDCMSG.
    WRITE: WA_BDCMSG-TCODE,WA_BDCMSG-MSGTYP,WA_BDCMSG-MSGV1,WA_BDCMSG-FLDNAME.
    CLEAR WA_BDCMSG.

    ENDLOOP.
    ENDIF.


FORM BDC_DYNPRO USING PROGRAM DYNPRO.
  CLEAR WA_BDCDATA.
  WA_BDCDATA-PROGRAM  = PROGRAM.
  WA_BDCDATA-DYNPRO   = DYNPRO.
  WA_BDCDATA-DYNBEGIN = 'X'.
  APPEND WA_BDCDATA TO IT_BDCDATA.
ENDFORM.

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
FORM BDC_FIELD USING FNAM FVAL.
*  IF FVAL <> NODATA.
    CLEAR WA_BDCDATA.
    WA_BDCDATA-FNAM = FNAM.
    WA_BDCDATA-FVAL = FVAL.
    APPEND WA_BDCDATA TO IT_BDCDATA.
*  ENDIF.
ENDFORM.


Now save and activate the Program and execute.before all ,save your external data in note pad with tab space.
BDC Call Transaction Method Program in SAP ABAP
After executing BDC program ,it will ask note pad file path ,then give file path in input field.
BDC Call Transaction Method Program in SAP ABAP
Execute the BDC call transaction program.
BDC Call Transaction Method Program in SAP ABAP
Now system will process the transaction screens to upload the data into SAP data base.
BDC Call Transaction Method Program in SAP ABAP
Now program successfully transferred the data through two recorded screens of FI01 transaction code .






we have successfully created the Call transaction method program as SAP ABAP Developer.

SAP ABAP
 BDC and LSMW
  BDC Call Transaction Method Program in SAP ABAP
  BDC Session Method Program Tutorial in SAP ABAP 
  BDC Interview Questions
 SAP LSMW Tutorial Step by Step
 Difference Between Call Transaction and Session Methods in SAP ABAP

bdc call transaction method
sample bdc program in sap abap
bdc call transaction method in sap abap
bdc call transaction
bdc example in sap abap
bdc call transaction method in sap abap example
call transaction bdc in sap abap
bdc program example in sap abap
bdc sample program
call transaction method in sap abap
call transaction bdc
bdc call transaction in sap abap
bdc call transaction program in sap abap
call transaction in sap abap
bdc program in sap abap
sap bdc
call transaction in sap abap report
bdc programming in sap abap
call transaction abap
bdc in sap
abap call transaction
bdc program
abap call transaction mode
abap bdc example
bdc using call transaction method
abap call transaction example
call transaction in sap abap example
call transaction sap abap
call transaction in bdc
bdc using call transaction
bdc call
call transaction in abap
call transaction
sap shdb
call transaction syntax in sap abap
bdc sample program in sap
sap bdc tutorial
call transaction mode
bdc in abap
call bdc
bdc transaction
bdc call transaction step by step
call transaction abap example
sap abap call transaction
how to create bdc program in sap abap
bdc program in sap
sap call transaction options
sap method transaction
call transaction syntax
bdc full form sap
bdc sap
tcode for bdc recording
sap bdc transaction
bdc session method in sap abap
sap bdc program
sample abap programs for practice
sap transaction method
sap alv
bdcdata in sap abap
call transaction using
adobe forms sap
call program abap
alv reports in sap abap
shdb recording
fi01 in sap
sap lsmw
call transaction update
how to run web dynpro application

Comments

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Module Pool Programming Interview Questions and Answers in SAP ABAP

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced