|
#1
|
|||
|
|||
Me gustaria saber con que tipo de formulario estas trabajando y desde donde es llamado.
Lo otro es que dentro del formulario deberias tener elementos de texto estandares con los cuales puedes hacer loop's a tablas estandares, Tu puedes usar como referencia uno de esos elementos de texto y colgar tu tabla interna ahi. |
#2
|
|||
|
|||
La llamada la hago desde el estandar de SAP f.18, me he creado un SapScript que es una copia de otro estandar, ya estaba todo creado, entonces las llamadas que hacia al otro las hace igual a este, por lo que yo no controlo las llamadas a las ventanas y a los elementos.
Entonces para hallar los datos que queria, me he creado un programa nuevo, unicamente para obtenerlos , un z_programa, y lo llamo desde las ventanas del main de mi SapScript con: perform obtener in z_programa using && .... changing && .... endperform Lo que quiero es que me liste una i_tab que hay dentro de ese método obtener, pero que me liste toda la tabla, no solo la primera linea. Espero haberme explicado.... |
#3
|
|||
|
|||
Dentro de los elementos de texto de la copia del formulario, uno de ellos debe hacer referencia alguna tabla estandar (puedes guiarte de acuerdo a los campos que se imprimen en la parte inferior del elemento de texto)... inclusive puede que uno de esos te sirva para la tabla z que intentas imprimir.
|
#4
|
||||
|
||||
Puede ser?
Has intentado desde tu programa Z, usar las funciones OPEN_FORM y WRITE_FORM ????
Saludos, |
#5
|
|||
|
|||
Si lo hago, pero cuando voy haciendo el debug al llamar a la funcion write_form se me queda en la siguiente instruccion:
check co_perform-active <> true. teniendo ambas como valor X. por lo que sale de la funcion sin ir a ninguna instruccion mas de la funcion...... |
#6
|
||||
|
||||
Usar un loop
Yo te recomendaria que coloques dentro de un loop la funcion write_form, para que no solo te muestre el primer elemento y puedas ver todo el contenido de la tabla interna.
LOOP AT itab. CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'CAB' * FUNCTION = 'SET' * TYPE = 'BODY' WINDOW = 'MAIN' * IMPORTING * PENDING_LINES = EXCEPTIONS ELEMENT = 1 FUNCTION = 2 TYPE = 3 UNOPENED = 4 UNSTARTED = 5 WINDOW = 6 BAD_PAGEFORMAT_FOR_PRINT = 7 SPOOL_ERROR = 8 CODEPAGE = 9 OTHERS = 10 . IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. ENDLOOP. |
#7
|
|||
|
|||
Ya lo tengo así, he intentado hacerlo poniendo antes un open_form y nada la cuestion es que
check co_perform-active <> true tienen el mismo valor, por lo que no ejecuta las siguientes instrucciones..., estando ya en el codigo de la funcion write_form. Pasa del primer rojo al ultimo, porque tienen los dos el valor X. function write_form. *"---------------------------------------------------------------------- *"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(ELEMENT) DEFAULT SPACE *" VALUE(FUNCTION) DEFAULT 'SET' *" VALUE(TYPE) DEFAULT 'BODY' *" VALUE(WINDOW) DEFAULT 'MAIN' *" EXPORTING *" VALUE(PENDING_LINES) *" EXCEPTIONS *" ELEMENT *" FUNCTION *" TYPE *" UNOPENED *" UNSTARTED *" WINDOW *" BAD_PAGEFORMAT_FOR_PRINT *" SPOOL_ERROR *" CODEPAGE *"---------------------------------------------------------------------- data: create type i, etype like itcca-tdetype. check co_perform-active <> true. pending_lines = false. if rstxc-tddebug = true. perform debug_write_form using element function type window. endif. if rstxc-tdopen = false. call function 'SAPSCRIPT_MESSAGE_DEF' exporting no = 423 v1 = 'WRITE_FORM'. perform exception. message a423 with 'WRITE_FORM' raising unopened. endif. if rstxc-tdclose = true. call function 'SAPSCRIPT_MESSAGE_DEF' exporting no = 443 v1 = 'WRITE_FORM'. perform exception. message a443 with 'WRITE_FORM' raising unstarted. endif. * Start Parser, if not started if type = 'BODY' or window ne system_window_main. if rstxc-tdwinopen = false. perform pa_open_windows. endif. if rstxc-tdstarted = false and window = system_window_main. perform pa_open. if rstxc-tddebug = true. perform debug_write_form using element function type window. endif. endif. endif. * Type case type. when 'TOP'. if window ne 'MAIN'. call function 'SAPSCRIPT_MESSAGE_DEF' exporting no = 424 v1 = 'TOP'. perform exception. message a424 with 'TOP' raising type. endif. etype = etype_top. when 'BOTTOM'. if window ne 'MAIN'. call function 'SAPSCRIPT_MESSAGE_DEF' exporting no = 424 v1 = 'BOTTOM'. perform exception. message a424 with 'BOTTOM' raising type. endif. etype = etype_bottom. when 'BODY'. etype = etype_current. when others. call function 'SAPSCRIPT_MESSAGE_DEF' exporting no = 425 v1 = type. perform exception. message a425 with type raising type. endcase. * Read Windows read table windows with key tdwindow = window tdetype = etype binary search. if sy-subrc ne 0. call function 'SAPSCRIPT_MESSAGE_DEF' exporting no = 426 v1 = window v2 = rstxc-tdform. perform exception. message a426 with window rstxc-tdform raising window. endif. * Read ELEMENTS read table elements with key tdwindow = window tdevent = element binary search. if sy-subrc ne 0. call function 'SAPSCRIPT_MESSAGE_DEF' exporting no = 427 v1 = element v2 = window v3 = rstxc-tdform. perform exception. message a427 with element window rstxc-tdform raising element. endif. perform tx_set using tx_form_txtind. if tx_catalog-tdastyle ne space. clear tx_catalog-tdastyle. modify tx_catalog index tx_catalog-tdtxtind. endif. * Function case function. when ev_func_set. perform ev_set_element using etype create. when ev_func_append. if window = system_window_main and etype = etype_current. perform ev_set_element using etype create. else. perform ev_append_element using etype create. endif. when ev_func_delete. perform ev_delete_element. when others. call function 'SAPSCRIPT_MESSAGE_DEF' exporting no = 428 v1 = function. perform exception. message a428 with function raising function. endcase. if rstxc-tddebug = true. perform debug_func using elements-tdfromline. debug-break. "#EC NOBREAK endif. * Main check window = system_window_main. case etype. when etype_current. ev_actual = create. perform pa_body. when etype_bottom. perform pa_bottom. if pc_bottom_height > ft-bot_height. pending_lines = true. endif. when etype_top. endcase. endfunction. |
Herramientas | Buscar en Tema |
Desplegado | |
|
|