Application Development and Automation 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: 
Read only

read table from FM

Former Member
0 Likes
561

Hi ,

I have found siutable FM, with two selection parameters....

CALL FUNCTION 'Z_SDPRICES'
       EXPORTING
            pricedate_from = lv_pricedate_from
            x_material     = 'X'
       TABLES
            matprice       = ZSD_MATPRICE2.


      LOOP AT ZSD_MATPRICE2.
        MOVE-CORRESPONDING ZSD_MATPRICE2 TO INT.
      IF SY-SUBRC NE 0.
        APPEND INT.
      ENDIF.
     ENDLOOP.

Why my INT table is not filled, the structure of the INT is the same as ZSD_MATPRICE2 .

THX

S.

Edited by: Matt on May 28, 2010 4:15 PM - fixed formatting

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
519

IF SY-SUBRC NE 0. " Are you sure of the relevance of this test?

If the structure are the same, you could also try a APPEND LINES OF zsd_matprice2 TO int.

Regards,

Raymond

Read only

0 Likes
519

sorry i tred everything IF SY-SUBRC EQ 0.

in any case the int table is not filled

brs

Read only

0 Likes
519

- Are both tables defined with a header line (they should not, obsolete, but your code needs it, no ASSIGNIONG or INTO wa)

- Does the FM manage an error raising if no data is loaded (e.g. RAISE NODATA, and use the EXCEPTION option of the FM call)

- Does the APPEND set sy-subrc to an error value (e.g. if INT is a sorted table or this kind of error)

Regards,

Raymond

Read only

Former Member
0 Likes
519

Hi,

If both the internal tables are of same structure you don't need a loop, rather use the below statement.

INT[] = ZSD_MATPRICE2[].

Regards,

Karthik D