Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BDC Basics Required - Please see the details

Former Member
0 Kudos
99

Hello all,

Please go through the steps below and let me know if im right.

You need to have access to BW system to follow the below steps.

Go to Transaction RSZDELETE.(This T Code is used to delete Queries in BW)

My requirement is i have to delete 1000's of Queries,

After execution of the above transaction, u will get a Pop Up to enter the Query names,

"Technical Name" is in where u have to enter the Query name.

And then pressing the execute button will delete the particular query.

But the problem here is under "Technical Name" there are no multiple options available to delete 1000's of Queries.

Right now i have those Query names in an excel sheet, So using BDC can we write a program to automatically loop into that excel file and get the Query names one by one and to put it under "Technical Name" of RSZDELETE Transaction and automatically delete them???

If so please let me know all the steps from basics on how to create the BDC for this requirement.

As im not much into ABAP and i know very very basics of ABAP.

Please give me the appropiate links to study and accomplish this.

Thanks in Advance,

Sowrabh

5 REPLIES 5

GauthamV
Active Contributor
0 Kudos
43

SEARCH in SCN you will get lot of posts on BDC basics.

former_member632729
Contributor
0 Kudos
43

Hi Dude,

For a BDC upload you need to write a program which created BDC sessions.

Steps:

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. You need to make the following changes:

5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated).

5.2 After the open-group, 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.

5.3. After perform bdc_transaction, add the endloop.

Execute the program. It will have options to create a batch session or to process directly.

Example


data bdcdata like bdcdata occurs 0 with header line.
tables: zipcldesigcat.

data : begin of itab occurs 0,
        mandt like zipcldesigcat-mandt,
        zdesigncd like zipcldesigcat-zdesigncd,
        zdesignation like zipcldesigcat-zdesignation,
        zdesigcat like zipcldesigcat-zdesigcat,
       end of itab.

*INCLUDE bdcrecx1.

start-of-selection.
  perform upload.
  perform open.

  loop at itab.
    perform move.
    call transaction 'SE16' using bdcdata mode 'E'.
    refresh bdcdata.
  endloop.
  perform close.

*&---------------------------------------------------------------------*
*&      Form  UPLOAD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form upload.
  call function 'UPLOAD'
      exporting
*         CODEPAGE                = ''
           filename                = ''
           filetype                = 'DAT'
           item                    = 'Your File'
*         FILEMASK_MASK           = ' '
*         FILEMASK_TEXT           = ' '
*         FILETYPE_NO_CHANGE      = ' '
*         FILEMASK_ALL            = ' '
*         FILETYPE_NO_SHOW        = ' '
*         LINE_EXIT               = ' '
*         USER_FORM               = ' '
*         USER_PROG               = ' '
*         SILENT                  = 'S'
*    IMPORTING
*         FILESIZE                =
*         CANCEL                  =
*         ACT_FILENAME            =
*         ACT_FILETYPE            =
       tables
            data_tab                = itab
      exceptions
           conversion_error        = 1
           invalid_table_width     = 2
           invalid_type            = 3
           no_batch                = 4
           unknown_error           = 5
           gui_refuse_filetransfer = 6
           others                  = 7
            .
  if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

*CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
*     EXPORTING
*          filename                = 'C:\TEST.XLS'
*          i_begin_col             = 1
*          i_begin_row             = 1
*          i_end_col               = 3
*          i_end_row               = 5
*     tables
*          intern                  = ITAB
*    EXCEPTIONS
*         INCONSISTENT_PARAMETERS = 1
*         UPLOAD_OLE              = 2
*         OTHERS                  = 3
*          .
*IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
*
endform.                    " UPLOAD
*----------------------------------------------------------------------*
*        Start new screen                                              *
*----------------------------------------------------------------------*
form bdc_dynpro using program dynpro.
  clear bdcdata.
  bdcdata-program  = program.
  bdcdata-dynpro   = dynpro.
  bdcdata-dynbegin = 'X'.
  append bdcdata.
endform.

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
form bdc_field using fnam fval.
  if fval <> space.
    clear bdcdata.
    bdcdata-fnam = fnam.
    bdcdata-fval = fval.
    append bdcdata.
  endif.
endform.
*&---------------------------------------------------------------------*
*&      Form  OPEN
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form open.
  call function 'BDC_OPEN_GROUP'
      exporting
           client              = sy-mandt
*         DEST                = FILLER8
           group               = 'ZDESIGCAT_R'
*         HOLDDATE            = FILLER8
*         KEEP                = FILLER1
           user                = sy-uname
*         RECORD              = FILLER1
*    IMPORTING
*         QID                 =
      exceptions
           client_invalid      = 1
           destination_invalid = 2
           group_invalid       = 3
           group_is_locked     = 4
           holddate_invalid    = 5
           internal_error      = 6
           queue_error         = 7
           running             = 8
           system_lock_error   = 9
           user_invalid        = 10
           others              = 11
            .
  if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

endform.                    " OPEN

*&---------------------------------------------------------------------*
*&      Form  MOVE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form move.

perform bdc_dynpro      using 'SAPLSETB' '0230'.
perform bdc_field       using 'BDC_CURSOR'
                              'DATABROWSE-TABLENAME'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ANLE'.
perform bdc_field       using 'DATABROWSE-TABLENAME'
                              'ZIPCLDESIGCAT'.
perform bdc_dynpro      using 'SAPLZIPCLDESIGCAT' '0001'.
perform bdc_field       using 'BDC_CURSOR'
                              'VIM_POSITION_INFO'.
perform bdc_field       using 'BDC_OKCODE'
                              '=NEWL'.
perform bdc_dynpro      using 'SAPLZIPCLDESIGCAT' '0001'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZIPCLDESIGCAT-ZDESIGCAT(01)'.
perform bdc_field       using 'BDC_OKCODE'
                              '=SAVE'.
perform bdc_field       using 'ZIPCLDESIGCAT-ZDESIGNCD(01)'
                              '2101'.
perform bdc_field       using 'ZIPCLDESIGCAT-ZDESIGNATION(01)'
                              'new'.
perform bdc_field       using 'ZIPCLDESIGCAT-ZDESIGCAT(01)'
                              'n'.
perform bdc_dynpro      using 'SAPLZIPCLDESIGCAT' '0001'.
perform bdc_field       using 'BDC_CURSOR'
                              'ZIPCLDESIGCAT-ZDESIGNCD(02)'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ENDE'.
perform bdc_dynpro      using 'SAPLSETB' '0230'.
perform bdc_field       using 'BDC_OKCODE'
                              '/EEND'.
perform bdc_field       using 'BDC_CURSOR'
                              'DATABROWSE-TABLENAME'.


endform.                    " MOVE

*&---------------------------------------------------------------------*
*&      Form  CLOSE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form close.
  call function 'BDC_CLOSE_GROUP'
       exceptions
            not_open    = 1
            queue_error = 2
            others      = 3.
  if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.

endform.                    " CLOSE

Edited by: Raghunath Shyamala on Mar 6, 2009 7:11 AM

Former Member
0 Kudos
43

Hi,

Check in SDN then you get lot of posts.

Regards

Md.MahaboobKhan

Former Member
0 Kudos
43

Hi,

check below link

Regards,

Madhu

Former Member
0 Kudos
43

Hi,

Basically

Do the following things.

1. Recording - SHDB

2. Tcode - FS01 (G/L account creation)

3. Program - looks below link

kindly have a look on below link:

http://searchsap.techtarget.com/tip/0,289483,sid21_gci960490,00.html

http://sap.ittoolbox.com/groups/technical-functional/sap-dev/writing-bdc-program-338382

Thanks,

Smita