07-03-2007 10:49 AM
Hallow
I using this ferform and I have eroor in tables what is wrong?
DATA:ls_prelp TYPE prelp, " semi-transparent infotype structure
ls_p0000 TYPE p0000,
lt_p0000 TYPE STANDARD TABLE OF p0000,
ls_p0001 TYPE p0001,
lt_p0001 TYPE STANDARD TABLE OF p0001.
LOOP AT infty_tab_after INTO ls_prelp.
CASE <wa_lcl_pers_tab>-infty.
WHEN '0000'.
PERFORM get_pnnn TABLES lt_p0000 USING ls_prelp ls_p0000.
WHEN '0001'.
PERFORM get_pnnn TABLES lt_p0001 USING ls_prelp ls_p0001.
ENDCASE.
ENDLOOP.
FORM get_pnnn <b>TABLES p_lt_p0000 TYPE any</b> USING p_ls_prelp p_ls_p0000.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn "Convert: semi-transparent -> transparent infotype
EXPORTING
prelp = p_ls_prelp
IMPORTING
pnnnn = p_ls_p0000.
APPEND p_ls_p0000 TO p_lt_p0000.
The eroor
Is
For typing of TABLES parameters, only table types should be used . . .
regards
07-03-2007 10:55 AM
Hi,
Refer below program:
REPORT demo_mod_tech_example_6.
TYPES: BEGIN OF line,
col1 TYPE i,
col2 TYPE i,
END OF line.
DATA: itab TYPE STANDARD TABLE OF line WITH HEADER LINE,
jtab TYPE STANDARD TABLE OF line.
PERFORM fill TABLES itab.
MOVE itab[] TO jtab.
PERFORM out TABLES jtab.
FORM fill TABLES f_itab LIKE itab[].
DO 3 TIMES.
f_itab-col1 = sy-index.
f_itab-col2 = sy-index ** 2.
APPEND f_itab.
ENDDO.
ENDFORM.
FORM out TABLES f_itab LIKE jtab.
LOOP AT f_itab.
WRITE: / f_itab-col1, f_itab-col2.
ENDLOOP.
ENDFORM.
Reward if useful!
07-03-2007 10:55 AM
You cannot use type <b>any</b> with the perform statement.
Either replace <b>any</b> with p0000 or p0001, if they are type compactible. Or try removing <b>any</b> all together. Otherwise I think you need to do two different Forms.
07-03-2007 11:21 AM
07-03-2007 10:55 AM
Hi,
Refer below program:
REPORT demo_mod_tech_example_6.
TYPES: BEGIN OF line,
col1 TYPE i,
col2 TYPE i,
END OF line.
DATA: itab TYPE STANDARD TABLE OF line WITH HEADER LINE,
jtab TYPE STANDARD TABLE OF line.
PERFORM fill TABLES itab.
MOVE itab[] TO jtab.
PERFORM out TABLES jtab.
FORM fill TABLES f_itab LIKE itab[].
DO 3 TIMES.
f_itab-col1 = sy-index.
f_itab-col2 = sy-index ** 2.
APPEND f_itab.
ENDDO.
ENDFORM.
FORM out TABLES f_itab LIKE jtab.
LOOP AT f_itab.
WRITE: / f_itab-col1, f_itab-col2.
ENDLOOP.
ENDFORM.
Reward if useful!
07-03-2007 11:49 AM
Hi,
Check this coding.
with regards,
Vamsi
DATA:ls_prelp TYPE prelp, " semi-transparent infotype structure
ls_p0000 TYPE p0000,
lt_p0000 TYPE STANDARD TABLE OF p0000,
ls_p0001 TYPE p0001,
lt_p0001 TYPE STANDARD TABLE OF p0001.
PERFORM get_pnnn TABLES lt_p0000 USING ls_prelp ls_p0000.
&----
*& Form GET_PNNN
&----
text
----
-->P_LT_P0000 text
-->P_LS_PRELP text
-->P_LS_P0000 text
----
FORM GET_PNNN TABLES P_LT_P0000
USING P_LS_PRELP
P_LS_P0000.
loop at p_lt_p0000.
endloop.
ENDFORM. " GET_PNNN