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

upload tab delimted file without using GUI_UPLOAD

Former Member
0 Likes
426

hi gurus,

my requirement is I have to upload a Tab - delimited text file into a internal table. this should happen as a background job due to which, I cannot use GUI_UPLOAD.

please provide me with code snippets using open dataset and close dataset.

points will be awarded for best code!

hi gurus,

my requirement is I have to upload a Tab - delimited text file into a internal table. this should happen as a background job due to which, I cannot use GUI_UPLOAD.

please provide me with code snippets using open dataset and close dataset.

points will be awarded for best code!

1 REPLY 1
Read only

Former Member
0 Likes
382

Hello,

Check this sample.


CONSTANTS: CON_TAB TYPE X VALUE '09'.
  OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE.
  IF SY-SUBRC = 0.
loop at g_T_outtab.
        CONCATENATE G_T_OUTTAB-VBELN
                    G_T_OUTTAB-POSNR
                    G_T_OUTTAB-VKBUR
                    L_F_POSID
                    G_T_OUTTAB-BSTKD
                    L_F_NETWR
                    L_F_ERDAT_OR
                    L_F_ERDAT_IN
                    G_T_OUTTAB-VBELN_IN
                    L_F_ERDAT_DE
                    G_T_OUTTAB-VBELN_DE
                    INTO OUTPUT
                    SEPARATED BY CON_TAB.
      TRANSFER OUTPUT TO P_FILE.
endloop.
endif.
  CLOSE DATASET P_FILE.

Cheers,

Vasanth