Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting Data in SAP

Status
Not open for further replies.

csharpe2

Technical User
Apr 1, 2008
2
US
Please reference Thread thread649-1412358. However, my situation is slightly different and more complex... I want to be able to export data from either a table, query, or ABAP automatically (based on a user defined frequency) and have it automatically FTP to a machine or email address. So again, I want to be able to "schedule" a job, it automatically run, and then automatically send to an email address or machine.

Thanks... Chris.
 
Use crystal reports and a crystal scheduler program.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Here is an overview of a solution provided to us by our SAP consultants that does just what you are talking about, using FTP for the file transfer.

1) An ABAP program extracts data from SAP and writes to a flat file.

2) An EXTERNAL COMMAND is defined for the FTP process with transaction SM69. It invokes FTP with an answer script that you must provide.

3) The ABAP program and the EXTERNAL COMMAND are combined as steps in a BACKGROUND JOB, which can be set to run on a scheduled basis. I don't know the transaction to create the background job, but it is scheduled thru transaction SM37.
 
Thanks MadMichael.... We would want to get the data to be exported either via a SQ00 Query or via a custom ABAP report. Is the "export" ABAP program different depending on which type of report is used? Do you have a sample program that is used to export the data.. that you can share?
 
As I said, this was developed by our SAP consultants, so I don't have a complete 'proof of concept' sample that I can share. I'm an ABAP newbie myself, only having taken a single 'fundamentals' class.

I did find the code routine that writes the flat file, hope it helps.

Code:
** Opening the file in output mode for writing
  open dataset P_DESK for output in text mode encoding default.
  if SY-SUBRC <> 0.      "If Error in opening the file
    message S000(SU) with 'File could not be open'.
    leave list-processing.
  endif.

  loop at TB_OUTPUT.
    clear L_CHAR.
    concatenate TB_OUTPUT-NAME  TB_OUTPUT-STREET  TB_OUTPUT-STREET4 TB_OUTPUT-CITY TB_OUTPUT-STATE
    TB_OUTPUT-PHONE TB_OUTPUT-CONTACT TB_OUTPUT-PER_ID TB_OUTPUT-PER_DES TB_OUTPUT-CUST_ID TB_OUTPUT-PSTLZ
    into L_CHAR separated by C_DELIM.
    transfer L_CHAR to P_DESK .

  endloop.
  close dataset P_DESK.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top