Professional Documents
Culture Documents
Executing BDC Through Web Dynpro (BDC Call Transaction in Web Dynpro) - SAP Blogs
Executing BDC Through Web Dynpro (BDC Call Transaction in Web Dynpro) - SAP Blogs
Community
Former Member
October 17, 2013 6 minute read
Executing BDC through Web Dynpro ( BDC Call transaction in Web Dynpro )
Follow RSS feed Like
To perform any Transactions through ABAP coding we have BAPI, Function Module or Class-Methods, But for few Transactions there are No direct BAPI, Function Module or Class-Methods, In
this situation a developer chooses “BDC Call Transation Method” to Update the speci c Transaction.
step 1) Create Recording for a speci c Transaction using ‘SHDB’ and Transport the recording to a Executable Report Program .
step 2) Write the BDC coding for the Recording using CALL TRANSACTION METHOD. ( note : Always use MODE : ‘N’ )
Example : CALL TRANSACTION ‘MM01’ USING IT_BDCDATA MODE ‘N’
UPDATE ‘S’
MESSAGES INTO IT_MESSTAB_tmp.
NOTE : Do not place any output screen Results, like ‘write’ statements, it will give a short dump while we execute through Web Dynpro .
step 3) To exchange Data between Web Dynpro and Report Program we can export the result to Memory ID and Import the data in Web Dynpro from Memory ID.
step 4) Create a Web Dynpro Component and where ever it is necessary to trigger a BDC, SUBMIT to the Report Program using the below syntax.
Example : submit ztest_mm_demo2 with material_id = lv_matnr and return.
NOTE: here Material_ID is the Parameter of the Report Program, I am passing a Material_ID from WebDynpro to Report
Program.
step 5) After executing the Report Program which contains BDC the Result is Exported to a Memory ID from Report Program, we have to Import the Result from
This is the simple solution how to Run the BDC through Web Dynpro.
Below I am placing a sample code for Creation of a Material using Web Dynpro & BDC.
***************************************************************************************
https://blogs.sap.com/2013/10/17/executing-bdc-through-web-dynpro-call-transaction-in-web-dynpro/ 1/7
2/5/2020 Executing BDC through Web Dynpro ( BDC Call transaction in Web Dynpro ) | SAP Blogs
***************************************************************************************
Report ZTEST_MM_DEMO2
**********************************************************************
** CREATION OF MATERIAL USING BASIC FIELDS
**********************************************************************
****************************************************************************
**** KRANTHI KUMAR M SAP ABAP WEBDYNPRO ADOBEFORMS
****************************************************************************
start-of-selection.
******************************************************************************
** BDC RECORDING
******************************************************************************
perform bdc_dynpro using ‘SAPLMGMM’ ‘0060’.
perform bdc_field using ‘BDC_CURSOR’
‘RMMG1-MTART’.
perform bdc_field using ‘BDC_OKCODE’
‘=ENTR’.
perform bdc_field using ‘RMMG1-MATNR’ ” MATERIAL CODE
LV_MATNR . “‘BEV1’.
perform bdc_field using ‘RMMG1-MBRSH’ ” MBRSH
LV_mbrsh . “‘B’.
perform bdc_field using ‘RMMG1-MTART’ ” MTART
LV_MTART . “‘KMAT’.
perform bdc_dynpro using ‘SAPLMGMM’ ‘0070’.
perform bdc_field using ‘BDC_CURSOR’
‘MSICHTAUSW-DYTXT(02)’.
perform bdc_field using ‘BDC_OKCODE’
‘=ENTR’.
perform bdc_field using ‘MSICHTAUSW-KZSEL(01)’
‘X’.
perform bdc_field using ‘MSICHTAUSW-KZSEL(02)’
‘X’.
perform bdc_dynpro using ‘SAPLMGMM’ ‘4004’.
perform bdc_field using ‘BDC_OKCODE’
‘/00’.
perform bdc_field using ‘MAKT-MAKTX’ ” DESCRIPTION
LV_MAKTX . “‘DESCRIPTION OF MAT’.
perform bdc_field using ‘BDC_CURSOR’
‘MARA-MEINS’.
perform bdc_field using ‘MARA-MEINS’ ” UOM
LV_MEINS . “BAG’.
perform bdc_field using ‘MARA-MTPOS_MARA’
‘0002’.
perform bdc_dynpro using ‘SAPLMGMM’ ‘4004’.
perform bdc_field using ‘BDC_OKCODE’
‘/00’.
https://blogs.sap.com/2013/10/17/executing-bdc-through-web-dynpro-call-transaction-in-web-dynpro/ 2/7
2/5/2020 Executing BDC through Web Dynpro ( BDC Call transaction in Web Dynpro ) | SAP Blogs
*———————————————————————-*
* Start new screen *
*———————————————————————-*
form bdc_dynpro using program dynpro.
clear WA_bdcdata.
WA_bdcdata-program = program.
WA_bdcdata-dynpro = dynpro.
WA_bdcdata-dynbegin = ‘X’.
*———————————————————————-*
* Insert eld *
*———————————————————————-*
form bdc_field using fnam fval.
clear WA_bdcdata.
WA_bdcdata-fnam = fnam.
WA_Bdcdata-fval = fval.
append WA_bdcdata TO IT_BDCDATA.
endform.
***********************************************************************************
***********************************************************************************
method onactiontrigger .
https://blogs.sap.com/2013/10/17/executing-bdc-through-web-dynpro-call-transaction-in-web-dynpro/ 3/7
2/5/2020 Executing BDC through Web Dynpro ( BDC Call transaction in Web Dynpro ) | SAP Blogs
endmethod.
Alert Moderator
Assigned tags
ABAP Development | sap developer network | Web Dynpro | web dynpro abap |
How to convert a front end BDC recording code(generated via SHDB) into a modular Code to be run in the background using ‘Call Transaction’ with error Log
By Fahad Javed , Nov 15, 2015
Developing ABAP Report into Web Dynpro ABAP one – Areas to be considered
By Former Member , Nov 06, 2013
Related Questions
15 Comments
Former Member
I think this is the rst blog that starts with “Very useful tip.”.
After seeing the entry in activity feed, I thought that it is a comment to existing blog.
Like (0)
https://blogs.sap.com/2013/10/17/executing-bdc-through-web-dynpro-call-transaction-in-web-dynpro/ 4/7
2/5/2020 Executing BDC through Web Dynpro ( BDC Call transaction in Web Dynpro ) | SAP Blogs
Thanks Manish
Like (0)
Former Member
Like (0)
Former Member
after a longtime i saw the rst blog regarding how to call a BDC through WDPro
Like (0)
Thanks Shantan
Like (0)
Matthew Billingham
Why use SUBMIT to launch the BDC? Why not program the BDC in a function module.
Like (0)
If we program the BDC in Function Module or Class Methods, when we try to run the Function Module or Class Methods through webdynpro it leads to short dump, as webdynpro will not work
with the Parameter ID’s . when you record a transaction the recording will contain the parameter ID’s hence it leads to short dump. where as here we are submiting the control to a Report
Program and Returning the Control to webdynpro.
Like (0)
Matthew Billingham
hmm. I cannot understand why you should get a dump. Parameter IDs are stored on the application server. The backend of the webdynpro runs on the appserver. I’ve run BDC through function
modules starting a new task without di culty.
What is the nature of the dump you get? I want to get to the bottom of this!
(I’m so old that I used to do BDC by hand… before you could record them…!)
Like (0)
https://blogs.sap.com/2013/10/17/executing-bdc-through-web-dynpro-call-transaction-in-web-dynpro/ 5/7
2/5/2020 Executing BDC through Web Dynpro ( BDC Call transaction in Web Dynpro ) | SAP Blogs
Matthew Billingham
Like (0)
Syam Babu
Hi Kranthi,
Excellent Stu .
Thanks,
Syam
Like (0)
Thanks Syam
Thanks,
Kranthi Kumar M.
Like (0)
Former Member
Hi Kranthi ,
“Best Of Luck”.
Regard’s,
Shamsher
Like (0)
Thanks shamsher,
Thanks,
Kranthi Kumar M.
Like (0)
https://blogs.sap.com/2013/10/17/executing-bdc-through-web-dynpro-call-transaction-in-web-dynpro/ 6/7
2/5/2020 Executing BDC through Web Dynpro ( BDC Call transaction in Web Dynpro ) | SAP Blogs
R Sampath Kumar
regards,
sampath kumar
Like (0)
Thanks,
Kranthi Kumar M.
Like (0)
Find us on
Newsletter Support
https://blogs.sap.com/2013/10/17/executing-bdc-through-web-dynpro-call-transaction-in-web-dynpro/ 7/7