Skip to Content
author's profile photo Former Member
Former Member

routine for Flatfile name

Hi all,

I just wrote my first ABAP routine to pick flatfile as below,

S:\Finance\HDA_DB\BOMYYYYMMDD.csv

when i check it there was no error in the routine.

however, it keeps showing error message "WRONG PARAMETER:FILE_NAME" when i click to load example data in proposal tab.

how i code this - I copy a code which worked (written by one of consultant for our company) and modify little bit.

i did some search in SDN and applied it into my routine below but they didn't work.

Routine code

program filename_routine.

  • Global code

$$ begin of global - insert your declaration only below this line -

  • Enter here global variables and type declarations

  • as well as additional form routines, which you may call from the

  • main routine COMPUTE_FLAT_FILE_FILENAME below

*TABLES: ...

  • DATA: ...

DATA: str1(60) TYPE c,

str2(10) TYPE c,

str3(8) TYPE c,

str4(4) TYPE c.

str1 = 'S:\Finance\HDA_DB\'.

str2 = 'BOM'.

str3 = SY-DATUM.

str4 = '.CSV'.

$$ end of global - insert your declaration only before this line -

  • -------------------------------------------------------------------

form compute_flat_file_filename

using p_infopackage type rslogdpid

p_datasource type rsoltpsourcer

p_logsys type rsslogsys

changing p_filename type RSFILENM

p_subrc like sy-subrc.

$$ begin of routine - insert your code only below this line -

  • This routine will be called by the adapter,

  • when the infopackage is executed.

concatenate str1 str2 str3 str4 into p_filename.

p_subrc = 0.

$$ end of routine - insert your code only before this line -

endform.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2011 at 02:50 AM

    just a wild guess..may be totally irrelevant...is you file of format .CSV?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 20, 2011 at 04:43 AM

    Hi,

    Please change your code as per the document. It will work........

    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d06d2597-7467-2e10-0d8a-9256a4c5d605

    Regards,

    Suman

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      1 : get your file name& Path in a Variable

      2 : variable like rsldpsel-filename

      3 : CONCATENATE filename sy-datum '.csv' INTO file.

      4: p_filename = file.

      use this it will work

      Regards

      Naveen

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.