Free item for total order value
Hi experts......
i Have a scenario.....
in a supermarket there is an offer.. saying if you buy for a total value of 500 rs... a gift of wort 100 rs is free.......how to configure this?
Samatha
Hi there,
Is your $100 free applicable on the purchase of any goods?
Then this is what you need to do. Define a new discount condition type. Define a new table with sales org / order type & assign it to the access seq of the condition type. Maintain the condition type in your pricing procedure. In the requirement routine of the condition type, put a customized logic. For that pass the net value of the order into a subtotal. In the customized logic, read the value from the sub total. If it is >= $500, then only the new discount condition type should apply. In the condition records maintain a value of $100.
This will ensure that if the value of the SO is >= $500, then $100 discount will be granted.
Or if your discount is based upoon purchase of a particular item, then this is what you do.
For this we need to define the Free goods determination procedure. We need to have a customized code in the requirement routine that we assign to the condition type NA00. Pass the net value of the order into a sub total. In the code put a logic that system reads the net value in the sub total. If the value is >= 500, then only NA00 will apply.
When maintaining the condition records, select 'inclusive' on the top menu bar.
Hope this helps.
Regards,
Sivanand
Similar Messages
-
HI All,
Is there any standard report to check total ordered value for PO.
I checked in ME80AN but its not giving excise value. I need Base + Excise + VAT / CST. (Total Net order value per PO)
Please suggest.
Regards
Mahesh M JDear Mahesh,
ME81N - Anlysis of order values - By Material / By buyer / By supplier
Totals analysis - ABC analysis -Analysis using comparison period - Frequency analysis
Regards
Anand -
Total order value (net) per PO with ME2N (Purchase order List display)
Hello,
with ME2N I can see the order value (net) of a PO per item line. Is it also possible to see the the total order value for all item lines in a PO?
Thanks for coming back to me!
Sofiahi in standard reports that is not possible
But you can opt for filter in PO no. feild and go for an specific PO and press enter it will show all the line item of that PO then you can apply the Total of all Po line items in net price feild
Or even while running the report you can go for specific PO no and then execute the report.
Hope this helps
Else need to devlop an Z report with help of ABAPER
Try with the table EKPO and feild RLWRT
He can solve your purpose
Regards
Sujoy
Edited by: SUJOY on Sep 22, 2008 2:39 PM -
Hi everybody ,
We need the Discount to be calculated automatically on the Total Order Value.
Its a promotion.
Useful suggestions will be rewarded.
Thanks
KartikHi pls follow the procedure below, Hope it will help u out
VOFM: ON PRICING
This note is an explanation of function "Maintain: Requirements and Formulas", which is also known as "VOFM".
By using descriptions and examples, this note explains how the VOFM function works in the R/3 Standard System, which objects are related to it and which restrictions exist.
Chapter 2.7 explains possible causes of errors and solutions for problems with the VOFM function.
To provide a good overview, this note is subdivided into the following sub areas:
1. General information
1.1 Definition of terms
1.2 Application areas
1.3 A frank word on the "source code responsibility"
2. Technology
2.1 Introduction
2.2 Namespaces
2.2.1 SSCR object registration
2.3 Structure of a VOFM object
2.3.1 Include file with ABAP form routine
2.3.2 Table entries in TFRM and TFRMT
2.4 Calling VOFM objects
2.4.1 VOFM object carrier
2.5 Activation, generation and RV80HGEN
2.6 Transport
2.7 FAQs: Possible causes of errors and problems
Technical field names are displayed in angle brackets [].
Note that this note only explains the mode of operation of the VOFM in an R/3 Standard Core System.
For R/3 industry solutions or Add-Ons the VOFM function displays a different behavior in subareas, however, this is not dealt with in this note.
Additional key words
VOFM, SAPMV80H, TFRM, TFRMT, RV80HGEN, XPRA, formulas, requirements, data transport routine, copy routine, data transfer.
Cause and prerequisites
1. General information
1.1 Definition of terms
Depending on the business processes used it may be necessary to influence the standard behavior of R/3 applications. For that purpose the VOFM function provides a corresponding environment in order to be able to develop and manage customer-specific logic simply.
The system stores the objects generated via the VOFM in the Customizing of the respective application area
(Pricing, message determination and so on) and its programs call the objects correspondingly.
Also SAP delivers certain functions in the form of VOFM objects.
Consequently, the VOFM is an exit technology as explained in more detail in Note 381348.
1.2 Application areas
Typical VOFM objects are requirements, formulas and data transfer routines.
These are used in processes of the purchase order, the delivery, billing, price determination, material determination, message determination, the free goods, the pricing and of others.
In the entries of the R/3 core menu of Transaction VOFM you can find a precise overview of the supported application areas.
1.3 A frank word on the "source code responsibility"
As in user exits, in VOFM objects are many fields and tables available. Thus, the use of VOFM objects is very versatile and consequently also very critical under certain circumstances. For the use of "customer-specific" VOFM objects the statements in Note 381348 regarding the responsibility for customer enhancements (Maintenance responsibility, problems during the upgrade and so on) apply. Read this note carefully before you decide on the use of customer-specific VOFM objects.
Errors and data inconsistencies that are caused by improper application or implementation of VOFM objects are not processed by the SAP Support but exclusively within the framework of the Consulting that has to be purchased separately.
2. Technology
2.1 Introduction
A VOFM object is uniquely defined via characteristics "group indicator" [GRPZE] and "group number" [GRPNO].
Here the group indicator, technically represented by a character field of length 4, is the logical connection to the calling environment.
Examples:
ABED copying requirement in the order
ADAT data transfer in the order
PBED requirements pricing
CASC Data transfer for sales activities
PBEK requirements account determination
CHRG requirements batches
REAK archiving for orders
VFCL Multi-dimensional scales
You can find all defined group indicators in the allowed values of the "GRPZE" domain in the ABAP Dictionary (Transaction SE11).
The group number can have a value from 1 to 999.
Exceptions are group indicators "PSTK" (= group key routine pricing) and "TDAT" (= data transfer for texts). For these the system can only assign group numbers from 1 to 99.
2.2 Namespaces
The VOFM has separate number ranges in order to distinguish VOFM objects delivered by SAP from customer-specific VOFM objects. These number ranges are often also called "VOFM namespaces".
However, note that this is not a "real namespace" that is protected by corresponding entries in system table "TRESC" (= reserved names for Customizing tables and Customizing objects).
Instead, only the VOFM logic itself does the definition and check of the number ranges.
The following list displays the customer number ranges sorted according to group indicators:
Indicator Name Number range customer
FOFU Subsequent functions 900 - 999
PSTK Group key routines 50 - 99
TDAT Data transfer routines f. texts 50 - 99
all other group indicators 600 - 999
In Note 356737 you can find more information on the available VOFM number ranges.
2.2.1 SSCR object registration
VOFM objects are subject to SSCR registration (= SAP Software Change Registration).
The reason for that is the necessity that every VOFM object is physically assigned to that SAP development class, from whose programs a corresponding jump into the VOFM object later occurs.
If you use the VOFM interface the system makes the assignment automatically. An assignment of customer-specific development classes is not possible.
2.3 Structure of a VOFM object
A VOFM object consists of the following parts:
Include file with ABAP form routine
TFRM table entry
TFRMT table entry
2.3.1 Include file with ABAP form routine
In the ABAP form routine the desired function is programmed.
Example pricing value formula number 001:
Include name : FV64A001
Form routine : FRM_KONDI_WERT_001
Implementation: * * Profit margin considering rebate agreements
form frm_kondi_wert_001.
xkwert = komp-kzwi3 - komp-wavwr.
endform.
Dependending on the selected group indicator, the group number and the system type (SAP or customer system), the system assigns and generates the include name and form routine name automatically.
For this reason, standard routines delivered by SAP generally have a different structure of the include name than customer-specific routines.
Example:
SAP standard value formula for the pricing
=> prefix FV64A + object number with 3 places from 'SAP namespace'
=> for example FV64A001
Customer-specific value formula for the pricing
=> prefix RV64A + object number with 3 places from 'customer namespace'
=> for example RV64A905
2.3.2 Table entries in TFRM and TFRMT
The entries in tables TFRM and TFRMT belonging to a VOFM object are used for the status management and assignment. The system always analyzes them if the user calls Transaction VOFM or if a generation operation occurs (for details refer to section 2.5).
The system generates exactly one TFRM table entry per VOFM OBjekt. In this TFRM entry the following information is stored:
Group indicator GRPZE
Group number GRPNO
Routine 'active' indicator AKTIV_TFRM
Application KAPPL
Date of the last generation GNDAT
Time of the last generation GNZEI
Examples:
GRPZE GRPNE AKTIV_TFRM KAPPL GNDAT GNZEI
PBED 001 X V 06 13 2001 09 06 39
TDAT 001 X 06 13 2001 09 06 39
CHRG 003 X 06 13 2001 09 06 39
The meaning of group indicators and group numbers has already been dealt with.
The 'active indicator' controls whether a VOFM object is 'active' or 'inactive'. Active VOFM objects have characteristic value AKTIV_TFRM = 'X', inactive objects have characteristic value AKTIV_TFRM = initial.
VOFM objects flagged as 'active' are 'known' to the calling program logic, that means they were included in the main program of the 'calling program' and can thus be addressed and
processed during the runtime.
You cannot delete VOFM objects that are still 'active'. In this case you have to reset the active indicator manually before.
The content of the 'Application' field serves to filter the relevant VOFM objects in various display functions and Customizing functions.
Example: Condition value formula 010 'Relevant Price'. This formula has characteristic value 'MS' for the 'Application' field (= External Services Management purchasing). Therefore the object is not open for selection in the input help during the maintenance of pricing procedure SD (Transaction V/08), because this is a Customizing transaction assigned to application 'V' (= Sales and Distribution).
Storing an application key is optional.
The generation date and the generation time record the time of the last registration of the VOFM object (the object carrier, refer to section 2.4.1).
In addition to the respective TFRM entry a VOFM object can have 'n' entries in table TFRMT. The entries are used for the storage of language-dependent object descriptions, which are structured as follows:
- Language key [SPRAS]
- Group indicator [GRPZE]
- Group number [GRPNO]
- Description [BEZEI]
Examples:
SPRAS GRPZE GRPNO BEZEI
D PBED 001 Regulierer abweich
E PBED 001 Different payer
The system supplies the language key automatically with the logon language of the user during the creation of a new VOFM object.
The length of the object description is limited to 20 characters.
Important! A VOFM object is only consistent if both the Include file with ABAP form routine and a corresponding TFRM table entry exist. Entries in table TFRMT are optional.
2.4 Calling VOFM objects
As mentioned above, VOFM objects are called directly by the application logic of R/3 standard programs. Technically this is implemented by ABAP statement 'PERFORM ... IN PROGRAM'. With the aid of this statement you can specify both the name of the subroutine and the main program dynamically (during the runtime).
Example: Call of a condition value formula from the pricing
if xkomv-kofrm ne 0. <<< formula reference existing?
xkwert = xkomv-kwert. <<< act. value in work variable
frm_kondi_wert-nr = xkomv-kofrm. <<< set up object names
perform (frm_kondi_wert) in program saplv61a if found. <<<CALL
xkomv-kwert = xkwert. <<
endif.
In the example above the subroutine is determined by the contents of variable 'FRM_KONDI_WERT'; the main program, which is to be searched for the form routine, is SAPLV61A.
If the called routine is not known in the main program, a program termination with the title 'PERFORM_NOT_FOUND' occurs.
Therefore some users of the VOFM technology call ABAP statement 'PERFORM ... IN PROGRAM' together with the addition 'IF FOUND', which has the effect that a jump into the form routine is only executed if this in fact exists in the main program. This does indeed prevent a program termination, however, the result of the overall process may deviate from the
result expected by the user, because in this case the system does not execute the source code implemented in the VOFM object.
2.4.1 VOFM 'object carrier'
Object carriers are required to make a VOFM object 'known' in the main program of the calling program (refer to section 2.4). The object carrier is integrated in the main program of the calling program as an independent include (for example SAPLV61A, SAPMV45A and so on).
Example: Inclusion of object carriers for word processing in SD
documents; Program 'SAPLV45T'
System-defined Include-files. *
INCLUDE LV45TTOP. "Global Data
INCLUDE LV45TDEF.
INCLUDE LV45TUXX. "Function Modules
INCLUDE LV45TNNN. <<< 'carrier' copy requirements for texts
INCLUDE LV45TENN. <<< 'carrier' copy routines for texts
Every active VOFM object (for an explanation on the active indicator refer to section 2.3.2) must be registered in the 'carrier'.
The system writes standard VOFM objects delivered by SAP directly into the 'carrier', VOFM objects from the number range reserved for customers (refer to section 2.2 'Namespaces') are sorted into a 'sub-include' included in the carrier.
Exactly one carrier exists per group indicator. The names of all defined object carriers are hard-coded in program MV80HF0A, form routine 'AKTIVIEREN_TRAEGER_SETZEN'.
Here the names of the sub-include for customer-specific VOFM objects belonging to the main carrier are also defined.
Example: Carrier object 'FV63ANNN' for the registration of condition basis formulas in the pricing (Program SAPLV61A)
FV63ANNN
<<< main
carrier-include
|-INCLUDE RV63ANNN. "User-Routinen <<< sub-include customer objects
| |- INCLUDE RV63A910. "Customer specific
| |- INCLUDE RV63A911. "Customer specific
| |- INCLUDE RV63A912. "Customer specific
| |- ...
|- INCLUDE FV63A001. "Volume
|- INCLUDE FV63A002. "Net value
|- INCLUDE FV63A003. "Net Price
|- INCLUDE FV63A004. "Net Value Plus Tax
|- INCLUDE FV63A005. "KZWI1
|- ...
Because the content of the VOFM object carriers is automatically created source code, you should avoid manual changes to them.
SAP notes, which suggest manual changes to the object carriers, are therefore also incorrect. However, if you nevertheless receive such a note to solve a problem, contact the SAP
Support with a reference to this note.
2.5 Activation, generation and RV80HGEN
The 'activation' is the inclusion of an VOFM object in an object carrier. A 'deactivation' results in the removal of the VOFM object from the object carrier.
The overall process for the creation of a current object carrier is often called 'generation'.
Generally the activation or generation fall into three types.
- Individual activation
- Collective activation
- Generation of object carriers via report RV80HGEN
The 'individual activation' causes the registration of an individual VOFM object in the corresponding object carrier. Which object carrier is relevant is determined with the aid of the group indicator and the group number. In addition to the entry of the VOFM object in the object carrier the system writes the date and time of the generation into table TFRM (refer also to section 2.3.2).
You can start the individual activation only manually. It is always always executed when a user selects a line within the VOFM editing interfaces and afterwards selects activity
'Activate' from the 'Edit' menu.
The 'collective activation' causes the registration of all VOFM objects that belong to a certain group indicator. Analog to the individual activation the system determines the relevant object carrier automatically and writes date and time into table TFRM. The 'collective activation' is a process which you can start also only manually. For this purpose, choose activity
'Activate all' from the 'Edit' menu.
During the generation via report RV80HGEN the system sets up the object carriers of all defined group indicators again. However, the system includes only those VOFM objects that have set the 'active' indicator in the corresponding TFRM table entry. Nonactive VOFM objects are not included in object carriers during the generation via report RV80HGEN.
Due to the quantity of the data to be processed,
the generation via RV80HGEN can take between 0,5 and >5 minutes (depending on the system and the constellation).
Because the RV80HGEN is defined as 'XPRA', it is executed automatically during a system upgrade.
You can also use this XPRA feature for the transport of VOFM objects in order to implement an automatic update of the object carriers after the import of VOFM objects into the target system (section 2.6 provides more details on the transport).
Both the collective activation and the activation via report RV80HGEN technically revert to the program components of the individual activation. For the separate control of the individual activation types form routine AKTIVIEREN_EINZELN (Include MV80HF0A) has a 'USING' parameter, which can have the following characteristic values:
'E' Activate individually
'A' Activate all (= collective activation)
' ' Deactivate individually
During the generation via RV80HGEN the system executes a collective activation for every group indicator sequentially, that means a call of form routine
AKTIVIEREN_EINZELN with characteristic value 'A'.
2.6 Transport
If you want to transfer VOFM objects from one system (= source) into another system (= target), this is generally made with an object transport.
As of Release 4.0, the VOFM function has a connection to the SAP 'Change and Transport System' (CTS) in order to simplify the transfer process for the user.
By the transport connection the system automatically adds newly created or changed VOFM objects to the object list of a transport request which was selected by the user before.
All steps necessary for the execution of a VOFM transport are described in detail in Note 22808 'Transferring formulas'. Note that steps 1-4 are only needed
if the VOFM maintenance environment providesno automatic connection to the transport system or if you want to combine a transport request manually. In any case you must execute step 5, regardless of how the transport request was created.
In addition to Note 22808, Note 385067 contains an overview for releases >= 4.6C regarding which sorts of tasks and object entries are required in a
transport request (depending on the activity carried out (create/change/activate/deactivate/delete)) in order to transport a VOFM object successfully. -
Can I use automatic Free goods determination for QT order types.
however i am using it for OR right now and i have done the related configuration for QT as well but system is not detmining Free Goods for QT order types.
I have also maintained the below entry in "Determine Item Category for Free Goods Item"
Sa Type ItCGr Usg. HLevelItCa DfltC
QT NORM FREE AGN AGNNHi
Std SAP itself doesnt support Free Goods at quotation level
Standard SAP supports Free Goods at quotation level and hence the item categories AFNN and AGNN are provided in the standard SAP. But, the Automatic determination of Free Goods is not possible for SD documents under category other than 'C'.
In your scenario...since the automatic determination is not possible, think about handling the functionality manually or through user exits.
Thanks,
Ravi -
Hi,
There was a difference in Total of Order values in T code VKM4 and order value in FD32. I noticed that VKM4 was displaying all open orders irrespective of either it is blocked or released. But Open Order value in FD32 displays only the sum of open orders that are without block. The open orders that are blocked due to some reasons are not considered for open order value in FD32. Hence, there was a difference in values displayed in FD32 and VKM4. The open order value in FD32 is getting updated through standard info structure S066. I believe, S066 is not getting updated if the order is blocked.
My requirement is that the open order value in FD32 should include blocked orders also and the value in VKM4 and FD32 should look same.
1. Is there any functional customization that need to be done in regards to this scenario i.e, settings for including blocked orders also in open order value calculation in FD32?
2. Is there any user exits available to solve this? I searched for the possible user exits but couldn't find any relevant one. Please suggest.
3. Is there any other means through which we can update the standard info structure S066 with blocked orders also?
Thanks in advance
Senthil Kumarit never be same.
I noticed that VKM4 was displaying all open orders irrespective of either it is blocked or released.<b>--->here u can get only Released Orders na, by selecting parametres</b>
better to go for Z reports which suits ur requirement, but i think we are missning some imp point in terms of Functional.
Regards
Prabhu -
How can I add a new line item for production order?
HI all,
How can I add a new line item for production order through BAPI/FM? Thanks in advance.Hi Mil,
Unfortunetly SAP is not in front of me.
But if possible go to BAPI transaction , check for any production order's bapi for CHANGE purpose. Where you will be able to add your new line.
Reward if useful! -
How to not to display any line items for val flds values are zero in KE30?
Dear All,
In KE30,in one of my reports, i do not want to display such line items for which all values are zero for all val flds, it should only display the line items for which there is any value, i have tried Zeros hide in KE35 in formatting menu>other format>hide zeros, but unofrtunately it didnt came out.
Regards
Rashid
Edited by: rashinuet on Feb 20, 2012 4:38 PMDear Abhishek,
I have tried that as well in ke35 and made this option activated on my val flds like sales revenue for hide zero values, but it didnt came out as well, then in i tried ke32 change report >Extras menu>form settings, this adopts all the settings in the report from the form you have assigned, but this is not working, i am failed to understand what has gone wrong.
Regards -
Error: Automatic tick in free Item in purchase order on line for specific vendor
Hello All,
Sales order is created then running mrp through MD01,requisitions are created.while creating purchase order for a particular vendor it is automatically ticking on free item indicator and giving error as material is not maintained in the plant (XXX) Free trade. while PR is not created for plant(XXX).
i have checked they are not doing any transaction in plant (xxx).
Please do needful in above issue.Hi all ;
Can you share screen-shoots for your sales document ?
1-What is your sales document type ? Go to VOV8 find it and share.
2-What is your item category for this sales order? Go to VOV7 find it and share us.
3-What is your schedule line ? Go to VOV6 find it and share us.
Regards.
M.Ozgur Unal -
Hi,
We have a scenario where in certain line items in a Purchase Order, first a net value was entered and then they were made free items by checking the free item indicator.
The purchase order was then saved.
However the value that was reduced when the items became free items wasn't getting updated in the Net value that appeared in the Header Level conditions. This resulted in the Net value of the Purchase order appearing higher than it was.
When we went to ME22N and unchecked the free item indicator for all the free items and re-checked them, the value was updated correctly.
Any idea why the value was not updated correctly the first time?
Thanks,
NanditaPlease check if you can replicate this behaviour. If this does not happen, then it is a one-off case and better to leave it at that. If you are able to replicate this consistently, the likely reason is that the values are transferred to the header conditions before you make the item free. The conditions are not refreshed while saving the PO (which should actually be done). In such a case, your best bet is to ask SAP to look into this.
Lakshman -
How to define the detail "Condition" item for sales order?
Hi, I checked the condition information of a sales order, the following contents were displayed:
PR00 Price 230.00
Gross Value 230.00
Discount Amount 0.00
Net Value for Item 230.00
Net Value 2 230.00
Net Price 230.00
I can understand that the price 230.00 can be maintained via tcode: vk11, what I want to know is:
How to define/control the following items such as:
Gross Value 230.00
Discount Amount 0.00
Net Value for Item 230.00
Net Value 2 230.00
Net Price 230.00
and how to control their currency?
Thanks.Hi, Dear Ferry Lianto,
Thank you very much.
Commonly I know the total pricing procedures.
But, would you please tell me how to control the CURRENCY for the subitem of a condition type as follows?
For example, I can see the following kind of
contents in the Tab:condition of a sales order:
PR00 Price 130.00000 TEST 100
Gross Value 20.12 USD 100 <-how to
Discount Amount 0.00 USD 100
Rebate Basis 20.12 USD 100
Net Value for Item 20.12 USD 100
Net Value 2 20.12 USD 100
Net Value 3 20.12 USD 100
VPRS Cost 27.22 HKD
Profit Margin 16.61 USD
The currency of PR00:price can be controlled via tcode VK12; but how to control the currency of its subitem such as gross value, discount amountm, net value for item, net value 2, & net calue 3...
Thanks and regards. -
Tax as percentage of totaL order value
Hi,
In pricing i have a scenarios where the tax is calculated on the total sales order value.
If order has 2 items
10 mat1 net value 5000
20 mat2 net value 40000
The tax should be 1 per of 90000 ie RS 900
The client does not want it enter it manually and want to use condition records.
Best regards
JatinderHi
As per my knowledge tax is always calculated on the nett value of the sales order which is in line with your requirement
Make sure that in your pricing procedure that you are not giving from and to for that tax condition tye
Suppose in your PP you have a PR00 at step 10 ( first condition type)
Say a customer discount K007 at step 20
Say a material discount K020 at step 30
Material price is Rs100 and customer discount is 5 % thae it is 95 rupees and than a material discount another 5 % then the nett price becomes Rs 90
Now you want tax MWST to be 1 % on this Rs 90 that is 90 paise or .9 rs then in your PP mwst should be in step 40 without from and to and with its requirements and other things
You have to maintain condition record for MWST as 1 % for your domestic key combination
Regards
Raja -
Free goods-more than one material as a free item in sales order
Hi,
We have a requirement for our client in free goods scenario in which the client wants to give more than one material(2or3 etc) as a free item in the sales order.I have already explored the slaes BOM functionality,anyother suggestions other than Sales BOM will be of great help to me.
ThanksHi Sam,
Check out my [post|Re: Free goods process requirement] wherein I had the same problem once upon a time.
We tried all possible things, however concluded that through std SAP functionality the same is not possible.
FYI: Free Goods doesnt support BOM, Sub items, Product selection. etc.
Regards,
Amit
Edited by: Amit Iyer on May 12, 2011 3:01 PM -
Open items for purchase order its very urgent
hi
my requirement is to write extract program for purchase order(me21) to extract only open items.
please provide sample code its very urgent.
thanks in advance.
points will be rewarded.
thanks
hari prasad reddycheck the below report :
REPORT ZMM_OPEN_PO_REPORT no standard page heading
line-size 255
message-id zwave.
======================================================================
Program Name : ZMM_OPEN_PO_REPORT *
Description : This report displays all Open PO Items and output *
would be PO Number,Material number and so on *
Author : Seshu *
Date : 01/24/2007 *
MODIFICATION HISTORY *
DATE | AUTHOR | CHANGE # | DESCRIPTION OF MODIFICATION *
--|||--
01/24/07| Seshu | DEVK921979 | Initial *
D A T A D E C L A R A T I O N P A R T ***
type-pools
type-pools : slis.
Tables
tables : ekko, " Purchase order Header
ekpo, " Purchase order Item
marc. " Material with Plant data
Internal table for output.
data : begin of i_output occurs 0,
ebeln like ekko-ebeln,
matnr like ekpo-matnr,
end of i_output.
ALV Data declaration.
data : v_repid like sy-repid.
ALV Function Module Variables
DATA: gs_layout type slis_layout_alv,
g_exit_caused_by_caller,
gs_exit_caused_by_user type slis_exit_by_user.
DATA: gt_fieldcat type slis_t_fieldcat_alv,
gs_print type slis_print_alv,
gt_events type slis_t_event,
gt_list_top_of_page type slis_t_listheader,
g_status_set type slis_formname value 'PF_STATUS_SET',
g_user_command type slis_formname value 'USER_COMMAND',
g_top_of_page type slis_formname value 'TOP_OF_PAGE',
g_top_of_list type slis_formname value 'TOP_OF_LIST',
g_end_of_list type slis_formname value 'END_OF_LIST',
g_variant LIKE disvariant,
g_save(1) TYPE c,
g_tabname_header TYPE slis_tabname,
g_tabname_item TYPE slis_tabname,
g_exit(1) TYPE c,
gx_variant LIKE disvariant.
data : gr_layout_bck type slis_layout_alv.
Ranges
ranges r_eindt for eket-eindt.
initialization.
v_repid = sy-repid.
start-of-selection.
Get the data from EKKO ,EKPO and MARC Table
perform get_data_tables.
end-of-selection.
display the data in the form of ALV
perform display_data.
*& Form get_data_tables
Get the data from EKKO,EKPO and MARC Table
FORM get_data_tables.
clear : i_output.
refresh : i_output.
fill the dates in ranges
r_eindt-low = sy-datum - 7.
r_eindt-high = sy-datum + 14.
r_eindt-option = 'BT'.
r_eindt-sign = 'I'.
append r_eindt.
Get the data from EKKO,EKPO and EKET Tables
select aebeln bmatnr into table i_output
from ekko as a inner join
ekpo as b on aebeln = bebeln
inner join marc as c on cmatnr = bmatnr
inner join mara as d on dmatnr = bmatnr
inner join eket as e on eebeln = aebeln
and eebelp = bebelp
where c~beskz = 'E'
and c~werks = '1000'
and d~mtart = 'FERT'
and b~loekz = space
and b~elikz = space
and e~eindt in r_eindt.
if sy-subrc ne 0.
message e000(zwave) with 'No open purchase order found'.
endif.
ENDFORM. " get_data_tables
*& Form display_data
text
FORM display_data.
Fill the Fiedlcat
PERFORM fieldcat_init using gt_fieldcat[].
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = g_user_command
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = gr_layout_bck
IT_FIELDCAT = gt_fieldcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = g_save
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = i_output
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " display_data
*& Form fieldcat_init
text
-->P_GT_FIELDCAT[] text
FORM fieldcat_init USING e01_lt_fieldcat type slis_t_fieldcat_alv.
DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
Purchase order number
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'EBELN'.
LS_FIELDCAT-ref_fieldname = 'EBELN'.
LS_FIELDCAT-ref_tabname = 'EKKO'.
LS_FIELDCAT-TABNAME = 'I_OUTPUT'.
ls_fieldcat-seltext_L = 'Purchase Order'.
ls_fieldcat-seltext_M = 'Purchase Order'.
ls_fieldcat-seltext_S = 'Purchase Order'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
Material #
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME = 'MATNR'.
LS_FIELDCAT-ref_fieldname = 'MATNR'.
LS_FIELDCAT-ref_tabname = 'EKPO'.
LS_FIELDCAT-TABNAME = 'I_OUTPUT'.
ls_fieldcat-seltext_L = 'Material'.
ls_fieldcat-seltext_M = 'Material'.
ls_fieldcat-seltext_S = 'Material'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
ENDFORM. " fieldcat_init -
There are two sales order type standard(A) and promotion(C) defined in our business.
when we create standard order it will goods automatically capture the free goods we maintaind.
However for promotion order, the system shows below message:
Free goods could not be determined for item 000001
Document category is not from sales order category (VBTYP <> 'C')
whether it is unable to use free goods for order type "C"?
Please advice,
Many thanks,
YangDear Yadav
There are two order type ZAA1 - standard ZAA2 - promotion
two item cateogry ZDC0 - standard ZDC1 - free of charge.
I made a test to change the item category assignment as ZAA1 with ZDC1 and ZAA2 with ZDC0.
Still the free goods can automatically captured with standard order but promotion failed.
So I think the difinition of item category is no problem and it may related to sales order type.
My colleague told me it is unable to use free goods for the sales order which SD document category is not "C".
I try to change the SD document categ from I to C for promotion order and the free goods appear.
So the result is if i define the SD document category as I that I can't use function of free goods?
Please advice
Many thanks,
Yang
Edited by: Jun Yang on Nov 26, 2009 9:34 AM
Maybe you are looking for
-
Problem Updating Business Partner DI Object loaded via XML
Hello, I'm working with SB1 8.81 PL 08 I have to Update a Business Partner Object in a Target SB1 Company Database starting from a Business Partner Objects saved as XML from the Source SB1 Company Database. Normally this works fine, I load from XML
-
Place of newly opened tabs is not logical (not put to the end of row)
When I have more tabs opened (for example 5) and I click a link with the middle mouse-button NOT on the last tab (for example on the 2nd one) Firefox does not put the newly opened tab to the end of the row, it is inserted right after the clicked page
-
Hi Experts, Is it is possible to create an invoice format in XL reporter
-
Where does the scrambling occur?
Dear experts, I've seen in some TDMS docu that the scrambling for HCM is performed in the source system, so no sensitive data is extracted without scrambling. But I haven't found such information for scrambling for ERP. I mean I would like to know wh
-
Using Labview realtime module in RTAI
hello everyone, i want to use Labview realtime module in RTAI for real time applications beacuse of it's free source and very good performance. is it possible to do this work? if it is, can anyone introduce some same case study or something similar t