Application Development 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: 

ANY TABLE modification

Former Member
0 Kudos

Hi,

I have a badi. This badi has a table parameter of type "ANY TABLE". I am trying to modify a field of this table.

This is how I am doing this.

1. Loop though this table

2. Get the record of the table into work area

3. Modify the field of this work area.

4. Use the statement to * MODIFY TABLE c_t_data FROM it_t_data * modify this internal table.

5. It is not modifying the table.

Is there anything else to do ? Is it different with this table? I used almost all variants of Modify such as using index and all other.

Please help me.

SM

1 ACCEPTED SOLUTION

0 Kudos

Sm,

Why don't you use ASSIGNING Statement?

Like as:

LOOP AT T_TABLE ASSIGNING <W_TABLE>

<W_TABLE>-FIELD = Value.

Or

ASSIGN .. FIELD ..from <W_TABLE> to <FIELD>.

<FIELD> = Value.

ENDLOOP.

Regards,

Alexandre

6 REPLIES 6

former_member588853
Active Contributor
0 Kudos

hi,

try to debug ner the badi and see whether the data which you are modifying is available..

else you can use fieldymbols..

<fs> type <table type>.

loop at <table> assigning <fs>.

<fs>-fieldname = 'modiffy data.

endloop.

what is the badi you are using.. can you give details..

regards,

nazeer

0 Kudos

Sm,

Why don't you use ASSIGNING Statement?

Like as:

LOOP AT T_TABLE ASSIGNING <W_TABLE>

<W_TABLE>-FIELD = Value.

Or

ASSIGN .. FIELD ..from <W_TABLE> to <FIELD>.

<FIELD> = Value.

ENDLOOP.

Regards,

Alexandre

0 Kudos

Hi Sorry...

The simple modify statement worked when I was trying to modify single field. When I tried to do two fields it was not. Can you please let me know how to do it ?

SM

0 Kudos

Use below code as example, It is updating both the quantity values.

DATA T_ZMARD TYPE STANDARD TABLE OF ZMM_MARD WITH HEADER LINE.

SELECT * INTO TABLE T_ZMARD

FROM ZMM_MARD

WHERE MATNR = '000000000013531120'.

READ TABLE T_ZMARD INDEX 1.

T_ZMARd-ZMENGE = '100.00'.

T_ZMARD-ZMENGE1 = '101.00'.

MODIFY ZMM_MARD FROM T_ZMARD.

0 Kudos

Hi Sudhir,

I used the exact code. It works only when I update single field. WHen I update more than one field it does not work..

thanks

SM

0 Kudos

Use this :

Modify <your tab> from <your_structure> into f1 f2 transporting F1 F2.

Regards.

Wail