Wednesday, 14 December 2011

Then Go to SHDB transaction in development client and go to new recording. Give the recording name as ZRECORDINGNEW and opt the same vendor master updation transaction code FK02. 
 
In this case your development client should have at least one vendor. If not create it and input the vendor in FK02 transaction and as you did earlier select the address checkbox.  
 
It will show you the address information. You don’t change anything in that and come back. Because this is not the vendor to whom we are going to change his PIN Code.  
Now it will show you the recording information. Delete all the recording information and press the import button and browse bdc_recording file from the presentation server.  
 
 
The previous recording information will loaded in to BDC recording and go back from the screen. It would popup for saving the recording. Now save that recording.  
 
 
Select the recording and press ‘program’ button. It will popup for new program creation. Input the required details and the expected BDC recording program will get created.  
 
   
report ZVENDORUPDATE
       
no standard page heading line-size 255.

include bdcrecx1.

start-
of-selection.

perform open_group.

perform bdc_dynpro      using 'SAPMF02K' '0106'.
perform bdc_field       using 'BDC_CURSOR'
                              
'RF02K-LIFNR'.
perform bdc_field       using 'BDC_OKCODE'
                              
'/00'.
perform bdc_field       using 'RF02K-LIFNR'
                              
'B002568'.
perform bdc_field       using 'RF02K-D0110'
                              
'X'.
perform bdc_dynpro      using 'SAPMF02K' '0110'.
perform bdc_field       using 'BDC_CURSOR'
                              
'LFA1-PSTLZ'.
perform bdc_field       using 'BDC_OKCODE'
                              
'=UPDA'.
perform bdc_field       using 'LFA1-NAME1'
                              
'MURARI SHARAN SRIVASTAVA'.
perform bdc_field       using 'LFA1-SORTL'
                              
'000568'.
perform bdc_field       using 'LFA1-STRAS'
                              
'Brook House, Shakespeare Sarani'.
perform bdc_field       using 'LFA1-ORT01'
                              
'Kolkatta'.
perform bdc_field       using 'LFA1-PSTLZ'
                              
'560076'.
perform bdc_field       using 'LFA1-LAND1'
                              
'IN'.
perform bdc_field       using 'LFA1-REGIO'
                              
'25'.
perform bdc_field       using 'LFA1-SPRAS'
                              
'EN'.
perform bdc_transaction using 'FK02'.

perform close_group.

BDC recording from testing client to development client

By Venkatraman N, IBM
This method would be useful, when you don’t have required datum in development client and when you have same in testing client and you want to BDC recording with that datum.  
Login to the Testing client where you will have data.
Go to transaction SHDB and press new recording.  
As an instance, here we will try to modify vendor’s postal code of his address.  So, give FK02 as the transaction code to be executed and give recording name like ‘ZRECORD’.  
 
Now it goes to Vendor master update screen. Opt a vendor and click the address checkbox and press enter.  
 
It will show the vendor’s address information.  
Now change the existing PIN code 700019 to 560076 and press save. It will take you to the recording screen.  
Now you cannot create a program with this recording information in testing client. So, import your recording information to one presentation server file. Press import button.
Give a text file name and save it in the presentation server.  
Setting the delivery class and maintenance
Saving the table
Technical Settings
Activating The Table

Creating a simple database table using BDC

By Banupriya R, YASH Technologies
Report ypriyatest.
TABLES:
      bdcdata.
DATA:t_bdcdata LIKE
        STANDARD TABLE
        OF bdcdata.
PARAMETERS :
   p_table(15) TYPE c.
DATA:
  MSG LIKE BDCMSGCOLL,
  T_MSG LIKE TABLE OF MSG,
  MESSAGE(72) TYPE C.
PERFORM PROCESS.
*&---------------------------------------------------------------------
*
*&      Form  fill_screendata
*&---------------------------------------------------------------------

form fill_screendata  using    value(p_0015)
                               value(p_0016).
  BDCDATA-PROGRAM = P_0015.
  BDCDATA-DYNPRO  = P_0016.
  BDCDATA-DYNBEGIN = 'X'.
  APPEND BDCDATA TO T_BDCDATA.
 CLEAR BDCDATA.
endform.                    " fill_screendata
*&---------------------------------------------------------------------
*
*&      Form  FILL_FIELD_DATA
*&---------------------------------------------------------------------

form FILL_FIELD_DATA  using    value(p_0020)
                               value(p_0021).
  BDCDATA-FNAM = P_0020.
  BDCDATA-FVAL = P_0021.
  APPEND BDCDATA TO T_BDCDATA.
 CLEAR BDCDATA.
 endform.                    " FILL_FIELD_DATA
*&---------------------------------------------------------------------
*
*&      Form  PROCESS
*&---------------------------------------------------------------------

form PROCESS .
**first screen
PERFORM fill_screendata
   USING 'SAPMSRD0' '0102'.
PERFORM FILL_FIELD_DATA
   USING 'RSRD1-TBMA' 'X'.
PERFORM FILL_FIELD_DATA
   USING 'RSRD1-TBMA_VAL' p_table.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=ADD'.
**second screen
PERFORM fill_screendata
   USING 'SAPLSD41' '2200'.
PERFORM FILL_FIELD_DATA
   USING 'DD02D-DDTEXT' 'Bdc Table'.
PERFORM FILL_FIELD_DATA
   USING 'DD02D-CONTFLAG' 'A'.
PERFORM FILL_FIELD_DATA
   USING 'DD02D-MAINFLAG' 'X'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=CHANGE_MAINTFLAG'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '/00'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=DEF'.
**second screen filling table fields
PERFORM fill_screendata
   USING 'SAPLSD41' '2200'.
PERFORM FILL_FIELD_DATA
   USING 'DD03P-FIELDNAME(01)' 'mandt'.
PERFORM FILL_FIELD_DATA
   USING 'DD03P-FIELDNAME(02)' 'name'.
PERFORM FILL_FIELD_DATA
   USING 'DD03P-FIELDNAME(03)' 'empid'.
PERFORM FILL_FIELD_DATA
   USING 'DD03D-ROLLNAME(01)' 'mandt'.
PERFORM FILL_FIELD_DATA
   USING 'DD03D-ROLLNAME(02)' 'char20'.
PERFORM FILL_FIELD_DATA
   USING 'DD03D-ROLLNAME(03)' 'numc4'.
PERFORM FILL_FIELD_DATA
   USING 'DD03P-KEYFLAG(01)' 'X'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '/00'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=WB_SAVE'.
**saving the table****
PERFORM fill_screendata
   USING 'SAPLSTRD' '0100'.
PERFORM FILL_FIELD_DATA
   USING 'KO007-L_DEVCLASS' '$TMP'.
PERFORM FILL_FIELD_DATA
   USING 'KO007-L_AUTHOR' 'SAPDEV02'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=TEMP'.
**filling technical settings.
PERFORM fill_screendata
   USING 'SAPLSD41' '2200'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=SE13'.
PERFORM fill_screendata
   USING 'SAPMSEDS' '0050'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_CURSOR' 'DD09V-TABART'.
PERFORM FILL_FIELD_DATA
   USING 'DD09V-TABART' 'APPL0'.
PERFORM FILL_FIELD_DATA
   USING 'DD09V-TABKAT' '0'.
PERFORM FILL_FIELD_DATA
   USING 'ALLOWSTATE-NOT_ALLOWED' 'X'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=SICH'.
PERFORM fill_screendata
   USING 'SAPMSEDS' '0050'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=BACK'.
PERFORM fill_screendata
   USING 'SAPLSD41' '2200'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=WB_SAVE'.
PERFORM fill_screendata
   USING 'SAPLSD41' '2200'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=WB_CHECK'.
PERFORM fill_screendata
   USING 'SAPLSD41' '2200'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=WB_ACTIVATE'.
PERFORM FILL_SCREENDATA
    USING 'SAPLSEWORKINGAREA' '0205'.
PERFORM FILL_FIELD_DATA
    USING 'BDC_OKCODE' '=WEIT'.
PERFORM fill_screendata
   USING 'SAPLSD41' '2200'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=BACK'.
PERFORM fill_screendata
   USING 'SAPMSRD0' '0102'.
PERFORM FILL_FIELD_DATA
   USING 'BDC_OKCODE' '=BACK'.
CALL TRANSACTION 'SE11' USING T_BDCDATA MODE 'A' MESSAGES INTO T_MSG.
LOOP AT T_MSG INTO MSG.
CALL FUNCTION 'FORMAT_MESSAGE'
 EXPORTING
   ID              = MSG-MSGID
   LANG            = 'EN'
   NO              = MSG-MSGNR
   V1              = MSG-MSGV1
   V2              = MSG-MSGV2
   V3              = MSG-MSGV3
   V4              = MSG-MSGV4
 IMPORTING
   MSG             = MESSAGE
 EXCEPTIONS
   NOT_FOUND       = 1
   OTHERS          = 2
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc EQ 0.
      WRITE / MESSAGE.
    ENDIF.
ENDLOOP.
endform.                    " PROCESS
Output
First Screen

How to do BDC without writing BDC program

By Vikram Chellappa, Mouri Tech Solutions
In this example, I have used the transaction VV31 (Create Output – Condition Records - Billing) to do the BDC. 
1.       Go to Transaction SHDB and click “New Recording” button.
 
2.       The following popup screen gets populated, there you enter the Recording name and transaction for which you wish to do the BDC (In this example it is VV31). Click “Start recording” button.
 
3.       In the Transaction, enter the mandatory field. In this case it is Output type (AUS1). Hit enter key.
 
4.       The following screen appears for more entry. Enter all the mandatory fields and click on save.  
5.       SAP will give the Recorded program as shown in the following screen shot.  
6.       Click the Export button    and save the file as word document file into the system.
7.       Now open the newly created word document file.  
8.       Select/Highlight the first field in the word document for which for which BDC needs to done. (In this case it is output type i.e. AUS1) and go to the menu path Insert à Field
9.       A new screen will get populated and there you select the “Merge Field” option from the list box and enter the Column Name (In this case the 1st column is output_type).
10.    Now you can see in the word document that the highlighted field will get replaced with the column name.
 
 
11.    Similarly you highlight the other fields for which we need to create the BDC and give the unique column names for those fields.
12.   Now you can see that all the required fields have been mapped with unique column names.
13.    Now go the menu path Tools à Letters and Mailings à Mail Merge Wizard.
14.    A mail merge wizard will gets opened in the right hand side.
15.    Now open the excel file where which you have the data to do the BDC for transaction VV31. Check that the column name in the word document is matching with the column name in the Excel file.
16.    Close the Excel File.
17.    Switch to world document and Now Click “Next: Start document” link in the bottom of Mail Merge wizard
18.   Now click on “Next: Select recipients” link
19.   Now click on “Browse” link
20.    It will open the popup for selecting the file (which is having data for BDC).
21.    Press “Open” button
22.    A new popup will get triggered.

How to do BDC without writing BDC program

By Vikram Chellappa, Mouri Tech Solutions
In this example, I have used the transaction VV31 (Create Output – Condition Records - Billing) to do the BDC. 
1.       Go to Transaction SHDB and click “New Recording” button.
 
2.       The following popup screen gets populated, there you enter the Recording name and transaction for which you wish to do the BDC (In this example it is VV31). Click “Start recording” button.
 
3.       In the Transaction, enter the mandatory field. In this case it is Output type (AUS1). Hit enter key.
 
4.       The following screen appears for more entry. Enter all the mandatory fields and click on save.  
5.       SAP will give the Recorded program as shown in the following screen shot.  
6.       Click the Export button    and save the file as word document file into the system.
7.       Now open the newly created word document file.  
8.       Select/Highlight the first field in the word document for which for which BDC needs to done. (In this case it is output type i.e. AUS1) and go to the menu path Insert à Field
9.       A new screen will get populated and there you select the “Merge Field” option from the list box and enter the Column Name (In this case the 1st column is output_type).
10.    Now you can see in the word document that the highlighted field will get replaced with the column name.
 
 
11.    Similarly you highlight the other fields for which we need to create the BDC and give the unique column names for those fields.
12.   Now you can see that all the required fields have been mapped with unique column names.
13.    Now go the menu path Tools à Letters and Mailings à Mail Merge Wizard.
14.    A mail merge wizard will gets opened in the right hand side.
15.    Now open the excel file where which you have the data to do the BDC for transaction VV31. Check that the column name in the word document is matching with the column name in the Excel file.
16.    Close the Excel File.
17.    Switch to world document and Now Click “Next: Start document” link in the bottom of Mail Merge wizard
18.   Now click on “Next: Select recipients” link
19.   Now click on “Browse” link
20.    It will open the popup for selecting the file (which is having data for BDC).
21.    Press “Open” button
22.    A new popup will get triggered.