SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Maintain Forward-To Agent for mail notification



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SAP Business Workflow
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Thu Feb 19, 2009 4:35 pm    Post subject: Maintain Forward-To Agent for mail notification Reply with quote

Maintain Forward-To Agent for mail notification (Batch input report around SO36)

Code:
*& *----------------------------------------------------------------------*
*    Report : Z_MASS_SO36
*    Author : Morten Hjorth Nielsen
*    Webpage: http://www.mortenhjorthnielsen.com
*
*    Purpose: Maintain Workflow Forward to e-mail adress for office mail
*             forwarding.
*
*    This report is meant for inspiration, before you use it in a productive
*    environment please Test and Adjust thoroughly
*& *----------------------------------------------------------------------*

REPORT  z_mass_so36.

TABLES usr02.

DATA bname LIKE usr02-bname.
DATA email TYPE so_name.
DATA bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF itab OCCURS 20,
      bname LIKE usr02-bname,
      email TYPE so_name,
END OF itab.

SELECT-OPTIONS user FOR usr02-bname.

PARAMETERS: lv_dom(72) LOWER CASE,
            ctumode LIKE ctu_params-dismode DEFAULT 'N', "Run in background
            cupdate LIKE ctu_params-updmode DEFAULT 'S'. "Synch. update

************************************************************************
* read user from USR02 and generate forward to address and build       *
* internal table                                                       *
************************************************************************


SELECT bname FROM usr02 INTO bname
       WHERE bname IN user.

  itab-bname = bname.

  CONCATENATE bname '@' lv_dom INTO email.
  itab-email = email.

  APPEND itab.
ENDSELECT.

* loop over bruger og opdater so36

LOOP AT itab.
  REFRESH bdcdata.
  PERFORM so36.
*  WRITE:/ itab-bname, itab-email.
ENDLOOP.

*&--------------------------------------------------------------------*
*& Form so36
*&--------------------------------------------------------------------*

FORM so36.

  PERFORM bdc_dynpro USING 'RSSOADM0'   '1000'.
  PERFORM bdc_field  USING 'BDC_CURSOR' 'ETIM'.
  PERFORM bdc_field  USING 'BDC_OKCODE' '=ONLI'.
  PERFORM bdc_field  USING 'USRNAM'     itab-bname.
  PERFORM bdc_field  USING 'NEW_SUBS'   itab-email.
  PERFORM bdc_field  USING 'SUB_ESC'    'u'.
  PERFORM bdc_field  USING 'BDAT'       '01.01.2004'.
  PERFORM bdc_field  USING 'BTIM'       '08:00:00'.
  PERFORM bdc_field  USING 'EDAT'       '31.12.9999'.
  PERFORM bdc_field  USING 'ETIM'       '24:00:00'.
  PERFORM bdc_field  USING 'FORW_ALL'   'X'.
  PERFORM bdc_field  USING 'PSTHR2'     'X'.
  PERFORM bdc_dynpro USING 'RSSOADM0'   '1000'.
  PERFORM bdc_field  USING 'BDC_OKCODE' '/EE'.
  PERFORM bdc_field  USING 'BDC_CURSOR' 'USRNAM'.

  CALL TRANSACTION 'SO36' USING bdcdata
                          MODE ctumode
                          UPDATE cupdate.
ENDFORM.                                                    "so36

*----------------------------------------------------------------------*
* Start new screen *
*----------------------------------------------------------------------*

FORM bdc_dynpro USING program dynpro.
  CLEAR bdcdata.
  bdcdata-program = program.
  bdcdata-dynpro = dynpro.
  bdcdata-dynbegin = 'X'.
  APPEND bdcdata.
ENDFORM. "BDC_DYNPRO

*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*

FORM bdc_field USING fnam fval.
  CLEAR bdcdata.
  bdcdata-fnam = fnam.
  bdcdata-fval = fval.
  APPEND bdcdata.
ENDFORM. "BDC_FIELD
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SAP Business Workflow All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.