Dica: Definindo dinamicamente opções de entrega do back-end

Perguntas relacionadas a questões técnicas do Oracle EBS. Criação de Concorrentes, Value Sets, Alerts, Forms Personalizations, Configurações, etc
Responder
Avatar do usuário
Porva
Rank: DBA Sênior
Rank: DBA Sênior
Mensagens: 342
Registrado em: Seg, 29 Jan 2007 7:36 am
Localização: São Paulo/SP
Rafael S. Nunes
São Paulo/SP

Pessoal,

Achei uma dica interessante para uma necessidade que surgiu aqui.

Você pode determinar um e-mail para que receba o resultado de um concurrent, no meu caso, eu precisava enviar o PDF gerado pelo concurrent. Na tela Submit Request pode-ser fazer isso manualmente pela opção Opções de Entrega/Delivery Opts no próprio concurrent, mas eu precisava fazer isso dinamicamente, então achei a solução abaixo, testei aqui e funcionou:
Dynamically Setting the Delivery Options from Back End
In Oracle Release 12.1.3 Oracle have come up with a new functionality to deliver the output of the Concurrent Program by various methods.

when we click on the Delivery options button it will open up another form which contains the information in which the output can be delivered.

1.IPP Printer : we can specify the Printer IP adress and user name and password for the printer and the no of copies to be printed(can be used if the required information is available).

2.Email: we can specify the email to whom the output has to be mailed after completion.(Specify any valid email address).

3.Fax : we can specify the fax details so that the the output can be faxed once the request is complted.

4.FTP: specify the FTP details to move the output to a particular folder in the server so that it can be access by the employees.

I have taken the Example Email which is generally commenly used.

By default the From field is filled with the email address of the logged in user and subject has the instance name and the report name and the logged in user name.

we can edit and change the subject and give as per the requirement.

In the TO field and the CC fields specify the Email address to whom the output has to be emailed.

If multiple emails are there then seperate them by using the ','.

This is the functionality used from the front end.

If we want to use the same thing from the back end which we generally used to submit the conucurrent program from the back end.

Use the below code.

/* Formatted on 2/20/2013 1:52:15 PM (QP5 v5.139.911.3011) */

Selecionar tudo

DECLARE
  l_conc_id     NUMBER;
  l_user_id     NUMBER := 3651;
  l_resp_id     NUMBER := 20420;
  l_resp_ppl_id NUMBER := 0;
  l_boolean     BOOLEAN;
BEGIN
  --
  -- Define dinamicamente o destinatario do resultado do concurrent
  --
  l_boolean := fnd_request.add_delivery_option(TYPE         => 'E', -- this one to speciy the delivery option as Email
                                               p_argument1  => 'Testing the Email option from back end', -- subject for the mail
                                               p_argument2  => 'abx@xyz.com', -- from address
                                               p_argument3  => 'xyz@abc.com', 'adf@abc.com', -- to address
                                               p_argument4  => '',   -- cc address to be specified here.
                                               nls_language => '');  -- language option);
  --
  -- Dispara o concurrent pelo SUBMIT_REQUEST
  --  
  IF l_boolean = TRUE THEN
    fnd_global.apps_initialize(l_user_id, l_resp_id, l_resp_ppl_id); -- intialize the apps.
    --
    l_conc_id := fnd_request.submit_request(application => 'FND',
                                            program     => 'FNDSCURS',
                                            start_time  => SYSDATE,
                                            sub_request => FALSE);
    COMMIT;
    dbms_output.put_line('l_conc_id = ' || l_conc_id);
  END IF;
END;
fonte: http://oraclesanpra.blogspot.com/2013/1 ... tions.html

Exemplo:
Imagem

A dica acima seta esta parte dinamicamente:

Imagem
Avatar do usuário
Porva
Rank: DBA Sênior
Rank: DBA Sênior
Mensagens: 342
Registrado em: Seg, 29 Jan 2007 7:36 am
Localização: São Paulo/SP
Rafael S. Nunes
São Paulo/SP

Complementando...

Aqui só consegui fazer funcionar com um template no XML Publisher, não consegui enviar corretamente apenas o PDF feito pelo Reports!

e ainda foi necessário associar o template (XML Publisher) na solicitação pela função fnd_request.add_layout

Exemplo abaixo:

https://community.oracle.com/thread/4125203

Selecionar tudo

-- Adding delivery option to send the request output as email
l_boolean := fnd_request.add_delivery_option
               (type => 'E' -- this one to speciy the delivery option as email
               ,p_argument1 => 'NNN Project Detail Report email' -- subject for the mail
               ,p_argument2 => 'xx_Test@rdu.com' -- from address
               ,p_argument3 => 'nnnn.nnnnx@nnn.com' -- to address
               ,p_argument4 => 'nnn@xx.ac.uk' -- cc address to be specified here.
               ,nls_language => ''); -- Optional

 

-- Adding Template to the request
if l_boolean then
  l_boolean := fnd_request.add_layout
                 (template_appl_name => 'PA'
                 ,template_code      => 'XXPA_PROJECT_DETAIL_REPORT'
                 ,template_language  => 'En' -- English
                 ,template_territory => 'US'
                 ,output_format      => 'EXCEL'
                 );
else
  raise e_add_del;
end if;

 

if l_boolean then
  l_boolean := fnd_request.set_options ('YES');
else
  raise e_add_layout;
end if;

 

if l_boolean then

  l_conc_id := fnd_request.submit_request
                  (application => 'PA'
                  ,program     => 'XXPA_PROJECT_DETAIL_REPORT'
                  ,description => 'NN Project Detail Report'
                  ,start_time  => sysdate
                  ,sub_request => false
                  ,argument1   => null
                  ,argument2   => '2017/10/01 00:00:00'
                  ,argument3   => '2017/10/31 00:00:00'
                     );
else
  raise e_set_repeat;
end if;
Avatar do usuário
dr_gori
Moderador
Moderador
Mensagens: 5024
Registrado em: Seg, 03 Mai 2004 3:08 pm
Localização: Portland, OR USA
Contato:
Thomas F. G

Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered

Muito bom !!! Ótima opção.
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 11 visitantes