Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

erorr in perform tables

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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!

4 REPLIES 4

former_member150733
Contributor
0 Kudos

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.

0 Kudos

HI Anish Thomas

U CAN GIVE AN EXAMPLE?

REGARDS

Former Member
0 Kudos

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!

former_member219399
Active Participant
0 Kudos

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