on 07-25-2008 4:06 PM
Hi... I´m new using smartforms...
I have the next issue, i need make that my smartmform show me one page for every document that i transfer from the control program... How can i do this???? and i have to show in each page the number of the document and also show every record that it is associate.
Check this example program:
SF_EXAMPLE_03
Regards,
ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi erevy body...
Your answers help me alot but, i have another issue about the control program, here is the complete code...
-
-
*
*& Report ZFI_PC_COMP_RETEN_ISLR
*&
*&----
*
*&
*&
*&----
*
REPORT zfi_pc_comp_reten_islr.
*----
*
***********************************************************************
TABLAS
***********************************************************************
TABLES: bsak, "Contabilidad: Índice secundario p.acreedores (part.comp.)
t001, "Sociedades
t001z, "Datos adicionales de la sociedad
adrc, "Direcciones (gestión central de direcciones)
lfa1, "Maestro de proveedores (parte general
bkpf, "Cabecera de Documento
bseg, "Segmento de documento de Contabilidad
with_item. "Info retención impuestos por tipo ret.y pos.doc.FI
Nombre del modulo de funciones del formulario.
DATA: nombre_modulo_funcion TYPE rs38l_fnam,
control TYPE ssfctrlop,
errtab TYPE tsferror.
************************************************************************
PARAMETERS *
************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK doc WITH FRAME TITLE text-006.
PARAMETERS: p_soc LIKE t001-bukrs, "OBLIGATORY,
p_ejer LIKE bsak-gjahr. "OBLIGATORY.
SELECT-OPTIONS: s_fec FOR bsak-bldat, "OBLIGATORY.
s_dcont FOR bsak-augbl.
SELECT-OPTIONS: s_acre FOR lfa1-lifnr.
SELECTION-SCREEN END OF BLOCK doc.
************************************************************************
DATA *
************************************************************************
DATA: ti_bsak TYPE zcompro OCCURS 0 WITH HEADER LINE.
DATA: ti_bsak_2 TYPE zcompro OCCURS 0 WITH HEADER LINE.
DATA: ti_bsak_3 TYPE zcompro OCCURS 0 WITH HEADER LINE.
DATA: ti_cabe TYPE zcab_compro OCCURS 0 WITH HEADER LINE.
DATA: ti_with_item TYPE zwith_item OCCURS 0 WITH HEADER LINE.
*DATA: tbsak TYPE zbsak OCCURS 0 WITH HEADER LINE.
DATA: zbsak TYPE bsak.
DATA: BEGIN OF aux_it_bsak OCCURS 0.
INCLUDE STRUCTURE ti_bsak.
DATA: END OF aux_it_bsak.
*DATA: BEGIN OF aux_it_bsak_2 OCCURS 0.
INCLUDE STRUCTURE ti_bsak_2.
*DATA: END OF aux_it_bsak_2.
DATA: BEGIN OF aux_it_bsak_3 OCCURS 0.
INCLUDE STRUCTURE ti_bsak_3.
DATA: END OF aux_it_bsak_3.
DATA: BEGIN OF aux_it_cabe OCCURS 0.
INCLUDE STRUCTURE ti_cabe.
DATA: END OF aux_it_cabe.
DATA: BEGIN OF aux_it_with_item OCCURS 0.
INCLUDE STRUCTURE ti_with_item.
DATA: END OF aux_it_with_item.
PERFORM buscar_datos.
PERFORM cargar_formulario1.
*&----
*
*& Form BUSCAR_DATOS
*&----
*
text
*----
*
--> p1 text
<-- p2 text
*----
*
FORM buscar_datos .
Obtener la Razon Social del Agente de Retencion (Dist. Perija)
SELECT SINGLE butxt
INTO CORRESPONDING FIELDS OF ti_cabe
FROM t001
WHERE bukrs EQ p_soc.
MOVE ti_cabe-butxt TO aux_it_cabe-butxt.
Obtener la fecha del documento de pago.
SELECT SINGLE augdt
INTO CORRESPONDING FIELDS OF ti_cabe
FROM bsak
WHERE bukrs EQ p_soc.
MOVE ti_cabe-augdt TO aux_it_cabe-augdt.
Obtener el RIF del Agente de Retencion (Dist. Perija)
SELECT SINGLE paval
INTO CORRESPONDING FIELDS OF ti_cabe
FROM t001z
WHERE bukrs EQ p_soc.
MOVE ti_cabe-paval TO aux_it_cabe-paval.
Obtener Nombre y RIF del Sujeto Retenido.
SELECT name1 stcd1 adrnr
INTO CORRESPONDING FIELDS OF ti_cabe
FROM lfa1
WHERE lifnr IN s_acre.
MOVE ti_cabe-adrnr TO aux_it_cabe-adrnr.
MOVE ti_cabe-name1 TO aux_it_cabe-name1.
MOVE ti_cabe-stcd1 TO aux_it_cabe-stcd1.
ENDSELECT.
Obtener la direccion del Agente de Retencion
SELECT SINGLE street
INTO CORRESPONDING FIELDS OF ti_cabe
FROM adrc
WHERE addrnumber EQ ti_cabe-adrnr.
MOVE ti_cabe-street TO aux_it_cabe-street.
Buscar los datos del detalle del Comprobante
Busqueda de los docomentos contables en BSAK
SELECT * FROM bsak
INTO CORRESPONDING FIELDS OF ti_bsak
WHERE bukrs EQ p_soc
AND lifnr IN s_acre
AND bldat IN s_fec
AND augbl IN s_dcont
AND gjahr EQ p_ejer
AND buzei = 001
AND blart EQ 'KR'
AND qbshb NE ''.
MOVE-CORRESPONDING ti_bsak TO aux_it_bsak.
APPEND ti_bsak.
APPEND aux_it_bsak.
ENDSELECT.
ENDFORM. " BUSCAR_DATOS
*&----
*
*& Form CARGAR_FORMULARIO1
*&----
*
text
*----
*
--> p1 text
<-- p2 text
*----
*
FORM cargar_formulario1 .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZFI_RET_ISLR_FORM'
IMPORTING
fm_name = nombre_modulo_funcion
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid
TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
********************************************************************
control-no_dialog = 'X'.
control-preview = 'X'.
control-no_open = 'X'.
control-no_close = 'X'.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
ARCHIVE_PARAMETERS =
USER_SETTINGS = 'X'
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJ =
OUTPUT_OPTIONS =
control_parameters = control
IMPORTING
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
error handling
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
*********************************************************************
Ejecuta el modulo de funcion que muestra los datos en el formulario.
LOOP AT ti_bsak INTO ti_bsak_2.
SELECT bldat xblnr
INTO CORRESPONDING FIELDS OF ti_bsak_3
FROM bkpf
WHERE belnr = ti_bsak-belnr.
ENDSELECT.
Monto del importe
SELECT dmbtr
INTO CORRESPONDING FIELDS OF ti_bsak_3
FROM bseg
WHERE belnr EQ ti_bsak-belnr
AND bschl = 31.
ENDSELECT.
Base Imponible, % de Retencion y ISLR Retenido.
SELECT * FROM with_item
INTO CORRESPONDING FIELDS OF ti_with_item
WHERE belnr EQ ti_bsak-belnr
AND witht NE 'I1'
AND witht NE 'I2'.
MOVE-CORRESPONDING ti_with_item TO aux_it_with_item.
APPEND aux_it_with_item.
ENDSELECT.
CALL FUNCTION nombre_modulo_funcion
EXPORTING
archive_index =
archive_parameters =
control_parameters = control
mail_appl_obj =
mail_recipient =
mail_sender =
output_options =
user_settings = 'X'
ws_it_bsak_2 = ti_bsak_2
ws_it_cabe = aux_it_cabe
ws_it_bsak_3 = ti_bsak_3
ws_it_with_item = ti_with_item
importing document_output_info =
job_output_info =
job_output_options =
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
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.
*
**********************************************************************************
CALL FUNCTION 'SSF_CLOSE'
IMPORTING
JOB_OUTPUT_INFO =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
error handling
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
analyse internal error table of Smart Forms
CALL FUNCTION 'SSF_READ_ERRORS'
IMPORTING
errortab = errtab.
IF NOT errtab IS INITIAL.
add your handling
EXIT.
ENDIF.
**********************************************************************************
the problem is when i call the smartform appears an error with the structure that i´m using to do the loop cicle...
Any opinion abut it...
Thanks.
Hi,
In your loop node... you have events
Sort on Event begin.... It works same as at new event in reports
provide the document field name and select the check box under sort on event begin
Under that use command node for triggering new page
and then display the document number in the text element.
make sure that you use the condition for the command... select not in first page checkbox
this should solve your issue
regards
padma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I´m runnig my program and when call the smartform, an error appears and says this...
CALL_FUNCTION_PARM_MISSING
CX_SY_DYN_CALL_PARAM_MISSING
so, tells me that is a parameter that i´m not passing to the SF, so the parameter is de internal table where i´m doing the Loop cicle...
So i dont get it what or why is doing this...
-
-
Hi everybody i already fix the problem....Thanks for everything....
Regards.
Krystian....
Edited by: krystian parada on Jul 29, 2008 8:51 PM
The question was answered parcially but there´s details that i have some doubts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
This is like triggerring the form for every document.
I am not sure whether it will work or not
But you can try this.....
Loop at itab.
call the function module which is getting generated after activating the smartform.
Here you have to send the table with one header and multiple line items then
for the first Header it will print all the data.
for then next record ( like next header send only one header and multiple items associated with it ).
Endloop.
regards,
Venkatesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.