cancel
Showing results for 
Search instead for 
Did you mean: 

WD4A service call storing multi-line text-edit fields

HammerM
Active Participant
0 Kudos

Dear Form Members

Please can you help with my problem

I have a webdynpro abap form for registering feedback with 3 different text-edit fields on it. The user can type many words in these fields that can go over many lines.

I use a service call to call a remote function to save the data in the backend, but I cannot work out how to store the 3 text fields with many lines into the backend.

I tried using the STRING importing parameter for each field but the remote function does not allow this type.

Please can you help with as much detail as possible as this is my first attempt at this.

Many Thanks

Accepted Solutions (1)

Accepted Solutions (1)

chengalarayulu
Active Contributor
0 Kudos

Hi Mark,

You can achieve this on the concept of GUID.

Just create a Structure of GUID, and TableType as well, then give it in RFC Import parameters.

You use the below code to convert long text into guid_22/guid_32 etc.,, that guid can be stored on your DB.

If you wanna extract the text, you can use READ_TEXT function module.

************************************

Data:  lv_guid type sysuuid_22,
lv_text type string_table,

lt_tline type oij_tline,

ltt_tline type table of tline,

ls_thead TYPE thead,


*-Generating the GUID---*
  CALL FUNCTION 'GUID_CREATE'
    IMPORTING
      ev_guid_22 = lv_guid.              """" This can be stored on DB.


  CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'
    EXPORTING
      stream_lines = lv_text
      language     = sy-langu
      lf           = abap_true
    TABLES
      itf_text     = lt_tline.


  ls_thead-tdobject = 'TEXT'
  ls_thead-tdid     = 'ST'.
  ls_thead-tdspras  = sy-langu.
  ls_thead-tdname   = lv_guid.              

*-Saving the text----*
  CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
      header          = ls_thead
      savemode_direct = 'X'
    TABLES
      lines           = ltt_tline
    EXCEPTIONS
      id              = 01
      language        = 02
      name            = 03
      object          = 04.

Hope this would be helpful to you.

HammerM
Active Participant
0 Kudos

Hi Chengalarayulu D

Thank you for your reply

Could you possibly elaborate more as this is my first attempt as mentioned and I need all the help I can get.

Thank you again

chengalarayulu
Active Contributor
0 Kudos

Mark,

let, suppose i've DB structure like (ZSD_DETAILS)

SID              CHAR20 PK      Student ID

SNAME       SNAME              Student Name

ADDRESS   SYSUUID_22     Student Address (GUID)

:- Here Address may contain multiple lines (long text).

RFC: ZRFC_GET_SD_DETAILS

TABLES

     IT_DETAILS LIKE ZSD_DETAILS

EXPORTING

     EV_FAILED TYPE CHAR01.

Now for ADDRESS, we should create GUID(Generated by System dynamically), so use the above mentioned code for GUID, then populate the values onto mentioned table structure. then call the RFC to update/own operation.

If you wanna get original ADDRESS then you should use GUID which is stored on your DB table with FM - READ_TEXT.

Ex.

     Call Function 'READ_TEXT'

          exporting

                   name = <db_guid>(Address)

          tables

               lines = <lt_tlines>.

chengalarayulu
Active Contributor
0 Kudos

Mark,

is it resolved?

HammerM
Active Participant
0 Kudos

Hi

Thank you for your excellent help with this. I'm currently working on it now and following your much valued assistance I am hoping to resolve this.

HammerM
Active Participant
0 Kudos

Hi again D Chengalarayulu

Thank you in advance again for all your help.

I have re-configured my table and structure and then adjusted my function module with your example of input parameters and code, but the required result is not happening.

Is the code you gave complete or do I need to adjust it?

Thanks again for your patience.

Mark

chengalarayulu
Active Contributor
0 Kudos

Hi Mark,

its sample, according to above mentioned code, you have to adjust your coding.

Answers (0)