Skip to Content
0
Former Member
Mar 04, 2009 at 06:37 AM

generating a file at the application as doc_no.txt

22 Views

Hi to all experts ,

my requirement is to generate a file at the application server for each physical inventory doc

like 1122323.txt , 1243413.txt for example Here is code . The file path is at the selection screen. but getting an error as file not opened

DATA:output TYPE string.


  OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

  IF sy-subrc EQ 0.

    LOOP AT it_output INTO wa_output.

 CONCATENATE wa_output-iblnr
             wa_output-zeili
             wa_output-matnr
             wa_output-werks
             wa_output-lgort
             wa_output-bstar
             wa_output-erfme
             wa_output-maktx
             wa_output-lgpbe

        INTO output SEPARATED BY '|'.


CONCATENATE p_file wa_output-iblnr INTO p_file.

   TRANSFER output TO p_file .

ENDLOOP.

CLOSE DATASET p_file.