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

Down loading file to apps server,

Former Member
0 Likes
516

Hi Experts,

Presntly I have to download a file to apps server,the contents of the file has FI related entries.

In my program I have writen BDC for the FB01 transaction,

When the transaction is updated then a FI document number is generated.

I have to save file with this FI document # and other entries to the apps server.

Please give me an idea to work out with this issue.

Thanks in Advance,

Regards,

Irfan Hussain

4 REPLIES 4
Read only

Former Member
0 Likes
501

Hi,

Use OPEN DATASET for output

...transfer

close dataset.

1) Write OPEN DATASET.

2) Start the loop.

2) Call Transaction.

3) Transfer

4) Complete loop.

5) Close dataset.

Is there any other issue??

Regards,

Shashank

Read only

0 Likes
501

hi Irfan,

Use <b>OPEN DATASET FOR OUTPUT</b>...

here is the sample code

IF I_FLG = ''.

<b> OPEN DATASET I_FILE FOR OUTPUT IN TEXT MODE.</b>

IF SY-SUBRC NE 0.

PERFORM ZYIR008_PUT_MESSAGE USING 'E'

'File Open Delete Error(?1)- ?2 ?3 ?4'

SY-SUBRC I_FILE 'OUTPUT' SPACE.

ENDIF.

I_FLG = 'X'.

ENDIF.

PERFORM CSV_CONVERT USING I_BUFF WK-BUFFER.

<b> TRANSFER WK-BUFFER TO I_FILE.</b>

CASE SY-SUBRC.

WHEN 0.

  • ADD 1 TO O_CONT.

WHEN OTHERS.

PERFORM ZYIR008_PUT_MESSAGE USING 'A'

'Transfer Dataset Error(?1) - ?2 ?3 ?4'

SY-SUBRC

I_FILE

O_CONT

SPACE.

ENDCASE.

Regards,

Santosh P

Read only

Former Member
0 Likes
501

hi Irfan

try this

parameters: V_DATA(132) lower case.

open dataset V_DATA FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT RECORD.

TRANSFER RECORD TO V_DATA.

ENDLOOP.

CLOSE DATASET V_DATA.

WRITE: /10 'SUCCESSFULLY WRITTEN IN THE APPLICATION SERVER'.

regards

kishore

Read only

Former Member
0 Likes
501

Use this syntax to capture the FI Document no that got generated after a successful run of ur BDC

GET PARAMETER ID 'BLN' FIELD <var>.

(var => is the variable to capture the FI Document that got created)

Append ur other entries of the FI Document from the program and download it into appln server using OPEN, TRANSFER & CLOSE statements

Message was edited by: Sravanthi