Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Multiple Containers handling while saving

Former Member
0 Likes
779

I am having four containers in a single screen.

I have created containers in PBO event.

I am trying to save the data entered in containers in PAI event.

When I am saving the data, only the last Container's data is getting stored. Is there any way / method to get all the container's and the respective data as well in PAI event? Also when the user wants to display the screen after saving he should be able to see the data in respective containers only.

6 REPLIES 6
Read only

Former Member
0 Likes
733
 problem with ur code itself , y only last record -->bcos its updating the header Area only.So u have to correct code.

regards

Prabhu

Read only

Former Member
0 Likes
733

Can you post your code..

Read only

Former Member
0 Likes
733

CALL METHOD ls_editor->get_text_as_r3table

IMPORTING

table = i_texttable.

CLEAR wa_tdline-tdformat.

IF i_texttable IS NOT INITIAL.

LOOP AT i_texttable ASSIGNING <tdline>.

IF NOT <tdline> IS INITIAL.

l_text_vorh_lv = l_x_l.

wa_tdline-tdline = <tdline>.

APPEND wa_tdline TO ls_tline.

ENDIF.

ENDLOOP.

ENDIF.

IF NOT ls_tline[] IS INITIAL.

CLEAR ls_thead.

ls_thead-tdobject = 'ZPERNR'.

ls_thead-tdid = 'ZPA'.

IF fcode EQ 'UPD'.

CONCATENATE 'MYCONTAINER1' p9002-pernr INTO ls_thead-tdname.

CONDENSE ls_thead-tdname NO-GAPS.

ls_thead-TDSPRAS = sy-langu.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

  • client = sy-mandt

header = ls_thead

  • INSERT = ' '

savemode_direct = l_x_l

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

  • IMPORTING

  • FUNCTION =

  • NEWHEADER =

TABLES

lines = ls_tline

EXCEPTIONS

id = 1

language = 2

name = 3

object = 4

OTHERS = 5.

IF sy-subrc <> 0.

  • MESSAGE e246(zdsh01_pp1) WITH sy-subrc.

ENDIF.

ENDIF.

Read only

0 Likes
733

1. You should get the text / data from each container separately. Just like the way you get getting the text from ls_editor, you should get data from other controls as well.

2. Call COMMIT_TEXT followed by SAVE_TEXT.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
733

Hello Radha,

check demo programs..

SAPTEXTEDIT_DEMO_2_OLD

i hope this will help you..

regards,

Srini

Read only

Former Member
0 Likes
733

Solved it on my by declaring separate objects and editors for each container and calling the same in the PAI also