Skip to Content
avatar image
Former Member

another image question - using Regular ABAP not web dynpro

Following Otto's awesome instructions:

1) create image field in your form (not only image!! it must be the image field)
2) load your picture in the backend
3) convert the image into XSTRING
4) create the XSTRING variable in the interface/ context, fill it with the picture data
5) bind the image field to this variable
6) enjoy
Regards, Otto

We can easily get an image to appear on a form produced from Web Dynpro ABAP using an XML interface.

However, we are having an issue doing the same using a regular ABAP report and Data Dictionary interface.

We added a new field to our DDIC structure called signature TYPE RAWSTRING (we can't define a new domain with type X since SAP doesn't allow that, but they are both Variable Length Byte Strings).

We use the exact same code to upload the same image from UNIX, we see the byte string in our variable, but no image appears on our form (using the ImageField object).

We then created a Global variable with type Xstring in our interface. We pass our binary image to the function module. Through debugging, I see that an error occurs because the gloabl variable states it's max characters is only 255.

any ideas?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 13, 2010 at 08:12 AM

    Hello, I must admit I didn´t try that in regular ABAP (not WD). But looks like you have. That means you have both solutions, right? So you can start with the image extraction out of SAP and passing to the variable the same way in both solutions, right? Then debug out if the value passed to the image field is the same for both. To make that fast, use the trace and check the values in the attached files. If there will be a difference, move the check to the ABAP, what is the value BEFORE passing to the form.

    Mostly I would try to create a demo myself, but I am too busy these days, Otto

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 13, 2010 at 08:20 AM

    I asked a colleague who I helped with a regular ABAP personal card printing. There is a photo of the employee on the form. It is not WD, it is true regular ABAP. And the proposed approach worked for him.

    If you can check the variable values, it can help us move forward. Are you sure, the forms are designed the same way? I hope you didn´t forget to set "embed image data"? What picture type do you use? The same type for both applications? Which one is that?

    Otto

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Otto - i finally figured it out.

      check this thread - show-image-from-binary-data-xstring-field

      it specifically mentions having to use FM to convert the binary to a string.

      CALL FUNCTION 'SSFC_BASE64_ENCODE'
        EXPORTING
          bindata = image_xstring
        IMPORTING
          b64data = image_string.
      

      to convert the Xstring into a String - all this time, i've been trying to make sure I was passing an Xstring!

      Once I did this, the signature field came as planned.

      thanks for your help.

      rp.

  • Jan 13, 2010 at 09:24 PM

    I thank you. The solution you provided has all the details so anybody can recreate this!! Glad your app works, Otto

    Add comment
    10|10000 characters needed characters exceeded