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: 

reading the file from application server for record number of times

0 Kudos

As i am picking file from application server As it is having only two records right now

so i am using DO 2 TIMES . loop

but is case if i don't know exactly how much record it posses how to use the logic.

please see the image uploaded

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sachin.

Try this way...

OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc EQ 0.

*  DO 2 TIMES.

   DO.  

    READ DATASET gv_file INTO li_strng.

    IF sy-subrc EQ 0.

      APPEND li_strng TO it_strng.

    ELSE.

      EXIT.

    ENDIF.

  ENDDO.

ENDIF.

Rewardful points if useful.

Regards,

João

2 REPLIES 2

Former Member
0 Kudos

Hi Sachin.

Try this way...

OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc EQ 0.

*  DO 2 TIMES.

   DO.  

    READ DATASET gv_file INTO li_strng.

    IF sy-subrc EQ 0.

      APPEND li_strng TO it_strng.

    ELSE.

      EXIT.

    ENDIF.

  ENDDO.

ENDIF.

Rewardful points if useful.

Regards,

João

0 Kudos

Thanks Brother !!