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

badi WORKORDER_UPDATE

Former Member
0 Likes
4,540

hi all,

i need to change it_header at method BEFORE_UPDATE but since it is importing table, it is not allowed to be changed ..is there anyway that enable me to change the data at it_header

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,215

Try to use field-symbols

field-symbols: <fs_abc> type cobai_s_header.

Loop at IT_HEADER assigning <fs_abc>

your codes....

endloop.

Hope it helps.

hi all,

i need to change it_header at method BEFORE_UPDATE but since it is importing table, it is not allowed to be changed ..is there anyway that enable me to change the data at it_header

11 REPLIES 11
Read only

Former Member
0 Likes
3,216

Try to use field-symbols

field-symbols: <fs_abc> type cobai_s_header.

Loop at IT_HEADER assigning <fs_abc>

your codes....

endloop.

Hope it helps.

Read only

0 Likes
3,215

Hi Yuen Yap,

Thanks for replying.

This is my coding:

field-symbols: <fs_abc> type line of cobai_t_header.

loop at it_header assigning <fs_abc>.

<fs_abc>-refnr = 'abc'.

modify it_header from <fs_abc> transporting refnr.

endloop.

but still error occurs:

the field it_header cannot be changed

Kindly advice if you have the sample correct coding

Read only

0 Likes
3,215

As I remember you don't need to use the reserve word modify. Try it in debug mode to see if it change.

Your code should just have:

loop at it_header assigning <fs_abc>.

<fs_abc>-refnr = 'abc'.

endloop.

Field-symbols works like a pointer, it points to that specific record.

Read only

0 Likes
3,215

Thanks Yuen Yap.

I need to ask 1 more question. DO you have any idea what is the indicator in this BADI when it is in creating/changing mode instead of looking from sy-tcode

Read only

0 Likes
3,215

Errrmmm... I need more clarification. What kind of indicator are you refering? Success indicator (sy-subrc)?

sy-tcode is a transaction code. BADI work as exits, it needs to be implemented and activate before you can start using it.

Read only

0 Likes
3,215

Thanks Yuen Yap for replying.

I have found the 'insert' indicator at component level.

it_component-vbkz = 'I'

another 1 question:

smod: CNEX0016 has importing parameter COCI_AUFK_IMP which will auto update to EBAN (PR table) , how come badi WORKORDER_UPDATE does not have..or is there any other badi that can perform update to EBAN

Read only

0 Likes
3,215

I don't think I can help you much, because I am a HR programmer and not a logistic programmer. You can start a new thread for this question so that other experts can help you.

If you are asking general Abap question, I can still help, but the question you just posted don't look like a general Abap question.

Read only

0 Likes
3,215

ok thanks.

Read only

0 Likes
3,215

I am having similar problem to overwriting badi fileds..have you mangaed solve this???

method if_ex_workorder_update~before_update.

  • break dreddy.

field-symbols: <fs_abc> type line of cobai_t_header.

loop at it_header assigning <fs_abc>.

<fs_abc>-gltrp = '20100130'.

endloop.

endmethod.

Read only

Former Member
0 Likes
3,215

Hi ,

I have a similar requirement to update the special stock indicator in the components tab of work order. I too used the field symbol technique but it is not working.

My code is

assign wa_component to <fs_abc>.

<fs_abc>-sobkz = '3'.

Please correct if there is any error in the code.

Regards,

Prabaharan.G

Read only

0 Likes
3,215

i am having similar probelme...did you managed to solve the issue??

method if_ex_workorder_update~before_update.

  • break dreddy.

field-symbols: <fs_abc> type line of cobai_t_header.

loop at it_header assigning <fs_abc>.

<fs_abc>-gltrp = '20100130'.

endloop.

endmethod.