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

Error in getting the file content from CL_CRM_DOCUMENTS

Hi,

My requirement is to store the contents of an attachment into an internal table and pass it to next system and i dont want to download to file.

so when i use method get_with_table, i am getting the contents in binary format, I am not able to do the same in ASCII. see my code,

DATA : T_ITAB TYPE SDOKCNTASCS.

DATA : T_FILETYPE TYPE SDOKFILACIS.

DATA: T_SKWF_IO LIKE SKWF_IO.

T_SKWF_IO-OBJID = '44CEB4D549C229FBE100000097A3145C'.

T_SKWF_IO-CLASS = 'CRM_P_ORD'.

CALL METHOD CL_CRM_DOCUMENTS=>GET_WITH_TABLE

EXPORTING

PHIO = T_SKWF_IO

TEXT_AS_STREAM = 'X'

IMPORTING

FILE_ACCESS_INFO = T_FILETYPE

file_content_ascii = t_itab .

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

The table t_itab remains blank after executing the fun. module. I dont know why? Any one help me on this. Do I miss any thing?

Thanks,

Kumar.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2006 at 06:46 AM

    Hi Kumar,

    How did you achieve the attachment? Passing the binary content to method CREATE_WITH_TABLE?

    Just check the importing structure FILE_ACCESS_INFO of GET_WITH_TABLE method. make sure the parameter BINARY_FLG is not set to 'X'.

    If this parameter is not 'X', then the table can be downloaded in ASCII format.

    Regards,

    Karthik.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Karthik,

      I don't understand how one can pass a value to importing parameter(file_access_info) in the method get_with_table. Even though if you pass then how it will influence on pulling the data?

      Please let me know if you get some answer.

      Thanks,

      Kumar.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2009 at 07:55 PM

    Hi Kumar,

    I'm not sure if it works ..

    but just give a try ..

    open the attachment in editable mode in SAP .. check the windows temp directory .. in the path ..

    C:\Documents and Settings\Administrator\Local Settings\Temp\<Directory GUID>\file.ext

    Normally SAP stores the temporary file in the above location.

    open this file and save it in ASCII format ..

    then run your code..

    regards

    Sandeep

    Add a comment
    10|10000 characters needed characters exceeded

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.