08-30-2006 8:58 PM
hello all,
is there a way to convert a table with header line to a structure?
thanks in advanced'
dana.
08-30-2006 9:01 PM
Hi,
I am not sure if you are looking something like this..
DATA: BEGIN OF itab occurs 0.
INCLUDE STRUCTURE Z_MY_DDIC_STURCT.
DATA: end of itab.
OR.
DATA: S_STRUCTURE LIKE ITAB..
READ TABLE ITAB INTO S_STRUCTURE WITH KEY...
Thanks,
Naren
08-30-2006 9:06 PM
Can you elaborate more on what exactly you are trying to achieve?
Sunil Achyut
08-30-2006 9:10 PM
for the first time i do smartforms.
and when i finish writing my code and ran the program, i found that the function that call the smartforms doesnt use internal table - it used structure only.
so i want to know if there is a way that i can move data from internal table to a structure so that the function will use the structure.
08-30-2006 9:13 PM
In a structure you can hold only one row, so you have to use a loop and pass the data to smartforms. Can you specify what FM you are using.
Sunil Achyut
08-30-2006 9:26 PM
fm:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = name
IMPORTING
FM_NAME = lf_fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
CALL FUNCTION lf_fm_name
EXPORTING
CONTROL_PARAMETERS = control
parnr = parnr
NAME1 = NAME1
TELF1 = TELF1
vtext = vtext
TABLES
itab_cust = itab_cust.
the error i got:
08-30-2006 9:34 PM
the error i got:
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_TYPE',
was neither
caught nor passed along using a RAISING clause, in the procedure "SMARTFORMS"
"(FORM)"
.
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
The reason for the exception is:
In the function "/1BCDWB/SF00000137" the STRUCTURE parameter "ITAB_CUST" is
typed in such a way
that actual parameters are not valid, unless they are compatible
according to the Unicode fragment view.
08-30-2006 9:34 PM
If I understood your question right, doing the following should resolve your problem
CALL FUNCTION lf_fm_name
EXPORTING
CONTROL_PARAMETERS = control
parnr = parnr
NAME1 = NAME1
TELF1 = TELF1
vtext = vtext
TABLES
itab_cust = itab_cust[].
Just add the braces and it should do it. This is assuming <b>itab_cust</b> is an internal table with a header line.
FYI - Any parameter under Tables Tab is a internal table and not a structure, and since its an internal table with a header line you have to enclose the '[]' braces to indicate the same.
hith
Sunil Achyut
Message was edited by: Sunil Achyut
08-30-2006 9:41 PM
you can use like this-->
fm:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = name
IMPORTING
FM_NAME = lf_fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
data mystruct type line of itab.
loop at itab into mystruct.
CALL FUNCTION lf_fm_name
EXPORTING
CONTROL_PARAMETERS = control
parnr = parnr
NAME1 = NAME1
TELF1 = TELF1
vtext = vtext
TABLES
itab_cust = mystruct.
endloop.
are you using this for smartform or pdfform?
in either cases it will print the forms as different documents. suppose if you are having 10 lines in your internal table then it will give 10 diff documents.
reward me if this is helpful.
08-31-2006 3:48 AM
im sorry but now i understood what i did:
the structure that the function get not match to the struc. that the SF define.
sorry to bother you,
thank you all very much,
dana.