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

output file

Former Member
0 Likes
315

HI ,

I need to add a parameter “Extract” and on that I need to put output file destination “kt_extract/NAME” . Just suggest me how to do and how I will send the output into that output file…. The below code is used for open dataset . Please help me in this issue .

.

OPEN DATASET CUSTMAT_FILE FOR OUTPUT IN TEXT MODE.

IF SY-SUBRC NE 0.

PERFORM WRITE_ERROR_TO_SYS_LOG

USING 'PP Data Warehouse' SY-REPID 'PP_CJ'

'Error in Opening Cust Material File' custmat_file.

ENDIF.

Regds

Sabya

HI ,

I need to add a parameter “Extract” and on that I need to put output file destination “kt_extract/NAME” . Just suggest me how to do and how I will send the output into that output file…. The below code is used for open dataset . Please help me in this issue .

.

OPEN DATASET CUSTMAT_FILE FOR OUTPUT IN TEXT MODE.

IF SY-SUBRC NE 0.

PERFORM WRITE_ERROR_TO_SYS_LOG

USING 'PP Data Warehouse' SY-REPID 'PP_CJ'

'Error in Opening Cust Material File' custmat_file.

ENDIF.

Regds

Sabya

1 REPLY 1
Read only

Former Member
0 Likes
295
parameters: p_extr like rlgrap-FILENAME.

OPEN DATASET p_extr FOR OUTPUT IN TEXT MODE.

IF SY-SUBRC NE 0.
PERFORM WRITE_ERROR_TO_SYS_LOG
USING 'PP Data Warehouse' SY-REPID 'PP_CJ'
'Error in Opening Cust Material File' custmat_file.

else.
loop at itab.
transfer itab-data to p_extr.
endloop.

close dataset p_extr.
ENDIF.