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

Update/Modify Table while moving spaces to a field?

Former Member
0 Likes
985

I have a field that is a custom append in an SAP table, don't think it makes any difference in this case, but thought I'd mention it. When I move space to the 10char field in a structure, the I move the structure to the table declared in the ABAP, I say modify, or update, the field still has the previous value in it? It should be spaces?

Is it because it is blank? It seems to blank out other fields?

Any suggestions? Thank-You.

1 ACCEPTED SOLUTION
Read only

former_member222860
Active Contributor
0 Likes
704

Hey,

Instead of moving spaces to the field, u can simply nullify the contents of the field.

like this:

select * into corresponding fields of table itab from mara

loop at itab.
clear itab-matnr.
update mara from itab.

if sy-subrc = 0.
commit work.
endif.
endloop.

Hope it works.

thanks\

Mahesh

I have a field that is a custom append in an SAP table, don't think it makes any difference in this case, but thought I'd mention it. When I move space to the 10char field in a structure, the I move the structure to the table declared in the ABAP, I say modify, or update, the field still has the previous value in it? It should be spaces?

Is it because it is blank? It seems to blank out other fields?

Any suggestions? Thank-You.

3 REPLIES 3
Read only

Former Member
0 Likes
704

hi how u r passing spaces, if possible please provide the code for us to analyze and answer

Read only

former_member222860
Active Contributor
0 Likes
705

Hey,

Instead of moving spaces to the field, u can simply nullify the contents of the field.

like this:

select * into corresponding fields of table itab from mara

loop at itab.
clear itab-matnr.
update mara from itab.

if sy-subrc = 0.
commit work.
endif.
endloop.

Hope it works.

thanks\

Mahesh

Read only

Former Member
0 Likes
704

Hi ,

The appended fields of the table are updated in the same way as the regular fields of the table.

Pass null values to the specific field (Appended field) and Modify the table.

******

Loop at it_mara into wA_mara.

wa_mara-DISPO = ''.

Modify mara from wa_mara .

Endloop.

*******

Hope this helps.

Regards,

Radhika.