Painting records depending on previous record
Hi all,
I need to pute the foreground color of a record depending on an field of the previous record, i mean, if the current record has the same data than the previous one it has to be blue, but if it's different it has to be red.
can someone tell me how to do, and in wich trigger.
thx!
Hello,
Here is the good way to check the duplication in detail block. So use the same logic and instead of showing message you can set the visual attribute on your choice. See the link below.
http://sheikyerbouti.developpez.com/duplicates/duplicates.htm
So, in WHEN-VALIDATE-RECORD there is message "This record is duplicated". There use your blue visual attribute and add one ELSE condition and use the 2nd visual attribute.
Remove the RAISE FORM_TRIGGER_FAILURE line.
-Ammad
Similar Messages
-
How to add a version by default depending on previous version found in db of a record?
Hello,
How to add a version by default depending on previous version found in db of a record?
E.g ID 0001 Version : 1
when inserting id 0001 version 2.
I want the version to be added automatically on insert , depending on id input.
Thanks.Hi,
I think using a trigger is better choice.
from application, you should manage concurrent processes.
Regards -
Does report painter is dependent on report writer
Hi,
can anyone tell me that whether the report painter is dependent on report writer.
if iam going to learn sap painter alone then also we have to use sets , key figures etc.
if there is any dcument or pdf file please send me the link.
thanks,
joseph.hi,
Report Writer functions can be accessed from within the Report Painter.
The difference lies in the GUI of the report painter.
For Report Painter
http://help.sap.com/saphelp_47x200/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/content.htm
For Report Writer
http://help.sap.com/saphelp_47x200/helpdata/en/66/bc7dc143c211d182b30000e829fbfe/content.htm
regards,
pankaj singh
Message was edited by:
Pankaj Singh
Message was edited by:
Pankaj Singh -
Hi,
Lets say, we have three parameters A, B and C. B is dependent on A, C is dependent on A and B. If A value is entered, then we can list only the values of B which are related to A. If User is not entered A value then how can we list all values available in B? In the sameway for C also ( If A and B values not entered then it should allow to select a value from all available values in C)?
I don't want to put default "ALL" value and then use this in other value sets to get all values. Is there any other way using some dummy parameters? I searched in threads but couldn't find relevant.
Thanks,
Venkat.Hi,
Lets say, we have three parameters A, B and C. B is dependent on A, C is dependent on A and B. If A value is entered, then we can list only the values of B which are related to A. If User is not entered A value then how can we list all values available in B? In the sameway for C also ( If A and B values not entered then it should allow to select a value from all available values in C)?
I don't want to put default "ALL" value and then use this in other value sets to get all values. Is there any other way using some dummy parameters? I searched in threads but couldn't find relevant.
Thanks,
Venkat. -
Creating drop down menus that change dependant upon previous menu
I need to create a drop down menu and then have the next drop down change its content based on the selection in the previous menu
Would anybody have any code that I could play around with that would help me achieve this?
Thanks!!
MarkHi Mark,
This should get you close:
Create a .cfc call it product, as in save as product.cfc
You'll need to change the datasource name and the FROM clause below on both queries.
<cfcomponent output="false">
<cffunction name="getProduct" access="remote" returnType="query">
<cfset var data="" />
<cfquery datasource="yourdb" name="data">
SELECT product_uid,product_title
FROM yourtable
</cfquery>
<cfreturn data>
</cffunction>
<cffunction name="getSubProduct" access="remote" returnType="query">
<cfargument name="product_uid" type="numeric" required="true">
<cfset var data="" />
<cfquery datasource="yourdb" name="data">
SELECT sub_uid,sub_title
FROM yourtable
WHERE sub_product_uid = #ARGUMENTS.product_uid#
</cfquery>
<cfreturn data>
</cffunction>
</cfcomponent>
Imbed this in your your cfm page:
<cfselect
name="Product"
bind="cfc:product.getProduct()"
style="width:387px;"
size="1"
multiple="No"
required="No"
display="product_title"
value="product_uid"
bindonLoad="True">
</cfselect>
<cfselect
name="Sub Product"
bind="cfc:product.getSubProduct({product_uid})"
style="width:387px;"
size="1"
multiple="No"
required="No"
display="sub_title"
value="sub_product_uid">
</cfselect> -
Dependency on previous parameter
I have a report that contain 2 dynamic multiple selection parameter what I like to accomplish is on selection of parameter 1 will be population of list of parameter 2 example:
Fields u201Clocationu201D and u201CBoxu201D
Location can be 1, 2
Box can be a,b,c,d but a and b belong only to location 1 c and d belong only to location 2 .
As right now parameter 1 show all location what is ok but parameter 2 show all boxes and I want to show only the boxes that belong to location selected how I can accomplish this?
If I select location 1 should show boxes a, b
If I select location 2 should show boxes c,d only.
Thank you.Hi
It doesn't tale much time, you need to create a parameter. Please Follow the below steps.
1) Select Dynamic under List of Values.
2) Give a required prompt group text as you required.
3) Under the Value in the First Line Select Location, no need to give any description. Then under Parameter in the same row just give a left mouse click. Now this is for Location 1 to select box a,b.
4) Do it in the next row as above for Box, select box and no need of any description then again under parameter give a click to create a parameter for box. Click on ok.
5) Now in the Preview select "SELECT EXPERT", In the choose fields dialogue box, select Location Column under "report fields".
6) From the drop down list select "equal to" option. From the second drop down list select the Parameter which is like,
EG : {?My Parameter - Location}
7) Click on ok, that will automatically return you to a dialogue box that asks you to enter your prompt.
That's all you need to do.
Regards
Raj Mahesh -
Hi
this is suresh. I am new for this technology.. Please Help me to know anybody about this issue....
The user will select the dropdown for the characteristic and it should display relevant values based on entered value from the preceding characteristic. For example, u201Cassembly typeu201D field value u201CCabinetu201D is only displayed for TLA Family type u201CSYMM5u201D u201CSYMM6u201D or u201CSYMM7u201D values. This is my requirement... How can i implement in core abap.
Dependent values like...
ASSEMBLY TYPE----> TLA FAMILY TYPE
ADAPTER -
> SYMM5 / SYMM6/ SYMM7
BOARD -
> CLARIION/ CONVERGED/ CELERRA SHOEBOX
CAB/PDU/PDP -
> CLARIION/ CONVERGED/ CELERRA SHOEBOX
CABINET -> SYMM5 / SYMM6/ SYMM7
CABLE - SERIALIZED.......> CLARIION/ CONVERGED/ SYMM5 / SYMM6/ SYMM7/ CELERRA SHOEBOX
These values coming from the table and as well as Dynamically also...(IN Both cases)
Please tell me how to implement in core abap....is there any code available please share with me.
Thank to ALL...Hi Suri,
Well, I also agree with Craig as this may not be feasible in QM stand alone! Possibly you can think of using selected sets for attributes as an alternative for this. I try to explain for the same case in point.
1. Letu2019s say we have created 2 qualitative MIC as Country and State
2. Create code groups under catalog 1 with states names
3. Create selected set as IN, GE, US for India, Germany and US respectively.
4. Under each one of these selected sets define country specific states.
5. You can assign more than 1 selected sets in MIC under catalog section.
6. As a result of which while carrying out result recording system will prompt you to put state name. drill down respective country folder and choose the appropriate one.
But this wouldnu2019t depend on previous result. At lease would ensure you can input the data.
Regards,
Anand Rao -
Turn Photoshop into Corel PHOTO-PAINT
At the request of a couple of Photoshop enthusiasts in these forums, they thought I should post this feature request.
In a previous discussion, harry teasley wrote:
May I suggest a single suggestion, "Turn Photoshop into Corel Photo-Paint"?
In a previous discussion, Reynolds (Mark) wrote:
[I] agree with Harry's…
May I suggest a single suggestion, "Turn Photoshop into Corel Photo-Paint"?
In support of Harry Teasley and Mark Reynolds, I have created these lists of features included in both packages, that if not ignored might win over some Corel PHOTO-PAINT fans. Not that Adobe Photoshop is hurting for more customer base, but you get the idea. Oh! And none of these suggestions would remove any of Photoshop's existing functionality!
Here's a list of features that Corel PHOTO-PAINT has that Adobe Photoshop does NOT (as far as I know):
Mouse wheel zoom snaps to 100%.
Zoom tool actually zooms to selection bounds, even if it's greater than the document's bounds.
Cutting, copying, pasting and deleting selected layers.
File >> New From Clipboard.
Renaming menu bar commands and moving/copying them around at will.
Mapping arrow keys to keyboard shortcuts (CTRL+up and CTRL+down are my favorite)
Interactive Object Transparency Tool (wineglass tool).
Swatches panel width @ 1 swatch wide.
Ability to have larger swatches.
Click and hold on a swatch to see warmer, cooler, darker and lighter versions of that swatch.
Clicking a layer in the document to toggle between transform, rotate, warp and perspective.
If you select a layer, perform a single action on that layer, and undo that action, PP doesn't select the previous layer you had selected.
Checkpoints.
Reasonable price.
And here's a list that neither Photoshop or Corel PHOTO-PAINT has (as far as I know):
Creating new menu bar commands (wherever you want them) and assigning scripts to them.
Mouse wheel zoom does not maintain position when zooming way out and back in.
Brush strokes are not natural like Corel Painter and have a "skip rock" side-effect to them (yes, even with spacing set to 1 and smoothing checked).
Adding an alpha channel to the standard color picker.
Fully supported PNG alpha (even Photoshop creates artifacting that I've only seen present itself in Maya, but Pixelformer fixes the problem and saves the PNG appropriately). (more info)
Granted, there are a couple of features that Photoshop has, even from a Corel PHOTO-PAINT-biased standpoint, that I find extremely beneficial!
The first opened or newly-created document opens maximized (small thing, but very handy).
Vector shapes (though, still not truly vector).
Layer effects (and the drop shadows are flawless).
The healing brush! Just awesome!
I'm sure there are a multitude of other features within Adobe Photoshop that I will grow to love, but these are the ones that stick out to me now, after having been forced to use Photoshop over the last couple years.
And I don't steal software either, so that's part of the reason I've grown up using Corel's products.He was trying to argue that Photoshop had a more reasonable price with Elements.
I was only pointing out that Corel also has a cheaper alternative to PHOTO-PAINT. In fact, you can't even BUY PHOTO-PAINT solo. You have to buy the entire Graphics Suite.
This wasn't always the case, however. -
How do you eliminate transparent pixels caused by glare from the sun coming off a painting and still retain orginal color and composition?
You'll need to post the image for us to give advice.
In general, the glare cannot be removed. You can clone over the glare, but the cloned areas will not be the original underlying painting. Depending on your image, acceptable solutions might be possible, as long as you are aware of what is actually being done.
Ken -
Hi,
Please explain me the steps for creating background in smartforms.
Regards,
SreejaDisplaying a Background Picture for Copy Purposes
Use
In your business procedures, you may often want to use existing forms as patterns for creating new ones. You can easily do this by scanning the exising form into the computer, displaying it as background picture, and copying it over. In the Form Painter, you can use windows to copy over the output areas of a form; in the Table Painter, you can use cells to copy over templates. This section describes how to do it.
Prerequisites
You must import any graphics into the SAP System using Administering Form Graphics (transaction SE78 ):
Double-click a graphic format in the tree structure in the folder Document Server ® GRAPHICS ® General graphics.
Choose Graphic ® Import.
The transaction imports the graphic and stores it on the Business Document Server (BDS). Now you can display it in a form.
See also: Graphic Administration.
Procedure
Insert your graphic as background picture of a page (see: Creating Pages). The graphic appears in the Form Painter as soon as you update your entries by pressing ENTER .
Use the Form Painter to overlay the graphic with a window. To make this easier, select the option Transparent Window on the General tab of the Form Builder settings ().
Create a template in this window. To position the template, set the Vertical Alignment to Absolute (from top). You find this option on the Template tab in the Details view.
Without this setting, SAP Smart Forms cannot display a background picture in the Table Painter, because then the vertical position of the template in the window depends on previous, possibly dynamic, output.
If you encounter problems when trying to set the vertical alignment, save your Smart Form, exit SAP Smart Forms completely, and call the form again. See also Note 375087 in the SAPNet.
When you switch to the Table Painter after making these settings, an additional checkbox Display Background Picture appears. Mark this checkbox.
Result
The background graphic appears in the Table Painter. The right and left margins in the Table Painter, as usual, correspond to the right and left window borders. Copy over the lines of the pattern. To draw lines more exact, deactivate the Align With Grid attribute in the Table Painter.
With complex patterns, divide the page into several windows. This makes it easier to copy over the individual smaller patterns.
Step wise
SMART FORM Creation
uSING TABLE IN Smart Form
1) Tcode --> SmartForms
2) Form name --> Z_SF_TEST Create
3) Under Global settings
a) Form Interface
Table Tab
ITAB LIKE EKPO
b) GLOBAL Definitions
WA_NETPR LIKE EKPO-NETPR
In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
For that we have to create an extra variable in global definitions
Ex: netpr FIELD of EKPO
CREATE program lines and specify WA_NETWR = itab-netpr.
4) RT CLick on main Window
CREATE --> TABLE
Click Table painter
DEFAULT %LTYPE will be Created
a) If you want more like Header footer etc add by rt click on %LTYPE1
Table (Tab)
%LTYPE Radio(SELECT) 5 CM 5 CM 6 CM
CLICK on DATA (Tab)
INTERNAL TABLE ITAB LIKE ITAB
5)RT click on table control and create --> program lines
General attribute (Tab)
INPUT PARAMETER OUTPUT PARAMETER
itab WA_NETPR
Code Area
WA_NETWR = ITAB-NETPR.
6) RT CLcick on table ctl and create 3 text to display the fields
a) % text1 +button(insert field)
FIELD name &itab-ebeln&
Output options (tab)
Check New line LINETYPE %Ltype1
check new cell
b) % text2
& itab-ebelp&
output options
check new cell
c) % text2
& wa_netpr&
output options
check new cell
Report ac
Tables ekpo.
Data: itab1 like ekpo occurs 0 with header line.
select * into table itab1 from ekpo.
Call function module
Smartforms are same as sapscripts. The transaction code to create the smart forms is SMARTFORMS. Check out these sites for step by step procedure.
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
http://help.sap.com/saphelp_nw04/helpdata/en/9b/e3b0d9c2a711d3b558006094192fe3/frameset.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sapgenie.com/abap/smartforms_detail.htm
http://www.sap-press.com/downloads/h955_preview.pdf
https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%0samples/smartforms/smartform%20in%20abap.pdf
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/smartforms/subroutine%20and%20select-option%20in%20smartform.pdf
http://www.sap-basis-abap.com/sapsf001.htm
http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9b/e3b0d9c2a711d3b558006094192fe3/frameset.htm
http://www.sap-img.com/smartforms/smart-006.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
http://esnips.com/doc/7e67af5c-6188-4252-8613-41816756d560/from-sappres.pdf
http://esnips.com/doc/58566115-54a4-4405-8872-8de952e245e5/smartform.pdf
http://esnips.com/doc/2276d194-dc47-4b1e-9c14-7af0ffe923ca/smartforms-xsf-output.pdf
http://esnips.com/doc/13b7ae7a-b32c-4b96-b588-881859d4ac99/Template,Table,Loop,Command-in-Smartforms.doc
http://esnips.com/doc/97acb00a-e513-4611-91f0-c626f460bfc5/Smart_Form_Overview.pdf
http://esnips.com/doc/77a981b9-8fe3-4fbb-8101-67745c1fe60c/SMART-FORMS_shail.ppt
http://help.sap.com/saphelp_nw04/helpdata/en/9b/e3b0d9c2a711d3b558006094192fe3/frameset.htm
http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
http://www.sap-img.com/smartforms/smart-006.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
I suggest you to use the Unit CH(CHARACTERS) for the Left Margin and Width and
LN(LINES) for Upper margin and Height
SMARTFORMS STEPS.
1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
2. Create Table type(t_struct) of stracture in se11.
3. In your program declare Internal table(Itab) type table of structure(struct).
4. Define work area(wa) like line of internal table.
5. Open Tcode Smartforms
6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
8. In form pages and window, create Page node by default Page1 is available.
9. In page node you can create numbers of secondary window. But in form there is only one Main window.
10. By right click on page you can create windows or Go to Edit, Node, Create.
11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
13. In table there are three areas Header, Main Area, Footer.
14. Right click on the Main area create table line by default line type1 is there select it.
15. Divide line into cells according to your need then for each cell create Text node.
16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
17. Save form and activate it.
18. Then go to Environment, function module name, there you get the name of function module copy it.
19. In your program call the function module that you have copied from your form.
20. In your program in exporting parameter of function pass the internal table(itab).
SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
configure forms with data from an SAP System for the relevant business processes.
To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
SAP Smart Forms also support postage optimizing.
Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
What Transaction to start SAP Smart Forms?
Execute transaction SMARTFORMS to start SAP Smart Forms.
Key Benefits of SAP Smart Forms:
SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
These actions do not include writing of coding lines or using a Script language.
Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
For Web publishing, the system provides a generated XML output of the processed form.
Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
SmartForms System Fields
Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
System fields of Smart Forms
&SFSY-DATE&
Displays the date. You determine the display format in the user master record.
&SFSY-TIME&
Displays the time of day in the form HH:MM:SS.
&SFSY-PAGE&
Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
&SFSY-FORMPAGES&
Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
&SFSY-JOBPAGES&
Contains the total page number of all forms in the currently processed print request.
&SFSY-WINDOWNAME&
Contains the name of the current window (string in the Window field)
&SFSY-PAGENAME&
Contains the name of the current page (string in the Page field)
&SFSY-PAGEBREAK&
Is set to 'X' after a page break (either automatic or command-controlled )
&SFSY-MAINEND&
Is set as soon as processing of the main window on the current page ends
&SFSY-EXCEPTION&
Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception ).
Example Forms Available in Standard SAP R/3
SF_EXAMPLE_01
Simple example; invoice with table output of flight booking for one customer
SF_EXAMPLE_02
Similar to SF_EXAMPLE_01 but with subtotals
SF_EXAMPLE_03
Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
Advantages of SAP Smart Forms
SAP Smart Forms have the following advantages:
1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
2. Displaying table structures (dynamic framing of texts)
3. Output of background graphics, for form design in particular the use of templates which were scanned.
4. Colored output of texts
5. User-friendly and integrated Form Painter for the graphical design of forms
6. Graphical Table Painter for drawing tables
7. Reusing Font and paragraph formats in forms (Smart Styles)
8. Data interface in XML format (XML for Smart Forms, in short XSF)
9. Form translation is supported by standard translation tools
10. Flexible reuse of text modules
11. HTML output of forms (Basis release 6.10)
12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
You can search www.help.sap.com for more details.
The following wesites provide details about ABAP and smartforms
http://cma.zdnet.com/book/abap/index.htm
http://www.sapgenie.com
http://www.sappoint.com
http://abap4.0catch.com/SAP_and_ABAP_Links.html#SAP_Hints_and_Tips
http://www.sapgenie.com/abap/smartforms.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
http://www.sap-img.com/smartforms/smart-001.htm
http://www.sap-img.com/smartforms/smartform-tutorial.htm
http://www.sap-img.com/smartforms/smart-002.htm
http://www.sapgenie.com/abap/smartforms.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-basis-abap.com/smartforms/smartforms-in-details.htm
http://www.erpgenie.com/abap/smartforms_detail.htm -
Dear Masters,
I have table called price detail with the following structure (with some sample rows)
with price_detail
as
select to_date('1/1/2013' , 'mm/dd/yyyy') sell_date, 100 dealer_price, 10 discount from dual
union all
select to_date('1/2/2013' , 'mm/dd/yyyy') sell_date, 120 dealer_price, 20 discount from dual
union all
select to_date('1/3/2013' , 'mm/dd/yyyy') sell_date, 200 dealer_price, 10 discount from dual
union all
select to_date('1/4/2013' , 'mm/dd/yyyy') sell_date, 100 dealer_price, 20 discount from dual
union all
select to_date('1/5/2013' , 'mm/dd/yyyy') sell_date, 120 dealer_price, 10 discount from dual
union all
select to_date('1/6/2013' , 'mm/dd/yyyy') sell_date, 210 dealer_price, 30 discount from dual
union all
select to_date('1/7/2013' , 'mm/dd/yyyy') sell_date, 140 dealer_price, 40 discount from dual
union all
select to_date('1/8/2013' , 'mm/dd/yyyy') sell_date, 150 dealer_price, 10 discount from dual
union all
select to_date('1/9/2013' , 'mm/dd/yyyy') sell_date, 200 dealer_price, 20 discount from dual
union all
select to_date('1/10/2013', 'mm/dd/yyyy') sell_date, 100 dealer_price, 10 discount from dual
union all
select to_date('1/11/2013', 'mm/dd/yyyy') sell_date, 120 dealer_price, 30 discount from dual
union all
select to_date('1/12/2013', 'mm/dd/yyyy') sell_date, 140 dealer_price, 20 discount from dual
Net_price and Net_price_before_discount are two calculated columns
Net price = Dealer_price – Discount ( from 2rd day after the current day , so if we are calculating for 1/4/2013 then the discount should come from 1/6/2013)
Net_ Price_ bd = Dealer_price ( From the 2rd day before the current day, so if we are calculating for 1/4/2013 then the Dealer_price should come from 1/2/2013) – Discount
Please refer below table after the highlighted date
Sell_date(mm/dd/yyyy)
Dealer_Price
Discount
Net Price
Net_Price_bd
Ch_flag
1/1/2013
100
10
90
140
1/2/2013
120
20
100
80
1/3/2013
200
10
190
90
1/4/2013
100
20
70
100
1/5/2013
120
10
80
190
1
1/6/2013
210
30
200
70
1
1/7/2013
140
40
120
80
1/8/2013
150
10
140
200
2
1/9/2013
200
20
170
120
1/10/2013
100
10
80
140
2
1/11/2013
120
30
120
170
1
1/12/2013
140
20
140
80
The task is that if for a row ch_flag is set to 1 (ch_ flag is available in the same table) which means Discount has been changed for that row and as Discount is being used to calculate the Net_price (for sell_date-2) and Net_Price_bd ( for sell_date) , corresoding records should get changed.
If for a row ch_flag is set to 2 which means Dealer_price has been changed for that row and as Dealer_price is being used to calculate the net_price ( for sell_date) and Net_Price_bd ( sell_date +2 ), corresponding records should also get changed
e.g. Say Discount has been modified for sell_date 1/5/2013 the flag is set to 1 , now Net_price_bd for sell_date and Net_price for sell_date -2 should get recalculated.
Please suggest me.
There will be multiple rows with ch_flag 1 and 2 , so i need to update all the corresonding rows in a single shot.
Can it be achived through Merge ?
AbBelow may be a possible solution to your problem:
alter session set nls_date_format = 'mm/dd/yyyy';
drop table test_table;
create table test_table as
select to_date('1/1/2013' , 'mm/dd/yyyy') sell_date, 100 dealer_price, 10 discount from dual union all
select to_date('1/2/2013' , 'mm/dd/yyyy') sell_date, 120 dealer_price, 20 discount from dual union all
select to_date('1/3/2013' , 'mm/dd/yyyy') sell_date, 200 dealer_price, 10 discount from dual union all
select to_date('1/4/2013' , 'mm/dd/yyyy') sell_date, 100 dealer_price, 20 discount from dual union all
select to_date('1/5/2013' , 'mm/dd/yyyy') sell_date, 120 dealer_price, 10 discount from dual union all
select to_date('1/6/2013' , 'mm/dd/yyyy') sell_date, 210 dealer_price, 30 discount from dual union all
select to_date('1/7/2013' , 'mm/dd/yyyy') sell_date, 140 dealer_price, 40 discount from dual union all
select to_date('1/8/2013' , 'mm/dd/yyyy') sell_date, 150 dealer_price, 10 discount from dual union all
select to_date('1/9/2013' , 'mm/dd/yyyy') sell_date, 200 dealer_price, 20 discount from dual union all
select to_date('1/10/2013', 'mm/dd/yyyy') sell_date, 100 dealer_price, 10 discount from dual union all
select to_date('1/11/2013', 'mm/dd/yyyy') sell_date, 120 dealer_price, 30 discount from dual union all
select to_date('1/12/2013', 'mm/dd/yyyy') sell_date, 140 dealer_price, 20 discount from dual;
table test_table created.
alter table test_table add net_price number;
alter table test_table add net_price_bd number;
alter table test_table add ch_flag number;
table test_table altered.
--Calculate and update the Net Price and Net Price BD
merge into test_table t
using (
select sell_date,
dealer_price,
discount,
dealer_price - lead(discount, 2, 0) over(order by sell_date) net_price,
lag(dealer_price, 2, 0) over (order by sell_date) - discount net_price_bd,
ch_flag
from test_table
) s
on (t.sell_date = s.sell_date)
when matched then
update set net_price = s.net_price, net_price_bd = s.net_price_bd;
12 rows merged.
Now, Lets see how the data looks:
select *
from test_table;
SELL_DATE DEALER_PRICE DISCOUNT NET_PRICE NET_PRICE_BD CH_FLAG
01/01/2013 100 10 90 -10
01/02/2013 120 20 100 -20
01/03/2013 200 10 190 90
01/04/2013 100 20 70 100
01/05/2013 120 10 80 190
01/06/2013 210 30 200 70
01/07/2013 140 40 120 80
01/08/2013 150 10 140 200
01/09/2013 200 20 170 120
01/10/2013 100 10 80 140
01/11/2013 120 30 120 170
01/12/2013 140 20 140 80
12 rows selected
Now, update few discounts and dealer price and set corresponding CH_FLAG.
update test_table set discount = 15, ch_flag = 1 where sell_date = to_date('01/05/2013');
update test_table set discount = 25, ch_flag = 1 where sell_date = to_date('01/06/2013');
update test_table set discount = 35, ch_flag = 1 where sell_date = to_date('01/11/2013');
update test_table set dealer_price = 175, ch_flag = 2 where sell_date = to_date('01/08/2013');
update test_table set dealer_price = 110, ch_flag = 2 where sell_date = to_date('01/10/2013');
commit;
Update the TEST_TABLE for the rows dependent on previous/later dates, where the discount and/or dealer price is modified:
merge into test_table t
using
select sell_date,
discount,
dealer_price,
decode(a.prev_ch_flag, 1, dealer_price - next_discount, net_price) upd_net_price,
decode(a.prev_ch_flag, 1, 'Modified', 'Same') is_net_price_modified,
decode(a.next_ch_flag, 2, next_dealer - discount, net_price_bd) upd_net_price_bd,
decode(a.next_ch_flag, 2, 'Modified', 'Same') is_net_price_bd_modified,
ch_flag,
next_ch_flag,
prev_ch_flag
from (
select sell_date,
discount,
lead(discount, 2, 0) over(order by sell_date) next_discount,
dealer_price,
lag(dealer_price, 2, 0) over (order by sell_date) next_dealer,
ch_flag,
lead(ch_flag, 2, 0) over (order by sell_date) next_ch_flag,
lag(ch_flag, 2, 0) over (order by sell_date) prev_ch_flag,
net_price,
net_price_bd
from test_table
) a
) s
on (t.sell_date = s.sell_date and (s.is_net_price_modified = 'Modified' or s.is_net_price_bd_modified = 'Modified'))
when matched then
update set net_price = s.upd_net_price, net_price_bd = s.upd_net_price_bd;
3 rows merged.
Now, lets see the final data:
select *
from test_table;
SELL_DATE DEALER_PRICE DISCOUNT NET_PRICE NET_PRICE_BD CH_FLAG
01/01/2013 100 10 90 -10
01/02/2013 120 20 100 -20
01/03/2013 200 10 190 90
01/04/2013 100 20 70 100
01/05/2013 120 15 80 190 1
01/06/2013 210 25 200 75 1
01/07/2013 140 40 120 80
01/08/2013 175 10 165 200 2
01/09/2013 200 20 170 120
01/10/2013 110 10 80 140 2
01/11/2013 120 35 120 170 1
01/12/2013 140 20 140 80
12 rows selected
This operation is possible using a regular Update, but not sure why I did not use it; perhaps I was thinking weird while arriving at solution -
Profit center at Material master
Hi All
We have one issue related to Profit center
Material Master record not maintained with out Profit center
PO created GR arrived ,MIGO posted with 101
Now we are unable to do any inventory transactions
Balancing field "Profit Center" in line item 001 not filled
Message no. GLT2201
Then we canceled Material document ,made the stock Zero with 102
Try to enter profit center again at MM02,Error giving as "stock still exists"
Checked MMBE, no stock there ,but Onorder stock still showing
Is there any dependency on previous period stocks because MIGO 101 posted in April,canceled with 102 with previuos period
Any suggestions?
Thanks
SAP MMHi,
this is new G/L created?? . it may the reason of document splitting . please check the entry exist in
SPRO-FINANCIAL ACCOUNTING(NEW)-GL ACCNT(NEW) -BUSINESS TRANSACTION-DOCUMENT SPLITTING-CLASSIFY G/L ACCOUNTS FOR DOCUMENT SPLITTING.
REGARDS,
MUKESH -
I created a new configuration for HRRCF_A_STARTPAGE_INT_CAND and named it as ZHRRCF_C_STARTPAGE_INT_CAND
How do I create a DELEGATION TO for this new config
ThanksHello
Most likely you have not yet defined the NACE (= transaction) settings. Example:
Call transaction NACE, choose condition V2 (= Shipping) and push button "Output Types".
Select your output type and choose "Processing Routines". Here you should have defined:
- Trans.Medium = 6 (= EDI)
- Program = RSNASTED
- FORM Routine = EDI_PROCESSING
In "Partner Functions" you can define default for the output partner.
Go back to the conditions and choose button "Condition Records".
- Select your output type
- Choose the key combination (depends on previous customizing), e.g. "Sales Organization / Delivery type / Ship-to party"
- Enter your key values, e.g. SalesOrg=1000, DeliveryType = 'LF', ShipTo=<Ship-to-party>
PartnerFunction = 'SH', Partner = <ship-to-party>, Medium = 6, Time = 4 (immediately, Language = 'EN'.
Now you should see that the output is generated automatically as soons as you enter the delivery in change mode.
Regards
Uwe -
[Help]Brush lagging when i chose big size, PS CS 6
Hi eveyone
This is my first thread, sorry for my bad language.
I had a problem in brush tool, when i increase size brush tool become 31px - 2500 px it will become lagging, but in 30px - 1px not lagging
It just brush tool and another tool there is no lag like that.
I choose another color still having lag, and the another tool no having like that.
Layout size is A4 (27,8 x 21)
Anyone can help this problem?
ThanksSome brush type tools require a lot of repetitive sequential processing as the brush tip pixels increase in number the latency can seem like for ever. For example smudge brush size, burn, dodge, blur. sharpen. Some filters like liquify will use your video card's GPU and their response may be nearly instant. Some Brushes require the use of a GPU like the mixer brushes. Disable OpenGL and mixer brushes are not an option. Mixing Paint reguire a lot of repetitive processing a which needs to be done in a sequence can not be done in parallel for the output and input depends the previous iteration and on the stroke's path, pressure and paint on canvas and on the brush. Even using a GPU a large mixer brush will lag some.
-
Force user to give input on only F4 help
Hi,
I have two screen fields.Based on what data is entered on first field, F4 options for second field should be filtered.
Also,user should give input to both the fields only by using F4 functionality, not by keyboard input.
This is a module pool screen, not a selection screen.
Presently I have used F4IF_INT_TABLE_VALUE_REQUEST in Process on value request block to give F4 help on both the fields.
I can make the user to give input on only dropdown by changing the dropdown to List box in screen painter,but then, POV block and hence the above FM is not getting triggered.
I can't assign search help or check tables in both cases because the input options are dependent on previous inputs.
Please help.Hi Kiran,
Make both the fileds as list box and create a module for bot the fields.
PROCESS ON VALUE-REQUEST.
FIELD 'FIELD 1' MODULE field1_values.
FIELD 'FIELD 2' MODULE field2_values.
Inside the module fetch the values into an internal table depending upon your requirement and pass the internal table to FM - F4IF_INT_TABLE_VALUE_REQUEST. For the second field the values sholuld be fetched into the internal table based on the values of the first field.
Thanx & Rgds,
Krishna
Maybe you are looking for
-
Call a C function in select statement
I have a C function FUN1(int,int) in a c file utility.c. I want to use this function in PL/SQL or Pro*c in the select statement as Select col1,col2,fun1(col3,col4)r_fun1 from table_1; Can any one tell the way to do this. Rergards,
-
Keep losing my bookmarks when signing on and off, and mostly when i reset Firefox to stop freezeups which happen quite often
-
"Error getting CSS support information for driver[HsvAdmDriver]" in HFM
Can anyone suggest a workaround for the error message: "Error getting CSS support information for driver[HsvAdmDriver]"
-
Is there a conflict with Mountain Lion and ATT air card?
I have an ATT USBconnect Momentum 4G air card. Ever since I installed Mountain Lion I am getting an error message that says that something is trying to modify the configuration. Is there a conflict with Mountain Lion and the ATT 4G air card? If so, i
-
1) "3D Surface Graph" does not work stably; sometimes it changes its properties (e.g. plot style) without me doing anything prior to that; a couple of times it lost a complete sense so that I had to delete the graph and install it again 2) I tried to