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

Batch Program

Former Member
0 Likes
318

Hi Folks

I need to write a batch program that will run once a day and create and send a File formatted according to requirements to a third party on their FTP server

I need to query ZTABLE(KUNNR, VBELN, ERDAT, ERZET, FLAG) for all records where FLAG = space. After the records are written into the file, then I need to update FLAG = 'X'. Can someone please help me get started on this. Any help is greatly appreciated

The file contains Name/Address Record, Credit Order Record, Credit Order Sub Total Record and Credit Order Total Record. Each record is separated by carriage return and line feed.

<b>The Name/Address Record contains</b>

Client Number (4)= 9999

Record Type (1)= 'A'

Customer Number (15, left justified, keep leading zeroes, right fill with spaces)= VRKPA-KUNNR

Customer Name = ADRC-NAME1

<b>Credit Order Record</b>

Client Number (4) = 9999

Client Order Number (22, first 14 characters) = VBAK-VBELN

Order Amount (8) = VBAK-NETWR (use whole dollars only, no cents)

<b>Credit Order Sub Total Record</b>

Client Number(4) = 9999

Number of Order Records (6) = no of order detail records for this client number

Filler (6) = spaces

Total Order Amount (12) = use whole dollars, no cents

<b>Credit Order Total Record</b>

Client Number(4) = 9999

Total Order Amount (12) = use whole dollars only

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
282

Hi Megan

first you create work areas of the type of records mentioned .

After fetching the whole data in some intrenal table you can use these work areas to write tha data into the file using open dataset and transfer command .

after succesful uploading the file you can write update query to update the records to set the flag 'X'

Then you can schedule the program using SM36

Let me know if you were looking something else.

Best Regards

Naresh

1 REPLY 1
Read only

Former Member
0 Likes
283

Hi Megan

first you create work areas of the type of records mentioned .

After fetching the whole data in some intrenal table you can use these work areas to write tha data into the file using open dataset and transfer command .

after succesful uploading the file you can write update query to update the records to set the flag 'X'

Then you can schedule the program using SM36

Let me know if you were looking something else.

Best Regards

Naresh