Skip to Content
avatar image
Former Member

Type of Parameter

Hi People,

I am using one FM : - CALL FUNCTION 'SSFC_BASE64_DECODE'

CALL FUNCTION 'SSFC_BASE64_DECODE'


   EXPORTING

     B64DATA                        = lv_data1

  IMPORTING

    BINDATA                        = lv_content

Here i am exporting base64 data which is in string(text) format....and i am receiving the converted data in xstring format...

And aftwads i want to save that xstring data in database table(RAWSTRING)...

But the problem is what should be the datatype of 'B64DATA' which i am exporting ???

If i use string then it is saying that 'The string is too long'...and when i am using any other datatype like C etc. i am getting dump...(Type conflict)..

Please Help...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • avatar image
    Former Member
    Jan 05, 2015 at 06:46 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 06:54 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi ketan,

      Find below code for your reference to parse the data.

      Just debug the code given below and you can understand the logic.

      data :     v_len  type string,
                v_textlen  type string,
                v_textlen1  type string,
                wa_mail_cont type char2048,
                wa_mail_cont1 type char2048,
                wa_mail_cont2 type char2048,
                 wa_mail type line of bcsy_text.

        v_len = strlen( lv_data1 ) .
            move v_len to v_textlen.
            move v_textlen to v_textlen1.
            if v_len >= 255.
              v_len = 255.
            endif.
            wa_mail_cont  = lv_data1.

            while not wa_mail_cont  is initial.
              move wa_mail_cont+0(v_len) to  wa_mail_cont1.
              move wa_mail_cont+v_len(v_textlen) to  wa_mail_cont2.
              append wa_mail_cont to l_it_contents.
              wa_mail_cont = wa_mail_cont2 .
              v_textlen = strlen( wa_mail_cont ).
              if v_textlen >= 255.
                v_len = 255.
              else.
                v_len = v_textlen..
              endif.
            endwhile.

      loop the internal table l_it_contents and you can pass value to FM

      from internal table value one by one.

      Thanks,

      Marimuthu.K

  • Jan 05, 2015 at 06:57 AM

    Hi,

    Type string is working fine for me. I dont know why are you getting issue with type string.


    Capture.JPG (50.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HI,

      May be its like this.

      Declare a internal table with a fiels of type string, read the file into internal table. Now loop this Itab and pass the string field to FM inside the loop.

  • Jan 05, 2015 at 09:13 AM

    String type is right for parameter type. It is just that FM cannot decode so long string.

    Try this base64 decode method:

    l_xstring = cl_http_utility=>decode_x_base64( encoded = l_string ).

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 09:18 AM

    Hi,

    Check the where used list of the funciton module for more details.

    Kesav

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 10:54 AM

    Hi Ketan,

    maybe i don't understand it.

    lv_data1 is passed to B64DATA and must be defined TYPE STRING. lv_content is passed to BINDATA and must be defined as XSTRING.

    Can you please send some code and mention the exact error (message class, type, numner)?

    Regards,

    Clemens

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 03:02 PM

    I think you first have to determine the length of B64DATA and pass that value in the parameter B64LENG.

    rob

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 09:23 PM

    Try this:

    Where M16.txt is a JPEG image opened with notepad and saved as a text file.

    Rob

    Message was edited by: Rob Burbank


    Code.PNG (13.0 kB)
    Add comment
    10|10000 characters needed characters exceeded