terça-feira, 14 de fevereiro de 2023

Workflow - Erro formatação HTML na exibição SBWP

 - Para exibição de HTML no container da SBWP por mais que o HTML funcione 100% no ambiente tipo chrome, edge ou qualquer outra ferramenta para exibição no SAP especificamente na exibição de conteúdo as vezes aparece algumas tags fora de posição ou aparece a tag mesmo, etc..

Para resolver esse problema fiquei procurando até achar um cara que fala de uma nota da SAP q desconhecia até então falando justamente da do  HTML em editor sapscript.

2472157 - Work item description with HTML table in expression is not displayed correctly

Resumindo a nota a estrutura que deve ser usado para montar o HTML deve ser a RSWEBPUB_T_W3HTML que é a mesma estrutura do editor sapscript

Na primeira linha do sapscript no container do workflow deve ser colocado o texto MAIL_HTML_ONLY e depois a tabela que tem o HTML.

Ficaria dessa forma.

==== Eu alterei o TLINE_T  pela RSWEBPUB_T_W3HTML que é mais apropriado






-- OUTRO FATOR IMPORTANTE - No inbox no FIORI não aceita classes com script, na SBWP aparece certo mas no MY INBOX aparece desformatado, tem q colocar os estilos direto na TAG


EXEMPLO HTMLPARA UMA TABELA
LOOP AT lt_doc REFERENCE INTO DATA(lr_doc).


AT FIRST.

APPEND '<html>' TO rt_html.

APPEND '<style>' TO rt_html.

APPEND 'table, th, td{ text-align: left; font-family: "Helvetica"; }' TO rt_html.

APPEND '</style>' TO rt_html.

APPEND '<body>' TO rt_html.

APPEND '<h2>Liberação de Pagamento para Fornecedor</h2> <p>' TO rt_html.

APPEND |<table>| TO rt_html.

APPEND |<tr>| TO rt_html.

APPEND |<th style="width:200px; text-align:left;">Fornecedor:</th>| TO rt_html.

APPEND |<td style="width:500px; text-align:left;">{ lr_doc->supplier }-{ lr_doc->supplierfullname }</td>| TO rt_html.

APPEND |</tr>| TO rt_html.

APPEND |<tr>| TO rt_html.

APPEND |<th style="width:200px; text-align:left;">Data do Lançamento :</th>| TO rt_html.

APPEND |<td style="width:500px; text-align:left;">{ lr_doc->postingdate DATE = ENVIRONMENT }</td>| TO rt_html.

APPEND |</tr>| TO rt_html.

APPEND |<tr>| TO rt_html.

APPEND |<th style=<th style="width:200px; text-align:left;">Data do Vencimento :</th>| TO rt_html.

APPEND |<td style="width:500px; text-align:left;">{ lr_doc->netduedate DATE = ENVIRONMENT }</td>| TO rt_html.

APPEND |</tr>| TO rt_html.

APPEND |<tr>| TO rt_html.

APPEND |<th style="width:200px; text-align:left;">Texto Cabeçalho :</th>| TO rt_html.

APPEND |<td style="width:500px; text-align:left;">{ lr_doc->documentitemtext }</td>| TO rt_html.

APPEND |</tr>| TO rt_html.

APPEND |<tr>| TO rt_html.

APPEND |<th style="width:200px; text-align:left;">Documento criado por :</th>| TO rt_html.

APPEND |<td style="width:500px; text-align:left;">{ lr_doc->accountingdoccreatedbyuser }-{ lv_username }</td>| TO rt_html.

APPEND |</tr>| TO rt_html.

APPEND |<tr>| TO rt_html.

APPEND |</table>| TO rt_html.


APPEND '</p><p/>' TO rt_html.

APPEND '<table>' TO rt_html.

APPEND |<th style="width:80px; text-align:left; border:1px solid ;">Item</th>| TO rt_html.

APPEND |<th style="width:200px; text-align:center; border:1px solid black;">Valor do item</th>| TO rt_html.

APPEND |<th style="width:70px; text-align:left; border:1px solid black;">Moeda</th>| TO rt_html.

APPEND |<th style="width:150px; text-align:left; border:1px solid black;">Centro de Lucro</th>| TO rt_html.

APPEND |<th style="width:500px; text-align:left; border:1px solid black;">Atribuição</th>| TO rt_html.


APPEND '</tr>' TO rt_html.

ENDAT.


APPEND '<tr>' TO rt_html.

APPEND |<th style="width:80px; text-align:left; border:1px solid ;">{ lr_doc->accountingdocumentitem }</td>| TO rt_html.

APPEND |<th style="width:200px; text-align:right; border:1px solid black;">{ abs( lr_doc->amountincompanycodecurrency ) NUMBER = ENVIRONMENT }</td>| TO rt_html.

APPEND |<th style="width:70px; text-align:left; border:1px solid black;">{ lr_doc->companycodecurrency }</td>| TO rt_html.

APPEND |<th style="width:150px; text-align:left; border:1px solid black;">{ lr_doc->profitcenter }</td>| TO rt_html.

APPEND |<th style="width:500px; text-align:left; border:1px solid black;">{ lr_doc->assignmentreference }</td>| TO rt_html.


APPEND '</tr>' TO rt_html.


ENDLOOP.


APPEND '</table>' TO rt_html.

APPEND '</body>' TO rt_html.

APPEND '</html>' TO rt_html.




Transações WORKFLOW


SWU3 - Configuração de jobs automáticos

SWIA - Para eliminar processos de workflow parados na caixa de entrada 


Transação SMLG - Utilizei essa transação para configurar um erro que dava na conexão do servidor do workflow.

Ao testar a conexão dava um erro que não acha o grupo SPACE, nessa transação SMLG o grupo para o servidor estava em branco, eu preenchi com o SPACE e deu certo 


SWU_OBUFmanual buffer refreshSWPCcontinue WF after a system crash
SWI6show all WF instances, work item IDs by BOR/CL name & Object Key (optional)SWI5work item per work center, job, organizational unit, position, user
SWIAwork item administration (WI)SWI2_DIAGerror diagnosis
SWWLdelete work itemSWI2_DEADdeadline monitor
SWWL_TOPLEVELdelete a parent workflow with all of its child work itemsSWI2_DURAprocess duration
SWUDWF diagnosisSWI2_ADM1find orphaned work item
SWELSevent traceSM12lock, unlock the object
SWELdisplay event traceSARAarchiving

 

Workflow Development

SWDDWF builderSWNADMINnotification management
PFTCtemplate, task management (WS, TS)SM37view scheduled and processed jobs
PFTC_DISassigning possible agentSBWPWF inbox
PFACrule creation, editing, testingSWU0simulate the event linkage
SWO1business object builder (BOR)SWEQADMevent queue, preventing RFC-problem
SWUStest, execute WFSWB_CONDall start conditions
SWEINSTall terminating events linkageSWU9WF trace for the session
SWUI_VERIFYWF verificationSWI1selection report for work item
SOSTSAPconnect transmission requestSWPAcustomizing WF runtime system
SWNCONFIGnotification configurationPPOMorganization & staffing
SWEQBROWSERevent waiting in the event queuePPOMEorganizational management, structure & staff assignment, user mapping
SM52view tRFCSWI2_FREQopened task statistic

 

ABAP Development

SE24classesSE11data types, domains, tables
SE37function modules, functionsSE09list of change requests per SAP user
SE38programsSE03change requests management
ST22runtime error logs, dumpsSTMSchange requests transferring