Adding new constant value to an 'enum' used in a field causes an exception

We are using the DPL. I added a new constant to an enum that is used as a field on an entity called Booking (this field is not a key). This seems to cause an exception during onForeignKeyDelete when we delete an object from a related entity. The constraint is a "NULLIFY" on a "MANY_TO_ONE" relationship, so the effect should be just to nullify the Booking foreign key, but for some reason the fields are being checked and causing this exception. Shouldn't it be possible to add a new constant value to an enum without having to do some sort of migration? The stack is below. Note that the two types mentioned in the exception message are in fact the same (this is the enum). For the moment we can truncate our database, because we are still in development, but this would present a problem in production.
IllegalArgumentException: Not a subtype of the field's declared class com.chello.booking.model.BookingStatus: com.chello.booking.model.BookingStatus
at com.sleepycat.persist.impl.RawAbstractInput.checkRawType(RawAbstractInput.java:142)
at com.sleepycat.persist.impl.RecordOutput.writeObject(RecordOutput.java:75)
at com.sleepycat.persist.impl.RawAccessor.writeField(RawAccessor.java:232)
at com.sleepycat.persist.impl.RawAccessor.writeNonKeyFields(RawAccessor.java:148)
at com.sleepycat.persist.impl.ComplexFormat.writeObject(ComplexFormat.java:528)
at com.sleepycat.persist.impl.PersistEntityBinding.writeEntity(PersistEntityBinding.java:143)
at com.sleepycat.persist.impl.PersistKeyCreator.nullifyForeignKeyInternal(PersistKeyCreator.java:170)
at com.sleepycat.persist.impl.PersistKeyCreator.nullifyForeignKey(PersistKeyCreator.java:137)
at com.sleepycat.je.SecondaryDatabase.onForeignKeyDelete(SecondaryDatabase.java:1082)
at com.sleepycat.je.ForeignKeyTrigger.databaseUpdated(ForeignKeyTrigger.java:37)
at com.sleepycat.je.Database.notifyTriggers(Database.java:2016)
at com.sleepycat.je.Database.deleteInternal(Database.java:800)
at com.sleepycat.je.Database.delete(Database.java:714)
at com.sleepycat.persist.BasicIndex.delete(BasicIndex.java:133)
at com.sleepycat.persist.PrimaryIndex.delete(PrimaryIndex.java:206)
at com.sleepycat.persist.BasicIndex.delete(BasicIndex.java:124)
at com.sleepycat.persist.PrimaryIndex.delete(PrimaryIndex.java:206)
Kind regards
James Brook

James,
I've started investigating this and at first look it does appear to be a DPL bug. Over the next few days I'll look more deeply and report back here with what I find. If it is indeed a bug, we'll fix this for the next JE 4.0.x release and I'll make the fix available to you.
You are correct that adding enum values is allowed without a conversion of any kind. The only change you should have to make, other than adding the enum value, is to bump the version of the containing entity in the @Entity annotation. I'm suspect you've already done that, but if you hadn't, it wouldn't cause the problem you're seeing.
We have tested the addition of enum values, but not in combination with foreign key deletion and the NULLIFY constraint, I'm afraid.
If I'm correct about it, the bug is specific to adding enum values and deleting a secondary key with the NULLIFY constraint, prior to re-writing the entity in some other way. So if the entity is updated (written) before the secondary key is deleted, then the problem should not occur. Therefore, one workaround is to call EntityStore.evolve after adding the enum value, and before using the store in other ways.
Thanks for reporting this, and I hope this is not blocking your development.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to create new subsite while adding new item to the list by using javascript?

    hi,
    I hav a task ie, when I add item to the list then subsite will create with that list item title and description . So By using javascript, I have to create subsite while adding new item to the list.
    Help me to solve this.
    Thank you, 

    Is your item getting added through Javascript client object model ? If yes, you can write in the success delegate of your list creation method the logic to create the subsite.
    function CreateListItem()
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('List Name');
    var itemCreateInfo = new SP.ListItemCreationInformation();
    this.oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', 'My New Item!');
    oListItem.set_item('Body', 'Hello World!');
    oListItem.update();
    clientContext.load(oListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.CreateListItemOnSuccess), Function.createDelegate(this, this.onQueryFailed));
    function CreateListItemOnSuccess() {
    var subsiteTitle = oListItem.get_item('Title');
    //Logic to create a subsite
    function onQueryFailed(sender, args) {
    I have added a sample flow for the above scenario. Have a look at the following lnk for how you can craete a subsite using ecmascript.
    http://ravisoftltd.wordpress.com/2013/03/06/sharepoint-2010-create-site-with-ecma-script-with/
    Geetanjali Arora | My blogs |

  • Having problems when adding new Curency value field + currency field.

    I need to add a new Currency field (CURR, length 15, 2 decimal places) plus the Currency field itself to a view. 
    I'm really struggerling. I have looked at the existing SAP fields in the Component workbench and I have to admit I can not see how a field is linked/related to the currency itself. Is this link established purlely at the disctionary level?.
    Has anyone added their own Z field value  and Z currency field before. I can create both fields and display them, but what I can not work out is how I related them within the component workbench, or is this done from the dictionary?.
    Any help would be greatly appreciated.
    I should have been able to look at an existing SAP example and work out how it's done, but so far I can not see/determine how this is achieved, even though someone has mentioned that it's controlled via the GET_I_field method. Looking at this method I was expecting to see some mention of both the Currency value field and the Currency field. But as I don't see these confusion reigns.
    Jason

    That's correct, but am I right in thinking that you can't actually create the currency key field itself?.
    I am aware that currency value fields can be created which reference a currency key field, but can see nothing that allows me to create a currency key field to be referenced.
    I hope that makes sense.
    Also, I have amended the structure, changing my value fields from Decimal 15,2 to Currency 15,2  and have created a new currency key field in the structure and referenced this from the Currency value field.
    Witin the Component/view/context node I can see this new currency key field, but it appears as STRUCT.fieldlabel whereas my currency value field appears in the context node as EXT.fieldlabel, because it was created in the AET.
    My problem is that when attempting to add the currency key field onto the screen I don't have it to select from within the list of structures/attributes. All the others attributes in the context node seem to be there, except the new currency key field/attribute.
    The attribute has a SET_fieldlabel, GET_fieldlabel, GET_M_Fieldlabel and a GET_I_Fieldlabel, which I believe is all that should be required.
    Does anyone know what my problem could be?.
    Jason

  • Retrive a new sequence value from a table using Stored Procedure

    Dear experts
    i have written the following stored procedure, but i want this to return itemid to the environment. Please help as i am absolutely new to oracle.
    create or replace procedure "SP_ITEMS"
    (vitem IN VARCHAR2,
    vqty IN NUMBER,
    vrate IN NUMBER)
    is
    begin
    INSERT INTO ITEMS (item,qty,rate)
    VALUES (vitem,vqty,vrate);
    end;
    Thanks
    With regards
    Manish Sawjiani

    If you want a column to be automatically populated with a sequence, then you need to create a sequence, and create a trigger to populate the column with the sequence. You can use the returning clause in a select statement to return the value of the inserted sequence. You can do this with just sql or you can put it in a procedure. I have demonstrated both below. This is a general sql and pl/sql problem, not something specific to the Express Edition, so please post future such questions in the sql and pl/sql discussion group instead.
    SCOTT@10gXE> CREATE TABLE items
      2    (itemid NUMBER,
      3       item   VARCHAR2 (50),
      4       qty    NUMBER (10, 3),
      5       rate   NUMBER (10, 3))
      6  /
    Table created.
    SCOTT@10gXE> CREATE SEQUENCE item_sequence
      2  /
    Sequence created.
    SCOTT@10gXE> CREATE OR REPLACE TRIGGER items_bir
      2    BEFORE INSERT ON items
      3    FOR EACH ROW
      4  BEGIN
      5    SELECT item_sequence.NEXTVAL
      6    INTO   :NEW.itemid
      7    FROM   DUAL;
      8  END items_bir;
      9  /
    Trigger created.
    SCOTT@10gXE> SHOW ERRORS
    No errors.
    SCOTT@10gXE> VARIABLE g_itemid NUMBER
    SCOTT@10gXE> INSERT INTO items (item, qty, rate)
      2  VALUES ('item1', 2, 3)
      3  RETURNING itemid INTO :g_itemid
      4  /
    1 row created.
    SCOTT@10gXE> PRINT g_itemid
      G_ITEMID
             1
    SCOTT@10gXE> CREATE OR REPLACE PROCEDURE sp_items
      2    (p_item      IN  VARCHAR2,
      3       p_qty      IN  NUMBER,
      4       p_rate      IN  NUMBER,
      5       p_itemid OUT NUMBER)
      6  AS
      7  BEGIN
      8    INSERT INTO ITEMS (item, qty, rate)
      9    VALUES (p_item, p_qty, p_rate)
    10    RETURNING itemid INTO p_itemid;
    11  END sp_items;
    12  /
    Procedure created.
    SCOTT@10gXE> SHOW ERRORS
    No errors.
    SCOTT@10gXE> EXECUTE sp_items ('item2', 3, 4, :g_itemid)
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> PRINT g_itemid
      G_ITEMID
             2
    SCOTT@10gXE> SELECT * FROM items
      2  /
        ITEMID ITEM                                                      QTY       RATE
             1 item1                                                       2          3
             2 item2                                                       3          4
    2 rows selected.
    SCOTT@10gXE>

  • Use of JUPanelBinding.setup causes an exception

    Hi,
    I have a problem with using the setup function of the JUPanelBinding class.
    here it is:
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
         at java.awt.EventQueue.invokeAndWait(EventQueue.java:834)
         at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1257)
         at oracle.jbo.uicli.controls.JUErrorHandlerDlg.reportException(JUErrorHandlerDlg.java:363)
         at oracle.jbo.uicli.controls.JUErrorHandlerDlg.reportException(JUErrorHandlerDlg.java:279)
         at oracle.jbo.uicli.mom.JUMetaObjectManager.reportException(JUMetaObjectManager.java:174)
         at oracle.view.ChooseMachine.<init>(ChooseMachine.java:122)
         at oracle.view.ChooseAction.NextButton_actionPerformed(ChooseAction.java:276)
         at oracle.view.ChooseAction.mav$NextButton_actionPerformed(ChooseAction.java)
         at oracle.view.ChooseAction$5.actionPerformed(ChooseAction.java:82)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:158)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Any help is welcomed.

    Hi,
    I am also having the same problem. Could you please tell how did you fix it?
    Thanks in advance.

  • Added new fields in vendor master in xk01 but data is not getting saved

    Hi experts,
    To add new fields in vendor master i have followed the following steps :
    1.) Appended a structure ZRTGS in LFA1 table with required fields and activated
    2.) Added new button in xk01( vendor master ) using spro -> logistics-general -> business partner -> vendors ->
    control ->adoption of customer's owaster data fields -> prepare modification free-enhancement of vendor master record
    Created a screen group ZR and defined label tab pages with function code ZRTGS and saved entries
    3.) Created a implementation for BADIs VENDOR_ADD_DATA and VENDOR_ADD_DATA_CS.
    4.) Created a program with my own subscreen for the required fields
    The button is getting displayed in XK01, XK02 and XK03 respectively. Whenever the button is clicked the subscreen with
    the fields is also displayed. But whenever i try to save the data in either XK01 or XK02 it is not getting saved in to the
    database table LFA1.
    Request your help in this regard.
    Thanks in Advance.

    Hi,
    You may need to check this include .
    EXIT_SAPMM06E_008  -->Import Data from Customer Subscreen for Purchasing Document
    Thanks,
    vamshi

  • Adding new field with constant value for pre-existing records

    Hi,
    I have to introduce in different tables (ztable and standard one) a new field, containing the company code. The problem is that all the records already inserted in these tables should be filled with a particular company code ('DD01').
    I'd like to have this field automatically filled with a constant value without having to develop a program in order to update all the preexisting data. The reason is that cardinality of these tables is aroud 100 Millions of rec....
    Ideal solution should be to have some rule/routine defined in the data dictionary CR, so to get the field value during the import of the related CR.
    I've seen that is possible to define routine, but only for maintainance view (so new records..). If I open the db view, the situation is the following (example):
    Campi di ZKR_CRPU  
    Nm.campo Pos. Tp. dati Lngh. Decimali Not null Default
    MANDT 1 VARCHAR 3   X '000'
    ZZKDATANNO 2 VARCHAR 4   X '0000'
    ZZKDATMESE 3 VARCHAR 2   X '00'
    ZZKCODZONA 4 VARCHAR 3   X ' '
    ZZKDCODCTDIS 5 VARCHAR 6   X ' '
    ZZKCRPU 6 DECIMAL 10 9 X 0
    Is it possible to change the default value? is there a solution to my problem without developing a tool just for updating a field? I can also define a custom data element if the problem can be solved.
    Thanks a lot,
    Gabriele

    Hi!
    If I were you, I will not look for another solution, because it's pretty easy task for ABAP.
    It can be solved within 1 line:
    UPDATE ztable SET zzcompany = 'DD01' WHERE zzcompany = ''.
    Regards
    Tamá

  • Custom: use constant value in relationship between objects?

    I have two related classes:
    * Class A uses application identity, and has multiple PK fields, PK1 and
    PK2.
    * Class B has a 1-many relationship with class A. However, class B's
    database table only has a column that relates to Class A's PK2 column.
    (the PK1 value is a constant) for all Class B objects).
    I have no idea how to express this relationship via kodo. Can anyone
    assist?

    What I've chosen to do is add a new DB column to my table which has a
    constant value (ie: is the same for every row). Then I can join with it.
    I'd request this simple feature to be added in a future release: the
    ability to specify a literarl constant value as part of the join
    criteria in the metadata. It could be very easily added: instead of
    specifying a column containing the join value, you could put the literal
    into the .jdo file.
    thanks.
    Patrick Linskey wrote:
    You could put together a custom field mapping that performed the join
    like you described if you really wanted to. Bear in mind, however, that
    the field mapping APIs are subject to change etc. etc. etc.
    -Patrick
    On Tue, 20 May 2003 22:25:16 -0400, David Michaels wrote:
    Thanks for the quick reply, as usual Abe.
    In this case, I will link to the full PK of the related object, just one
    of the components of that PK is a constant. There's no place to
    override the SQL used for these sort of joins?
    Perhaps I can do this with a view too.
    Abe White wrote:
    It's not possible to create a Kodo relation that doesn't actually link
    to the (full) primary key of the related object. Note that in general,
    that kind of database design is not a good idea, because there's no
    guarantee you're linking to a unique object.
    You can use a Kodo query to get the related objects; you could hide the
    query behind your getter method.

  • Maintaining operating concern after adding new value field

    Hello,
    I added a new value field to our live operating concern,maintained the data structure throguh KEA0(Maintain operating concern).The changes are transported from Development to Quality,Changes were reflected in Q system.After testing in Q system transports were pushed to production system.The new value field is added to the operating concern. When i check the log for KEA0 in production system it displayed one message like:
    Field VV088 was added to the reference structure
    Message no. KE782.You probably either  changed the operating concern or SAP-EIS aspect, and added the field VV099 to the definition.
    The added a CO-PA value field:
    In this case, the field is added to the definition or the summarization levels. This invalidates all existing levels. Consequently, you need to activate them again and fill them with data.
    In production system maintaining operating concenr or KEAO is only in display mode.Is it needed to regenerate the operating concern once again in production, how to do it. Is the message talking about the KEDV summarization levels.?
    thanks
    rahul

    Hi,
    No no ....KEDV is nothing to do here....that is creation of summarization in CO-PA.
    Since you added new value field you necessarily have to Regenerate the operating concern...
    Use Tcode KEA0...go to Environment tab...there the status of Cross client part  and client specific part both will be in RED....now just click on the Cross client (candle button)...now the system would regenerate the operating concern...once it is over do the same for the client specific...
    Beware when you do regenerate the operating concern no body can enter any transaction in that server since it is cross client table ...hence better do it after business hours.
    Hope this helps!
    Running KEDU with rebuild is relevant only when you already have created summarization and called up the same in the CO-PA report "options" tab. If you did not created the summarization you are nothing to do with KEDU.
    Next: The new value field has to be transported to PRD and hence even in PRD we have to do the regeneration manually.
    Regards,
    Velumani
    Message was edited by: Velumani Arunachalam
    Message was edited by: Velumani Arunachalam

  • Adding new field at leasing contract using EEWB and using it for pricing

    Using the Easy enhancement workbench, I have created a new tab containing a new field at the item level of contract. Then in SPRO, in the field catalog, I added a new entry using the same field name and data element name. Created a new condition table with this new field. created access sequence and assigned it to a condition type.
    I tried to maintain condition record for the condition type but initially it was showing some error for which I had to implement a new method for the BAdi /SAPCND/ROLLNAME.
    Now. condition record is also maintained successfully.
    But, the problem is that the value is not reflected at the contract.
    Somehow, the condition record is not being picked up.
    Please suggest some solution.
    Regards,
    Anindita RoyChowdhury.

    Hi Anindita,
    Stpes mentioned in your questions are fine.
    You have created new Screen @ item level in Order txn, right?
    Did u checked value passed to the method of BAdI ?
    As per my knowledge, pricing call must have happened before you fill the Zfield which u added in new screen. Hence no value in field and no effect on pricing.
    Regards,
    Deven

  • Adding new field using EEWB and using it for Pricing

    Using the Easy enhancement workbench, I have created a new tab containing a new field at the item level of contract. Then in SPRO, in the field catalog, I added a new entry using the same field name and data element name. Created a new condition table with this new field. created access sequence and assigned it to a condition type.
    I tried to maintain condition record for the condition type but initially it was showing some error for which I had to implement a new method for the BAdi /SAPCND/ROLLNAME.
    Now. condition record is also maintained successfully.
    But, the problem is that the value is not reflected at the contract.
    Somehow, the condition record is not being picked up.
    Please suggest some solution.
    Regards,
    Anindita RoyChowdhury.

    Hi Anindita,
    Stpes mentioned in your questions are fine.
    You have created new Screen @ item level in Order txn, right?
    Did u checked value passed to the method of BAdI ?
    As per my knowledge, pricing call must have happened before you fill the Zfield which u added in new screen. Hence no value in field and no effect on pricing.
    Regards,
    Deven

  • Regarding adding new pricing condition using BAPI_SALESORDER_CHANGE

    Hi All,
    I am trying to add a new pricing condition at item level using Bapi_salesorder_change, but it is not getting updated. I am also doing Bapi_transaction_commit as the next step.
    I am passing the sales order number and the Update flag in the header. Tried passing G as the logic switch-pricing and also tried with logic_switch-COND_HANDL = X.
    I am passing the data in structure CONDITIONS_IN with the value for item numebr, condition step number, condition count , condition value, currency and unit.
    Also I am passing data in CONDITIONS_INX with the required flags set and update flag as 'I'.
    The output says that order is changed and saved successfully, but the condition type is not there when i check the pricing coinditions inside the order at item level.Please help.
    Regards,
    Kaustubh B. Khasnis

    Hi,
    In the condition tab..
    Press the determination analysis button..
    There it will show the why the pricing condition type is not added..
    Thanks,
    Naren

  • How to refresh the grid so that default  values come on adding new row.

    Hi Experts,
    In alv grid while adding new row, i want some 2-3 column values to come by default from already existing row in grid.
    i am getting new row in internal table with 2-3 default values and rest columns blank on adding new row in alv grid
    but the entire row is coming blank, not able to get the default values in new row
    how can i refresh the grid so that default  values come on adding new row.
    thanks

    Hi Surabhi,
    Use this in Interactive section even if you are doing simple ALV.
    DATA:
    lv_ref_grid TYPE REF TO cl_gui_alv_grid.
    CLEAR : gv_tcode.
    *-- to ensure that only new processed data is displayed
    IF lv_ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    e_grid = lv_ref_grid.
    ENDIF.
    IF NOT lv_ref_grid IS INITIAL.
    CALL METHOD lv_ref_grid->check_changed_data.
    ENDIF.
    THis will solve your problem.
    Regards,
    Vijay

  • Impact of adding new value fields in ongoing operating concern.

    Hi All,
    Want to know the steps of adding new value fields in the existing operating concern in COPA?
    What is the overall impact of addition of New Value fields in the running Operating Concern?
    How do we test the addition of new value fields?
    Is the addition of New Value fields to the running Operating Concern advisable?
    Your support and advice is highly anticipated and appreciated.
    Thanks & Regards
    9819528669

    HI,
    please search in SCN forum before you post:
    Re: Adding a ValueField to an existing Operating Concern?
    Best regards, Christian

  • ME21N - new field added and same value posted to it for all line items

    hi all
    i have added new field under item  level in me21n screen.
    data for new filed fetched from tables with values entered in header level material number.
    For one record, it is ok
    but for multiple records, same value is fetched for all line items
    i have written coding in screen exit for 0111
    and function exits EXIT_SAPMM06E_016 and EXIT_SAPMM06E_018
    how to solve
    pl help
    regards
    senthil

    MODULE STATUS_0111 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
      if sy-tcode eq 'ME23N' or sy-tcode eq 'ME23'.
        LOOP at SCREEN.
          if screen-group1 ne 'PCS'.
            screen-input = 0.
            MODIFY SCREEN.
          endif.
        ENDLOOP.
      ENDIF.
      TYPES : BEGIN OF ty_cabn1,
             atnam TYPE cabn-atnam,
           end of ty_cabn1.
      DATA : itab_cabn1 TYPE STANDARD TABLE OF ty_cabn1 INITIAL SIZE 0,
             wa_cabn1 TYPE ty_cabn1.
      TYPES : BEGIN OF ty_cawn1,
        atinn TYPE cawn-atinn,
        atzhl TYPE cawn-atzhl,
        atwrt TYPE cawn-atwrt,
        end of ty_cawn1.
      DATA : itab_cawn1 TYPE STANDARD TABLE OF ty_cawn1 INITIAL SIZE 0,
             wa_cawn1 TYPE ty_cawn1.
      TYPES : BEGIN OF ty_cawnt1,
       pcs TYPE cawnt-atwtb,
        atinn TYPE cawnt-atinn,
        atzhl TYPE cawnt-atzhl,
        atwtb TYPE cawnt-atwtb,
          end of ty_cawnt1.
      DATA : itab_cawnt1 TYPE TABLE OF ty_cawnt1,
             wa_cawnt1 TYPE ty_cawnt1.
      TYPES : BEGIN OF ty_pcs1,
    pcs TYPE cawnt-atwtb,
      atwrt TYPE cawn-atwrt,
      atwtb TYPE cawnt-atwtb,
        end of ty_pcs1.
      DATA : itab_pcs3 TYPE TABLE OF ty_pcs1,
             itab_pcs4 TYPE TABLE OF ty_pcs1,
             wa_pcs1 TYPE ty_pcs1.
      TYPES : BEGIN OF ty_pcsn,
      matnr TYPE ausp-objek,
      ebelp TYPE dynpread-stepl,
      atwrt TYPE cawn-atwrt,
      atwtb TYPE cawnt-atwtb,
      END OF ty_pcsn.
      DATA : itab_pcsn TYPE TABLE OF ty_pcsn,
             wa_pcsn TYPE ty_pcsn.
      TYPES : BEGIN OF ty_ausp1,
         objek TYPE ausp-objek,
         atinn TYPE ausp-atinn,
         atwrt TYPE ausp-atwrt,
       END OF ty_ausp1.
      DATA : itab_ausp1 TYPE STANDARD TABLE OF ty_ausp1 INITIAL SIZE 0,
             wa_ausp1   TYPE ty_ausp1.
      DATA : param_name1(35) TYPE  c.
      DATA: progname1      TYPE sy-repid,
            dynnum1        TYPE sy-dynnr,
            dynpro_values1 TYPE TABLE OF dynpread,
            dynpro_values2 TYPE TABLE OF dynpread,
            field_value1   LIKE LINE OF dynpro_values1,
            ematn1         TYPE mara-matnr.
      if sy-tcode ne 'ME23N' and sy-tcode ne 'ME23'.  "psk
        clear : itab_cabn1,itab_cawn1,itab_cawnt1,itab_pcs3,itab_pcs4,itab_pcsn,itab_ausp1.
        clear : wa_cawn1,wa_cawnt1,wa_pcs1,wa_ausp1.
        if sy-uname eq 'IBM_ABAP'.
          param_name1 = '000000001'.
        else.
          param_name1 = '000000013'.
        endif.
        SELECT atnam
        FROM cabn
        INTO CORRESPONDING FIELDS OF TABLE itab_cabn1
        WHERE atinn  = param_name1.
        select *
        FROM cawn
        into CORRESPONDING FIELDS OF TABLE itab_cawn1
        WHERE atinn = param_name1.
        if itab_cawn1[] is NOT INITIAL.
          SELECT atinn atzhl atwtb
          FROM cawnt
          INTo CORRESPONDING FIELDS OF TABLE itab_cawnt1
          FOR ALL ENTRIES IN itab_cawn1
          WHERE atinn = itab_cawn1-atinn
          AND atzhl = itab_cawn1-atzhl.
        endif.
        if itab_cawnt1[] is NOT INITIAL.
          sort itab_cawnt1 by atinn atzhl.
          loop at itab_cawnt1 INTO wa_cawnt1.
            READ TABLE itab_cawn1 INTO wa_cawn1 with key atinn = wa_cawnt1-atinn
                                                         atzhl = wa_cawnt1-atzhl BINARY SEARCH.
            if sy-subrc eq 0.
           CONCATENATE wa_cawn-atwrt '->' wa_cawnt-atwtb INTO wa_cawnt-pcs.
           MODIFY itab_cawnt FROM wa_cawnt TRANSPORTING pcs.
           wa_pcs-pcs = wa_cawnt-pcs.
              wa_pcs1-atwrt = wa_cawn1-atwrt.
              wa_pcs1-atwtb = wa_cawnt1-atwtb.
              append wa_pcs1 to itab_pcs3.
            ENDIF.
            CLEAR : wa_cawnt1,wa_cawn1, wa_pcs1.
          ENDLOOP.
        ENDIF.
        CLEAR: dynpro_values1, field_value1.
    dynpro_values-FIELDNAME = 'MEPO1211-EMATN'.
    APPEND dynpro_values.
        field_value1-fieldname = 'MEPO1211-ematn'.
        APPEND field_value1 TO dynpro_values1.
        progname1 = 'SAPLMEGUI'.
        dynnum1 = '1211'.
        CALL FUNCTION 'DYNP_VALUES_READ'
          EXPORTING
            DYNAME                               = progname1
            DYNUMB                               = dynnum1
      TRANSLATE_TO_UPPER                   = ' '
         REQUEST                                = 'A'
      PERFORM_CONVERSION_EXITS             = ' '
      PERFORM_INPUT_CONVERSION             = ' '
      DETERMINE_LOOP_INDEX                 = ' '
      START_SEARCH_IN_CURRENT_SCREEN       = ' '
      START_SEARCH_IN_MAIN_SCREEN          = ' '
      START_SEARCH_IN_STACKED_SCREEN       = ' '
      START_SEARCH_ON_SCR_STACKPOS         = ' '
      SEARCH_OWN_SUBSCREENS_FIRST          = ' '
      SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
          TABLES
            DYNPFIELDS                           = dynpro_values1
       EXCEPTIONS
         INVALID_ABAPWORKAREA                 = 1
         INVALID_DYNPROFIELD                  = 2
         INVALID_DYNPRONAME                   = 3
         INVALID_DYNPRONUMMER                 = 4
         INVALID_REQUEST                      = 5
         NO_FIELDDESCRIPTION                  = 6
         INVALID_PARAMETER                    = 7
         UNDEFIND_ERROR                       = 8
         DOUBLE_CONVERSION                    = 9
         STEPL_NOT_FOUND                      = 10
         OTHERS                               = 11
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    READ TABLE dynpro_values1 INTO field_value1 with KEY fieldname = 'MEPO1211-EMATN'.
        LOOP at dynpro_values1 INTO field_value1 WHERE fieldname = 'MEPO1211-EMATN'.
          clear ematn1.
          if sy-subrc eq 0.
            ematn1 = field_value1-fieldvalue.
          endif.
          if ematn1 is not INITIAL.
            clear : wa_cawn1,wa_cawnt1,wa_pcs1,wa_ausp1.
            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                INPUT  = ematn1
              IMPORTING
                OUTPUT = ematn1.
            select *
            FROM ausp
            INTO CORRESPONDING FIELDS OF TABLE itab_ausp1
            WHERE objek = ematn1
            and atinn = param_name1.
            CLEAR itab_pcs4.
            if itab_ausp1[] is not INITIAL.
              sort itab_ausp1 by atinn atwrt.
              sort itab_cawn1 by atinn.
              READ TABLE itab_ausp1 INTO wa_ausp1 INDEX 1.
              loop at itab_cawn1 INTO wa_cawn1 WHERE atinn = wa_ausp1-atinn AND atwrt = wa_ausp1-atwrt.
                READ TABLE itab_cawnt1 INTO wa_cawnt1 WITH KEY atinn = wa_cawn1-atinn
                                                                atzhl = wa_cawn1-atzhl.
                if sy-subrc eq 0.
                  wa_pcs1-atwrt = wa_cawn1-atwrt.
                  wa_pcs1-atwtb = wa_cawnt1-atwtb.
                  append wa_pcs1 to itab_pcs4.
                  wa_pcsn-matnr = wa_ausp1-objek.
                  wa_pcsn-ebelp = field_value1-stepl.
                  wa_pcsn-atwrt = wa_cawn1-atwrt.
                  wa_pcsn-atwtb = wa_cawnt1-atwtb.
                  APPEND wa_pcsn to itab_pcsn.
                ENDIF.
                clear : wa_ausp1,wa_cawn1,wa_cawnt1.
              ENDLOOP.
            ENDIF.
           clear wa_pcs1.
           read TABLE itab_pcs4 into wa_pcs1 index 1.
           if sy-subrc eq 0.
             EKPO_CI-ZPCS = wa_pcs1-atwrt.
           endif.
          ENDIF.
        ENDLOOP.
        CLEAR: field_value1.
        LOOP at dynpro_values1 INTO field_value1 WHERE fieldname = 'MEPO1211-EMATN'.
          clear wa_pcsn.
          if field_value1-fieldvalue is not INITIAL.
            read TABLE itab_pcsn INTO wa_pcsn with key  matnr = field_value1-fieldvalue
                                                        ebelp = field_value1-stepl.
            if sy-subrc eq 0.
              clear  EKPO_CI-ZPCS.
    *EKPO_CI-ZPCS = wa_pcs1-atwrt.
              EKPO_CI-ZPCS = wa_pcsn-atwrt.
            endif.
          endif.
        ENDLOOP.
       CLEAR: field_value1, dynpro_values1.
       progname1 = 'SAPLXM06'.
       dynnum1   = '0111'.
       field_value1-fieldname = 'EKPO_CI-ZPCS'.
       APPEND field_value1 TO dynpro_values1.
       if ematn1 is not INITIAL.
         clear wa_pcs1.
         read TABLE itab_pcs4 into wa_pcs1 index 1.
         if sy-subrc eq 0.
           EKPO_CI-ZPCS = wa_pcs1-atwrt.
         endif.
       ENDIF.
      endif.
    ENDMODULE.                 " STATUS_0111  OUTPUT
    Function exits:
    ^^^^^^^^^^^^^^^^^
    EXIT_SAPMM06E_016
    ^^^^^^^^^^^^^^^^^
    INCLUDE ZXM06U41 .
    DATA XFISTL LIKE EKPO-FISTL.
    TABLES: ADRC, T001W.
    DATA: PLANT LIKE T001W-WERKS.
    SELECT SINGLE * FROM T001W WHERE WERKS = I_EKPO-WERKS.
    SELECT SINGLE * FROM ADRC WHERE ADDRNUMBER = T001W-ADRNR.
    XFISTL = ADRC-SORT2.
    SET PARAMETER ID 'FIS' FIELD XFISTL.
    * Added For PCS 12.11.2010
    DATA : fs_ekpo type EKPO_CI.
    if sy-tcode = 'ME22N' or sy-tcode = 'ME23N'.
    *  if tekpo-zpcs is INITIAL.
    *    message e000(zmm) with 'PCS Type should be chosen'.
    *  endif.
      loop at tekpo.
        if ( tekpo-ebeln eq i_ekpo-ebeln and tekpo-ebelp eq i_ekpo-ebelp ).
          ekpo_ci-zpcs = tekpo-zpcs.
        endif.
      ENDLOOP.
    endif.
    ^^^^^^^^^^^^^^^^^
    EXIT_SAPMM06E_018
    ^^^^^^^^^^^^^^^^^
    INCLUDE ZXM06U40 .
    E_CI_EKPO-ZPCS = EKPO_CI-ZPCS.
    E_CI_UPDATE = 'X'.

Maybe you are looking for