cancel
Showing results for 
Search instead for 
Did you mean: 

Text Edit-BSP

Former Member
0 Kudos

Hi Experts,

I am doing Textedit using BSP.

i want to edit any text in textedit then click save to SAP Database!!

How is the performed it?

Regards,

S.Suresh.

Accepted Solutions (1)

Accepted Solutions (1)

former_member188685
Active Contributor
0 Kudos

Bind the Textedit to a Varaible of length what ever you want. when ever you enter some text read the formfields value using the textedit ui id in DO_HANDLE_DATA if it is MVC , if it is Page with flow logic then use ON_INPUTPROCESSING event.

once you have the data in variable you can save it to DB if it is custom table then use Update/modify

if it is standard table field use some standard function/BAPI

Former Member
0 Kudos

Hi,

Plz send me the code!!

Regards,

S.Suresh.

former_member188685
Active Contributor
0 Kudos

in this case you don't need much coding also..

this is the code in the event oninputprocessing

DATA: str TYPE string.
IF event_id = 'htmlb'.

  str = request->get_form_field( name = 'te' ).
 "here you can update the DB>...
  CALL METHOD page->set_attribute
    EXPORTING
      name  = 'TEXT'
      value = str.

ENDIF.

layout

have a page attribute name tex


< % @ p a ge lang uage ="abap" % >
< % @ extension name="htmlb" prefix="htmlb" % >
< h t m l b :co ntent de sign= "design2003"   >
  < h tm l b :page title=" " >
    < h t ml b :form>
      < h t m l b:textEdit cols     = "40"
                      disabled = "FALSE"
                      id       = "te"
                      rows     = "5"
                      text     = "<%= text %>"
                      width    = "100%" />

      <  h t m l b :button text    = "Press Me"
                    on Cl i ck = "myClickHandler"   />
    < /  h  tm lb :for m >
  < / h t ml b:pa ge >
< / h t mlb :co n ten t>

Former Member
0 Kudos

Hi Vijay Babu Dudla ,

This is good code. but type as only one line in text edit then press save button its gone to SAP DB. so i typed as multiple line(next line) then press save button its gone to only one line(add next line)in SAP DB.

i want multiple line(next) in text edit then its gone to multiple line in SAP DB.

Regards,

S.Suresh

Former Member
0 Kudos

Hi,

You can use the following:

DATA: t_str TYPE TABLE OF string.

SPLIT str AT cl_abap_char_utilities=>cr_lf INTO TABLE t_str.

And then write t_str into DB.

Regards,

Tanguy

Former Member
0 Kudos

Hi Tanguy Pares,

its good. t_str is coming multiple line. but i could not go to DB.

move t_str to it_sample-text.----> its error.

how is it?

Regards,

s.suresh.

Former Member
0 Kudos

What is the error you get?

In order to use the statement you have specified, the TEXT field of your internal table it_sample must be a table of strings.

Former Member
0 Kudos

Hi,

t_str are fields as line and table_line.

but could not give to internal table.

how is change it?

Plz tell me about it!!

Regards,

S.Suresh

Former Member
0 Kudos

What is the error you get?

What is the type of your internal table IT_SAMPLE?

Former Member
0 Kudos

Hi,

now i got internal table values and move to DB..

Thanks.

S.Suresh.

Former Member
0 Kudos

S.Suresh,

Could you post the code that you used to get this to work finally?

Many Thanks,

Colm

Answers (0)