How to Fetch Production ordr No in Batch no Creation table

Hi experts
One of our customer needs batch number need to be auto generated and this number should be Production order no.
Only one rececipt from pdn will happen to one PO.
I tried below query to fetch the value. But it is showing no results.
SELECT T1.BaseRef FROM OIGN T0 inner join IGN1 T1 on T0.DocEntry = T1.DocEntry WHERE T1.BaseRef is not null and T0.DocNum = (SELECT Substring($[$-35.2.0],4,9))
In this query 35.2.0 is Receipt from production number which is displaying in "Rows from Documents", in Batch set up (Batch no creation table).
Thanks in Advance
Unni

Hi Mr.Nagarajan,
Thanks for reply
1) There will be only one receipt from production, against production order
2) Items are managed by batch
3) There will be only one batch no for receipt from production.
While putting receipt from production entry, Batch no creation window will open. Here in Batch no field, user need production order Number need to be autofetched.
I tried that for this thru formatted search.
but as this is third window (1. PO, 2.Receipt from prdocution, 3 .Batch no creation) and receipt from production is also not saved in the system, system is showing "No results" for my query.
Please help me here
Regards
Unnikrishnan

Similar Messages

  • How to fetch production Scrap of a material.

    Hi Experts,
    How to fetch production Scrap of a material. Please advise with database tables or function module.
    Thanks in advance,
    Viven

    in that case u have to calc. based on  the BOM qty.
    actual qty of RM material will not avail in the table AFRU .from AFRU u will get Gross/Net qty of FG material.based on this QTy u have to calc RM usage taking BOM conversion.

  • How to fetch data for a struture from a cluster table

    How can I fetch data for a struture, from a cluster table, based on the name of the structure?

    Hi,
    In order to read from Cluster DB Table use the following statement:
    Syntax
    IMPORT <f1> [ TO  < g1 > ] <f2> [TO < g2 >] ...
    FROM DATABASE <dbtab>(<ar>)
    [CLIENT <cli>] ID <key>|MAJOR-ID <maid> [MINOR-ID <miid>].
    This statement reads the data objects specified in the list from a cluster in the database <dbtab>.
    You must declare <dbtab> using a TABLES statement. If you do not use the TO <gi> option, the
    data object <fi> in the database is assigned to the data object in the program with the same
    name. If you do use the option, the data object <fi> is read from the database into the field <gi>.
    For <ar>, enter the two-character area ID for the cluster in the database. The name <key>
    identifies the data in the database. Its maximum length depends on the length of the name field
    in <dbtab>.
    The CLIENT <cli> option allows you to disable the automatic client handling of a client-specific cluster database, and specify the client yourself. The addition must always come directly after the name of the database.
    For Eg:
    PROGRAM SAPMZTS3.
    TABLES INDX.
    DATA: BEGIN OF JTAB OCCURS 100,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF JTAB.
    IMPORT ITAB TO JTAB FROM DATABASE INDX(HK) ID 'Table'.
    WRITE: / 'AEDAT:', INDX-AEDAT,
    / 'USERA:', INDX-USERA,
    / 'PGMID:', INDX-PGMID.
    SKIP.
    WRITE 'JTAB:'.
    LOOP AT JTAB FROM 1 TO 5.
    WRITE: / JTAB-COL1, JTAB-COL2.
    ENDLOOP.
    Regards,
    Neha
    Edited by: Neha Shukla on Mar 12, 2009 1:35 PM

  • How to fetch data from bseg based  on 2 internal tables in 1 select query?

    hi,
    i have bukrs and belnr in one internal table and bukrs and vbeln in another internal table..now if i select from bseg twice using for all entries for fields bukrs vbeln and bukrs belnr twice in 2 select statements its fine..but since bseg is a huge table i want to use select only once..but the problem is that none of the belnrs in the one internal table will have vbeln in another internal table....ie if vbeln is selected from bseg based on belnr in 1 internal table non eof those vbeln will be equal to vbeln on another internal tables..in this scenario even if i take all data from two internal tables into 1 single internal table and then use for all entries on vbeln and belnr of that table ..but i think this will not work because and AND operator will not work because no record will satisfy both vbeln and belnr conditions..even if i use OR operator if the 1st condition satisfies the select clause will not enter into the second clause and all the records will not be fetched...Please help how should i tackle this..

    Hi vijaya,
    no simple select statement solution so far.
    As BSEG is a huge table you should try to get the full key values into another internal table first.
    SAP avoids direct selections from BSEG.
    Pleas consider the use of one of the secondary index tables first:
          BSAD : Accounting: Secondary Index for Customers (Cleared Items)
          BSAK : Accounting: Secondary Index for Vendors (Cleared Items)
          BSAS : Accounting: Secondary Index for G/L Accounts (Cleared Item
          BSEC : One-Time Account Data Document Segment
          BSEG : Accounting Document Segment
          BSID : Accounting: Secondary Index for Customers
          BSIK : Accounting: Secondary Index for Vendors
          BSIS : Accounting: Secondary Index for G/L Accounts
    you may include
          BKPF : Accounting Document Header
    for restrictions about time and document type.
    The last step is a FOR ALL ENTRIES selection from BSEG providing the full key values.
    Although you may have even more selects, the overall performance will be much better.
    Regards,
    Clemens

  • How to fetch data from database in javafx 2.2 table which is editable.

    Dears!
    I want to fetch data from database in javafx 2.2 tableformat with jdbc , which is also editable and i can add more records in this table also.
    Can anybody help me

    I can vaguely recall some sort of JavaFX database connectivity feature, I'm not sure if it's valid anymore.The link is based on JavaFX Composer which only applied to NetBeans 6.9 and JavaFX 1.x (both of which are now dead techs).
    There is a good chance you will have to write your own. There are several blogs describing other peoples' work. You could probably use them as a reference.Here is Narayan's basic [url http://blog.ngopal.com.np/2011/10/19/dyanmic-tableview-data-from-database/] tutorial for displaying data from a database in a TableView, you'll need to look elsewhere for the editing portion.
    The [url http://docs.oracle.com/javafx/2/ui_controls/table-view.htm]JavaFX TableView tutorial gives info about how to handle edits in a TableView, but you will need to tie the updates back to the database yourself.
    It is possible that [url http://www.javafxdata.org/]DataFX may provide some facilities to help support you.

  • How to update values for qty n batch in mska table

    Hi experts,
    i would lke to know is it possible that we can update value of availabity of stock which is existing batch wise in MSKA table field 'kalab' (qty) n charg (batch).
    i mean we have devided material per document number into batch a b c.
    suposse
    we have '20015' material
    for doc1 (vbeln) -- A qty 5
    B qty 5
    C qty 0
    for doc2 (vbeln) A qty 2
    C qty 5
    B qty 0
    But after delivery we want to change the distribution of stock material like .
    for doc1 A qty 2
    B qty 3
    C qty 5
    and for doc2 A qty 5
    B qty 2
    C qty 0
    i create one programe and check the availabity in mska table n give input field to reorder the batch n quantity but how should i send these values in mska table so that sap will show the correct availabity of stock batch wise.
    if somebody did it before. through ur input please .
    Thanks.
    Seema

    Hi sutar,
    Seems it is not WD related Question.
    You are updating two tables here, but not updating in Database. check two tables how they are related.
    and mysuggestion is try to update thease two tables by using code in se38. you will get where the problem is.
    Cheers,
    Kris.

  • How to fetch column data using foreign key in adf table ?

    I have created a adf table using a view that has a group id and user id column. I want to display the user name ( from user table) and group name from group table. I had created view links to the corresponding tables from the user_group view ( whose iterator is used to render the table).
    It sort of works. I dragged the user name from the embedded user iterator in user_group iterator. It does find the correct user name but if I have more than one row, it displays the user name of the last row user in all rows !
    Is there a solution to this problem ?

    Well, I saw in the view query for the association view ( for Many-Many) that the SQL already had the joins with the two ( master) tables to the association table. So I went ahead and added the descriptive columns to the select clause. Then the selected columns showed up in the attribute list by themselves ( without my intervention). So far so good.
    Then I recreated the adf table attribute by dragging these newly selected attribute to the page. I still see that the value of the attribute is the same in all the rows - this time it is the value for the FIRST row. It doesn't correspond to the foreign key for that particular row.
    IS THIS A BUG ? Has anyone else ever done this ?

  • SQL batch doesn't work; How to fetch related objects with fetch group?

    I have two questions:
    1. SQL Batch doesn't seem to work. I have tested some batch object creation
    with BatchLimit set to -1, 0, 1, 25, 100. They all have similar
    performance.
    kodo.jdbc.DBDictionary: BatchLimit=25
    2. How to use custom fetch group to fetch related objects? The example of
    custom fetch group only show how to fetch different attributes in different
    groups. I have a test cases where I would like to pre-fetch related objects
    to save round trip.
    Enviroments:
    * Kodo 3.1.0 RC1
    * Oracle 9i release 1
    Thanks for any help!
    Qingshan Luo
    Senior Software Engineer
    Open Harbor
    1123 Industrial Road
    San Carlos, CA 94070
    Phone: 650-413-4251
    Fax: 650-413-4298

    try poracle 10g driver. At least they fixed terrible CLOB bug may be batch
    to. BTW 9.2.x has problem with batching with deferred constraints so be
    careful
    "Greg Campbell" <[email protected]> wrote in message
    news:c3dmnu$rmj$[email protected]..
    >
    "Qingshan Luo" <[email protected]> wrote in message
    news:c3dg7q$mdl$[email protected]..
    Hi,
    I have two technical questions with Kodo.
    1. SQL Batch doesn't seem to work. I have tried batch size of -1, 0, 1,25.
    But the performance from batch creating objects is not affected by batch
    size.
    kodo.jdbc.DBDictionary: BatchLimit=25You may be running into a bug in the Oracle 9.2 driver. That driverdoesn't
    reliably give update counts when using batching and prepared statement
    caching. By default, Kodo will turn off batching. You can manuallyenable
    batching by setting the BatchLimit on your DBDictionary, as you've done.If
    you do this, though, you may want to turn off prepared statement cachingby
    setting MaxCachedStatements to 0 (see
    http://www.solarmetric.com/Software/Documentation/3.1.0RC1/docs/ref_guide_dbsetup.html#ref_guide_dbsetup_builtin).
    >
    2. How to use custom fetch groups to eagerly fetch related persistable
    objects? Example only showed attributes, not relationships.You can find information on setting up eager fetching of relations at
    http://www.solarmetric.com/Software/Documentation/3.0.3/docs/ref_guide_
    perfpack_eager.html
    Basically, you'll need to add the relations to your fetch group, and
    set the eager fetching mode.
    Enviroment:
    * Kodo 3.1.0 RC1
    * Oracle 9i release 1.
    Qingshan Luo
    Senior Software Engineer
    Open Harbor
    1123 Industrial Road
    San Carlos, CA 94070
    Phone: 650-413-4251
    Fax: 650-413-4298

  • How to fetch data into my custom script configured in qc02 transaction

    Hi All,
    I configured the custom SAP-Script in place of standard script name in QC02 tcode.In my requirement when I execute QC22
    transaction the custom script will be triggered along with some data based on material number,batch number and plant.I need to fetch QALS-KTEXTMAT , QALS-CHARG, MCH1-HSDAT and MCH1-VFDAT.Please help me how to fetch this data.Any Enahancement need to use or any spot is there Please specify.
    Thanks in advance.
    Regards,
    Satya.
    Edited by: satyareddygade on Sep 8, 2011 2:13 PM

    Hi Satya,
    Try like this in your Script window text element.
    /: PERFORM FETCH_KTEXTMAT IN PROGRAM <Z Subroutine Pool program>                                                                               
    /: USING &QALS-PRUEFLOS&                                                                               
    /: CHANGING &GV_KTEXTMAT&                                                                               
    /: ENDPERFORM
    in Z Subroutine Pool program
    FORM fetch_ktextmat TABLES  intab  STRUCTURE itcsy
                                outtab STRUCTURE itcsy.
      DATA:
        lv_prueflos TYPE qals-prueflos,
        lv_ktextmat TYPE qals-ktextmat.
    *---Get Inspection Lot Number
      READ TABLE intab WITH KEY 'QALS-PRUEFLOS'.
      CHECK sy-subrc = 0.
      lv_prueflos = intab-value.
      SELECT SINGLE ktextmat FROM qals INTO lv_ktextmat WHERE prueflos EQ lv_prueflos.
      outtab-value = lv_ktextmat.
      MODIFY outtab FROM outtab TRANSPORTING value WHERE
      name = 'GV_KTEXTMAT'.
      CLEAR : intab,outtab.
    ENDFORM.                    "FETCH_KTEXTMAT
    /: PERFORM FETCH_HSDAT IN PROGRAM <Z Subroutine Pool program>    
    /: USING &*VBDPL-MATNR&
    /: USING &VBDPL-CHARG&
    /: CHANGING &GV_HSDAT&
    FORM fetch_hsdat TABLES  intab  STRUCTURE itcsy
                                outtab STRUCTURE itcsy.
      DATA:
        lv_matnr TYPE vbdpl-matnr,
        lv_charg TYPE vbdpl-charg,
        lv_hsdat TYPE mch1-hsdat.
    *---Get Material Number
      READ TABLE intab WITH KEY '*VBDPL-MATNR'.
      CHECK sy-subrc = 0.
      lv_matnr = intab-value.
    *---Get Batch Number
      READ TABLE intab WITH KEY 'VBDPL-CHARG'.
      CHECK sy-subrc = 0.
      lv_charg = intab-value.
      SELECT SINGLE hsdat FROM mch1 INTO lv_hsdat WHERE matnr EQ lv_matnr
                                                    AND charg EQ lv_charg.
      outtab-value = lv_hsdat.
      MODIFY outtab FROM outtab TRANSPORTING value WHERE
      name = 'GV_HSDAT'.
      CLEAR : intab,outtab.
    ENDFORM.                    "FETCH_HSDAT
    Use the following program symbols where you want to print.
    &GV_KTEXTMAT& &QALS-CHARG& &GV_HSDAT& and &MCH1-VFDAT&
    Regards,
    Surya.

  • How to fetch content from UCM in WLP using VCR

    Hi,
    I configured the connection between weblogic portal v10.3.2 and UCM 11g using VCR adapter guide. But i am struck in how to fetch the content from UCM/VCR and display it in Weblogic portal.
    Please guide me on how to fetch the content from UCM/VCR and display it in Weblogic Portlet ( JSF Portlet). is there any api is available to get the content from ucm and display it in portlet.
    Appreciate your support here.
    Thanks a lot,
    Suresh

    Suresh,
    Please check the name of the VCR configured in the UCm.
    You can use a batch file to load the VCR on to your Weblogic server. Using the name you can retrieve the contents from UCM.
    Please let us know other configuration details to help you further

  • How to fetch particular segment of records?

    Hi all,
    My last question is how to limit the rows returned. This time my question is how to fetch particular segment of records from DB table?
    In detail, if one table has 95 records, which method can be used to fetch #71-80 record only, not fetch #1-80 first and abandon the preceeding 70 ones?

    There are a few methods:
    - Set firstResult and maxResult on the JPA Query, this is normally the best option. Depending on your database this will best optimized to only select these rows.
    - Use a Cursor, in EclipseLink 1.1 there are QueryHints for doing this, see org.eclipse.persistence.config.QueryHints.
    - Select all of the results, and store them in your app or http session, and scroll through them in memory on next/previous.
    - Select just the ids, and store them in your app/page or http session, each page select the batch of object with the ids.
    - Use an order-by and critieria to limit your results to a specific amount.
    James : http://www.eclipselink.org
    http://en.wikibooks.org/wiki/Java_Persistence

  • What is a cube? how we store data in that? how we fetch data from cube?

    Hi,
    What is a cube? how we store data in that? how we fetch data from cube?
    Regards.
    venkat

    >
    venkey B wrote:
    > Hi,
    >
    >
    > What is a cube? how we store data in that? how we fetch data from cube?
    >
    >
    > Regards.
    >
    > venkat
    Hi Venkat,
    I guess you mean an infocube from the SAP BI product. I propose to look at the forum for Business Intelligence to find your answers.
    E.g. SAP POS DM writes the sales data in infocubes.....

  • How to run a FM using wf-batch

    Hi all,
    We are having one function module for updating production order number in a Z-Table.
    So whenever we save a production order this function module is automatically triggered using the user wf-batch and update the order number in the Z-Table.
    But we dont know how the function module was triggered using wf-batch when we created production order( Because the fm was created on 1998 by another client)
    How to find the link between FM(with wf-batch) and the production order?
    Kind Regards
    Kumar

    Hi aditya,
    Tnx for ur reply. But we are not using the WF module.
    If i put where used list for that FM then a business object with name Z_2005PP is displayed. In this they are using one method which contains the FM name.
    But if i put where used to that BO then no workflow template is available.
    So how they triggered the FM using wf-batch whenever they create the production order?
    Regards,
    Kumar.

  • How to delete the payroll result by batch? have any program to do this?

    Hi,
    how to delete the payroll result by batch? have any program to do this?

    With standard payroll deletion (PU01), SAP  will not allow payroll results to be deleted if it already reaches certain steps of payroll process (e.g. Pre-DME, DME); instead, you would have to do payroll a void or payroll reversal. This utility doens't check for that, and only delete payroll results based on the criteria given. This therefore could cause inconsistency in production if your payroll process already surpasses certain steps.
    Rgds.

  • Production Order Number and Batch Number same during order creation

    Hi All,
    I wanted to keep the Production Order number and Batch Number same during creation.
    How I can do that during creation of order only. So during creation same number to be get assigned automatically in the background.
    One thing I can maintain ; the same number range for both.
    But how to activate other functionality.
    Regards,
    Amit

    Hi SAP2511,
    For Production order-
    1.You can define a Order type  and  Mantain the number range same as batch number range (in  OPJH transction)
    For Batch
    1.Activate Automatic internal batch assignment - (OMCZ)
    2.Number range for batch - for object - BATCH_CLT - (OMAD)
    For batch creation at time of Order creation -
    You can create Automatic batch at the time of order creation or order release
    1 Create Production scheduler Profile(OPKP) and assign in Work scheduling view of material master for which you want to create batch at the time of order creation or release.(Select automatic batch creation at the time of release or creation in OPKP)
    Things to be taken care -
    1 . What if you set deleation flag for order?
    Regards
    Girish
    Edited by: girish khobare on Aug 20, 2010 9:31 AM

Maybe you are looking for