cancel
Showing results for 
Search instead for 
Did you mean: 

Dep. Key Mass change

Former Member
0 Kudos

Hi guys,

How can I make a mass change on my Assets?

There is a need to change depreciation keys on my Assets, so how can I do them as a mass without having to do it individually?

Accepted Solutions (1)

Accepted Solutions (1)

andreas_mann3
Active Contributor
0 Kudos

hi,

here's a sample abap

REPORT ztestas02.

INCLUDE bdcrecx1.

PARAMETERS file LIKE rlgrap-filename DEFAULT
           'h:chg_lt.csv'.

PARAMETERS:
            afapl  LIKE t093-afapl  DEFAULT 'ZDE',
            afaber LIKE t093-afaber DEFAULT '01',
            sep DEFAULT ';',
            panz TYPE n DEFAULT 1.
DATA date LIKE apqi-startdate.

DATA: BEGIN OF ftab OCCURS 0,
      line TYPE string,
      END OF ftab.

DATA: BEGIN OF itab OCCURS 0,
        bukrs TYPE anlb-bukrs,
        gsber TYPE anlz-gsber,
        anln1 TYPE anlb-anln1,
        anln2 TYPE anlb-anln2,
        ndjar TYPE anlb-ndjar,
        ndper TYPE anlb-ndper,
      END OF itab.

DATA: BEGIN OF sptab OCCURS 0,
      line(132),
      END OF sptab.
FIELD-SYMBOLS: <f>.

START-OF-SELECTION.

  PERFORM start.
  PERFORM verarbeitung.
*&---------------------------------------------------------------------*
*&      Form  start
*&---------------------------------------------------------------------*
FORM start.
  DATA datei TYPE string.
  datei = file.

  PERFORM open_group.

  CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
            filename = datei
            filetype = 'ASC'
       TABLES
            data_tab = ftab.

ENDFORM.                    " start

*&---------------------------------------------------------------------*
*&      Form  verarbeitung
*&---------------------------------------------------------------------*
FORM verarbeitung.
  LOOP AT ftab.
    CHECK sy-tabix > panz.
    CHECK ftab-line CN ' ;'.

*Feldweise einlesen
    REFRESH sptab. CLEAR sptab. CLEAR itab.
    SPLIT ftab-line AT sep INTO TABLE sptab.

    LOOP AT sptab.
      ASSIGN COMPONENT sy-tabix OF STRUCTURE itab TO <f>.
      IF sy-subrc = 0.
        PERFORM alphaformat(sapfs000) USING sptab-line <f>.
      ENDIF.
    ENDLOOP.

*Startdynpro 100
    PERFORM bdc_dynpro      USING 'SAPLAIST' '0100'.
    PERFORM bdc_field       USING 'BDC_OKCODE' '=D190'.
    PERFORM bdc_field       USING 'ANLA-ANLN1' itab-anln1.
    PERFORM bdc_field       USING 'ANLA-ANLN2' itab-anln2.
    PERFORM bdc_field       USING 'ANLA-BUKRS' itab-bukrs.
*
*Dynpro 190
    PERFORM bdc_dynpro      USING 'SAPLAIST' '1000'.
    PERFORM bdc_field       USING 'BDC_OKCODE' '=BUCH'.
    PERFORM bdc_field USING  'ANLB-NDJAR(01)' itab-ndjar.
    PERFORM bdc_field USING  'ANLB-NDPER(01)' itab-ndper.
*Ende
    PERFORM bdc_transaction USING 'AS02'.

    APPEND itab.
  ENDLOOP.



ENDFORM.                    " verarbeitung

A.

Message was edited by:

Andreas Mann

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

Pam,

There is no need for any coding. Just create a new substitution in ggb1 specifying your conditions/parameters. Create a work list for the assets you want to mass change and use the new substitution you created. Your depreciation key will be updated/changed.

Thanks

Jagdish

Former Member
0 Kudos

Hi, just use OA02 - add new substitution and insert the above abab coding.

cheers,

petra

Message was edited by:

Petra Fibichova