‎2010 Feb 22 7:46 AM
Hi Everyone,
I have written code for the event 02 with the following code.
DATA: BEGIN OF l_total.
INCLUDE STRUCTURE zztable.
INCLUDE STRUCTURE vimtbflags.
DATA END OF l_total.
LOOP AT total INTO l_total.
.
.
ENDLOOP.
I get the error UC_OBJECTS_NOT_CONVERTIBLE, when LOOP AT statement is executed. All i want to find is the ACTION on the record in the table maintenance, whether the record is updated or inserted. Any pointers?
Thanks,
Chan
‎2010 Feb 22 7:56 AM
Hi,
No pointers are required.
i have used like...
if not gt_zmm_camera_data_mod[] is initial.
loop at gt_zmm_camera_data_mod into wa_zmm_camera_data_mod.
wa_zmm_camera_data_mod-verify = c_n.
wa_zmm_camera_data_mod-verified = c_n.
wa_zmm_camera_data_mod-zcapture = c_n.
wa_zmm_camera_data_mod-captured = c_n.
wa_zmm_camera_data_mod-error = c_n.
modify gt_zmm_camera_data_mod from wa_zmm_camera_data_mod index sy-tabix
transporting verify verified
zcapture captured
error.
endloop.
modify zmm_camera_data from table gt_zmm_camera_data_mod.
endif.
{code]
or U can try like this.....
IF maint_mode = 'U' AND function = 'SAVE'.
LOOP AT total.
READ TABLE extract WITH KEY <vim_xtotal_key>.
IF sy-subrc EQ 0.
IF NOT extract11(15) IS INITIAL AND NOT extract26(1) IS INITIAL
AND NOT extract+329(1) IS INITIAL.
wa_zmm_camera_data_temp-lipds = extract+11(15) .
APPEND wa_zmm_camera_data_temp TO gt_zmm_camera_data_temp.
CLEAR : wa_zmm_camera_data_temp.
ELSEIF extract11(15) IS INITIAL OR extract26(1) IS INITIAL
OR extract+329(1) IS INITIAL.
wa_zmm_camera_data_temp-lipds = extract+11(15) .
wa_zmm_camera_data_temp-flag = c_x.
APPEND wa_zmm_camera_data_temp TO gt_zmm_camera_data_temp.
CLEAR : wa_zmm_camera_data_temp.
ENDIF.
ENDIF.
ENDLOOP.
Endif.
Reagrds
Arbind Prasad
‎2010 Feb 22 8:02 AM
Hi There,
Say for example i have ten records, out of which 5 are already existing and a field in changed in each record and 5 are newly inserted. I would like to know the status of these records. Like first five should have U and the last should have I. In summary, I would like to know the action that was performed on each record. The internal table TOTAL has line type which is 256 characters in length.
Thanks in advance.
Chan
‎2010 Feb 22 9:04 AM
Hello Chan,
In Event02 of the TMG i don't think you will have the field symbol <ACTION> at your disposal.
You can access this field symbol in the event 01. The values which <ACTION> can hold are given in this SAP documentation :
[http://help.sap.com/saphelp_nw04s/helpdata/EN/91/ca9f80a9d111d1a5690000e82deaaa/content.htm|http://help.sap.com/saphelp_nw04s/helpdata/EN/91/ca9f80a9d111d1a5690000e82deaaa/content.htm]
I think you should be using the Event 01 & not 02.
BR,
Suhas
‎2010 Feb 22 9:54 AM
Hi Suhas,
Yea I typed in the incorrect event. Right now I can see value into <ACTION> field symbol. I have one more query, how can i access the contents of this table. If i am using offsetting they are fetching incorrect values.
Thank,
Chan
‎2010 Feb 22 10:22 AM
Hello,
Can you please share the code which you are using to achieve this ?
BR,
Suhas
‎2010 Feb 22 10:58 AM
Hi Suhas,
The following code is returning the sy-subrc as ne 0.
ASSIGN COMPONENT 'ERNAM' OF STRUCTURE total TO <l_fval>. "Creation User
IF sy-subrc = 0.
<l_fval> = sy-uname.
ENDIF.
ASSIGN COMPONENT 'ERDAT' OF STRUCTURE total TO <l_fval>. "Creation Date
IF sy-subrc = 0.
<l_fval> = sy-datum.
ENDIF.
the assign component statement is failing. Total internal table doest have the component ERNAM or ERDAT. It has a component Line which is 256 char in length.
I also tried using the offseting but its not pointing to the right positions as i have a currency field in between.
Thanks,
Chan
‎2010 Feb 22 11:08 AM
Hello Chan,
The structure TOTAL will have the same structure as your Z-Table ?
Does your Z-Table have the fields ERNAM & ERDAT ? If not the ASSIGN statement is bound to fail. Give the proper field names in the ASSIGN (cross check against the Z-Table) & then check & revert back.
BR,
Suhas
PS: BTW did you check this post as reference : [|]
Edited by: Suhas Saha on Feb 22, 2010 4:41 PM
‎2010 Feb 22 1:19 PM
Hi Suhas,
I checked the link that you have sent. I have used the method to convert the string to structure. Yet i get a run time error saying:
The call of the method "READ_CONTAINER_C" of the class
"CL_ABAP_CONTAINER_UTILITIES" is incorrect. It was tried
to transfer a non-compatible variable to the formal parameter "IM_CONTAINER".
I have the following fields in the table:
BNAME - User Name
GSWRT - Currency Field
FIRST_NAME
LAST_NAME
ERNAM
ERDAT
I am unable to use the offseting as there is a currency field in it. Do we have a work around. In short, i am facing the same problem as the person in the link you sent.
Thanks,
Chan
Edited by: chanakya reddy on Feb 22, 2010 2:20 PM
‎2010 Feb 22 3:01 PM
Hi Everyone,
Finally done it myself. thanks everyone involved. especially suhas.
Regards,
Chan
Edited by: chanakya reddy on Feb 22, 2010 4:01 PM
‎2010 Feb 23 4:44 AM
Hello Chan,
What was the method you have used to correct your problem ? Plz keep in mind to share your solution for future reference.
BR,
Suhas
‎2010 Apr 20 8:25 AM