Temp-Table x Handle (Parâmetro)

leite1969

New Member
Caros colegas,

Sou Brasileiro e não tenho muito conhecimento em Inglês, portanto estou postando esta mensagem em português, mas se alguém conseguir ajudar-me na minha dúvida pode ser em ingles que estarei traduzindo no google, vamos lá:

Temos um Sistema ERP (Datasul) que trabalha com funções de EPC (External Procedure Call), onde podemos customizar programas recebendo do produto ERP uma tabela com pontos de chamadas, onde é possível efetuarmos manutenções no programa ERP (não possuímos fonte aberto - somente os arquivos *.r).

Estou precisando ler uma tabela temporária criada no relatório do ERP, o parâmetro passado para o meu programa seria o HANDLE da tabela temporária, estou precisando saber como, no meu programa, transformar a STRING do Handle enviada através da tabela tt-epc e assim conseguir efetuar a leitura da tabela temporária no meu programa.

Não posso receber como INPUT-OUPUT PARAMETER a tabela temporária gerada no programa A (ERP) pois estes programa passam como INPUT-OUPUT a tabela TT-EPC com o valor de STRING a HANDLE da tabela tt-ge-mov.

Em anexo, estou inserido um exemplo de como seria a situação desejada, quem ajudar agradeço muito, já tentei com várias pessoas aqui no Brasil e não tive retorno até o momento, inclusive com a Datasul.

Obrigado pela ajuda,

Eduardo Leite.
Analista de Sistema


/**** Traduzido pelo Google - Translated for the Google ****/

Expensive colleagues, I am Brazilian and I do not have much knowledge in English, therefore I am postando this message in Portuguese, but if somebody to obtain to help me in my doubt can be in English who I will be translating google, goes there: We have a System ERP (Datasul) that it works with EPC functions (External Procedure Call), where we can customizar programs receiving from product ERP a table with points of invocation, where is possible to effect maintenances in program ERP (we do not only possess open source - the archives * r). I am needing to read a bred temporary table in the report of the ERP, the parameter passed to my program would be the HANDLE of the temporary table, I am needing to know as, in my program, to transform the STRING of the Handle sent through the table tt-epc and thus to obtain to effect the reading of the temporary table in my program. I cannot receive as Input-ouput PARAMETER the temporary table generated in the A program (ERP) therefore this program passes as Input-ouput the Tt-epc table with the value of STRING the HANDLE of table tt-GE-mov. In annex, I am inserted an example of as it would be the desired situation, who to help I am thankful very, already I tried here with some people in Brazil and I did not have return until the moment, also with the Datasul. Debtor for the aid,

Eduardo Leite.
Analyst of System
 

Attachments

  • prog_01.p
    892 bytes · Views: 16
  • prog_02.p
    880 bytes · Views: 15
You can try to use the WIDGET-HANDLE function that converts a string into a widget handle.

It is worth using the VALID-HANDLE FUNCTION as well, to check that the handle can be used.

message valid-handle (widget-handle (p-ind-event)) view-as alert-box.

So, in your examples, prog02.p gets passed the temp-table tt-epc containing val-parameter, widget-handle converts this to a valid handle that you can use in your program.

Simon


/***** Programa c:\temp\prog_01.p ******/
DEF TEMP-TABLE tt-epc NO-UNDO
FIELD cod-event AS CHAR FORMAT "x(12)"
FIELD cod-parameter AS CHAR FORMAT "x(32)"
FIELD val-parameter AS CHAR FORMAT "x(54)"
INDEX id IS PRIMARY cod-parameter cod-event ASCENDING.

DEF TEMP-TABLE tt-ge-mov NO-UNDO
FIELD data AS DATE FORMAT "99/99/9999"
FIELD tempo AS INTEGER FORMAT "->,>>>,>>9"
FIELD sequencia AS INTEGER FORMAT "->,>>>,>>9".

CREATE tt-epc.

ASSIGN tt-epc.cod-event = "Update-fields"
tt-epc.cod-parameter = "tt-ge-mov(handle)".

&IF PROVERSION >= "9" &THEN
ASSIGN
tt-epc.val-parameter = STRING(TEMP-TABLE tt-ge-mov:HANDLE).
&ENDIF

RUN prog02.p (INPUT "",
INPUT-OUTPUT TABLE tt-epc).


/***** Programa c:\temp\prog_02.p ******/
DEF TEMP-TABLE tt-epc NO-UNDO
FIELD cod-event AS CHAR FORMAT "x(12)"
FIELD cod-parameter AS CHAR FORMAT "x(32)"
FIELD val-parameter AS CHAR FORMAT "x(54)"
INDEX id IS PRIMARY cod-parameter cod-event ASCENDING.
DEF TEMP-TABLE tt-ge-mov NO-UNDO
FIELD data AS DATE FORMAT "99/99/9999"
FIELD tempo AS INTEGER FORMAT "->,>>>,>>9"
FIELD sequencia AS INTEGER FORMAT "->,>>>,>>9".

DEF INPUT PARAM p-ind-event AS CHAR NO-UNDO.
DEF INPUT-OUTPUT PARAM TABLE FOR tt-epc.
FIND FIRST tt-epc
WHERE tt-epc.cod-event = "Update-fields"
AND tt-epc.cod-parameter = "tt-ge-mov(handle)" NO-LOCK NO-ERROR.
IF AVAIL tt-epc THEN DO:
/*** Efetuar a leitura da tabela tempor ria atrav‚s do handle passado na tabela tt-epc ***/
message
valid-handle (widget-handle (tt-epc.val-parameter))
tt-epc.cod-event
tt-epc.cod-parameter
tt-epc.val-parameter
view-as alert-box.
END.
 
Top