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: 

Some questions..

Former Member
0 Kudos
178

Hello all,

I am new to ABAP. I am learning now.I have some questions.

1. What is the typical structure of an ABAP program?

2. What are field symbols and field groups? Have you used "component idx of structure" clause with field groups?

3. What should be the approach for writing a BDC program?

4. What is a batch input session?

5. What is the alternative to batch input session?

6. What are the techniques involved in using SAP supplied programs? Do you prefer to write your own programs to load master data? Why?

Best Regards,

Purna

1 ACCEPTED SOLUTION

Former Member
0 Kudos
47

Hi Purna,

phew! these are lots of questions. Now let's see:

4. A batch-input session is a way (but not THE ONLY WAY) to massively process SAP transactions. That means, you store in such a session:

- what transaction(s) you want to run

- what screens you visit

- what fields you fill in each screen

- what pushbuttons/function codes/ok-codes (that is, what ACTION) you want to perform into each screen

So all this information is stored in a so-called "batch-input session". A typical example is the batch input session generated by the depreciation transaction (AFAB)

3. Maybe the easiest way to do so is to record a batch-input session (via SM35 > Record), and then write your ABAP code. You will find very useful a form like this:


*&---------------------------------------------------------------------*
*&      Form  dynpro
*&---------------------------------------------------------------------*
*       Inserta datos de CALL TRANSACTION (o BATCH-INPUT) en
*       tabla interna
*----------------------------------------------------------------------*
*      -->_DYNBEGIN  'X' empieza dynpro nuevo; ' ' mismo dynpro
*      -->_NAME      Si DYNBEGIN 'X' programa; si no, nombre campo
*      -->_VALUE     Si DYNBEGIN ' ' nº dynpro; si no, valor campo
*----------------------------------------------------------------------*
FORM dynpro USING _dynbegin
                  _name
                  _value.
*
  IF _dynbegin = c_yes.
    CLEAR bdc_data.
    bdc_data-dynbegin = c_yes.
    bdc_data-program  = _name.
    bdc_data-dynpro   = _value.
    APPEND bdc_data.
  ELSE.
    CLEAR bdc_data.
    bdc_data-fnam     = _name.
    bdc_data-fval     = _value.
    SHIFT bdc_data-fval LEFT
      DELETING LEADING space.
    APPEND bdc_data.
  ENDIF.
*
ENDFORM.                    " dynpro

...and then you should call this form once per line generated by the recording of the batch-input session... We all can give you some more details on this if necessary (won't we guys?? :-D)

5. Well, there are many other tecniques. You mean: for massive upload? For massive execution of transactions? Maybe CATT (Computer-Aided Testing Tool, transaction SCAT) could be used for this purpose as well. Or direct-input, for example if you want to upload material master records. Or just the straightforward INSERTs, but I seriously recommend you NOT to use it O:-)

6. I personally try to use standard SAP ways to upload master data. Thus you can take advantage of all SAP validations. But of course your legacy system needn't be SAP, so you'll have to develop your own ABAP code in order to perform some sort of "conversion" between the legacy format (mostly a plain text file) and the format expected by SAP.

Wow! I hope you reached this point. Pls write back if you need some more help. Or if this is enough, pls let us know anyway. BR,

Alvaro

2 REPLIES 2

Former Member
0 Kudos
47

Former Member
0 Kudos
48

Hi Purna,

phew! these are lots of questions. Now let's see:

4. A batch-input session is a way (but not THE ONLY WAY) to massively process SAP transactions. That means, you store in such a session:

- what transaction(s) you want to run

- what screens you visit

- what fields you fill in each screen

- what pushbuttons/function codes/ok-codes (that is, what ACTION) you want to perform into each screen

So all this information is stored in a so-called "batch-input session". A typical example is the batch input session generated by the depreciation transaction (AFAB)

3. Maybe the easiest way to do so is to record a batch-input session (via SM35 > Record), and then write your ABAP code. You will find very useful a form like this:


*&---------------------------------------------------------------------*
*&      Form  dynpro
*&---------------------------------------------------------------------*
*       Inserta datos de CALL TRANSACTION (o BATCH-INPUT) en
*       tabla interna
*----------------------------------------------------------------------*
*      -->_DYNBEGIN  'X' empieza dynpro nuevo; ' ' mismo dynpro
*      -->_NAME      Si DYNBEGIN 'X' programa; si no, nombre campo
*      -->_VALUE     Si DYNBEGIN ' ' nº dynpro; si no, valor campo
*----------------------------------------------------------------------*
FORM dynpro USING _dynbegin
                  _name
                  _value.
*
  IF _dynbegin = c_yes.
    CLEAR bdc_data.
    bdc_data-dynbegin = c_yes.
    bdc_data-program  = _name.
    bdc_data-dynpro   = _value.
    APPEND bdc_data.
  ELSE.
    CLEAR bdc_data.
    bdc_data-fnam     = _name.
    bdc_data-fval     = _value.
    SHIFT bdc_data-fval LEFT
      DELETING LEADING space.
    APPEND bdc_data.
  ENDIF.
*
ENDFORM.                    " dynpro

...and then you should call this form once per line generated by the recording of the batch-input session... We all can give you some more details on this if necessary (won't we guys?? :-D)

5. Well, there are many other tecniques. You mean: for massive upload? For massive execution of transactions? Maybe CATT (Computer-Aided Testing Tool, transaction SCAT) could be used for this purpose as well. Or direct-input, for example if you want to upload material master records. Or just the straightforward INSERTs, but I seriously recommend you NOT to use it O:-)

6. I personally try to use standard SAP ways to upload master data. Thus you can take advantage of all SAP validations. But of course your legacy system needn't be SAP, so you'll have to develop your own ABAP code in order to perform some sort of "conversion" between the legacy format (mostly a plain text file) and the format expected by SAP.

Wow! I hope you reached this point. Pls write back if you need some more help. Or if this is enough, pls let us know anyway. BR,

Alvaro