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

How to modify VBAP-FIXMG

Subhankar
Active Contributor
0 Likes
5,280

Hi All,

I have a Z report program. I want to modify the field VBAP-FIXMG field. I tried it by using FM BAPI_SALESORDER_CHANGE. But it is not working because this field is not editable when sales orders is in change mode. Is there any other way to modify this fields.

Thanks and regards

Subhankar

1 ACCEPTED SOLUTION
Read only

Former Member
3,445

Did you set the field FIXDAT_QTY of parameter ORDER_ITEM_IN for BAPI_SALESORDER_CHANGE?

Hi Hari,

Is strange that you don't have the field VBAP-FIXMG available for editing. Make sure the item you are displaying is not completely delivered. In this case indeed the field is not editable.

In our system (and I think this is the tandard behaviour of SAP) the field is available for update whenever the item was not fully delivered.

What I was willing to do is to activate or deactivate automatically this flag in case of specific situations.

The final solution I got is resumed below:

We created an include on MV45AFZZ :

1) form userexit_pricing_prepare_tkomp (The first one executres a perform included on the second exit.)

2) another on the form userexit_save_document_prepare. Here the flag is activated or not depending on some criteria.

(Points 1 to 3 below)

One of the validations is to check if the order is credit blocked. Since the order can be blocked for credit during saving, we need to find exactly the correct place where the flag should be removed (this should occur just before the transfer of requirements are created.

(Point 5).

1. Flags are set in userexit_save_document_prepare - this is line 378 of the Include MV45AF0B_BELEG_SICHERN. FIXMG flags are set in our second userexit logic.

2. Credit Check is done within form beleg_bearbeiten_ende u2013 this is line 383 in same Include. Here VBUK-CMGST is set to u2018Bu2019.

3. Requirements are determined in form bedarf_fuellen (line 803 in same include) u2013 this is where the VBBE entries are determined based on the values currently in VBAK, VBAP, etc. (that is, internally in the programu2026not yet in the database tables). So since at this time Order is already blocked (VBUK-CMGST=B) but the FIXMG flags are still set, the VBBE entries for those items will not be generated.

4. FIXMG flags were being cleared in a later exit (customer-function '003' in line 889 in same include) u2013 by this time, the VBBE entries were already determined. THIS IS THE STEP THAT WAS BEING DONE TOO LATE IN THE PROCESS.

5. We decided to choose the one that as close as possible before the VBBE/Requirements are determined, and this is where we found this enhancement spot: enhancement-point beleg_sichern_14 spots es_sapmv45a.

Hope this can help.

Fátima

10 REPLIES 10
Read only

Former Member
3,446

Did you set the field FIXDAT_QTY of parameter ORDER_ITEM_IN for BAPI_SALESORDER_CHANGE?

Read only

0 Likes
3,445

Yes. I did it. You can check sample code

if l_wa_vbap-op_ind = c_stat_r.

l_wa_item-fixdat_qty = c_check.

elseif l_wa_vbap-op_ind = c_stat_a.

l_wa_item-fixdat_qty = ''.

endif.

append l_wa_item to i_item_in.

  • Populate change indicator

l_wa_itemx-itm_number = l_wa_vbap-posnr.

l_wa_itemx-updateflag = c_stat_u.

l_wa_itemx-fixdat_qty = c_check.

append l_wa_itemx to i_item_inx.

at end of vbeln.

l_wa_ind-updateflag = c_stat_u.

call function 'BAPI_SALESORDER_CHANGE'

exporting

salesdocument = l_wa_temp-vbeln

order_header_inx = l_wa_ind

tables

return = i_bapiret2

order_item_in = i_item_in

order_item_inx = i_item_inx.

Read only

0 Likes
3,445

Thanks to all of you for your kind reply.

problem is now solved.

BAPI will work fine for those sales order which status is not completely delivered (VBUP-lfgsa <> 'C' ). You can check the standard code MV45AFFE_FELDAUSWAHL_STATUS. Line 185.

Unfortunately when I was tested all the sales order was completely delivered.

Thanks

Subhankar

Read only

Former Member
0 Likes
3,445

In BAPI_SALESORDER_CHANGE

you have a table parameter called ORDER_ITEM_IN.

In this structure u have a field FIXDAT_QTY. Try passing your value in this component of the structure alongwith other line item data.

Edited by: vijetasap on Oct 27, 2009 6:29 AM

Read only

0 Likes
3,445

Yes I pass the value.. it is not working as this field is not editable from transaction VA02. -item -schedule line. There is check box. I think this (not editable) is done from configuration. Is there any other way to update this fields.

Read only

0 Likes
3,445

i feel that the field itself is not in the editable state..

u can chek its module pool screen for it , there will be a option to make it editable .. i have done it once but dont rember exact step..

but the option will be available in the modulepool scrren for that field and this will make that filed for input and u can fill the data through it..

Edited by: imran khan on Oct 27, 2009 6:58 AM

Read only

Former Member
0 Likes
3,445

Hi,

Upon execution of the Bapi (BAPI_SALESORDER_CHANGE)

catch the 'Return' parameter in tables option, it shows the message

'Field header_inx-updateflag is not an input field'.

Goto tcode VA02 -> Sales Tab-> All Items.

Double click on any of the item - it navigates to a subscreen.

Goto -> Shedule Lines tab - Here u can find the field Fixed date & qty (FIXMG) in edit mode

Regards,

Deeba

Read only

Former Member
0 Likes
3,445

Hello,

I have a similar issue.

I need to update VBAP-FIXMG depending on Credit Status and depending if the schedule line quantity is fully confirmed.

I enter my code on MV45AFZZ via a new include but I got several issues updating the Credit Exposue.

My question is:

Where should I update this field (having VBUK and VBEP available to perform my checks, and be able to change VBAP-FIXMG without interfering on credit values?

Thanks !

FS

Read only

0 Likes
3,445

Hi Fatima,

How did you update the VBAP-FIXMG field? I am in the same situation and your answer would be very helpful.

Regards,

Hari

Read only

0 Likes
3,445

Hi Hari,

Is strange that you don't have the field VBAP-FIXMG available for editing. Make sure the item you are displaying is not completely delivered. In this case indeed the field is not editable.

In our system (and I think this is the tandard behaviour of SAP) the field is available for update whenever the item was not fully delivered.

What I was willing to do is to activate or deactivate automatically this flag in case of specific situations.

The final solution I got is resumed below:

We created an include on MV45AFZZ :

1) form userexit_pricing_prepare_tkomp (The first one executres a perform included on the second exit.)

2) another on the form userexit_save_document_prepare. Here the flag is activated or not depending on some criteria.

(Points 1 to 3 below)

One of the validations is to check if the order is credit blocked. Since the order can be blocked for credit during saving, we need to find exactly the correct place where the flag should be removed (this should occur just before the transfer of requirements are created.

(Point 5).

1. Flags are set in userexit_save_document_prepare - this is line 378 of the Include MV45AF0B_BELEG_SICHERN. FIXMG flags are set in our second userexit logic.

2. Credit Check is done within form beleg_bearbeiten_ende u2013 this is line 383 in same Include. Here VBUK-CMGST is set to u2018Bu2019.

3. Requirements are determined in form bedarf_fuellen (line 803 in same include) u2013 this is where the VBBE entries are determined based on the values currently in VBAK, VBAP, etc. (that is, internally in the programu2026not yet in the database tables). So since at this time Order is already blocked (VBUK-CMGST=B) but the FIXMG flags are still set, the VBBE entries for those items will not be generated.

4. FIXMG flags were being cleared in a later exit (customer-function '003' in line 889 in same include) u2013 by this time, the VBBE entries were already determined. THIS IS THE STEP THAT WAS BEING DONE TOO LATE IN THE PROCESS.

5. We decided to choose the one that as close as possible before the VBBE/Requirements are determined, and this is where we found this enhancement spot: enhancement-point beleg_sichern_14 spots es_sapmv45a.

Hope this can help.

Fátima