‎2006 Aug 21 10:28 AM
Hi experts,
Iam working on dialog programing and i have requirement to save two long texts at a time.
I put the long texts(custom controls) in tab strip control(container1,container2).
My problem is while saving....
1)if i enter data only in first container the data is getting saved.
2)If i enter data in second container it is getting saved.
3)But if i enter data in both the containers, <b>only second container data is getting saved.</b>
What might be the reason? What iam doing wrong?
(commit text written after the save_text.)
Reward guaraneed
thanks
kaki
‎2006 Aug 22 3:04 AM
Hi Kaki,
Include the logic to save data from TAB1 under SAVE of Tab2.
CASE ok_code.
WHEN 'SAVE'.
t_rhead-tdname = ag_no.
t_rhead-tdid = 'Z001'.
t_rhead-tdspras = sy-langu.
t_rhead-tdobject = 'ZAGREEMENT'.
CALL METHOD rem->get_text_as_stream
IMPORTING
text = rem_tab[].
LOOP AT rem_tab.
t_remk-tdformat = '/'.
t_remk-tdline = rem_tab.
APPEND t_remk.
ENDLOOP.
PERFORM SAVE_TEXT.
CALL FUNCTION 'COMMIT_TEXT'.
ENDCASE.
<b>This is tab2 container2 code</b>
CASE ok_code.
WHEN 'SAVE'.
CALL METHOD notes->get_text_as_stream
IMPORTING
text = notes_tab[].
IF flag_cont2 = 1.
LOOP AT notes_tab.
t_notes-tdformat = '/'.
t_notes-tdline = notes_tab.
APPEND t_notes.
ENDLOOP.
ENDIF.
t_nhead-tdname = ag_no.
t_nhead-tdid = 'Z002'.
t_nhead-tdspras = sy-langu.
t_nhead-tdobject = 'ZAGREEMENT'.
PERFORM save_text.
CALL FUNCTION 'COMMIT_TEXT'.
<i><b>* To updated Tab1, when SAVE is clicked on TAB2</b></i>
<b> t_rhead-tdname = ag_no.
t_rhead-tdid = 'Z001'.
t_rhead-tdspras = sy-langu.
t_rhead-tdobject = 'ZAGREEMENT'.
CALL METHOD rem->get_text_as_stream
IMPORTING
text = rem_tab[].
LOOP AT rem_tab.
t_remk-tdformat = '/'.
t_remk-tdline = rem_tab.
APPEND t_remk.
ENDLOOP.
PERFORM SAVE_TEXT.
CALL FUNCTION 'COMMIT_TEXT'.</b>
ENDCASE.
Best regards,
Prashant
Message was edited by: Prashant Patil
‎2006 Aug 21 10:32 AM
Hi,
It seems, that when you are moving from TAB 1 to another TAB 2, the container TAB 1 is released/freed.
Check in debug mode, whether while calling CONTAINER 2( TAB 2 ) on the tab strip, CONTAINER 1 ( TAB 1 ) is freed/cleared.
Best regards,
Prashant
‎2006 Aug 21 10:44 AM
Hi Kaki,
may be that time second container is active, try this way
first enter second, then first and see in this case which one is getting saved.
if first one is saved, then it means the container which is active only getting saved.
Check it once.
Regards
vijay
‎2006 Aug 22 1:58 AM
Hi Prashant & Vijay,
Yes..while moving from tab1 to tab2 the the container losing data in tab1.Iam able to get only active container data.
Can you tell me how to get inactive container data...
Thanks
kaki
‎2006 Aug 22 2:14 AM
‎2006 Aug 22 2:44 AM
Hi Kaki,
please show us the current relevant code at 'save' time.
‎2006 Aug 22 2:50 AM
Hi Neil..
This is <b>tab1</b>(container1) code
CASE ok_code.
WHEN 'SAVE'.
t_rhead-tdname = ag_no.
t_rhead-tdid = 'Z001'.
t_rhead-tdspras = sy-langu.
t_rhead-tdobject = 'ZAGREEMENT'.
CALL METHOD rem->get_text_as_stream
IMPORTING
text = rem_tab[].
LOOP AT rem_tab.
t_remk-tdformat = '/'.
t_remk-tdline = rem_tab.
APPEND t_remk.
ENDLOOP.
PERFORM SAVE_TEXT.
CALL FUNCTION 'COMMIT_TEXT'.
ENDCASE.
This is <b>tab2</b> container2 code
CASE ok_code.
WHEN 'SAVE'.
CALL METHOD notes->get_text_as_stream
IMPORTING
text = notes_tab[].
IF flag_cont2 = 1.
LOOP AT notes_tab.
t_notes-tdformat = '/'.
t_notes-tdline = notes_tab.
APPEND t_notes.
ENDLOOP.
ENDIF.
t_nhead-tdname = ag_no.
t_nhead-tdid = 'Z002'.
t_nhead-tdspras = sy-langu.
t_nhead-tdobject = 'ZAGREEMENT'.
PERFORM save_text.
CALL FUNCTION 'COMMIT_TEXT'.
ENDCASE.
Only active tab data is getting saved.How can i save both tabs containers data??
‎2006 Aug 22 3:19 AM
hI kAKI,
CAN'T YOU MOVE THE LOGIC AWAY FROM THE CONTAINERS AND HAVE IT ONLY ONCE AT THE pai OF THE MAIN SCREEN instead?
The logic will need to be done for both containers there of course.
ps, I don't think the logic at TAB2 WILL ALWAYS WORK. wHAT IF THE USER DOESN'T GO TO TAB2?? i THINK IT WOULD BE BEST TO BE DONE CENTRALLY.
‎2006 Aug 22 3:41 AM
Hi Neil,
Can you tell me how to do Centrally at the main screen of PAI.I tried that. But i count not get it.
‎2006 Aug 22 4:39 AM
it should be just a case of cutting and pasting the code from the other areas and putting it in a pai module. You will need a 'save' button on the main screen and will need to test for that value.
Post your existing PAI logic if I'm not making sense.
‎2006 Aug 22 2:53 AM
Hi Kaki,
Include a logic to populate the data into global variables when user moves from TAB1 to TAB2. I mean in the EVENT of moving from TAB1 to TAB2, populate the values of TAB1 into global variables.
This should solve the problem.
Best regards,
Prashant
‎2006 Aug 22 3:04 AM
Hi Kaki,
Include the logic to save data from TAB1 under SAVE of Tab2.
CASE ok_code.
WHEN 'SAVE'.
t_rhead-tdname = ag_no.
t_rhead-tdid = 'Z001'.
t_rhead-tdspras = sy-langu.
t_rhead-tdobject = 'ZAGREEMENT'.
CALL METHOD rem->get_text_as_stream
IMPORTING
text = rem_tab[].
LOOP AT rem_tab.
t_remk-tdformat = '/'.
t_remk-tdline = rem_tab.
APPEND t_remk.
ENDLOOP.
PERFORM SAVE_TEXT.
CALL FUNCTION 'COMMIT_TEXT'.
ENDCASE.
<b>This is tab2 container2 code</b>
CASE ok_code.
WHEN 'SAVE'.
CALL METHOD notes->get_text_as_stream
IMPORTING
text = notes_tab[].
IF flag_cont2 = 1.
LOOP AT notes_tab.
t_notes-tdformat = '/'.
t_notes-tdline = notes_tab.
APPEND t_notes.
ENDLOOP.
ENDIF.
t_nhead-tdname = ag_no.
t_nhead-tdid = 'Z002'.
t_nhead-tdspras = sy-langu.
t_nhead-tdobject = 'ZAGREEMENT'.
PERFORM save_text.
CALL FUNCTION 'COMMIT_TEXT'.
<i><b>* To updated Tab1, when SAVE is clicked on TAB2</b></i>
<b> t_rhead-tdname = ag_no.
t_rhead-tdid = 'Z001'.
t_rhead-tdspras = sy-langu.
t_rhead-tdobject = 'ZAGREEMENT'.
CALL METHOD rem->get_text_as_stream
IMPORTING
text = rem_tab[].
LOOP AT rem_tab.
t_remk-tdformat = '/'.
t_remk-tdline = rem_tab.
APPEND t_remk.
ENDLOOP.
PERFORM SAVE_TEXT.
CALL FUNCTION 'COMMIT_TEXT'.</b>
ENDCASE.
Best regards,
Prashant
Message was edited by: Prashant Patil
‎2006 Aug 22 3:19 AM
Hi Prashant,
Thanks a lot.It is working fine.
Full points alloted.
cheers,
kaki