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

Conversion spool Request to internal table

Former Member
0 Likes
1,070

Hi all,

Function Module to convert the spool request data to the internal table .

Regards,

S.Janani

6 REPLIES 6
Read only

Former Member
0 Likes
836

Use FM : RSPO_RETURN_SPOOLJOB

Pass RAW for DESIRED_TYPE parameter ...

Read only

Former Member
0 Likes
836

Check this Function

RSPO_DOWNLOAD_SPOOLJOB

You will get the clear Picture.

Read only

Former Member
0 Likes
836

Hi Janani,

You can use

RSPO_RETURN_ABAP_SPOOLJOB

pass the spool number and internal table name.

Reward if helpful.

Regards,

Mandeep

Read only

Former Member
0 Likes
836

I have got one issue, please give me the clarification.

To create a Generic program to move the file from one application server directory to other using date and time stamp.( In Selection screen)

Give two input fields for file paths and paths could be any up to the user.

(BW is loading data from EDI flat files for Home Depot. EDI generates the same file name every time. To avoid the data to be appended, we need to develop a program in BW to trigger the file name change after the data is loaded to BW.)

How can i do, please tell me

Read only

0 Likes
836

data: begin of itab occurs 0,

rec(1000) type c,

end of itab.

data: wa(1000) type c.

data : l_ref type REF TO CX_SY_FILE_IO,

l_text type string.

data: p_file type localfile.

data: p_file1 type localfile,

l_dummy type n.

data: ifile type table of salfldir with header line.

parameters: p_sorc type salfile-longname,

p_dest type salfile-longname.

call function 'RZL_READ_DIR_LOCAL'

EXPORTING

name = p_sorc

TABLES

file_tbl = ifile

EXCEPTIONS

argument_error = 1

not_found = 2

others = 3.

describe table ifile lines sy-tfill.

loop at ifile.

concatenate p_sorc '/' ifile-name into p_file.

concatenate p_dest '/' ifile-name into p_file1.

clear itab. refresh itab.

OPEN DATASET p_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.

if sy-subrc = 0.

open dataset p_file1 for output in text mode encoding default.

if sy-subrc = 0.

do.

try.

read dataset p_file into wa.

if sy-subrc <> 0.

exit.

endif.

transfer wa to p_file1.

catch CX_SY_FILE_IO into l_ref.

l_text = l_ref->get_text( ).

write: /'sub Directory found under', l_text.

l_dummy = l_dummy + 1.

exit.

ENDTRY.

enddo.

endif.

if l_dummy > 0.

write : / p_file , 'Was not copied to' , p_file1.

else.

write : / p_file , 'Was copied to ' , p_file1 .

endif.

endif.

close dataset p_file.

close DATASET p_file1.

clear l_dummy.

endloop.

Read only

0 Likes
836

Hi Anji,

For F4 Help see this code and TRY..........

selection-screen begin of block b1 with frame title text-001.

parameters : p_file1 type char80 lower case, "sourcefile

p_ftype(30) type c,

p_file2 type char80 lower case. "Target file

selection-screen end of block b1.

Concatenate p_file2 lv_date lv_time into p_file2.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.

  • Get the file name using file chooser

PERFORM get_file_name.

&----


*& Form get_file_name

&----


  • Get File Name

----


form get_file_name .

DATA : l_it_filetable TYPE filetable,

l_wa_file LIKE LINE OF l_it_filetable,

l_rc TYPE i,

l_filename TYPE string.

  • Use global class CL_GUI_FRONTEND_SERVICES for all front end activities

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

window_title = 'File selection box'

CHANGING

file_table = l_it_filetable

rc = l_rc

EXCEPTIONS

file_open_dialog_failed = 1

cntl_error = 2

error_no_gui = 3

not_supported_by_gui = 4

OTHERS = 5.

IF sy-subrc = 0.

LOOP AT l_it_filetable INTO l_wa_file.

  • Read the first entry as the file name

l_filename = l_wa_file-filename.

EXIT.

ENDLOOP.

p_file1 = l_filename.

ENDIF.

endform. " get_file_name

Then You can get F4 Help Box same you can do for P_File2 also.