2009 Feb 14 5:01 AM
Hi Guru's,
A custom table is getting data from XI, for one of the fields in table i want to set fixed value "X" for all records geting loaded. I tried to set fixed value at domain level for that field its not working am i missing something ? How to fix constant value to a field ?
Hi Guru's,
A custom table is getting data from XI, for one of the fields in table i want to set fixed value "X" for all records geting loaded. I tried to set fixed value at domain level for that field its not working am i missing something ? How to fix constant value to a field ?
2009 Feb 14 5:12 AM
Hi,
First get the data to the internal table from XI....
then loop at the table itab and modify the table with changed value...
See the given code as an example... this is tested and it works perfectly fine...
data t_itab type table of scarr.
data wa type scarr.
select * from scarr into table t_itab. " here is the place where you are fetching data from XI... here I
" am fetching data from SCARRR table
loop at t_itab into wa. " looping at an internal table....
wa-carrname = 'CHANGED VALUE'. " Here I am changing the field with the constant value ...
modify t_itab from wa. " After changing the field am modifying the table with the new value
endloop.
" Displaying the data
loop at t_itab into wa.
write wa.
endloop.Hope this helps you in solving the problem
Regards,
Siddarth
2009 Feb 14 5:18 AM
giving value at domin level can make its value search but it wont assing that value to field..
you have to do by coding....
modify that field once you get the value in internal table
2009 Feb 14 5:33 AM
Hi,
Add the code to the Report after the data is in your internal table.
LOOP AT it_itab INTO wa_itab.
wa_itab-field = 'X'.
"Not required if below INSERT statements added
' MODIFY it_itab INDEX sy-tabix FROM wa_itab TRANSPORTING field. " Field with 'X'
" here add the insert statement into ur custom table
INSERT ztable FROM wa_itab.
IF sy-subrc = 0.
COMMIT WORK. "This is also inside loop after each record.
ELSE.
UPDATE ztable FROM wa_itab. "<<-----It means Record already exist
IF sy-subrc = 0.
COMMIT WORK.
ENDIF.
ENDIF.
ENDLOOP.Regards
Bala Krishna
Edited by: Bala Krishna on Feb 14, 2009 11:10 AM
2009 Mar 24 4:47 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |