Skip to Content
author's profile photo Former Member
Former Member

upload tab delimted file without using GUI_UPLOAD

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! 😊

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2008 at 11:46 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.