Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Home arrow Tips and Tricks arrow ABAP Reports
ABAP Reports
BDC FAQ - Frequently Asked Questions PDF Print E-mail
User Rating: / 0
Written by Anon.   
Saturday, 06 December 2008

Explain BDC.

BDC stands for batch data communication is used to tranfer data from non sap system to sap system. 
There are two method used 2 transfer data using BDC 
1 DIRECT METHOD
2 BATCH INPUT METHOD it is also of two type :-
i) CALL TRANSACTION METHOD
ii) SESSION METHOD

The major difference b/w call transaction and session method is that in call transaction method data is updated Synchronously but session method is asynchronously session is generated in session method but session is not generated in call transaction method

BDC is all about automating the screen flow.  for example, lets say we send an IDoc to external system using transcation we19. If the requirement is to automate it , then BDC can be used.
Procedure:
1. record the transaction with tcode shdb
2. copy the transaction recording program code from where you want to execute it 
3. use the method to call : call transaction or session method

The above are the ways to automate those screen flows for which recording is performed.

Once you are done.. in the field values of BDC recording, put the values as input values whatever you want to mention.

How to handle errors in call transaction method and session method.

You can try this code to handle your BDC errors and display the corresponding error messages:

if session ne 'X'.
   call transaction tcode using itab_bdc mode 'N' UPDATE 'S' MESSAGES INTO i_errors.

* N - no display
* E - errors only
* A - display ALL screens
elseif session = 'X'.
   call function 'BDC_INSERT'
        exporting
            tcode = tcode
                tables
                   dynprotab = itab_bdc
                exceptions
                   internal_error = 1
                   not_open = 2
                   queue_error = 3
                   tcode_invalid = 4
                   printing_invalid = 5
                   posting_invalid = 6
                   others = 7

*Check SY-SUBRC
    if sy-subrc <> 0. "Unsuccessful
       loop at i_errors.
           MESSAGE ID i_errors-msgid TYPE i_errors-msgtyp NUMBER
            i_errors-msgnr WITH i_errors-msgv1 i_errors-msgv2
            i_errors-msgv3 i_errors-msgv4 INTO i_error_messages-message.

             append i_error_messages.
        endloop.
    endif.
endif.

 
General Flow of a BDC Program PDF Print E-mail
User Rating: / 0
Written by Tejas   
Friday, 05 December 2008

General flow of a BDC program is like this....

1) First create recording for the T code which you want to make BDC for... Use T code SHDB for recording.

2 ) Now save that recording and create pogram from that recording using Create Program button. give the BDC driver program name and create.

3 ) Now the general logic of BDC program goes like this....

 - Upload Flat file into and internal table using function module "UPLOAD"
 - OPEN BDC GROUP.
 - Now loop at that internal table which contains the data from flat file.
 - move data from internal table to fields of BDCDATA using automatically gebnerated code from BDC.
 - CALL TRANSACTION <T CODE> using BDCDATA...
 - CLOSE BDC GROUP

A sample program for the same is attatched here for your referance... just go through it..

report ztej_test_new no standard page heading line-size 255.

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
 
Dynamic selection screen based on user inputs PDF Print E-mail
User Rating: / 1
Written by Swarna S   
Tuesday, 04 November 2008

Dynamic selection screens based on user input parameters with dropdowns and execute button disabled.

The selection screen  push button does the functionality of the disabled execute button

Last Updated ( Tuesday, 04 November 2008 )
Read more...
 
The new error exception concept PDF Print E-mail
User Rating: / 0
Written by anon.   
Sunday, 29 June 2008
In release 6.10 a new exception concept has been introduced. Please find below a basic syntax of how
to code the new error-handling concept.
Read more...
 
Building the text for a return message PDF Print E-mail
User Rating: / 2
Written by Kevin Wilson   
Saturday, 24 May 2008
The following function module is used to return the text in a readable
format. Pass in the message ID, number and parameters and receive
the text in MESSAGE_TEXT_OUTPUT.
      CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = messtab-msgid
msgnr = messtab-msgnr
msgv1 = messtab-msgv1
msgv2 = messtab-msgv2
msgv3 = messtab-msgv3
msgv4 = messtab-msgv4
IMPORTING
message_text_output = w_textout.
 
Customize ABAP Program to Mass run MD02 PDF Print E-mail
User Rating: / 0
Written by Anon.   
Thursday, 10 April 2008
Read more...
 
ALV report to find the list of infotypes configured in a SAP System PDF Print E-mail
User Rating: / 12
Written by Swarna S   
Wednesday, 27 February 2008

ALV report to find the list of infotypes configured in a SAP System

Last Updated ( Wednesday, 27 February 2008 )
Read more...
 
Passing data using SAP memory PDF Print E-mail
User Rating: / 1
Written by Anon.   
Friday, 08 February 2008
There are two cross-program memory areas to which ABAP programs have access that you can use to pass data between programs.
Read more...
 
Batch Input with 'Call Transaction' PDF Print E-mail
User Rating: / 0
Written by Bence Toth   
Tuesday, 05 February 2008
Requirement:

Choose a transaction and write a Batch Input program with 'Call Transaction'. Do not use the Message tab feature of 'Call Transaction'. In this case the last error message will be at the SY-MSG* system fields. Recreate the complete error message from table T100! (This example is also used by the demonstration of SY-MSG* system  fields)

Read more...
 
Hide technique in reports PDF Print E-mail
User Rating: / 0
Written by Anon.   
Monday, 04 February 2008

You use the HIDE technique while creating a list level to store line-specific information for later use. To do so, use the HIDE statement as follows:

HIDE <f>.

Read more...
 
Interactive Reporting PDF Print E-mail
User Rating: / 0
Written by Judit Rakovits   
Saturday, 12 January 2008
Requirement:

List the first 100 purchase requsitions at the plant 'PL01' (table EBAN). Then make it possible to change the purchase requisition itself from the list by clicking twice on the row or by using a push-button.

Read more...
 
Useful standard reports PDF Print E-mail
User Rating: / 0
Written by Anon.   
Wednesday, 26 December 2007
Read more...
 
What is the difference between Move & assign statement? PDF Print E-mail
User Rating: / 0
Written by Anon.   
Thursday, 11 October 2007
Move :- To assign the value of a data object <fl> to a variable < f2 >, use the following
statement:
MOVE < f1 > TO < f2 >.
or the equivalent statement
< f2 > = < f1 >.
The contents of < f1 > remain unchanged.  < f1 > does not have to be a variable - it can also
be a literal, a text symbol, or a constant.  You must always specify decimal points with a period
(.), regardless of the user's personal settings.
Multiple value assignments in the form
< f4 > = < f3 > = <f2 > = < f1 > .

Assign :- ASSIGN < f > TO < FS >.
When you assign the data object, the system checks whether the technical attributes of the
data object < f > correspond to any type specifications for the field symbol < FS >.  The field
symbol adopts any generic attributes of < f > that are not contained in its own type
specification.  Following the assignment, it points to < f > in memory.
 
How to Get Error Message from BDC? PDF Print E-mail
User Rating: / 3
Written by Amit khari   
Monday, 17 September 2007

While doing call transaction, if an error occurs in updation, we declare bdcmsgcoll and store our messages in it, but how to retreive error message from it.

 

Read more...
 
TIP:Bypassing the system timeout value PDF Print E-mail
User Rating: / 0
Written by Kevin Wilson   
Thursday, 23 August 2007

Ever received that dreaded message "Time limit exceeded"? 

When you need to run a report that will go over the Basis timeout setting this is what you need to do....

Read more...
 
<< Start < Prev 1 2 3 4 5 6 Next > End >>

Results 1 - 15 of 85

Google Search

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor