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

how to create file on application server?

Former Member
0 Likes
572

how to create file on application server?

how to create file on application server?

4 REPLIES 4
Read only

former_member188594
Active Participant
0 Likes
547

Hi,

use the concept of file handling to create your file on logical system(application server). Make use of OPEN DATASET, WRITE DATASET, CLOSE DATASET and write your code. Also make use of

F4_DXFILENAME_TOPRECURSION function module.

Regards,

Sekhar

Read only

Former Member
0 Likes
547

Hi,

The following program illustrates the creation of ifle in app server and reading the file from appli server:

DATA: ITAB LIKE vbakOCCURS 0 WITH HEADER LINE.

PARAMETERS: P_VBELN LIKE VBAP-VBELN.

START-OF-SELECTION.

SELECT *

FROM VBAP

INTO TABLE ITAB

WHERE VBELN = P_VBELN

PERFORM WRITE_DATA.

PERFORM READ_DATA.

&----


*& Form WRITE_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM WRITE_DATA.

OPEN DATASET 'VBAP_DATA' FOR OUTPUT IN TEXT MODE.

LOOP AT ITAB.

TRANSFER ITAB TO 'VBAP_DATA'.

ENDLOOP.

CLOSE DATASET 'VBAP_DATA'.

CLEAR: ITAB, ITAB[].

ENDFORM. " WRITE_DATA

&----


*& Form READ_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM READ_DATA.

OPEN DATASET 'VBAP_DATA' FOR INPUT IN TEXT MODE.

DO.

READ DATASET 'VBAP_DATA' INTO ITAB.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

APPEND ITAB.

ENDDO.

CLOSE DATASET 'VBAP_DATA'.

LOOP AT ITAB.

WRITE:/ ITAB-VBELN,

ITAB-POSNR.

.

ENDLOOP.

ENDFORM. " READ_DATA

If it is helpful rewards points

Regards

Pratap.M

Read only

Former Member
0 Likes
547

How to create file on application server

You can use transactions CG3Z (Uploading file)and CG3Y (Downloading file)

Read only

0 Likes
547

Award points ,I know that it will be useful

thank you,

Ravee