‎2008 May 16 8:35 AM
dear gurus
can i call bdc in report ??????????
if yes how?????
regards
somesh
‎2008 May 16 8:37 AM
Yes
1. Work out the transaction you would use to create the data manually.
2. Use transaction SHDB to record the creation of one material master data. Click the New recording button or the Menu - Recording - Create
3. Save the recording, and then go back a screen and go to the overview.
4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording.
5. Edit the program. You will see that all the data you entered is hard-coded into the program.
After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated).
Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data. After perform bdc_transaction, add the endloop. Execute the program.
Have a look at below link for examples and details:
[BDC|http://www.sapdevelopment.co.uk/bdc/bdchome.htm]
Here are other links to get more details:
http://help.sap.com/saphelp_erp2005/helpdata/en/fa/097015543b11d1898e0000e8322d00/frameset.htm
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://sapabap.iespana.es/sap/info/bdc/bdc01.htm
http://myweb.dal.ca/hchinni/sap/bdc_home.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&;
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
http://abapprogramming.blogspot.com/search/label/ABAP%20BDC%20COMPLETE
I hope it helps.
Best Regards,
Vibha
Please mark all the helpful answers
‎2008 May 16 8:38 AM
‎2008 May 16 8:43 AM
Hi,
Please find the sample BDC recording code called from a report program:
&----
*& Report Z271837_BDC *
*& *
&----
*& *
*& *
&----
REPORT z271837_bdc .
Data declarations
DATA : it_bdcdata TYPE TABLE OF bdcdata,
wa_bdcdata TYPE bdcdata.
Selection Screen.
SELECTION-SCREEN BEGIN OF BLOCK s1 WITH FRAME TITLE text-001.
PARAMETER : p_qty TYPE char10.
SELECTION-SCREEN END OF BLOCK s1.
Start of Selection
START-OF-SELECTION.
BDC recording for ME22 : Update line item qty : MENGE field
PERFORM bdc_start USING 'SAPMM06E' '0105'.
PERFORM bdc_proc USING 'BDC_CURSOR' 'RM06E-BSTNR'.
PERFORM bdc_proc USING 'BDC_OKCODE' '/00'.
PERFORM bdc_proc USING 'RM06E-BSTNR' '4500050023'.
PERFORM bdc_start USING 'SAPMM06E' '0120'.
PERFORM bdc_proc USING 'BDC_CURSOR' 'EKPO-MENGE(01)'.
PERFORM bdc_proc USING 'BDC_OKCODE' '=BU'.
PERFORM bdc_proc USING 'RM06E-EBELP' '10'.
PERFORM bdc_proc USING 'EKPO-MENGE(01)' p_qty.
PERFORM bdc_start USING 'SAPLSPO1' '0300'.
PERFORM bdc_proc USING 'BDC_OKCODE' '=YES'.
Call the transaction
CALL TRANSACTION 'ME22' USING it_bdcdata MODE 'A'.
&----
*& Form BDC_START
&----
text
----
-->P_SNAM text
-->P_SVAL text
----
FORM bdc_start USING p_snam
p_sval.
wa_bdcdata-program = p_snam.
wa_bdcdata-dynpro = p_sval.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
ENDFORM. " BDC_START
&----
*& Form BDC_PROC
&----
text
----
-->P_FNAM text
-->P_FVAL text
----
FORM bdc_proc USING p_fnam
p_fval.
wa_bdcdata-fnam = p_fnam.
wa_bdcdata-fval = p_fval.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
ENDFORM. " BDC_PROC
Reward if useful
Regards
Shiva
‎2008 May 20 5:21 AM