Selection formula no values

Using:
Crystal Reports XI SP5
Windows XP Pro
Dear Crystal Reports users,
As been a Crystal Reports developer, I came across the following problem. I'm using a table that contains rows for the input and output processes. I want to limit this table to only show the input processes.
The situation is as followed:
A user creates a order, to this order the user adds products he wants. For this product there is a packing process, this packing process has a input and output process, this is 1 process number, but has different batch numbers for the input and output process. However, sometimes there are no input processes, because the product is prepacked, that is what this problem is about.
The table is (re)named Processes_input
Linking is as followed:
Orders
|---> Left outer join (Enforced from) ---> Processes
|---> Left outer join (Enforced from) ---> Processes_input
However, when I try to do this with the select expert, with the following code:
{Proceses_input.Input_indicator} = 1
The report doesn't return process rows, because there is no input process, but I do want to display the orderline data and process data for that row.
I then tried to add Processes_input with an query
SELECT proc_input.*
FROM Processes proc_input
WHERE proc_input.Input_indicator = 1
Same linking as before only no selection formula.
This works some times, but when the datasource changes, the report doesn't return any data but there is data on the input process...
Does anyone know what to do, to get the correct data and still be able to switch dataconnections, since the report is used in a test enviroment and production enviroment.
Hoping on your response.
With kind regards,
Cyrus

Thanks for your help. I found out where the problem was.
The problem was that I was using a query that didn't assign a custom name for the table, I think that is why Crystal Reports couldn't handle the database tables correctly. The problem was solved by using a custom name for the table.
Wrong:
SELECT *
FROM Processes
WHERE Input_process = 1
Correct:
SELECT Process_input.*
FROM Processes Process_input
WHERE Process_input.Input_process = 1
Thanks for your help and I hope this will help others with the same problem.
With kind regards,
Cyrus
Edited by: Cyrusje on Jan 15, 2010 8:19 AM

Similar Messages

  • Pass the results from a selection formula to the default values for a parameter field

    Post Author: kevans
    CA Forum: General
    Crystal 10 u2013 SQL 2000
    I want to create a parameter field that will display all of our IT Departments so the end user can select the one they want to run the report against, such as IT-Security, IT-Network, etc. about 40 in all.  BUT I donu2019t want this to be a static list where I type in all 40 depts in the default list, I was hoping I could do something more dynamic such a formula field that says u201C if {group.name startswith u2018ITu2019 then {group.name}u201D and then have the parameter field pull from this source.
    Iu2019m sure this has been answered in a previous post but Iu2019m not finding it.  I see stuff on creating a record selection formula such as u2018if {?group} like u2018IT-Secur*u2019 thenu2026u201D  but this leaves too much room for error if people donu2019t type the name correctly.  Maybe Iu2019m not using the record selection formula correctly?  Sorry if I offend anyone but I just upgraded from 8 to 10 and thought for sure this option would be in 10, perhaps built right into the parameter default value page where you can place in select criteria but NOTHING has changed.

    Post Author: sharonmtowler
    CA Forum: General
    if you are creating the parameters in the rpt file, it will only pull values you enter, or directly from the database
    in the record selection you can do something like this, so if they only enter the first 2 characters it should pick up only the IT etc.
    (if eft(,2)={?parameter} then true else ={?parameter})

  • "Missing parameter values." Error when setting record selection formula

    Setup - VS 2008, CR 2008 (v12.0), Win XP & C#.Net
    I have a form which loops through all parameters (non-linked to sub reports, so only off the main report) and allows users to enter the values for each parameter. When hitting the preview button, I loop through all of the saved values, set the parameter field values and then add any additional filters into the recordselection formula as below. The problem i'm having is that the ReportDocument.HasRecords returns true if the ReportDocument.RecordSelectionFormula doesn't filter out every result.
    For example, I have a list of customers and if I set the selection formula to filter out a specific customer, ReportDocument.HasRecors returns true, if I set the selection formula to filter something that doesn't exist i.e. customer "xk39df", the moment this line of code runs "ReportDocument.RecordSelectionFormula = rsFormula;" - ReportDocument.HasRecors returns the following exception as opposed to "False".
    Message: Missing parameter values.
    Source: CrystalDecisions.ReportAppServer.DataSetConversion
    StackTrace:    at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.hasRecords()
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_HasRecords()
    ErrorID: MissingParameterFieldCurrentValue
    The strange thing is, it works fine if the recordselectionformula selects a record which exists in the results - all parameters have a current value except for the linked parameters.
    This one has got me stumped!
    foreach (ParameterFieldDefinition parameterField in ReportDocument.DataDefinition.ParameterFields)
                    var query = ReportObjects.Values.Cast<Filters>().Where(objects => objects.ParameterName == parameterField.Name.ToUpper().Trim());
                    foreach (var item in query)
                        parameterField.CurrentValues.Clear();
                        parameterField.CurrentValues.Add(item.ParameterValue);
                        parameterField.ApplyMinMaxValues(item.MinLength, item.MaxLengh);
                        parameterField.ApplyCurrentValues(parameterField.CurrentValues);
                var records = ReportObjects.Values.Cast<Filters>().Where(recordSelection => recordSelection.RecordSelectionFormula.Trim().Length != 0);
                foreach (var item in records)
                    rsFormula += item.RecordSelectionFormula;
                if (rsFormula.EndsWith(" AND "))
                    rsFormula = rsFormula.RTrim(5);
                ReportDocument.RecordSelectionFormula = rsFormula;

    Hi,
    The report has it's own ADO Datasource set in crystal reports, so I just pass the log on information to the report object before doing anything else.
    this.DataSourceConnections[0].SetConnection("ServerName", "Database", "sa", "Password");
    I then do a refresh before applying the parameter values (I do this because the user can preview the report more than one time by using a preview button on the parameter form without re-loading the report object)
    this.Refresh();
    Then I set all parameter values followed by setting the recordselection formula.

  • Passing values at run time through a JSP page to selection formula to crystal report

    <p>hi,</p><p>   i am using one jsp page.in that page there is a field to select a date </p><p>this value will go to the report and report contain one selection formula.</p><p>which value we are passing on that basis the report should display</p><p>with date which we are passing  from GUI.</p><p>help.............................................................</p><p>//R</p>

    I believe the value of this is based on the owner of the scheduled object.  So if the Admin is scheduling it on behalf of a user I think it should use the user the Admin scheduled on behalf of.  It should be simple to test, simply create a report with this value being displayed and nothing else and see what values you get.

  • To create a Crystal Report which will prompt for a value and if nothing is entered select the alternative value from the database record.

    Hi Experts,
    I am working on a report in Crystal (2008) which will prompt user to input a value, but if nothing is entered then it will select relevant database value.
    I created a string parameter prompt called "{?Pack_Qty_Overide}" and used the following formula.
    IF {?Pack_Qty_Overide} = ""
    THEN {OITM.SalPackUn}
    ELSE {?Pack_Qty_Overide}
    However, when I check the formula in editor, it says that there should be a number at the end of "Else" clause.
    What am I doing wrong?

    Hi Janos,
    OITM.SalPackUn is Numeric(19.6). When I used parameter input type as number, my formula returned error that "A number is required here" at the "if .... " statement.
    So I used the formula you provided and it worked, such that when I input a quantity in parameter prompt it would display that, but if no override value given, the field remains blank - i.e. it does not display the value stored in OITM.SalPackUn.
    What am I doing wrong?
    Thanks,
    YP

  • How to create Formula based value field in COPA

    Hi,
    I want to know how to create formula based  value field in COPA
    My Requirement is i want to collect some value in formula based value field and want to use in copa allocation cycle as a tracing
    factor.
    anybody give some light on the same topic or requirement ?
    Thanks
    Nilesh R

    The key figure you are creating in KE2K is not a value field, i.e. you can't post to it and you can't use it in a report. It is a caluculated value that can be used only in assessment and top-down-distribution.
    In Ke2K, enter a name for your key figure, then click on the the white sheet button to create it. Now the formular area is open for input. Input your formular (e.g. VV001 + VV002 - VV003 .... where VVXXX are the technical names of value fields).
    Now click the "check formuar"-button. Then save.
    Before you can use the key figure in assessment, execute TC KEUG.
    Now the key figure is available as any value field in the tracing factor selection of your assessment cycle.
    I hope this made it clearer.
    Regards
    Nikolas

  • Report Selection Formula Error with Crystal Reports 2008 SP3 Fix Pack 3.5

    Hello,
    My name is Carlos, and I would like to report a defect found in the Crystal Reports 2008 SP 3 Fix Pack 3.5 Runtime that is affecting the majority of our reports.  As well, I would like to ask if there is a simple workaround that does not involve updating hundreds of reports.
    The issue is that the runtime engine incorrectly returns the report selection formula.  I have included sample code showing what I mean.
    To reproduce;
    1. Create a simple report that has a date range filter like: 
      ({Orders.Order_Date} >= {?START_DATE})  
      AND ({Orders.Order_Date} <= {?END_DATE})
    2. Create a test app as follow that loads a report using the following code:
    ReportDocument rpt = null;
    try
      rpt = new ReportDocument();
      rpt.Load("TestReport.rpt");
      this.txtMessage.Text = string.Format(
        "ReportSelectionFormula:{0}{1}",
         Environment.NewLine,
      rpt.RecordSelectionFormula);
    catch (Exception ex)     
      this.txtMessage.Text = ex.ToString();     
    3.  Install Crystal Reports 2008 SP3 Fix Pack 3.5 Runtime [https://smpdl.sap-ag.de/~sapidp/012002523100006341772011E/cr2008fp35_redist.zip]..
    4.  Execute the app.
    At this stage, the screen shows
    ReportSelectionFormula:
    (   (  NOT  {Orders.Order_Date} >= {?START_DATE}  )   AND   (  NOT  {Orders.Order_Date} <= {?END_DATE}  )   ) 
    The expected value is:
    ReportSelectionFormula:
    (   (  {Orders.Order_Date} >= {?START_DATE}  )   AND   (  {Orders.Order_Date} <= {?END_DATE}  )   ) 
    If we were to repeat the same test above but use the Crystal Reports 2003 SP3 runtime (i.e. no Fix Pack), which can be dowloaded from [https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip], we would get the correct report selection formula. A side-effect for this incorrect report selection formula is a runtime exception complaining about an errorkind and a boolean being expected. 
    Do you know if there is any workaround that I can apply in code, perhaps a different Fix Pack?  Is there a Fix Pack expected to be released soon?  It is not practical for us to update our reports and use a different style in the record selection formula because we have many such reports, and our customers probably have even more.
    Thank you.
    -Carlos.

    Already a known issue, here's the [KB 1584095 - A boolean NOT is added at the beginning of a record selection formula when the report is loaded by the Crystal Reports .NET SDK |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533383334333033393335%7D.do]

  • Crystal Reports 8.5 Multi-Selection Formulas

    Let me start by saying that I am fairly new to Crystal Reports design, so I appreciate your patience as I try to describe my issue to you.
    I am using Crystal Reports 8.5 with an Oracle database.  The database contains a field that I refer to as a multi-selection field, meaning that end-users have the ability to select zero, one, or all values available to them in that field.
    I am designing a Crystal Report which has a checkbox for each of the selection values within the multi-selection field. So, if the end-user selects three of the values in that field, then three checkboxes appear checked, while all the others checkboxes remain empty.  I have no problem getting the checkboxes to appear; that's not the issue.
    I have tried using direct table linking and views, subreports, formulas and running totals in a number of different combinations,
    to no avail. The results have been mixed; most of the time, only one of the values gets a checked box, while all the other checkboxes are blank. Other times (with some of the subreports) it returns a full set of checkboxes with only one box checked, for each selection value that is chosen in the record.
    My basic formula for the field looks like the following, and the formula is repeated for each checkbox (country).
    if {TW_V_COUNTRY.S_VALUE} = "Japan" then chr(253) else chr(168)
    The closest I've gotten to this report working correctly is when I link an alias of the view for each country.  If I have a view for two countries and select those two values in a record, both checkboxes appear checked.  However, if I add more views for additional countries and select those values within the record, only one checkbox appears checked.
    Has anyone ever done something like this successfully? I'd appreciate any help I can get. Thank you in advance.

    Okay, I know I've said this before, but this time it really works!
    I saw something online about how crystal processes null fields - that if it reaches a null value, it will stop processing it altogether.  Here's what I saw online about null fields: http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.businessobjects.integration.eclipse.designer.doc/designer/Crystal_Syntax47.html
    I have successfully created a report that will display all of the appropriate checkboxes - blank or checked.  This method does NOT use custom views.
    My report uses a separate subreport for each selection value in the multiselection field.  The subreports are located in the Group Footer of the main report.  Each subreport has PR.ID left outer linked to the VIEW.PR_ID.  Each subreport is grouped by PR.ID.  Each subreport contains a formula for the corresponding selection value:
    WhilePrintingRecords;
    global StringVar VarCH;
    If VarCH = "" then
    VarCH:= if IsNull({VIEW.S_VALUE}) then chr(168) else
    if {VIEW.S_VALUE} = "Swiss Confederation - CH" then chr(253)
    else chr(168);
    WhilePrintingRecords;
    global StringVar VarCH;
    VarCH
    Each selection value has an abbreviation: AT, BE, BU, CH, CY, CZ, etc.  So, in the above formula, the only difference for each selection value is the name of the variable: VarAT, VarBE, VarBU, etc., and the actual selection value itself: Republic of Austria - AT, Swiss Confederation - CH, etc.  However, it may work with one universal variable throughout, like VarCountries. 
    The formula field is placed into the Group Footer within each subreport, formatted with Wingding font.  All other subreport sections are suppressed.  The subreport is placed next to its corresponding text object on the main report.  The subreports are linked to the main report: PR.ID --> VIEW.PR_ID.

  • Database DLL error on editing the record selection formula?

    Post Author: Aravind
    CA Forum: Older Products
    Hi All,I recently edited the record selection formula of an old report and since then the report is issuing me an "Error detected by database DLL" error.The report was running fine earlier and still continues to run fine if I undo the changes. Earlier, the records were selected based on a 'date' field and I edited the formula to select records based on another date field, but the report doesn't work.The report runs fine on my local PC using Crystal Reports, but web based reporting fails with the error message. The data is selected from a view and the date parameters I talked about are the fields in the same view.This view has around five date parameters and the report runs fine for all of them, except one date field.Any pointers are appreciated.Crystal reports version is 8.5. Regards,Aravind.

    Post Author: DPowell
    CA Forum: Older Products
    Ah, yes, the good old generic date error.
    The problem is likely an invalid date value in one (or all) of your records with that field.  You don't say what database engine you are connected to or which driver you are using for the report, but I'll give you some "pointers".
    Basically, the SQL fetch has encountered an error in your date field and the driver you are using in the report can't handle it.
    A null date could cause that problem.  Also a date-time field with an invalid value or truncated time value.  A robust ODBC driver, like one of the Microsoft drivers might be able to overcome it.  Likewise, vendors frequently release updated drivers to improve error handling just like this.
    1.  Analyze your data, specifically the contents of the "new" date field you are using for some kind of invalid date.
    2.  Experiment with different ODBC drivers by creating alternate ODBC connections to the same database using different ODBC drivers.
    3.  Browse and experiment with options in Crystal Reports Properties that allow you to specify data conversions for NULLs and Dates.
    Good luck !

  • Saved Data Selection Formula

    Hi...
    I need some help in creating a Saved Data Selection formula. The data source is a SQL Server Stored Procedure which returns a number of fields including 16 'flag' fields which can contain either a 0 or a 1.
    The client wants to select which 'flag' fields will be used to filter the report, interactively changing the selection(s).
    Any number of fields could be selected, or just 1.
    The parameter has values 1-16 along with a description. The description is what the user sees. The parameter is named 'Indicator'
    I'm stumbling over the fact that the formula has to return a boolean.... I tried:
    if not hasvalue({?Indicator}) or {?Indicator}=0  then 1=1;
        if hasvalue({?Indicator}) and {?Indicator} = 1 and {p_rpt_Customer_AutoHigh.is_314a}
        or hasvalue({?Indicator}) and {?Indicator} = 2 and {p_rpt_Customer_AutoHigh.is_auto}
        or hasvalue({?Indicator}) and {?Indicator} = 3 and {p_rpt_Customer_AutoHigh.is_autohigh_update}
    etc.....
        then 1 = 1
        else 1=0;
    but I'm not certain how to construct the logic because at the end of all this, I need a THEN... which makes no sense...
    I've created Saved Data Selects before, but there were specific tests that were applied, for examplde....
    if hasvalue({?Parameter}) and {?Parameter}=1 then {field) in LastFullWeek
    These were discrete user selections, not multiple selections, and the 'test' was concrete - this in there!
    Any help you could provide would be welcome....

A: Saved Data Selection Formula

You don't actually have to have an If statement for this.  Your comparisons all evaluate to true or false anyways  So, what you can do is something like this:
(not hasvalue({?Indicator}) or {?Indicator}=0) or
({?Indicator} = 1 and {p_rpt_Customer_AutoHigh.is_314a} ) or
({?Indicator} = 2 and {p_rpt_Customer_AutoHigh.is_auto} ) or
({?Indicator} = 3 and {p_rpt_Customer_AutoHigh.is_autohigh_update}) or
Notice where I've put the parentheses - these are very important for getting this to work correctly.
Note also that you don't have to include "hasvalue()" in all of the lines.  This is because of the way Boolean expressions are processed.  Because of the "or", Crystal will only process until it hits the first "true" result.  If {?Indicator} doesn't have a value, it will be caught with the "not hasvalue({?Indicator})" in the first line and none of the rest of the formula will be processed.
-Dell

You don't actually have to have an If statement for this.  Your comparisons all evaluate to true or false anyways  So, what you can do is something like this:
(not hasvalue({?Indicator}) or {?Indicator}=0) or
({?Indicator} = 1 and {p_rpt_Customer_AutoHigh.is_314a} ) or
({?Indicator} = 2 and {p_rpt_Customer_AutoHigh.is_auto} ) or
({?Indicator} = 3 and {p_rpt_Customer_AutoHigh.is_autohigh_update}) or
Notice where I've put the parentheses - these are very important for getting this to work correctly.
Note also that you don't have to include "hasvalue()" in all of the lines.  This is because of the way Boolean expressions are processed.  Because of the "or", Crystal will only process until it hits the first "true" result.  If {?Indicator} doesn't have a value, it will be caught with the "not hasvalue({?Indicator})" in the first line and none of the rest of the formula will be processed.
-Dell

  • Selection formula not selecting by dates

    I'm having an odd problem with my report. I'm trying to filter by the start date of a job. The DB I'm pulling from stores it as a string, YYYMMDD (e.g. today is 20090713). In most of my reports it works just fine, but in this one it seems that it's ignoring the filter altogether.
    My original selection formula was:
    {JobMaster.StartDate} IN {?FromDate} to {?ToDate}
    In an effort to 'fix' it, I changed it to:
    DateSerial(ToNumber(Mid({JobMaster.StartDate},1,4)),ToNumber(Mid({JobMaster.StartDate},5,2)),ToNumber(Mid({JobMaster.StartDate},7,2))) >= DateSerial(ToNumber(Mid({?FromDate},1,4)),ToNumber(Mid({?FromDate},5,2)),ToNumber(Mid({?FromDate},7,2)))
    AND
    DateSerial(ToNumber(Mid({JobMaster.StartDate},1,4)),ToNumber(Mid({JobMaster.StartDate},5,2)),ToNumber(Mid({JobMaster.StartDate},7,2)))
        <= DateSerial(ToNumber(Mid({?ToDate},1,4)),ToNumber(Mid({?ToDate},5,2)),ToNumber(Mid({?ToDate},7,2)))
    I noticed that it even grabs jobs July, even if I pass the FromDate as 20080601 and ToDate as 20090601. The startdate I'm dealing with is 20090702.
    Any ideas? Thanks in advance.

    Hi Lain,
    Do the following :
    Create single Date parameter and in options allow range values true.  Now in your record selection you gie = {?Date}
    Thanks,
    Sastry

  • CRVS2010 Beta - Selection Formula

    I have some reports created with CR4VS2008 that normally work in VS2010+CR4VS2010 (after the standard conversion of the VS solution), but if I edit without changes the .rpt in VS2010 and than save the file in the new CR format, the selection formula hard coded in the rpt no longer works (the selection formula is very simple:  {table.field} = 'ALL' ).
    Thanks in advance for your help.

    Hi Don,
    I solved my problem.
    I changed in report and in code from rpt.RecordSelectionFormula to rpt.DataDefinition.SavedDataSelectionFormula and now it works.
    // CS code
    MyReport rpt = (MyReport )MyWindowsForm.crystalReportViewer1.ReportSource;
    // Does not work in CR4VS2010 Beta2 but works in CR4VS2008
    rpt.RecordSelectionFormula = "{TABLE.FIELD} = 'MY FILTER VALUE'";
    // Works in CR4VS2010 Beta2
    rpt.DataDefinition.SavedDataSelectionFormula= "{TABLE.FIELD} = 'MY FILTER VALUE'";
    Hope this help.
    Rocco

  • Distinct records with conditional select formula

    Post Author: nelsonchris
    CA Forum: Data Connectivity and SQL
    Hello,
    I have a simple report pulling data from two tables. I want
    only distinct records. I am selecting records based on
    parameters; here is the select formula:
    ({?Service Name} = "*" or {selsvc.ServiceName} like
    {?Service Name})and
    ({?Program Name} = "*" or {selsvc.Selected Service Entry 
    Program Name} like {?Program Name}) and
    ({?Agency Name}  = "*" or {selsvc.Selected Service Entry 
    Agency Name} like {?Agency Name})
    The problem comes from the fact that Crystal will add the
    selsvc fields to the reports SQL select code, which has the
    effect of duplicating some records that do not have the same
    values for the selsvc fields. The select formula above is
    the only place in the report where values from the selsvc
    field are used, and as you can see they are only used when
    the user has submitted a matching parameter for them. I can
    not figure out how to get rid of the duplicates, please
    help!
    Thanks for your time,
    Chris

    Post Author: yangster
    CA Forum: Data Connectivity and SQL
    I don't follow why you are getting duplicates with your selectionare you getting duplicates without the selection criteria?if you are then they really are not duplicates and there could be issues with your joins between the 2 tables

  • Select-option value is not getting captured in at selection-screen on value

    In Selection screen , we have Select-option and  a parameter.
    Based on the values given in Select-option, the values of Parameter should get populate.
    To achieve this functionality,
    I  used  At selection u2013screen  on value request  for <parameter>  EVENT and 'F4IF_INT_TABLE_VALUE_REQUEST' Function Module.
    But the Select-option values are not getting captured in this event,unless u press Enter key.
    Is there any other way to achieve this functionality.
    Please Guide me.

    When you call function 'F4IF_INT_TABLE_VALUE_REQUEST'. make sure you send it the name of the screen variable - the F4IF_INT_TABLE_VALUE_REQUEST function calls DYNP_VALUES_READ itself if you tell it the name of your report, screen number, and the variable name... snippet below.
    Jonathan
      data:
        l_repid             type syrepid.
      l_repid = sy-repid.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          dynpprog         = l_repid
          dynpnr           = '1000'
          dynprofield      = 'S_FIELD-LOW'  "Select options - low value
    * etc

  • Selection screen field value capturing

    Hi,
    I have developed a report for displaying amendment changes in a purchse order. The input are purchase order
    and plant. Now they have asked for an additional input of version field, which should also have F4 field-value help.
    For version field, default there is no F4 key. So, i have written code like after entering the PO number when we press the enter key, for the corresponding PO, it brings the version no in input field. But my problem is it is displaying the values for version field, but when i select some value it is not getting updated in selection-screen version field. I have attached my code below... please help me
    in the below code my problem is only between
    AT SELECTION-SCREEN on value-request for P_REVNO.
    and
    start-of-selection event...
    TABLES : ekko,
    ekpo,
    cdhdr,
    cdpos,
    MEPO1325,
    t001,
    t166c,
    t166t,
    adrc,
    komp, " net rate of header
    konv, " net value of purchase order
    zammendpodet.
    TYPES : BEGIN OF ts_cdpos,
    ebeln TYPE ekbe-ebeln,
    ebelp TYPE ekbe-ebelp,
    matnr type ekpo-matnr,
    maktx type makt-maktx,
    prdat type ekpo-prdat,
    belnr TYPE ekbe-belnr,
    budat TYPE ekbe-budat,
    tkey(70),
    txz01 TYPE ekpo-txz01,
    ctxnr TYPE t166c-ctxnr,
    desp(20) type C,
    MEINS LIKE MARA-MEINS,
    chtxt TYPE t166t-chtxt.
    INCLUDE STRUCTURE cdpos.
    TYPES : END OF ts_cdpos.
    data : begin of it_makt occurs 0,
    matnr like makt-matnr,
    maktx like makt-maktx,
    end of it_makt.
    data : begin of it_maRA occurs 0,
    matnr like maRA-matnr,
    mEINS like maRA-mEINS,
    end of it_maRA.
    *Internal table declartion
    DATA : it_erev TYPE TABLE OF erev WITH HEADER LINE,
    it_ekko1 type table of ekko with header line,
    it_konv2 type table of konv with header line,
    it_ekpo TYPE TABLE OF ekpo WITH HEADER LINE,
    it_ekpo1 TYPE TABLE OF ekpo WITH HEADER LINE,
    it_cdhdr TYPE TABLE OF cdhdr WITH HEADER LINE,
    it_t166c TYPE TABLE OF t166c WITH HEADER LINE,
    it_ekbe TYPE TABLE OF ekbe WITH HEADER LINE,
    IT_AMMEND TYPE TABLE OF ZAMMENDPODET WITH HEADER LINE,
    IT_AMMEND1 TYPE TABLE OF ZAMMENDPODET WITH HEADER LINE,
    it_komp TYPE TABLE OF KOMP WITH HEADER LINE,
    it_konv type table of konv with header line,
    it_konv1 type table of konv with header line,
    it_cdpos TYPE TABLE OF ts_cdpos WITH HEADER LINE.
    data : BEGIN OF it_erev1 occurs 0,
    revno TYPE erev-revno.
    data : end of it_erev1.
    data : begin of it_cdpos1 occurs 0.
    include structure cdpos.
    data : ebeln like ekko-ebeln,
    item like ekpo-ebelp,
    aedat like ekpo-aedat,
    matnr like ekpo-matnr,
    txz01 like ekpo-txz01,
    desp(20) type C,
    MEINS LIKE MARA-MEINS,
    item1 like ekpo-netpr.
    data : end of it_cdpos1.
    types : dy_temp TYPE lips-lgort.
    DATA : dyfields LIKE dynpread OCCURS 1 WITH HEADER LINE, dy_value TYPE dy_temp.
    DATA: progname TYPE sy-repid,
    dynnum TYPE sy-dynnr,
    dynpro_values TYPE TABLE OF dynpread,
    field_value LIKE LINE OF dynpro_values.
    *Work variable declaration
    DATA : v_revno TYPE erev-revno,
    revno1 type zammendpodet-revno,
    w_version TYPE erev-revno,
    w_erdat TYPE erev-erdat,
    w_eruhr TYPE erev-eruhr,
    wv_eruhr TYPE erev-eruhr,
    v_tabkey TYPE cdpos-tabkey,
    v_temp(5),
    v_olddate(8),
    v_newdate(8),
    v_value_old TYPE cdpos-value_old,
    V_OLD TYPE EKPO-BRTWR, " OLD VALUE FOR PURCHASE ORDER
    l_ind TYPE i,
    temp value 0 type i,
    temp1 type i,
    temp2 type i,
    temp3 type i,
    wa_cdpos like line of it_cdpos,
    wa_cdpos1 like line of it_cdpos1,
    v_tabkey1 TYPE cdpos-tabkey.
    PARAMETERS : p_ebeln TYPE ekko-ebeln,
    p_ebelp TYPE ekpo-ebelp.
    p_bukrs TYPE t001-bukrs,
    p_revno type erev-revno.
    INITIALIZATION.
    AT SELECTION-SCREEN on value-request for P_REVNO.
    CLEAR: dyfields[], dyfields.
    dyfields-fieldname = 'P_REVNO'.
    APPEND dyfields.
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    dyname = sy-cprog
    dynumb = sy-dynnr
    TABLES
    dynpfields = dyfields.
    READ TABLE dyfields INDEX 1.
    SELECT revno
    FROM erev
    INTO TABLE it_erev1 WHERE edokn = p_ebeln.
    IF sy-subrc = 0.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'REVNO'
    dynpprog = progname
    dynpnr = dynnum
    dynprofield = 'P_REVNO'
    value_org = 'S'
    TABLES
    value_tab = it_eREV1
    EXCEPTIONS
    parameter_error = 1
    no_values_found = 2
    OTHERS = 3.
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF.
    START-OF-SELECTION.
    SELECT SINGLE *
    FROM t001
    WHERE bukrs EQ p_bukrs.
    IF sy-subrc EQ 0.
    SELECT SINGLE *
    FROM adrc
    WHERE addrnumber EQ t001-adrnr.
    ENDIF.
    SELECT SINGLE *
    FROM ekko
    WHERE ebeln
    EQ p_ebeln
    AND frgke = 2.
    select * from konv into corresponding fields of table it_konv where knumv eq ekko-knumv.
    useful informations will be rewarded.
    thanks and regards,
    subbu.,

    Hi ,
           Use this function module
        call function 'DYNP_VALUES_UPDATE'
          exporting
            dyname               = sy-repid
            dynumb               = sy-dynnr
          tables
            dynpfields           = t_dynpfields
          exceptions
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            others               = 8.
    where t_dynpfields would contain name of field and value you want to update.
    Please reward if useful.

  • Maybe you are looking for