‎2006 Mar 16 8:12 AM
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
‎2006 Mar 16 8:29 AM
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
‎2006 Mar 16 8:31 AM
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
‎2006 Mar 16 8:31 AM
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
‎2006 Mar 16 8:31 AM
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