Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Writing a UNIX file(on-line) and Reading(background)

Former Member
0 Kudos

I am trying to have 1 program read a PC file and write it to UNIX in the INITIALIZATION event, then read and process it after the initialization event. During initialization I find and build an internal table from the PC file, then open the UNIX file for output, TRANSFER lines, and close the UNIX file. After this completes, I can verify the file exists with data.

  perform get_fueling_file.

  open dataset dsn for output in text mode.
  loop at itab_report_input.
    transfer itab_report_input to dsn.
  close dataset dsn.

Then when the selection screen is presented, I choose to run in background. The options for background running are presented (AL11 - file still there and populated). Scheduling options presented (AL11 OK), but after IMMEDIATE selected and saved file exists, but empty.

  open dataset dsn for input in text mode.
  if  sy-subrc  <>  0.
    write:  'form xfer_report_from_unix--bad open'.

  clear   itab_report_input.
  refresh itab_report_input.

    read dataset dsn into itab_report_input.
    if  sy-subrc  <>  0.
    append itab_report_input.

I traced it down to a system call "SendSubmitReq" and when called the file goes from populated to empty. As insight, when background processing is not selected everything's fine. When separated into two programs, one to write to UNIX the next to read everything works.

TIA for your help.


Former Member
0 Kudos

Hi Martin

I doubt with the mechanism you are using.

Maybe you can try this way:

Give radiobuttons in selection screen:

1. Transfer from Presentation Server to Application server - Alternatively we can use transaction CG3Z.

2. Upload from Application server and Process.

Kind Regard