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

Regarding Dataset

Former Member
0 Likes
310

HI..

I want sample code on Dataset.

Requirement : I uploaded one excel file into internaltable using FM "ALSM_EXCEL_TO_INTERNAL_TABLE.

Now I want to upload this internal table into Application Server file.

After that I want to get back that data into internal table from Application server file.

How can I do It using DataSet.

Please send me code for my requiremnt and for General Dataset also.

Regards

Sandeep.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
293

Try This

DAta : gv_dataset1 TYPE char100.

Note : p_file is the filename.

  gv_dataset1 = p_file.
    OPEN DATASET gv_dataset1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
*         MESSAGE
    ELSE.
      WHILE ( sy-subrc EQ 0 ).
        READ DATASET gv_dataset1 INTO wa_itab.
        IF NOT wa_itab IS INITIAL.
          APPEND wa_itab TO itab.
        ENDIF.
        CLEAR wa_itab.
      ENDWHILE.
    ENDIF.
    CLOSE DATASET gv_dataset1.

1 REPLY 1
Read only

Former Member
0 Likes
294

Try This

DAta : gv_dataset1 TYPE char100.

Note : p_file is the filename.

  gv_dataset1 = p_file.
    OPEN DATASET gv_dataset1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
*         MESSAGE
    ELSE.
      WHILE ( sy-subrc EQ 0 ).
        READ DATASET gv_dataset1 INTO wa_itab.
        IF NOT wa_itab IS INITIAL.
          APPEND wa_itab TO itab.
        ENDIF.
        CLEAR wa_itab.
      ENDWHILE.
    ENDIF.
    CLOSE DATASET gv_dataset1.