Utilize a função do módulo SO_NEW_DOCUMENT_ATT_SEND_API1 neste campo para passar o parâmetro (new object id).
SOFOLENTI1-COPY - para cópia carbono
SOFOLENTI1-BLIND_COPY - para cópia carbono oculta
Avalados por :
Olá a todos,
Criei um relatório que envia a saída do relatório para endereços de e-mail externos. Quero colocar alguns endereços de e-mail em CC ou CCO.
Por favor, oriente-me para que eu possa prosseguir com o desenvolvimento.
Obrigado e cumprimentos,
Syed
Utilize a função do módulo SO_NEW_DOCUMENT_ATT_SEND_API1 neste campo para passar o parâmetro (new object id).
SOFOLENTI1-COPY - para cópia carbono
SOFOLENTI1-BLIND_COPY - para cópia carbono oculta
apenas passe pelo código abaixo e
*&---------------------------------------------------------------------*
*& Relatório Z_TTTT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_TTTT1.
************************************************************************
*DECLARAÇÕES DE TABELAS
************************************************************************
TABLES: SOLI.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT_B1 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE .
PARAMETERS SAPID RADIOBUTTON GROUP ADDR.
SELECTION-SCREEN COMMENT 5(20) T_SAPID.
PARAMETERS EMAIL_ID RADIOBUTTON GROUP ADDR.
SELECTION-SCREEN COMMENT 30(20) T_EMAIL.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT_B2 NO INTERVALS.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 5(20) TXT_ID.
SELECT-OPTIONS: ID FOR SOLI-LINE NO INTERVALS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 5(20) TXT_CC.
SELECT-OPTIONS: CC FOR SOLI-LINE NO INTERVALS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 5(20) TXT_BCC.
SELECT-OPTIONS: BCC FOR SOLI-LINE NO INTERVALS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B5 WITH FRAME TITLE TEXT_B5.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS P_ATTACH AS CHECKBOX USER-COMMAND RAD1.
SELECTION-SCREEN COMMENT 5(20) T_ATTACH.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(20) T_FLNAME.
PARAMETERS P_FLNAME TYPE RLGRAP-FILENAME MODIF ID M1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B5.
************************************************************************
*Declarações de Dados
************************************************************************
DATA: MAIL_CONTENT LIKE SOLI OCCURS 0 WITH HEADER LINE,
SUBJECT_LINE LIKE SOOD1-OBJDES.
DATA : SENDER TYPE SY-UNAME,
IT_REC type SOLI OCCURS 0 WITH HEADER LINE.
************************************************************************
*Bloco de Inicialização
************************************************************************
INITIALIZATION.
TEXT_B1 = 'Especificação de Saída'.
T_SAPID = 'ID do Usuário SAP'.
T_EMAIL = 'ID do Email'.
TXT_ID = 'ID do Destinatário'.
TXT_CC = 'CC'.
TXT_BCC = 'BCC'.
TEXT_B2 = 'Destinatário'.
TEXT_B5 = 'Anexo'.
T_ATTACH = 'Anexo'.
T_FLNAME = 'Nome do arquivo'.
* TXT_SEND = 'Nome do Remetente'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF P_ATTACH <> 'X'.
IF SCREEN-GROUP1 = 'M1'.
SCREEN-INPUT = 0. " Desabilitar para entrada.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FLNAME.
PERFORM GET_FILENAME.
************************************************************************
*Início do Bloco de Seleção
************************************************************************
START-OF-SELECTION.
* LOOP AT TEXT1.
* MOVE TEXT1-LOW TO MAIL_CONTENT-LINE.
* APPEND MAIL_CONTENT.
* ENDLOOP.
**** Corpo do Email
MOVE 'Oi' TO MAIL_CONTENT-LINE.
APPEND MAIL_CONTENT.
MOVE 'Este é um email de teste' TO MAIL_CONTENT-LINE.
APPEND MAIL_CONTENT.
MOVE 'Obrigado' TO MAIL_CONTENT-LINE.
APPEND MAIL_CONTENT.
**** Título do Email
MOVE 'Email de Teste' TO SUBJECT_LINE.
PERFORM SEND_EMAIL TABLES MAIL_CONTENT USING SUBJECT_LINE.
*&---------------------------------------------------------------------
*& Formulário SEND_EMAIL
*&---------------------------------------------------------------------
FORM SEND_EMAIL TABLES OBJCONT STRUCTURE MAIL_CONTENT
USING TITLE LIKE SOOD-OBJDES.
DATA: RECEIVERS TYPE SOOS1 OCCURS 0 WITH HEADER LINE,
TSOOD1 TYPE SOOD1,
PACKING_LIST TYPE SOXPL OCCURS 0 WITH HEADER LINE,
OBJCONT1 type SOLI OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF AT_HEADER OCCURS 1.
INCLUDE STRUCTURE SOLI.
DATA: END OF AT_HEADER.
CLEAR: TSOOD1,
RECEIVERS.
REFRESH RECEIVERS.
MOVE: SY-LANGU TO TSOOD1-OBJLA,
'Aviso de Email' TO TSOOD1-OBJNAM,
'C' TO TSOOD1-OBJSNS,
TITLE TO TSOOD1-OBJDES,
'Rajan' TO TSOOD1-OWNNAM.
*loop através de cada ID e movê-los para a tabela de destinatários
LOOP AT ID.
* TRANSLATE ID-LOW TO UPPER CASE.
IF SAPID = 'X'.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
' ' TO RECEIVERS-RECESC,
ID-LOW TO RECEIVERS-RECNAM,
'X' TO RECEIVERS-SNDEX.
ELSE.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
'U' TO RECEIVERS-RECESC,
'U-' TO RECEIVERS-RECNAM,
ID-LOW TO RECEIVERS-RECEXTNAM.
ENDIF.
APPEND RECEIVERS.
CLEAR RECEIVERS.
ENDLOOP.
*loop através de cada CC e movê-los para a tabela de destinatários
LOOP AT CC.
TRANSLATE CC-LOW TO UPPER CASE.
IF SAPID = 'X'.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
' ' TO RECEIVERS-RECESC,
CC-LOW TO RECEIVERS-RECNAM,
'X' TO RECEIVERS-SNDEX,
'X' TO RECEIVERS-SNDCP.
ELSE.
MOVE: SY-DATUM TO RECEIVERS-RCDAT,
SY-UZEIT TO RECEIVERS-RCTIM,
'U' TO RECEIVERS-RECESC,
'U-' TO
Consulte o fórum, este tópico foi discutido muitas vezes.
Verifique os parâmetros dos destinatários. Lá você pode encontrar os parâmetros responsáveis por CC e BCC.
Consulte o fórum, este assunto já foi discutido várias vezes no fórum.
Verifique os parâmetros dos destinatários. Aqui você pode encontrar os parâmetros responsáveis por CC e CCO.
contacto@primeinstitute.com
(+51) 1641 9379
(+57) 1489 6964
© 2024 Copyright. Todos los derechos reservados.
Desarrollado por Prime Institute