Skip to Content
0
Former Member
Apr 06, 2006 at 01:37 AM

PRoblem regarding Submit -> Open/Transfer/Close Dataset

27 Views

Hello again, I know I keep asking the same topic (regarding datasets) for the past week. Its been a new topic for me. However, I have a program which I am testing that is shown below.

<b>REPORT ZPROG_COOL7 NO STANDARD PAGE HEADING.

DATA: ITAB_LIST TYPE STANDARD TABLE OF ABAPLIST WITH HEADER LINE.

PARAMETERS: PNAME TYPE SYCPROG. (this does nothing yet ...)

SUBMIT ZPROGRAM EXPORTING LIST TO MEMORY AND RETURN

USING SELECTION-SET 'CEDEX'.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = ITAB_LIST

  • EXCEPTIONS

  • NOT_FOUND = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF SY-SUBRC = 0.

CALL FUNCTION 'WRITE_LIST'

TABLES

LISTOBJECT = ITAB_LIST.

ENDIF.

DATA: LD_FILENAME TYPE LOCALFILE.

DATA: I_MONTH TYPE TABLE OF T247 WITH HEADER LINE.

DATA: IHTML TYPE TABLE OF W3HTML WITH HEADER LINE.

CALL FUNCTION 'WWW_LIST_TO_HTML'

  • EXPORTING

  • list_index = sy-lsind

TABLES

HTML = IHTML.

CLEAR IHTML.

LD_FILENAME = '
H******\SAPReport\death.html'.

OPEN DATASET LD_FILENAME FOR OUTPUT IN BINARY MODE.

LOOP AT IHTML.

TRANSFER IHTML TO LD_FILENAME.

ENDLOOP.

CLOSE DATASET LD_FILENAME.

CLEAR: LD_FILENAME.</b>

As you can see it is suposed to get a list from a diffrent program, write the list, and then transfer the list into a directory in the SAP application server. This all works fine on foreground but in Background Proccessing the story is diffrent.

Here is the problem:

If Iam to send a job in background, the report will generate fine if you view the spool list <b>but there HTML file that is supposed to be saved becomes blank.</b> Is there a way to solve this issue? Thank you all take care, and good day.