REPORT YUSERMOD .

TABLES: USR02.
DATA: BEGIN OF BDC_TAB1 OCCURS 5.
        INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDC_TAB1.
DATA: USER(12) VALUE 'DDDDDDDD',
      INI_PWD(8) VALUE 'INIT',
      DIALOG VALUE 'X',
      PROFILE1(12) VALUE 'SAP_ALL',
      PROFILE2(12) VALUE 'SAP_NEW',
      FULL_NAME(30) VALUE 'Full name',
      PRINT_IMMED VALUE 'X',
      PRINTER_NAME(4) VALUE 'SISK',
      PARAMETER(3) VALUE 'RID',
      PAR_VAL(18) VALUE 'YUSERADD'.

START-OF-SELECTION.

  PERFORM CREATE_USER.
  CALL TRANSACTION 'SU01' USING BDC_TAB1 MODE 'N' UPDATE 'S'.
  PERFORM ADD_ADDRESS_DATA.
  CALL TRANSACTION 'SU01' USING BDC_TAB1 MODE 'N' UPDATE 'S'.
  PERFORM ADD_DEFAULTS.
  CALL TRANSACTION 'SU01' USING BDC_TAB1 MODE 'N' UPDATE 'S'.
  PERFORM ADD_PARAMS.
  CALL TRANSACTION 'SU01' USING BDC_TAB1 MODE 'N' UPDATE 'S'.

*---------------------------------------------------------------------*
*       FORM CREATE_USER                                              *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM CREATE_USER.

  REFRESH BDC_TAB1.
  CLEAR BDC_TAB1.
**************************************************1
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '200' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU200-XUSER' TO BDC_TAB1-FNAM,
         USER TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/6' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************2
  MOVE: 'SAPLSUSB' TO BDC_TAB1-PROGRAM,
        '0705' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU213-BCODE' TO BDC_TAB1-FNAM,
          INI_PWD  TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU213-BCODE2' TO BDC_TAB1-FNAM,
          INI_PWD TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU213-DIA' TO BDC_TAB1-FNAM,
          DIALOG TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU213-PROFILE(1)' TO BDC_TAB1-FNAM,
          PROFILE1 TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU213-PROFILE(2)' TO BDC_TAB1-FNAM,
          PROFILE2 TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/5' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************3
  MOVE: 'SAPLSUSB' TO BDC_TAB1-PROGRAM,
        '701' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         'CONT' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************4
  MOVE: 'SAPLSUSB' TO BDC_TAB1-PROGRAM,
        '702' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         'CONT' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************5
  MOVE: 'SAPLSUSB' TO BDC_TAB1-PROGRAM,
        '703' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/12' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************6
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '200' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/3' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM GENERATE_BDC_DATA_CR                                     *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM ADD_ADDRESS_DATA.

  REFRESH BDC_TAB1.
  CLEAR BDC_TAB1.
**************************************************1
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '200' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU200-XUSER' TO BDC_TAB1-FNAM,
         USER TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/18' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************2
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '320' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'USR03-NAME1' TO BDC_TAB1-FNAM,
          FULL_NAME TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
          '/11' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '320' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
          '/3' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************3
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '200' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/3' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM ADD_ADDRESS_DATA                                         *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM ADD_DEFAULTS.

  REFRESH BDC_TAB1.
  CLEAR BDC_TAB1.
**************************************************1
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '200' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU200-XUSER' TO BDC_TAB1-FNAM,
         USER TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/17' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************2
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '310' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'USR01-SPLD' TO BDC_TAB1-FNAM,
          PRINTER_NAME TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU310-SPDB1' TO BDC_TAB1-FNAM,
          PRINT_IMMED TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
          '/11' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '320' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
          '/3' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************3
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '200' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/3' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
ENDFORM.
*---------------------------------------------------------------------*
*       FORM ADD_DEFAULTS                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM ADD_PARAMS.

  REFRESH BDC_TAB1.
  CLEAR BDC_TAB1.
**************************************************1
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '200' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU200-XUSER' TO BDC_TAB1-FNAM,
         USER TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/19' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************2
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '350' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU350-PARID(1)' TO BDC_TAB1-FNAM,
          PARAMETER  TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'XU350-PARVA(1)' TO BDC_TAB1-FNAM,
          PAR_VAL TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
          '/11' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '320' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
          '/3' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
**************************************************3
  MOVE: 'SAPMS01J' TO BDC_TAB1-PROGRAM,
        '200' TO BDC_TAB1-DYNPRO,
        'X' TO BDC_TAB1-DYNBEGIN.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
  MOVE: 'BDC_OKCODE' TO BDC_TAB1-FNAM,
         '/3' TO BDC_TAB1-FVAL.
  APPEND BDC_TAB1.CLEAR BDC_TAB1.
ENDFORM.