Transaction Descuentos por Linea en la ORDR

Buen dia Expertos quiero realizar un transaction para que valide los descuentos que se realizan en un pedido en SAP
el porcentaje se rige con las escalas de descuentos que tenemos en la tabla SPP2, el objetivo de este transaction es mantener la integridad de los descuentos estipulados y no se puedan cambiar los descuentos de acuerdo a nuestra tabla de descuentos, por ejemplo por 3 cajas de algún producto es el 2% de descuento estipulado pero si alguien le pone 4% no lo permita porque el descuento asignado según la SPP2 es 2%, he intentado usar cursores para leer las lineas de productos y realizar comparaciones pero no lo he logrado, si alguien pudiera brindarme su ayuda para terminar este requerimiento se lo agradecería mucho.
De antemano muchas gracias.
Saludos Cordiales

Puedes incluir una comprobación en el Transaction Notification, la comprobación que deberías hacer sería algo así:
@descuentos_modificados as numeric
IF @object_type in ('15') And @transaction_type in ('A')
Begin
set @descuentos_modificados = (select  count(*) from odln
left join dln1  on
odln.docentry = dln1.docentry
left join spp2 on
dln1.itemcode = spp2.itemcode and
odln.cardcode = spp2.cardcode and
dln1.quantity >= spp2.amount and
spp2.amount = (select max(spp2.amount) from spp2 where amount<=dln1.quantity)
where dln1.DiscPrcnt <> spp2.Discount and odln.docentry = @list_of_cols_val_tab_del)
If @descuentos_modificados >0
     Begin
          Set @error =1
          Set @error_message = 'Error: Descuentos modificados'
     End
End
Saludos

Similar Messages

  • Descuento por documento

    es posible asignar otro descuento por documento y quitar el que se tiene en autorizaciones. digo por que ocupo hacer que mis gerentes otorgen descuentos hasta el 7% y que tengan carta abierta para dar entrada de op con descuentos mayores.
    Si alguien con mas experiencia sabe como, me podría ayudar ...por fis saludos.

    para rulios. Mira es que tengo asignado el descuento máximo a algunos usuarios por 7% en autorizaciones. Pero me ocasiona un problema ya que esto es configurado para todos los documentos del sistema. Hoy ocupo que en las entradas de mercancía por orden de compra entren con descuentos y en ocasiones estos arrebasan el 7% por lo cual a algunos usuarios no la dejan generarlas, el chiste es que deseo que estos usuarios puedan generar estas hasta con el 7% en ventas y en entradas que se pueda con mas descuento.
    Pense en transaction notification pero la verdad me da un poco de miedo dismuir el rendimiento del sistema por tener tantos bloqueos, no tienen alguna opción.
    Manuel si podría usar las busquedas formateadas pero lo malo es que no siempre asignan el mismo descuento entonces ahi rompería la lógica. Si tienen otra idea o si no se puede sería bueno que me pudieran decir para comunicarles esto a mis jefes y ver otra manera de que trabajen esto .
    Muchas gracias

  • AR Transaction Data vs Line Item

    Hello,
    I have need to generate a report with some degree of detail and I am having an issue understanding the correlation between AR Transaction Data and Line Item.  In a report I would like to show sales for the period and AR balances and I need to be able to drill down on these (at Profit center level or Business Area Level both Characteristics have been added to the extractor and are being populated).
    How is Sales for Period derived in Transaction Data?  Can I create this same Key Figure at the Line Item Level?
    Any assistance is greatly appreciated.
    MK

    Sales are derived from the posting key used to post a AR document
    The posting key is either sales/turnover relevant or not
    As peopel use posting keys for all sorts of thingss- this is not the ideal solution to report Sales
    it also includes VAT
    ow ar eyou planning to add Profit Centre -?
    Conside the following document
    Dr Debtors £117.50
    Cr Reveneu Prfit centre 1  £50
    Cr reveneue Profit Centre 2  £50
    Cr VAT £17.50
    how are you going to get the profit centre onto the debtors postings?
    You can't... you can see the data in 0EC_PCA_4 or you can join Ar4 ODS to the GL ODS via an infoset

  • How to add new line in transact move order line

    Hi,
    i am able to update locaotr in Transact move order.
    But i want to add two locators for the same line.
    I tried to insert one more record in data base, but getting error unique index error.
    so how can we add new line in transact move order line .
    please help to slove this isse.
    Thanks In Advance
    Venu.

    Hi,
    the fact that your question is posted in Order Management section, does the move order automatically generated by OM?
    nevertheless, i don't think you should (or allowed, in this case) to add a new line in transact move order. Transact move order only queries (not create records) the move order lines eligible to allocate and transact.
    So, I don't see why you need to add a new line in transact move order.
    You can, however, add a new line in the allocation of the lines, where for instance, you need to have half of the line allocated to one locator, and the other half to another locator
    Thanks

  • Read a specific line of a txt file using vba not using line by line, Leer una Linea especifica de archivo de texto sin recorrer linea por linea

    Buenos días - Good morning
    Mi pregunta la escribiré en español y en ingles y espero alguien tenga la solución.
    I'll write my question in Spanish and English and I hope someone has the solution.
    SPANISH
    Creé una Macro en VBA que lee mas de 200.000 archivos de texto (.txt) los cuales tienen diferentes tamaños y cantidad de información dentro de ellos, de cada archivo necesito extraer la información de las 3 primeras lineas y las ultimas 10 lineas, las 3
    primeras lineas es fácil ya que uso un "READLINE" 3 veces y voy capturando la información de las tres primeras lineas, para las ultimas 10 lineas las cuales están identificadas por un código inicial hago un ciclo que lee linea por linea hasta que
    encuentra el numero 3 en un espacio especificado de la linea y de ahí captura la información de cada linea de texto que serian las 10 ultimas, el problema que tengo es que la cantidad de archivos y de información dentro de los archivos aumenta considerablemente
    cada día y por tener el ciclo que lee cada una de las lineas de cada archivo de texto la Macro se demora cada vez mas a medida que aumenta la información y consume cada vez mas memoria de la maquina.
    Necesito un método diferente que no lea linea por linea y que yo le pueda decir lea la linea (renglón) numero 1000 (ejemplo) y capture la información a partir de ahí para ahorrar algo de tiempo, o saber cuantas lineas de texto tiene el archivo .txt y decirle
    que me lea a partir de (numero total de lineas del txt -(menos) 10 lineas) así me leería las 10 ultimas.
    ENGLISH
    I created a Macro in VBA that reads more than 200,000 text files (.txt) which have different sizes and quantity of information within them, each file need to extract the information from the first 3 lines and last 10 lines, 3 first lines is easy as using a
    'READLINE "3 times and am capturing information from the first three lines, for the last 10 lines which are identified by an initial code I make a loop that reads line by line until it finds the number 3 in a specified area of ​​the line and then capture
    the information of each line of text that would be 10 last, the problem that I have is that the number of files and information within files significantly increases every day and having the loop that reads each line of each text file is delayed Macro increasingly
    as more information and consume more and more memory on the machine.
    I Need a different method not read line by line and I can tell you read the line (row) number 1000 (example) and capture the information from there to save some time or know how many lines of text have the file .txt and tell me read from (total number of lines
    of txt - (minus) 10 lines) so I would read 10 last.
    Here is the code I currently use
    Dejo el código que uso actualmente
    Dim fs, f, ts, REG
    Set fso = CreateObject("Scripting.FileSystemObject")
        On Error Resume Next
    sFilePath = strFolder & "\" & strFileName
    Set f = fso.getFile(sFilePath)
    Set ts = f.OpenAsTextStream(1, 0)
    REG = ts.READLINE
    Ciclo para llegar hasta las ultimas 10 lineas
    Cycle to reach the last 10 lines
    For J = 1 To 200000
                REG = ts.READLINE
                    If Val(Mid(REG, 6, 1)) = 3 Then

    Good Morning ryguy72
    First thank you so much for your answer, sorry for my english in the question, I tried for a long time to make a code that wasn't so slow to read the last 10 lines, 'cuz most codes used a cycle "For" to read line by line asking if in the specific
    position is the character(number) that tells me that i should get started to read the last lines that i need, that takes a lot longer than your code doing a Split with Mydata and storing it in strData(). I don't know how to do this and every forum that
    i consulted to read the last 10 lines quickly they made the same read line by line with a Cycle "for".
    Thanks again, I gonna improve my code with your help, 'cuz it took about 4 hours to read all the information and everyday ascended more time and memory consumption.
    Thanks to everyone who offered their help so disinterested and free, so should always be people with that spirit, I hope someday to be SO good as you programming.

  • Error : Transaction header and line tables cannot be empty

    please can some one help me.
    when i want to create an invoice without anuy line, i have the error : Transaction header and line tables cannot be empty .
    can some one tell me how can i solve this
    regards.

    Hi,
    I really don't know if it is possible to create an invoice in AR with no transaction lines. When I interface invoices from another system to AR (and there is no need to detail inventory items), I use a single line with a dummy inventory item or with no inventory item (inventory_item_id and warehouse_id set to null) in transaction lines, and I use the description field to describe the link to the other software in a user-friendly way.
    Regards,
    Ketter Ohnes
    Message was edited by:
    Ketter Ohnes

  • Descuento por paquete compra en tienda de miami

    hola somos extranjeros planeamos ir de compras en breves a la cuidad de miami,, teniamos pensado comprar dos ipad mini de 249,99 cada uno y una notebook dell ispiron de 649,99. y tal ves algunos accesorios para las compras. queriamos saber si nos podrian brindar algun descuento por el paquete de compras realizadoy en dicho caso en que tienda de miami podriamos comprarlo muchas gracias

    Hola RafaBianchi-
    Te agradecemos mucho el interés que estas demostrando en realizar tu siguiente compra con Best Buy. En el momento, Best Buy no tiene descuentos para los artículos que estás buscando.  Mi mejor recomendación es de visitar una tienda de Best Buy para ver sus promociones actuales, o visitar BestBuy.com.
    Espero que disfrutes tu viaje,
    Karina|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Posting transaction with out line item :)

    Hi Gurus
    i was asked in an interview that" how to post a transaction with out line items ?" i told we cannot post...
    can anybody share their views on it if yes how
    Thanks in advance..
    Vicky

    Hi,
    in Profitcenter Accounting you can decide if you want to post with or without line items in the periodic transfer programs 1KE* (1KEK, 1KEH, 1KEI,...).
    If you deactivate the flag for line items this would then only post total records, but no line items.
    Best regards,
    Andreas

  • Difference between Transaction Figures and Line Items

    Hi,
    I gone through FI like FI-GL,FI-AR,FI-AP..there i find...
    Line Items & Transaction figures as main...like
    in FI we have
    Line Items - 0FI_GL_4,0FI_AR_4,0FI_AP_4 etc...
    Transaction Figures - 0FI_GL_6,0FI_AR_6,0FI_AP_6 etc...
    Now Can some please explain...
    what exactly Line Items are?
    What exactly Transaction Figures are?
    How data flows from end to end in FI? i.e where exactly GL,AR,AP comes into picture..how they are internally related?
    Some one please explain me in detail (with expamles if possible) and quick reply is much appreciated...
    Regards
    Ramsunder

    Hi
    What exactly  line items :
    Line items are document items that were posted to a specific account. In contrast to a document item a line item only contains the information from the document that is relevant from the account view.
    You can display the following line items:
    Open items, Cleared items, Noted items, Parked items ,Items with special G/L transactions (in Accounts Receivable and Accounts Payable),Items with customer or vendor items (in Accounts Receivable and Accounts Payable)
    You can display the line items for the following account types:  Customer accounts,Vendor accounts,G/L accounts.
    What exactly Transaction Figures are?
    Transaction figures are the sums of line items on the debit or credit side. The balance is the difference between the debit and the credit transaction figure.
    If you take General ledger
    AP records all accounting transactions for dealings with suppliers(Vendors). Much of its data is obtained from procurement (Materials Management).
    AR records all accounting transactions for dealings with customers. Much of its data is obtained from Sales and Distribution.
    Asset Accounting records all accounting transactions relating to the management of assets.
    Travel Management manages and calculates travel costs and supports travel planning and travel expenses.
    Bank ledger supports the posting of cash flows.
    Regards
    Chandra Sekhar T

  • Transaction KSB1(cost line items)  - Tables or FM's to get data?

    Hi,
    For a current report, I need to obtain the data stored in transaction KSB1 - Actual Cost Line items for cost centers.
    What tables contain this data? Are there any standard function modules available to obtain the data?
    Please help.
    Thanks,
    John

    The following content from SAP help file may help you.
    Use
    You can use Report Painter reports and line item reports from the Cost Center Accounting (CO-OM-CCA) and Internal Orders components (CO-OM-OPA) to evaluate archives. Generally, the following reports can read the relevant data from any archive:
    ·        All Report Painter reports for table CCSS
    ·        The actual line item report for internal orders
    ·        The actual line item report for cost centers
    ·        Document display
    The SAP system includes a variety of report and archiving object .combinations. The standard system thus provides only a limited number of reports for given archiving objects. However, it is also possible to execute other reports for an archiving object.
    Actions
    Reading Report Painter Reports from the Archive via the Component
    1.      To execute a Report Painter report, choose Information system ®Report selection in the given component and select the desired report.
    2.      On the report selection screen, choose Data source.
    3.      On the following dialog box, select Read from archive and choose Continue.
    4.      On the following dialog box, enter the object from which you want to read the archived data.
    Choose F4 Help to obtain a list of the archiving objects to which the report applies.
    5.      Choose Archive selection to determine the archive files for the report.
    6.      As in the standard transaction, you can start the report online or in a background job.
    Reading Line Item Reports and Documents from the Archive via the Component
    1.      To execute a line item report or document display, choose Information system ® Report selection in the given component and select the desired line item report or document display.
    2.      On the report selection screen, choose Extras ® Data source.
    3.      On the following dialog box, select Archive as the data source.
    4.      On the following dialog box, enter the object from which you want to read the archived data.
    Choose F4 Help to obtain a list of the archiving objects to which the report applies.
    5.      Choose Archive selection to determine the archive files for the report.
    6.      As in the standard transaction, you can start the report online or in a background job.
    As it is often unnecessary to enter further selection criteria when reading data from an archive, you can enter an asterisk (*) under Cost center and Order where required.
    Reading Reports from Archive Administration from the Archive (SARA Transaction)
    1.      Under Object name, enter the archiving object (such as CO_COSTCTR) and choose Evaluate.
    Choose F4 Help for the Read program field to list all the reports for the archiving object.
    2.      Choose and execute the required report.
    3.      Branch from the selection screen to the data source selection:
    a)  For Report Painter reports, choose Data source.
    b)  For line item reports or for document display, choose Extras ®Data source.
    4.      The archiving object is already defaulted. Choose Archive selection to determine the archive files for the report.
    5.      As in the standard transaction, you can start the report online or in a background job.
    Assigning Reports to Archiving Objects
    The SAP system stores the report assignments to the archiving objects. The assignment controls which objects appear in the F4 Help for the data sources and which reports appear for the read programs in archive administration.
    A warning message appears if you choose an archiving object that is not assigned the relevant report or a report that is not assigned the relevant archiving object. You can ignore this warning message. You can execute the report if you wish, but you must bear in mind that incomplete data will be the result.
    To view the assignments in the standard SAP system, see the ARCH_REPOW table.
    Importing Standard Assignments
    The ARCH_REPOW table is a Customizing table that also allows user-defined assignments. Standard assignments are provided therefore in client 000 only. You cannot use reports in other clients for reading data from the archive.
    1.      To import standard assignments to other clients, go to the SAP  initial screen, choose Tools ® ABAP Workbench ®ABAP Editor, and enter and execute program ARCH_REPOW_IMPORT.
    2.      Enter CO_* as the archiving object.
    3.      Accept the default settings in the other fields (source client 000, report type RW).
    4.      Choose Execute.
    Creating Custom Assignments
    In principle, you can read data from given archiving objects even if the standard SAP system does not have the relevant combination of report and archiving object.
    ·        For Report Painter reports, the prerequisites are:
    -   The report applies to table CCSS
    -   The archiving object includes table COSP or COSS
    Tables COSP and COSS may also appear in the archiving object definitions as COSPA and COSSA.
    Of course, you may also use custom reports to read archiving object data.
    ·        For line item reports, table COEP must be part of the archiving object. Table COEP may also appear in the archiving object definition as view COVP or COVPxy (where u201Cxu201D and u201Cyu201D stand for numerals).
    If you want to work with previously unsupported assignments, enter these in table ARCH_REPOW in order to avoid confusion among end-users. In addition, you can include documentation justifying the use of the corresponding report for your own archive reading runs.
    To enter a new assignment:
    1.      Start system transaction SM30.
    2.      Enter table ARCH_REPOW.
    3.      ChooseMaintain.
    4.      Choose New entries to enter the new assignments.
    Make the following entries:
    a)  Under Object name, enter the name of the archiving object.
    b)  Under Report type, enter:
    RW for Report Painter reports
    TR for line item reports
    c)  Under Program name, enter:
    The name of the report group for Report Painter reports
    KSB1 for the actual line item report for cost centers
    KOB1 for the actual line item report for internal orders
    KSB5 for document display
    d)  Leave the Activate archive selection field empty.
    Standard Contents of Table ARCH_REPOW
    Report
    Program Name
    Report Type
    Object Name
    Cost Center Actual Line Items
    KSB1
    TR
    CO_ALLO_ST
    CO Documents, Actual Costs
    KSB5
    TR
    CO_ALLO_ST
    Cost Center Actual Line Items
    KSB1
    TR
    CO_CCTR_EP
    CO Documents, Actual Costs
    KSB5
    TR
    CO_CCTR_EP
    Area: Cost elements
    1AIP
    RW
    CO_CCTR_ID
    Area: Statistical key figures
    1SKL
    RW
    CO_CCTR_ID
    Cost centers: Drilldown by Partner
    1SHK
    RW
    CO_CCTR_ID
    Cost centers: Actual/plan variance
    1SIP
    RW
    CO_CCTR_ID
    Area: Cost Centers
    1KSL
    RW
    CO_CCTR_ID
    Area: Activity types
    1SLB
    RW
    CO_CCTR_ID
    Cost Centers: Period Breakdown Actual/Plan
    1SMA
    RW
    CO_CCTR_ID
    Cost Center Actual Line Items
    KSB1
    TR
    CO_CCTR_ID
    CO Documents, Actual Costs
    KSB5
    TR
    CO_CCTR_ID
    Area: Cost elements
    1AIP
    RW
    CO_CCTR_PL
    Area: Statistical key figures
    1KSL
    RW
    CO_CCTR_PL
    Cost centers: Drilldown by Partner
    1SHK
    RW
    CO_CCTR_PL
    Cost centers: Actual/plan variance
    1SIP
    RW
    CO_CCTR_PL
    Area:  Cost Centers
    1SKL
    RW
    CO_CCTR_PL
    Area: Activity types
    1SLB
    RW
    CO_CCTR_PL
    Cost Centers: Period Breakdown Actual/Plan
    1SMA
    RW
    CO_CCTR_PL
    Area: Cost elements
    1AIP
    RW
    CO_COSTCTR
    Area: Statistical key figures
    1KSL
    RW
    CO_COSTCTR
    Cost centers: Drilldown by Partner
    1SHK
    RW
    CO_COSTCTR
    Cost centers: Actual/plan variance
    1SIP
    RW
    CO_COSTCTR
    Area:  Cost Centers
    1SKL
    RW
    CO_COSTCTR
    Area: Activity types
    1SLB
    RW
    CO_COSTCTR
    Cost Centers: Period Breakdown Actual/Plan
    1SMA
    RW
    CO_COSTCTR
    Cost Center Actual Line Items
    KSB1
    TR
    CO_COSTCTR
    CO Documents, Actual Costs
    KSB5
    TR
    CO_COSTCTR
    Order Actual Line Items
    KOB1
    TR
    CO_ITEM
    Cost Center Actual Line Items
    KSB1
    TR
    CO_ITEM
    CO Documents, Actual Costs
    KSB5
    TR
    CO_ITEM
    CO Documents, Actual Costs
    KSB5
    TR
    CO_KSTRG
    List: Orders
    6L00
    RW
    CO_ORDER
    List: Cost elements
    6M00
    RW
    CO_ORDER
    Order: Actual/plan variance
    6O00
    RW
    CO_ORDER
    Order: Drilldown by Partner
    6O08
    RW
    CO_ORDER
    Order: Drilldown by Period
    6Z02
    RW
    CO_ORDER
    Order Actual Line Items
    KOB1
    TR
    CO_ORDER
    CO Documents, Actual Costs
    KSB5
    TR
    CO_ORDER

  • Diff. G/L Transaction Figures Vs Line Item.

    Hi Guys,
    Can any body explain diffrenece between "General Ledger: Transaction Figures" and "General Ledger: Line Item"
    I need to prepare P & L reporting which data source will be appropriate for this.
    Your help is highy appriciated.
    thanks
    Ajay

    HI,
    For P&L the most appropriate Source will be the line item(GL 4) datasource as it Amount field does not have the Cumulative Balance. This is what is required for a P&L Account. Where as in case of balance Sheet accounts, you need cumulative balance, which is present in General Ledger: Transaction Figures (GL10 / GL6 depending on the version of R/3)
    Regards,
    Gaurav

  • Diff. Transaction Figures Vs Line Item.

    Hi Guys,
    Can any body explain diffrenece between "General Ledger: Transaction Figures" and "General Ledger: Line Item"
    I need to prepare P & L reporting which category will be appropriate for this.
    Your help is highy appriciated.
    thanks
    Ajay

    Hi,
    Edited by: santosh kumar on Sep 8, 2009 12:27 PM

  • Hacer un asiento con diferentes fechas contables por linea

    Buenas tardes a todos;
    Necesito poner en un mismo asiento lineas con diferentes fechas contables.
    Lo he hecho en pruebas en parametrizaciones de documento Registro diario y he quitado el check donde bloquea esto.
    Alguien sabe si esto tiene alguna implicacion negativa en al aplicacion o se puede usar las veces que se quiera y no ocurre nada.
    Muchas gracias de antemano.
    Saludos.

    Hola.
    En principio no, pues esa opción está para evitar que se coloque una fecha diferente a la del encabezado en cada línea. Al desactivarla, puede colocar una fecha diferente en la línea deseada (siempre y cuando el período contable no esté bloqueado).
    Saludos.

  • How to get Delivery Number at AR-Transaction Lines ?

    Hi,
    We are trying to develop a custom invoice output from AR Transactions (12.0.5). What our aim is to get Delivery Number from Transactions screen at Line Level. We want to provide this, because our client wants to show Delivery Number at this Invoice output...
    How can we provide this ?
    I will be very grateful for any assistance
    Thanks in advance...
    Cagri

    Nagamohan
    First of all i want to thank you for your support.
    we found out that interface_line_attribute3 coloumn is referenced with Waybill field at shipping transactions form. and this field can be seen at Line Transaction Flexfield at AR-Transaction Lines...
    Thanks in advance
    Cagri

  • Standard Memo Lines read account from Transaction type not from memo accoun

    Standard Memo Lines read account from Transaction type not from memo account
    Is There Away To Readed From Memo lines account
    Facts:
    Define New Standard Memo Lines with Name "Discounts"
    With Type: Line
    Revenue Account: 01.0.000.0000.000.411001.0000
    Active Date: 01-JAN-2007
    When I create transaction with class Invoice
    I select the transaction type, and select customer
    I press on line items button
    I open the list description I select the "discount" define as memo line, I save the transactions
    I press on the Complete Button
    After that I navigate to Distributions button
    I found the account affect not read from account define for memo lines. It read from revenue account define in transaction type
    Especially when I use memo lines, how to read revenue account from account assign to memo lines not from transaction type

    Standard Memo Lines read account from Transaction
    type not from memo account
    Is There Away To Readed From Memo lines account
    Facts:
    Define New Standard Memo Lines with Name "Discounts"
    With Type: Line
    Revenue Account: 01.0.000.0000.000.411001.0000
    Active Date: 01-JAN-2007
    When I create transaction with class Invoice
    I select the transaction type, and select customer
    I press on line items button
    I open the list description I select the "discount"
    define as memo line, I save the transactions
    I press on the Complete Button
    After that I navigate to Distributions button
    I found the account affect not read from account
    define for memo lines. It read from revenue account
    define in transaction type
    Especially when I use memo lines, how to read revenue
    account from account assign to memo lines not from
    transaction typeHi,
    In my opinion, we need to set up AUTOACCOUNTING for 'REVENUE' as standard lines so that system picks up Revenue account from Standard memo lines instead of Transaction type.
    Regards,
    Sreenivas

Maybe you are looking for