‎2006 Aug 16 4:15 PM
When creating a sales order for a service product, a SAP standard validation exists that prevents entering a value different from 1.Therefore it is decided to remove this quantity 1 validation from the sales order transaction as suggested by SAP. This must only be done for service order type ZS01. All other order types should maintain limited to quantity 1.
In form bedingung_pruefen_005 (include LV07A005)
tables: t003o.
clear: t003o.
if not t459k-auart is initial.
select single * from t003o where auart eq t459k-auart.
if ( vbep-wmeng > 1000 or
vbep-cmeng > 1000 ) and
t003o-autyp eq service.
error_exception = true.
da_sy-msgno = '696'.
da_sy-msgv1 = vbap-posnr.
error_exception = true.
exit. " Aus Do-Loop, nicht aus Bedingung!
endif.
endif.
Want i want is not to check whether t459k-auart is initial, but whether the value is not in a newly defined custom table. (eg. zsales)
Implementing this change should consider OSS note 956056.
This note describes the problem and also gives an indication what other routines must be considered when the change is done.
Please find hereafter the detaled information of this note
Background programming information:
Where is the quantity 1 set ?
When the item and the schedule line are created in the STRUKTUR_ANLEGEN_POSITION routine in the FV45SFST_STRUKTUR_ANLEGEN_POSI include program, the VBEP-WMENG schedule line quantity is filled with the component quantity (SDSTPOX-MNGKO).
This in turn is filled with the fixed value QUAN_1 when the BOM item is created in STRUKTUR_ANLEGEN in the FV45SFST_STRUKTUR_ANLEGEN include program.
The call stack for this is as follows:
1 SAPFV45S FORM STRUKTUR_ANLEGEN_POSITION
2 SAPFV45S FORM STRUKTUR_AUS_XSTB
3 SAPFV45S FORM STRUKTUR_ANLEGEN
4 SAPFV45P FORM VBAP_BEARBEITEN_ENDE
5 SAPFV45P FORM REPAIRITEMS_GENERATE
6 SAPMV45A FORM FCODE_PREP_40
7 SAPLV00F FORM FCODE_BEARBEITEN
Where is message V1696 output?
This message is output because of the source code in the routine in the BEDINGUNG_PRUEFEN_005 include in program LV07A005.
In the case of items with a service order, the only quantity permitted is 1.
The call stack for this is as follows:
1 SAPLV07A FORM BEDINGUNG_PRUEFEN_005
2 SAPLV07A FUNCTION SD_ORDER_SUBSEQUENT_ALLOWED
3 SAPFV45E FORM VBEP_BEARBEITEN_BESCHAFFUNG
4 SAPFV45E FORM VBEP_BEARBEITEN
question : please help me in coding?
‎2006 Aug 16 4:32 PM
In form bedingung_pruefen_005 (include LV07A005)
tables: t003o, zsales.
clear: t003o.
if not t459k-auart is initial.
select single * from t003o where auart eq t459k-auart.
if ( vbep-wmeng > 1000 or
vbep-cmeng > 1000 ) and
t003o-autyp eq service.
error_exception = true.
da_sy-msgno = '696'.
da_sy-msgv1 = vbap-posnr.
error_exception = true.
select single * from zsales where auart eq t459K-auart.
if sy-subrc = 0.
error_exception = false.
endif.
exit. " Aus Do-Loop, nicht aus Bedingung!
endif.
endif.
‎2006 Aug 16 4:32 PM
In form bedingung_pruefen_005 (include LV07A005)
tables: t003o, zsales.
clear: t003o.
if not t459k-auart is initial.
select single * from t003o where auart eq t459k-auart.
if ( vbep-wmeng > 1000 or
vbep-cmeng > 1000 ) and
t003o-autyp eq service.
error_exception = true.
da_sy-msgno = '696'.
da_sy-msgv1 = vbap-posnr.
error_exception = true.
select single * from zsales where auart eq t459K-auart.
if sy-subrc = 0.
error_exception = false.
endif.
exit. " Aus Do-Loop, nicht aus Bedingung!
endif.
endif.