2010 Sep 01 8:25 PM
Hi ,
I am trying to change a field value in itab using MODIFY statement.
The field is a char type and holding '0000000' initially. Now I am trying to change this value to other value. But the modify statement is not working.
like the code is,
data : value(32) type c,
wa-value = value.
wa-name = 'test'.
modify itab from wa transporting value name where id = '01'.
the Name field is getting updated properly with the new value, but the value field is not getting updated... this i sstill showing '0000000'.
Can any body help me on this.
Thanks,
Krishna
2010 Sep 01 8:33 PM
Well at least from your example, you are just declaring a variable called 'Value' and assigning it to the work area without assigning it any value. Are you sure this is not you are doing in your actual code?
Vikranth
Hi ,
I am trying to change a field value in itab using MODIFY statement.
The field is a char type and holding '0000000' initially. Now I am trying to change this value to other value. But the modify statement is not working.
like the code is,
data : value(32) type c,
wa-value = value.
wa-name = 'test'.
modify itab from wa transporting value name where id = '01'.
the Name field is getting updated properly with the new value, but the value field is not getting updated... this i sstill showing '0000000'.
Can any body help me on this.
Thanks,
Krishna
2010 Sep 01 8:33 PM
Well at least from your example, you are just declaring a variable called 'Value' and assigning it to the work area without assigning it any value. Are you sure this is not you are doing in your actual code?
Vikranth
2010 Sep 01 8:36 PM
I am assigning the value to the field VALUE. still this is not updating the new value.
2010 Sep 01 8:39 PM
Can you show the relevant part of your actual coding? Also did you check the sy-subrc value after the modify statement?
Vikranth
2010 Sep 01 8:47 PM
Hi..
Did you check by passing any hard coded value to the wa-value? May be the field 'value' was populated with the same '0000000' as it was before.
also try some manipulations while debugging.
Karthik
2010 Sep 01 8:48 PM
data : ls_partner TYPE bbp_pds_partner.
data : et_partner type table of bbp_pds_partner.
SELECT SINGLE partner_guid FROM but000 INTO lv_guid WHERE partner = l_partner.
ls_partner-partner_id = l_partner.
ls_partner-partner_no = lv_guid.
MODIFY et_partner FROM ls_partner TRANSPORTING partner_no partner_id
WHERE p_guid EQ ls_item-guid
AND partner_fct EQ c_partner_fct1
AND del_ind EQ space.
Intially the field partner_no field have '0000000' value now I am changing it to '1111111'. for the same statment the field partner_id is getting updated properly.
Thanks
Krishna
2010 Sep 01 9:15 PM
Hi..
Just check this link once under the heading : Changing Several Lines Using a Condition. It says "Furthermore, you can only modify the key fields of the internal table if it is a standard table."
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm
Karthik
2010 Sep 02 2:49 AM
Hi,
1. Check for sy-subrc after the select. Whether data is flowing to lv_guid.
2. Check for the field datatype for ls_partner-partner_no and lv_guid. They should match. If not, you would have to use conversion exit to match the ls_partner-partner_no.
Hope it helps
Sujay
2010 Sep 02 9:35 AM
TYPES : BEGIN OF y_trial,
value(32) TYPE c,
name(15) TYPE c,
END OF y_trial.
DATA : t_trial TYPE STANDARD TABLE OF y_trial,
w_trial TYPE y_trial.
FIELD-SYMBOLS : <fs_trial> TYPE y_trial.
CLEAR w_trial.
MOVE '01' TO w_trial-value.
MOVE 'ABC' TO w_trial-name.
APPEND w_trial TO t_trial.
CLEAR w_trial.
MOVE '02' TO w_trial-value.
MOVE 'XYZ' TO w_trial-name.
APPEND w_trial TO t_trial.
CLEAR w_trial.
MOVE '03' TO w_trial-value.
MOVE 'PQR' TO w_trial-name.
APPEND w_trial TO t_trial.
CLEAR w_trial.
MOVE '02' TO w_trial-value.
MOVE 'LMN' TO w_trial-name.
MODIFY t_trial FROM w_trial TRANSPORTING name WHERE value = '02'.
UNASSIGN : <fs_trial>.
LOOP AT t_trial ASSIGNING <fs_trial>.
WRITE 😕 <fs_trial>-value, <fs_trial>-name.
ENDLOOP.
Output is : 01 ABC
02 LMN
03 PQR
It has modifed the second row and the value has changed from "XYZ" to "LMN".
Regards,
Shekhar
2010 Sep 02 11:05 AM
Hi,
Check the datatype of both the variables only if they are the same the modification would take place.
Thanks & Regards,
Neela
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |