技术开发 频道

关于SAP地址/传真/邮箱的地址读取

  六、地址写入代码摘抄
FUNCTION ADDR_SAVE_INTERN.
*"----------------------------------------------------------------------
*"*"Verbuchungsfunktionsbaustein:
*"
*"*"Lokale Schnittstelle:
*"  TABLES
*"      ADRC_D STRUCTURE  ADRC
*"      ADRC_U STRUCTURE  ADRC
*"      ADRC_I STRUCTURE  ADRC
*"      ADRCT_D STRUCTURE  ADRCT
*"      ADRCT_U STRUCTURE  ADRCT
*"      ADRCT_I STRUCTURE  ADRCT
*"      ADRP_D STRUCTURE  ADRP
*"      ADRP_U STRUCTURE  ADRP
*"      ADRP_I STRUCTURE  ADRP
*"      ADCP_D STRUCTURE  ADCP
*"      ADCP_U STRUCTURE  ADCP
*"      ADCP_I STRUCTURE  ADCP
*"      ADRT_D STRUCTURE  ADRT
*"      ADRT_U STRUCTURE  ADRT
*"      ADRT_I STRUCTURE  ADRT
*"      ADR2_D STRUCTURE  ADR2
*"      ADR2_U STRUCTURE  ADR2
*"      ADR2_I STRUCTURE  ADR2
*"      ADR3_D STRUCTURE  ADR3
*"      ADR3_U STRUCTURE  ADR3
*"      ADR3_I STRUCTURE  ADR3
*"      ADR4_D STRUCTURE  ADR4
*"      ADR4_U STRUCTURE  ADR4
*"      ADR4_I STRUCTURE  ADR4
*"      ADR5_D STRUCTURE  ADR5
*"      ADR5_U STRUCTURE  ADR5
*"      ADR5_I STRUCTURE  ADR5
*"      ADR6_D STRUCTURE  ADR6
*"      ADR6_U STRUCTURE  ADR6
*"      ADR6_I STRUCTURE  ADR6
*"      ADR7_D STRUCTURE  ADR7
*"      ADR7_U STRUCTURE  ADR7
*"      ADR7_I STRUCTURE  ADR7
*"      ADR8_D STRUCTURE  ADR8
*"      ADR8_U STRUCTURE  ADR8
*"      ADR8_I STRUCTURE  ADR8
*"      ADR9_D STRUCTURE  ADR9
*"      ADR9_U STRUCTURE  ADR9
*"      ADR9_I STRUCTURE  ADR9
*"      ADR10_D STRUCTURE  ADR10
*"      ADR10_U STRUCTURE  ADR10
*"      ADR10_I STRUCTURE  ADR10
*"      ADR11_D STRUCTURE  ADR11
*"      ADR11_U STRUCTURE  ADR11
*"      ADR11_I STRUCTURE  ADR11
*"      ADR12_D STRUCTURE  ADR12
*"      ADR12_U STRUCTURE  ADR12
*"      ADR12_I STRUCTURE  ADR12
*"      ADR13_D STRUCTURE  ADR13
*"      ADR13_U STRUCTURE  ADR13
*"      ADR13_I STRUCTURE  ADR13
*"      ADRCOMC_D STRUCTURE  ADRCOMC
*"      ADRCOMC_U STRUCTURE  ADRCOMC
*"      ADRCOMC_I STRUCTURE  ADRCOMC
*"      ADRG_D STRUCTURE  ADRG
*"      ADRG_U STRUCTURE  ADRG
*"      ADRG_I STRUCTURE  ADRG
*"      ADRGP_D STRUCTURE  ADRGP
*"      ADRGP_U STRUCTURE  ADRGP
*"      ADRGP_I STRUCTURE  ADRGP
*"      ADRV_D STRUCTURE  ADRV
*"      ADRV_U STRUCTURE  ADRV
*"      ADRV_I STRUCTURE  ADRV
*"      ADRVP_D STRUCTURE  ADRVP
*"      ADRVP_U STRUCTURE  ADRVP
*"      ADRVP_I STRUCTURE  ADRVP
*"  EXCEPTIONS
*"      DATABASE_ERROR
*"      INTERNAL_ERROR
*"----------------------------------------------------------------------
*                           Initialisierung der FG sicherstellen
  PERFORM CHECK_FOR_INITIALIZATION.
  DEFINE WRITE_TO_DB.
  DELETE &1 FROM TABLE &1_D.
  IF SY-SUBRC <> 0.
    MESSAGE A840 WITH '&1' RAISING DATABASE_ERROR.
* Datenbankfehler beim L鰏chen aus Tabelle &
  ENDIF.
  UPDATE &1 FROM TABLE &1_U.
  IF SY-SUBRC <> 0.
    MESSAGE A841 WITH '&1' RAISING DATABASE_ERROR.
* Datenbankfehler beim 膎dern von Tabelle &
  ENDIF.
  INSERT &1 FROM TABLE &1_I.
  IF SY-SUBRC <> 0.
    MESSAGE A842 WITH '&1' RAISING DATABASE_ERROR.
* Datenbankfehler beim Einf黦en in Tabelle &
  ENDIF.
  END-OF-DEFINITION.
  WRITE_TO_DB  ADRC   .
* WRITE_TO_DB  ADRCT  .                                     "*912d
  DELETE ADRCT FROM TABLE ADRCT_D.                          "*912i
  IF SY-SUBRC <> 0.                                         "*912i
    MESSAGE A840 WITH 'ADRCT' RAISING DATABASE_ERROR.       "*912i
  ENDIF.                                                    "*912i
  UPDATE ADRCT FROM TABLE ADRCT_U.                          "*912i
  IF SY-SUBRC <> 0.                                         "*912i
    MESSAGE A841 WITH 'ADRCT' RAISING DATABASE_ERROR.       "*912i
  ENDIF.                                                    "*912i
  MODIFY ADRCT FROM TABLE ADRCT_I.                          "*912i
  IF SY-SUBRC <> 0.                                         "*912i
    MESSAGE A842 WITH 'ADRCT' RAISING DATABASE_ERROR.       "*912i
  ENDIF.                                                    "*912i
  WRITE_TO_DB  ADRP   .
  WRITE_TO_DB  ADCP   .
  WRITE_TO_DB  ADRT   .
  WRITE_TO_DB  ADR2   .
  WRITE_TO_DB  ADR3   .
  WRITE_TO_DB  ADR4   .
  WRITE_TO_DB  ADR5   .
  WRITE_TO_DB  ADR6   .
  WRITE_TO_DB  ADR7   .
  WRITE_TO_DB  ADR8   .
  WRITE_TO_DB  ADR9   .
  WRITE_TO_DB  ADR10  .                                 "*178i
  WRITE_TO_DB  ADR11  .                                 "*178i
  WRITE_TO_DB  ADR12  .                                 "*178i
  WRITE_TO_DB  ADR13  .                                 "*178i
  WRITE_TO_DB  ADRCOMC.
  WRITE_TO_DB  ADRG   .
  WRITE_TO_DB  ADRGP  .
  WRITE_TO_DB  ADRV   .
  WRITE_TO_DB  ADRVP  .

ENDFUNCTION.

0
相关文章