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

file not getting created in the application server path.

Former Member
0 Likes
2,256

HI GUYZ,

i have a requirment where i need to transfer my output file from alv/classical into application server path ie 'd:\old\scbbank\auto.txt'

i have used this particular code but its showinf file unable to create..

its not gettinf moved from it_final to wa_final nor from wa_final to my filename for application server..

this is my code please help me out in this..

DATA : LV_DATA TYPE  STRING,

       GV_FILE TYPE C.

GV_FILE =' D:\OLD\SCBBANK.txt'.

OPEN DATASET gv_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

  IF sy-subrc NE 0.

    MESSAGE 'Unable to create file' TYPE 'I'.

    EXIT.

  ENDIF.

  LOOP AT IT_FINAL INTO WA_FINAL.

    CONCATENATE wa_final-augbl

                N_AMT

               wa_final-bukrs

               wa_final-gjahr

               wa_final-belnr

               G_AMT

               T_AMT

               N_AMT

              INTO LV_DATA

              SEPARATED BY ','.

    TRANSFER LV_DATA TO GV_FILE.

    CLEAR WA_FINAL.

   ENDLOOP.

   CLOSE DATASET GV_FILE.

Regards,

Nawaz

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,820

Hi Nawaz

The Location should be defined in Transaction FILE.

You may find that it is defined slightly differently here. You should also check with your Basis Team, they should be able to confirm the correct path definition you require.

Also ensure your directory definition is Case Specific.

Regards

Arden

8 REPLIES 8
Read only

Former Member
0 Likes
1,821

Hi Nawaz

The Location should be defined in Transaction FILE.

You may find that it is defined slightly differently here. You should also check with your Basis Team, they should be able to confirm the correct path definition you require.

Also ensure your directory definition is Case Specific.

Regards

Arden

Read only

Former Member
0 Likes
1,820

Check if the file path is correct and that you have write permission for that folder.

Read only

former_member185054
Active Participant
0 Likes
1,820

Dear nawaz,

if you mantained the logical file path, check in File transaction.if so, use the below sample code,

CALL METHOD zacinxxcl0000001=>get_physical_path

        EXPORTING

          logical_path     = p_epath    " Error file path

          filename         = l_file     " Error file name

          operating_system = gc_os

          contrl_file_reqd = gc_space

        IMPORTING

          data_file        = l_dotd

        CHANGING

          subrc            = l_subrc

          MESSAGE          = l_msg.

      IF l_subrc EQ 0.

        filepath = l_dotd.

* Opening file for downloading error file

        OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

        IF sy-subrc NE 0.

          gs_error = 'X'.

          MESSAGE e000(zas) WITH text-013. "File cannot be created

        ENDIF.

      ELSE.

        MESSAGE e000(zaa) WITH 'LOGICAL FILE PATH DOES NOT EXIST'(015).

      ENDIF.

      gs_err-errline = 'No data exist. File cannot be created'(013).

      TRANSFER gs_err TO filepath.

      MESSAGE s002(zacinsd01) WITH text-016 filepath.

      CLOSE DATASET filepath.

if you not maintained in file transaction, then just check that file is there in application server or not(AL11).

Read only

Former Member
0 Likes
1,820

If data is not being moved from IT_FINAL to WA_FINAL, then it would seem that IT_FINAL is empty.

Rob

Read only

0 Likes
1,820

hi guyz

Thanks alot. i got it right.

i have another requirement in this

my output is this way

Gross amount       tax deduction      net amout

1000                         100                    900

2000                          200                    1800

                                             total net = 2700

if you guyz can see there is a total net amount

i need to do the net amount total and display in my output screen.

i cant use sum in the output by totalling it there itself.

since im downloading this output file in my local path i need to get it this way.

if there are 2 line items it should calculate the net amount and show the ttal net amount

H,1500000050,7500,2015,20150304,ARS,0000113100

I,1700000030,20150311,,  1000.00,     0.00,  1000.00

H,1500000052,7500,2015,20150304,ARS,0000113100

I,1700000035,20150311,,   500.00,     0.00,   500.00

T, 1500

i need it this way.

so can u guyz please help me out here. i need the code to calculate it.

Regards,

Nawaz

Read only

0 Likes
1,820

Please start a new discussion for this separate question.

Rob

Read only

0 Likes
1,820

hi rob,

i am sorry for asking a different question in this.

the reason i asked it here because i feel this is not that complicated issue so moderator might reject my request so i posted it here.

so can u guyz please help me out in this.

if u still want then i can post it in a new discussion.

please me out in this if h rejects.

Nawaz

Read only

0 Likes
1,820

loop at itab_final into gs_final.

gv_sum = Gross amount +      tax deduction + gv_sum.

at end of 1500000050.

gs_final1-total  = gv_sum.

clear gv_sum.

atend.


but post this query into a separate post.