Skip to Content
avatar image
Former Member

To Convert type Resource into Xstring

Hi,

Am doin file upload from Webdynpro portal.

My function module has got an importing parameter of type Xstring

i want the file to be uploaded converted to Xstring and then pass it into my FM , please suggest me the ways to convert my Resource type of the upload UI element into Xstring and then passit to my FM .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Nov 25, 2011 at 06:25 AM

    Hi,

    Check this forum [Thread|conversion-from-iresouce-wdj-to-xstring-abap]. It might be helpful.

    Regards,

    Anand G

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 25, 2011 at 06:43 AM

    Hi,

    You can check the below:

    Conversion from IResouce (WDJ) to XSTRING (ABAP)

    In that, check the answer posted by Aviad Levy.

    Hope this will help you.

    Note: Also if you want to convert XSTRING to IResource, you can refer the below link.

    Convert XString to String and String to IWDResource

    Regards,

    Jithin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 25, 2011 at 06:44 AM

    Hi Jenifer,

    This is Ravi Shankar from Emergys..

    I came to know about your Problem thro' Vijay Sir..

    wdContext.currentZpocnov_Proc_InputElement().setFile_Data(...);

    In setting the Value to the RFC Attribute - it's of Byte[] type.

    Try using

    byte[] buffer = new byte[1024];

    try {

    resource.read(true).read(buffer);

    } catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    then set

    wdContext.currentZpocnov_Proc_InputElement().setFile_Data(buffer);

    Try this code

    Regards

    K Ravi Shankar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 25, 2011 at 06:59 AM

    Hi

    Try this link - how-to-store-in-to-byte

    Regards

    K Ravi Shankar

    Add comment
    10|10000 characters needed characters exceeded