|
#1
|
||||
|
||||
Puede ser?
Has intentado desde tu programa Z, usar las funciones OPEN_FORM y WRITE_FORM ????
Saludos, |
#2
|
|||
|
|||
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...... |
#3
|
||||
|
||||
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. |
#4
|
|||
|
|||
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. |
#5
|
||||
|
||||
Sp01
Ve a la transaccion SP01 y encontraras un boton que dice "Further Selection Criteria..." al dar click aparecera una ventana y selecciona la opcion "User-Defined" y en la opcion que dice "PRINT-IMMEDIATELY" si esta sin el chek, colocaselo.
Y dime esto es para imprimir Purchase Orders??? Saludos, |
Herramientas | Buscar en Tema |
Desplegado | |
|
|