Sei sulla pagina 1di 11

11/20/2019 BDC Call Transaction Method Program in SAP ABAP

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE


SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

BDC Call Transaction Method Program in SAP


ABAP
June 05, 2017

Go Mobile at ₹199 SIGN UP

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.

https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 1/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

Download
the
toolbox
today

Give the Record name and Transaction code and click on Start New Get step-by-step
Recording Button. technical
documentation
to make app
building a
breeze.

Amazon Appstore
Now enter the Bank country and Key

Select Topics

Now enter the Bank name ,City ,country and street. 

https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 2/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

Now Save the Recording .

Now select the created record and click on Program.

Now give the program title and select radio button transfer from recording.

Now give the program title and click on source code button.

https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 3/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

Now save it as Local object.

Now BDC program will be created automatically and you can nd the
structures and dynpro and dyn eld subroutines in Include BDCRECX1 main
program.Copy them and paste in your source code.

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,


https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 4/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP
wa_bnka type ty_bnka.
SAP ABAP AND WEBDYNPRO TUTORIALS
data : it_bdcdata type table of bdcdata, SUBSCRIBE
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
.
https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 5/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP
IF SY-SUBRC <> 0.
SAP ABAP AND WEBDYNPRO TUTORIALS
* Implement suitable error handling here
ENDIF.
SUBSCRIBE

*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
https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 6/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP
* Insert
field *
SAP ABAP AND WEBDYNPRO TUTORIALS
*-----------------------------------------------------------
SUBSCRIBE
-----------*
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.

After executing BDC program ,it will ask note pad le path ,then give le path
in input eld.

Execute the BDC call transaction program.

https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 7/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

Now system will process the transaction screens to upload the data into
SAP data base.

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

RELATED POSTS:

https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 8/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP

SAP
SortingABAP
In SAP AND
SAP WEBDYNPRO
ABAP TUTORIALS
How To Pass
SUBSCRIBE
ABAP ALV Report Material And Selection-Screen
Tutorials Inform...

How To De ne
SAP ABAP ALV
Report O...

Related Posts Widget BDC SAP ABAP

Enter your comment...

Popular ABAP Tutorials

SAP ABAP Data Dictionary Real Time Interview


Questions and Aanswers
A il 11 2017
https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 9/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP
April 11, 2017

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE


SAP ABAP Data Dictionary Real Time Interview Questions and Answers
These interview Questions from the SAP ABAP Data Dictionary are faced at
the different companies in the several interviews which are useful for real …

KEEP READING

BADI Interview Questions in SAP


April 13, 2017

BADI Interview Questions in SAP A BAdI is an object-oriented


enhancement option, which makes it the most sophisticated enhancement
type. The main characteristic of a BAdI is that it provides a mechanism to …

KEEP READING

SAP ABAP Smartforms Interview Questions and


Answers
April 13, 2017

SAP ABAP Smartforms Interview Questions and Answers

What is smartform? Smart Forms are printing forms used to print Invoice …

KEEP READING

Sample ABAP Programming Examples for Practice


July 16, 2017

Sample ABAP Programming Examples for Practice Are you beginner to


ABAP Language ,you're looking for example programs for practice .Here i
collected some sample programs from various objects in ABAP useful for …

KEEP READING

ALV Reports Interview Questions


April 12, 2017

SAP ABAP ALV Reports Interview Questions and Answers for Experienced 


https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 10/11
11/20/2019 BDC Call Transaction Method Program in SAP ABAP
SAP ABAP ALV Reports Interview Questions and Answers for Experienced 
Here, i am sharing very import real time oriented questions which are faced
SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE
at several interviews on ALV Reports to help for freshers and experienced …

KEEP READING

Like on Facebook

SAP ABAP and WebD…


967 likes

Like Page Share

Be the first of your friends to like this

Donate to Me

Donate with PayPal

Powered by Blogger

Theme images by Michael Elkan

Labels

Monthly Updates

Report Abuse

Privacy Policy

https://sinuabaptutor.blogspot.com/2017/06/bdc-call-transaction-method-program-in-sap-abap.html 11/11

Potrebbero piacerti anche