Case to populate field

looking for little help.
I have a table with a field called open_closed
im inserting data into this table via a procedure from another table.
What im looking to do in the sp is when insert is happening, update this field old_new with the word "closed" if another field in the table has certain data in it.
Trying case like this.
insert into ME.MASTER (request_num,request_url,logged_date,form_status,requestor_business_segment,requestor,requestor_email,d2.open_closed)
SELECT d1.request_num,d1.request_url,d1.logged_date,d1.form_status,d1.requestor_business_segment,d1.requestor,d1.requestor_email
FROM
ME.STG_TABLE d1,
(select CASE WHEN 'current_role'='Approve_NO' THEN 'OPEN_CLOSED'='CLOSED'
          WHEN 'current_role'='Approve_YES' THEN 'OPEN_CLOSED'='CLOSED'
     END
          FROM ME.STG_TABLE
)d2does this look right ?

Hi,
Jay wrote:
looking for little help.
I have a table with a field called open_closed
im inserting data into this table via a procedure from another table.
What im looking to do in the sp is when insert is happening, update this field old_new with the word "closed" if another field in the table has certain data in it.
Trying case like this.
insert into ME.MASTER (request_num,request_url,logged_date,form_status,requestor_business_segment,requestor,requestor_email,d2.open_closed)
SELECT d1.request_num,d1.request_url,d1.logged_date,d1.form_status,d1.requestor_business_segment,d1.requestor,d1.requestor_email
FROM
ME.STG_TABLE d1,
(select CASE WHEN 'current_role'='Approve_NO' THEN 'OPEN_CLOSED'='CLOSED'
          WHEN 'current_role'='Approve_YES' THEN 'OPEN_CLOSED'='CLOSED'
     END
          FROM ME.STG_TABLE
)d2does this look right ?Try it. Does it do what you want?
If you get an error meesage, post the complete error message, including line number.
If you get the wrong results, point out where the results are wrong, and describe how you would get the right results in thiose places.
In any evert, post CREATE TABLE and INSERT statements, as they exist before the INSERT that you posted, so people can re-create the problem. Post the contents you want to be in the changed table after the problem INSERT is over.
Always say which version of Oracle you're using.
Remember what a CASE expression does: it returns a single value in one of the SQL data types, such as VARCHAR2. That means all the expressions after the THEN keywords have to evaluate to single values in one of the SQL data types. There is no BOOLEAN data type in SQL, so
THEN 'OPEN_CLOSED'='CLOSED'is one obvious problem.
This condition is syntactically correct:
'current_role'='Approve_NO' but it will never be TRUE. the 12-character sting 'current_role' is not the same as the 10-character string 'Approve_NO'. If current_role or approve_no are column names, then they shouldn't be in quotes.

Similar Messages

  • How to populate field catalogue fields in ALV using  dynamic internal table

    Hi All,
    Please let me know how to populate field catalogue fields in ALV using  dynamic internal table.
    I have created <dyn_table> using code below.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
                     EXPORTING
                       it_fieldcatalog = g_t_ifc
                        it_fieldcatalog = g_t_fieldcat
                     IMPORTING
                        ep_table        = dy_table.
      ASSIGN dy_table->* TO <dyn_table>.
    Create dynamic work area and assign to FS
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    Now this  <dyn_table>  has fields like idoc no.,creation date ,
    segment field 1, segment field 2 etc..Now idoc no.,creation date  are static fields from table EDIDC. And segment field 1, segment field 2 etc are dynamic fields from table EDSAPPL.
    In my  ALV report I am getting the final layout properly but I am unable to move values to corresponding fields in the final layout shown.Please let me know how to populate these fields from different tables.
    I tried this way but its not working.
    SORT g_t_edid4 BY docnum.
      LOOP AT g_t_edidc INTO g_r_edidc.
        READ TABLE g_t_edid4 into g_r_edid4
                         WITH KEY docnum = g_r_edidc-docnum
                                        BINARY SEARCH.
        IF sy-subrc = 0.
          <dyn_wa> =  g_r_edid4-sdata.
         MOVE-CORRESPONDING g_r_edid4 to <dyn_wa>.
       CLEAR g_r_edid4.
        ENDIF.
    MOVE-CORRESPONDING g_r_edidc to <dyn_wa>.
    APPEND <dyn_wa> TO <dyn_table>.

    You have to assign each field to field symbol and then assign the value to that field symbol and asssign that field symbol to workarea field symbol.
    LOOP AT g_t_edidc INTO g_r_edidc.
    READ TABLE g_t_edid4 into g_r_edid4
    WITH KEY docnum = g_r_edidc-docnum
    BINARY SEARCH.
    IF sy-subrc = 0.
    ASSIGN COMPONENT 'SDATA' OF STRUCTURE <DYN_WA> TO <DYN_FLD>.
    <DYN_FLD> = g_r_edid4-sdata.
    " <dyn_wa> = g_r_edid4-sdata.
    " Assign each fields like this.
    " MOVE-CORRESPONDING g_r_edid4 to <dyn_wa>.
    CLEAR g_r_edid4.
    ENDIF.
    " MOVE-CORRESPONDING g_r_edidc to <dyn_wa>.
    APPEND <dyn_wa> TO <dyn_table>.
    Regards,
    Naimesh Patel

  • How to populate fields "DocEntry" and "DocNum" in UDT? Those are not UDF.

    I created a UDT with document type. When I populate the data, I don't know how to populate fields "DocEntry" and "DocNum". Those are not UDF. Here is my coding. Can somebody help me out?
    Dim objUserTable As SAPbobsCOM.UserTable
                        objUserTable = objSBOAPI.oCompany.UserTables.Item("AIT_POSTRANS")
    objUserTable.UserFields.Fields.Item("DocEntry").Value ="1000"
    ///////////// Error here "DocEntry" is not a UDF
                                           objUserTable.UserFields.Fields.Item("U_TrnsType").Value = "4"
                            objUserTable.UserFields.Fields.Item("U_CardCode").Value = objRecord.Fields.Item(0).Value
                            objUserTable.UserFields.Fields.Item("U_ShpBrnch").Value = objRecord.Fields.Item(1).Value.Replace("'", "")

    Currently versions of the SDK (SBO2005A SP01, SBO2007A, SBO2005B, SBO2007B) does not support Data Support of UDO-tabeles using the DI-API... That means that you can only add data to such tables using the GUI,,,
    This is currently a huge problem and the number one DI-API Development Request. The status with SAP is that this will become part of the SDK in SAP Business One 8.8 (the next major release), but 8.8 does not yet have a shipment date (My guess is that it will be 2009 before we even see it in rampup)...
    I know some people have experimented with writing direct SQL to such tables and know it can be done, but be aware that SAP does NOT support it!... Personally I've never done it for that reason althoug it would have been nice to do if some situations...
    Sorry I could not give anything better...

  • Automatically populate fields in jsp documents based on other fields

    hello guys. I have a jsp document
    that has the following
    <af:inputText value="#{bindings.SourceDocumentId.inputValue}"
    label="#{bindings.SourceDocumentId.label}"
    required="#{bindings.SourceDocumentId.mandatory}"
    columns="#{bindings.SourceDocumentId.displayWidth}"
    binding="#{backing_transactions_editTransactions.docId}"
    id="docId">
    <af:validator binding="#{bindings.SourceDocumentId.validator}"/>
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.SourceDocumentId.format}"/>
    </af:inputText>
    <af:inputText value="#{bindings.DocumentName.inputValue}"
    label="#{bindings.DocumentName.label}"
    required="#{bindings.DocumentName.mandatory}"
    columns="#{bindings.DocumentName.displayWidth}"
    binding="#{backing_transactions_editTransactions.docName}"
    id="docName">
    <af:validator binding="#{bindings.DocumentName.validator}"/>
    </af:inputText>
    And I have created the generated the backing beans automatically.
    public class EditTransactions {
    private CoreInputText docId;
    private CoreInputText docName;
    public CoreInputText getDocId() {
    return docId;
    public void setDocName(CoreInputText inputText7) {
    this.docName = inputText7;
    public CoreInputText getDocName() {
    return docName;
    I have a method in appmodule that has this
    public String getDocName(Number docId)
    {String docName;
    return docName
    on the document Id field I have to input a certain docId after I input the docId I have to populate automatically the docName based on the doc Id being given.
    question
    1. how can I set the document name automatically w/out submitting the page ?
    2. how can I use my backing bean to set the docName using the method in my AppModule.?
    Can anyone help me regarding this one.
    Thank in advance
    alvin.

A: automatically populate fields in jsp documents based on other fields

here is what you need to do:
1. Change the definitions for your fields as following
<af:inputText value="#{bindings.SourceDocumentId.inputValue}"
                        label="#{bindings.SourceDocumentId.label}"
                        required="#{bindings.SourceDocumentId.mandatory}"
                        columns="#{bindings.SourceDocumentId.displayWidth}"
                        binding="#{backing_transactions_editTransactions.docId}"
                        id="docId" valueChangeListener="#{backing_transactions_editTransactions.docIdChange}"
autoSubmit="true">
            <af:validator binding="#{bindings.SourceDocumentId.validator}"/>
            <f:convertNumber groupingUsed="false"
                             pattern="#{bindings.SourceDocumentId.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.DocumentName.inputValue}"
                        label="#{bindings.DocumentName.label}"
                        required="#{bindings.DocumentName.mandatory}"
                        columns="#{bindings.DocumentName.displayWidth}"
                        binding="#{backing_transactions_editTransactions.docName}"
                        id="docName"
partialTriggers="docId">
            <af:validator binding="#{bindings.DocumentName.validator}"/>
          </af:inputText>2. add the followig method to your backing bean:
  public void docIdChange(ValueChangeEvent valueChangeEvent) {
    getDocName().setValue((String)getDocId().getValue() + "suffix");
  }Run your form and enter the value into docId field, then press tab to go to the next field - docName will be populated

here is what you need to do:
1. Change the definitions for your fields as following
<af:inputText value="#{bindings.SourceDocumentId.inputValue}"
                        label="#{bindings.SourceDocumentId.label}"
                        required="#{bindings.SourceDocumentId.mandatory}"
                        columns="#{bindings.SourceDocumentId.displayWidth}"
                        binding="#{backing_transactions_editTransactions.docId}"
                        id="docId" valueChangeListener="#{backing_transactions_editTransactions.docIdChange}"
autoSubmit="true">
            <af:validator binding="#{bindings.SourceDocumentId.validator}"/>
            <f:convertNumber groupingUsed="false"
                             pattern="#{bindings.SourceDocumentId.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.DocumentName.inputValue}"
                        label="#{bindings.DocumentName.label}"
                        required="#{bindings.DocumentName.mandatory}"
                        columns="#{bindings.DocumentName.displayWidth}"
                        binding="#{backing_transactions_editTransactions.docName}"
                        id="docName"
partialTriggers="docId">
            <af:validator binding="#{bindings.DocumentName.validator}"/>
          </af:inputText>2. add the followig method to your backing bean:
  public void docIdChange(ValueChangeEvent valueChangeEvent) {
    getDocName().setValue((String)getDocId().getValue() + "suffix");
  }Run your form and enter the value into docId field, then press tab to go to the next field - docName will be populated

  • How to pre-populate fields for new entry in table maintenance

    Hey everyone,
    I have a table maintenance set up that I would like to pre-populate two date fields when the user creates a new entry or copies an existing entry.
    I can do this by adding a PBO module for the maintenance screen but then if the screens are regenerated my changes are lost so this is not ideal.
    I've also found that I can use the events (05 and 21 I believe) to set the dates but using these events I can not fill in the values in the screen so this is also not ideal.
    Is there an event that can be used to pre-populate fields in a table maintenance screen? If not, what is your suggested method for accomplishing this?
    Thanks in advance! I appreciate any help!

    Hi,
    Please use the below links...
    [Table maintenance Field Validations;
    [http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=93454609]
    Thanks,
    Manish

  • Pre-populate and post populate fields

    What is the difference between pre-populate and post populate fields.
    How we test the pre-populate and post populate fields.

    Parth, one problem with your approach is he will submit PDF and therefore you won't be able to put the PDF in a variable that's suppose to contain just xml.
    The prepopulation should be the same. If you start off with an xdp, then you will call a render service that merges data with your xdp to create a PDF.
    Now when you submit, you will submit the entire PDF back in the Document Form variable. In Workbench, you can use the FormDataIntegration service to extract data from that PDF that's being stored under Document Form var/object/document and put it in an xml variable. Then you can just use xPath to do your condition.
    I'm assuming you'll just pass that same Document Form variable to the next step, because if you do any change to the PDF it'll brake the signature.
    Let me know if I missed anything.
    Jasmin

  • Pre-Populate field with a local XML

    Hello,
    What I want to achieve is to pre-populate fields on the opening of my PDF with an XML. It seems I have the choice between xfa.host.importData("filename.xdp") or xfa.datasets.data.loadXML(filename.xml,0,1).
    I know Acrobat have a limited access to filesystem for security and I don't want to start a web server.
    My question is Acrobat Professional have a default location to look if no path or HTTP address is provide?
    Thanks!

    Thanks for the reply,
    Ideally on MacOS 10,6 (Xserver). If it does not work on a Mac environment I can use Windows Server 2003 R2.

  • Populate fields in PDF file

    I have a requirement to develop a function module that will be called in a background process.  This function module needs to read in a PDF file containing javascript (always the same file), populate specific fields in that form (with data passed into the function module), and write out the new version of that file.  Any help in figuring out how to do this would be greatly appreciated.
    Edited by: Bob DeNuto on Dec 23, 2008 3:32 PM

    >If I understand correctly you propose something like this
    Something like, yes.
    >
    >Acrobat.exe /A "zoom=100" "xml=C:\example.xml" ....
    Certainly, neither will work. /A is followed by a single quoted
    string. There must be some separator, but I don't know what it needs
    to be (as I was alluding to in my first reply).
    To see if there is any hope, just try without the zoom= completely. In
    any case you can set the zoom in the document properties.
    Aandi Inston

  • Dropdown boxes in Fiori app My Timesheet (HCM_TS_CRE ) won't populate field

    Hi experts,
    I hope you can help me out. We recently discovered that the Wave 2 apps are completely different implementations from the original, Wave 1 apps. I am trying to get two of the new apps running - My Timesheet (hcm_ts_cre) and Approve Timesheets (hcm_ts_apv).
      In the MyTimesheet app, when the user tries to use one of the drop-down boxes in the time-entry screen to enter the internal order number or the attendance type, they click on the small box to the right of the field to bring up a dropdown box full of applicable values (IO's or Attendance Type codes, depending on the field). It populates correctly, but when the user clicks on a selection the box closes and the field remains empty.
      I've tried this on Google Chrome, IE, Firefox and Safari (on both desktop and iPhone). The behavior is very consistent from one platform to another.
      I upgraded the SAPUI5 component by installing OSS notes to bring everything up to the most recent release but it did not change the behavior. Shown below are the release levels of each of the libraries:
    Library
    Version: none
    Version:1.16
    Version:1.18
    Version:1.20
    (1.20.11)
    Version:1.22
    (1.22.5)
    com.sap.apf.apf-lib
    1.22.1
    com.sap.ca.scfld.md
    1.16.9
    1.18.10
    1.20.7
    1.22.1
    com.sap.ca.ui
    1.16.9
    1.18.10
    1.20.7
    1.22.2
    com.sap.collaboration.collaboration-comm
    1.16.9
    1.18.10
    1.20.6
    1.22.3
    com.sap.portal.ui5.portal-ui5-ext
    1.16.9
    1.18.10
    1.20.5
    1.22.1
    com.sap.smartbusiness.suite.smartbusines
    1.22.3
    com.sap.suite.suite-ui-commons
    1.16.9
    1.18.10
    1.20.7
    1.22.3
    com.sap.ui5.commons
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.comp
    1.22.4
    com.sap.ui5.core
    1.16.9
    1.18.10
    1.20.9
    1.22.6
    com.sap.ui5.dist.fiori-lib
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.inbox
    1.16.9
    1.18.10
    1.20.6
    1.22.8
    com.sap.ui5.layout
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.makit
    1.16.9
    1.18.10
    1.20.7
    1.22.6
    com.sap.ui5.mobile
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.mobile-ext
    1.16.9
    1.18.10
    1.20.9
    1.22.6
    com.sap.ui5.richtexteditor
    1.16.9
    1.18.10
    1.20.5
    1.22.8
    com.sap.ui5.suite
    1.16.9
    1.18.10
    1.20.6
    1.22.4
    com.sap.ui5.table
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.themelib_sap_bluecrystal
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.themelib_sap_goldreflection
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.themelib_sap_platinum
    1.22.8
    com.sap.ui5.themelib_sap_ux
    1.16.9
    1.18.10
    com.sap.ui5.unified
    1.16.9
    1.18.10
    1.20.7
    1.22.8
    com.sap.ui5.ux3
    1.16.9
    1.18.10
    1.20.7
    1.22.8
    com.sap.ui5.vbm
    1.16.9
    1.18.10
    1.20.5
    1.22.5
    com.sap.ui5.viz
    1.16.9
    1.18.10
    1.20.6
    1.22.3
    com.sap.ushell.ushell-lib
    1.16.9
    1.18.10
    1.20.8
    1.22.6
    com.sap.ushell.ushell_abap
    1.22.4
    I've asked our basis team to install 1.24.2 by installing SAP_UI SP10 in the hopes that would help.
    What do you think? Am I barking up the wrong tree? Am I heading down the wrong path?
    In case its helpful here are the component releases on our gateway system:
    SAP_BASIS
    740
    0007
    SAPKB74007
    SAP Basis Component
    SAP_ABA
    740
    0007
    SAPKA74007
    Cross-Application Component
    SAP_GWFND
    740
    0007
    SAPK-74007INSAPGWFND
    SAP Gateway Foundation 7.40
    SAP_UI
    740
    0009
    SAPK-74009INSAPUI
    User Interface Technology 7.40
    PI_BASIS
    740
    0007
    SAPK-74007INPIBASIS
    Basis Plug-In
    ST-PI
    2008_1_710
    0007
    SAPKITLRE7
    SAP Solution Tools Plug-In
    SAP_BW
    740
    0002
    SAPKW74002
    SAP Business Warehouse
    IW_PGW
    100
    0005
    SAPK-10005INIWPGW
    Process Gateway
    IW_SPI
    100
    0004
    SAPK-10004INIWSPI
    Service Provider Infrastructure
    IW_SCS
    200
    0008
    SAPK-20008INIWSCS
    Screen Scraping
    UIAPP001
    100
    0005
    SAPK-10005INUIAPP001
    UIAPP001 100: Add-On Installation
    UIAPP002
    100
    0004
    SAPK-10004INUIAPP002
    UIAPP002 100: Add-On Installation
    UISRA001
    100
    0003
    SAPK-10003INUISRA001
    HTML 5 Purchase contract approval
    UISRA002
    100
    0004
    SAPK-10004INUISRA002
    HTML5 Time Recording
    UISRA010
    100
    0004
    SAPK-10004INUISRA010
    HTML5 Staffing List
    UISRA012
    100
    0004
    SAPK-10004INUISRA012
    HTML5 My Department Spend
    UISRA020
    100
    0005
    SAPK-10005INUISRA020
    HTML5 Change Order (Address/Delivery Date)
    UIX01HCM
    100
    0003
    SAPK-10003INUIX01HCM
    UI for HCM Application
    Thanks for any advice you can offer!
    -Rob Solomon

    Thanks for the suggestion, Pankaj.
    I found an OSS note pertaining to SAPUI5 that had not been completely installed, so I finished the implementation of it. Now the component versions are up-to-date, as shown below. I can't find any more SAPUI5 1.22.xx versions to install. 1.22.8 is the most recent.
    Library
    Version: none
    Version:1.16
    Version:1.18
    Version:1.20
    (1.20.11)
    Version:1.22
    (1.22.8)
    com.sap.apf.apf-lib
    1.22.1
    com.sap.ca.scfld.md
    1.16.9
    1.18.10
    1.20.7
    1.22.1
    com.sap.ca.ui
    1.16.9
    1.18.10
    1.20.7
    1.22.2
    com.sap.collaboration.collaboration-comm
    1.16.9
    1.18.10
    1.20.6
    1.22.3
    com.sap.portal.ui5.portal-ui5-ext
    1.16.9
    1.18.10
    1.20.5
    1.22.1
    com.sap.smartbusiness.suite.smartbusines
    1.22.3
    com.sap.suite.suite-ui-commons
    1.16.9
    1.18.10
    1.20.7
    1.22.3
    com.sap.ui5.commons
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.comp
    1.22.4
    com.sap.ui5.core
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.dist.fiori-lib
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.inbox
    1.16.9
    1.18.10
    1.20.6
    1.22.8
    com.sap.ui5.layout
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.makit
    1.16.9
    1.18.10
    1.20.7
    1.22.6
    com.sap.ui5.mobile
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.mobile-ext
    1.16.9
    1.18.10
    1.20.9
    1.22.6
    com.sap.ui5.richtexteditor
    1.16.9
    1.18.10
    1.20.5
    1.22.8
    com.sap.ui5.suite
    1.16.9
    1.18.10
    1.20.6
    1.22.4
    com.sap.ui5.table
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.themelib_sap_bluecrystal
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.themelib_sap_goldreflection
    1.16.9
    1.18.10
    1.20.9
    1.22.8
    com.sap.ui5.themelib_sap_platinum
    1.22.8
    com.sap.ui5.themelib_sap_ux
    1.16.9
    1.18.10
    com.sap.ui5.unified
    1.16.9
    1.18.10
    1.20.7
    1.22.8
    com.sap.ui5.ux3
    1.16.9
    1.18.10
    1.20.7
    1.22.8
    com.sap.ui5.vbm
    1.16.9
    1.18.10
    1.20.5
    1.22.5
    com.sap.ui5.viz
    1.16.9
    1.18.10
    1.20.6
    1.22.3
    com.sap.ushell.ushell-lib
    1.16.9
    1.18.10
    1.20.8
    1.22.6
    com.sap.ushell.ushell_abap
    1.22.4
    I have tried it again from chrome, ie and firefox but the dropdown list is still not populating the field to which it is attached. I cleared the buffers of each browser with no improvement.
    It seems like it must be related to the SAPUI component. I will de-implement all of the 1.22.8 notes and then re-apply them. And maybe the basis team will install the new version today.
    I will update the ticket with any further news.
    If you have any other ideas for me, I would love to hear them. Thanks!
    -Rob

  • Auto populate field with user ID

    On my form, I have a box labeled user ID that is to be inputted by the user's ID.
    I like to have this box automatically populated with the person who signed in to APEX.
    Also, if it is possible, maybe gray this box out when it is auto-populated by the user ID.
    Any ideas?
    Thanks.

    The user_id is one of several fields to be populated on the form.
    Instead of the user typing in his user ID, I was thinking to automatically populate it with his username that he signed into APEX with.
    I am not familiar with APP_User. This may sound like the username from the login page which in that case, yes. I would like to pull this name and put it in the form.
    Now maybe I can just make it hidden. This is easy.
    Thanks.

  • Code to populate fields

    Hi gurus,
    I have 2 Z-fields in VBRP table.I have appended these fields to  the extract structure(2LIS_13_VDITM).I need to write a code to populate these fields with Data.As i am new to ABAP,can anyone help me with the code.Very much appreciated,also it would be great if you could just write in comments for what each line of code does.
    Thanks in advance

    Hi ,
          This is just a sample,
    TABLES: vbak,
            ekkn,
            vbap,
            ekpo.
    DATA: o_ekko LIKE ekko,
          i_t_ekpo LIKE ekpo   OCCURS 1 WITH HEADER LINE.
    DATA: BEGIN OF lt_custmat OCCURS 0,
                 kunnr LIKE vbak-kunnr,
                 matnr LIKE vbap-matnr,
          END OF lt_custmat.
    DATA: ld_distributionfactor LIKE mcekpo-abcposo,
          ebeln LIKE ekpo-ebeln,
          ebelp LIKE ekpo-ebelp,
          it_ekpo TYPE TABLE OF ekpo WITH HEADER LINE,
          old_val(50) TYPE c.               "For storing the value from the                            
                 style='mso-tab-count:3'>                                          "Field Symbol
    FIELD-SYMBOLS <fs> TYPE ANY TABLE.
    CASE zeitp.
      WHEN 'MA'.                            "When creating a purchase order
        MOVE '(SAPLEINS)T_EKPO[]' TO old_val.
        ASSIGN (old_val) TO <fs>.
        i_t_ekpo[] = <fs>.
        LOOP AT xmcekpo.
          ebeln = xmcekpo-ebeln.
          ebelp = xmcekpo-ebelp.
          IF xmcekpo-supkz = '1'.            "Old Value ?
            SELECT SINGLE * FROM ekpo INTO it_ekpo WHERE ebeln = ebeln AND
         ebelp = ebelp.
            xmcekpo-zkopprctr = it_ekpo-kopprctr.
          ELSE.                              "New Value ?
            READ TABLE i_t_ekpo WITH KEY ebeln = ebeln
                                         ebelp = ebelp.
            xmcekpo-zkopprctr = i_t_ekpo-kopprctr.
          ENDIF.
          MODIFY xmcekpo .
        ENDLOOP.
    hope it helps,

  • Generic service to populate fields in HCM Processes and Forms

    Dear Friends,
      I am developing generic service to populate some fields in HCM Processes and Forms. Please let me know whether i need to develop a single service for each field in the form or is better to write one generic service for all the form fields.
    Thanks in Advance

    Hi Sapient,
    By right, generic service means to be generic so that it can be re-used in any HCM forms thats needed the field/validation from the generic service.
    Unfortunately in real situation, generic service are not reusable for some reasons:
    - for the same field same field might have different validation in different form.
    - there is dependency, example, to read special field
    The key thing here is all about the design and planing before development. Whereby if you have all the info and requirement HCM form to be implemented(which you wont get it for most of the cases), and you have the overall view of all HCM to be implemented and you are able to plan ahead before coding, then you can design the generic service for each/related field.
    If it is not the case, i would encourage to use 1 generic service for all the field in the HCM form. It would ease the team during support/maintenance phrase as well. For sample, please refer to HRMSSRCF_REQUISITION_ADVANCED for Create Requisition form.
    This is my humble opinion based on my experience working on HCM forms. Please do comments and discuss.
    regards,
    Xiang Li

  • How to populate fields in standard SAP Screen

    Hi,
    There is one client requirement in <i>Create: Customer</i> transaction. (<b>T Code: XD01</b>)
    Go to transaction XD01. You get pop-up screen (Customer Create initial screen).  Enter the details required like account group, company code, etc.
    Now you get Create Customer General data screen. In this screen there will be tab like address, control data, Contact person etc. Initially control will be in Address tab.
    In address tab Language will be defiantly displayed (egs: English). (Screen details as in 1* below.) If you don’t find on screen scroll down the tab.
    Enter all the details and then you go to tab contact person. There you will enter one person as contact person and then you click on Home address Push button (which is below the tab strip.)
    On clicking home address push button one pop-up screen will be displayed.(Screen:  Contact Person: Home Address Create )
    In this screen there is also a language field (Blank now, mean no value..) (Sceen details as in 2* below.)
    Customer wants that this field is to be populated with the data of tab Address tab.
    How to do this. Could you please reply to this query ASAP. If I need to ask SD Consultant for any requirement please tell me what to ask. To them.
    Screen details: (got by technical help.)
    1*:
    Table Name        ADDR1_DATA
    Field Name        LANGU
    Data Element      SPRAS
    DE Supplement     0
    Parameter ID      SPR
    Screen Field      ADDR1_DATA-LANGU
    Program Name      SAPMF02D
    Screen Number     7000
    2*
    Program Name      SAPLSZA7
    Screen Number     0501
    Program Name      SAPLSZA7
    Status            ADDR0500
    Table Name        ADDR2_DATA
    Field Name        LANGU_P
    Data Element      SPRAS
    DE Supplement     0
    Parameter ID      SPR
    Thanks in advance. Please reply ASAP. Please let me know idf you need any further details.
    Regards,
    Vidyaprasanna.

    Hi Prasanna,
    You need to modify the code.
    you can do it in two ways.
    1  -  in the PAI of 1st screen you can use SET PARAMETER  for parameter SPR.
    Then in the next screen popup, it will automatically show the langu value.
    2  - in the pai of the popup screen, you can use GET PARAMETER statement to get the value of parameter SPR and then set this value to the screen field.
    In both the cases you need to modify the standard program.
    Hope this helps.
    Sajan.

  • PDF vrs. XML   Pre-populate fields in PDF created in Acrobat 7.0

    After converting some interactive/dynamic templates from Acrobat 5.0 to 7.0 we can no longer pre-populate fileds, including the barcode. With the 5.0 version we use FDF to populate the fields including the barcode 3 of 8, but with 7.0 it does not work and we were advise to use XML.
    We've been trying XML but can't make it work. Does any one know where I can get some sample coding?
    Please help!

    Hi Laura:
    Can you elaborate a bit more on "converting some interactive/dynamic templates from Acrobat 5.0 to 7.0" and "pre-populate"?
    If you were converting the template in Adobe LiveCycle Designer (comes with Acrobat Professional), then FDF import wouldn't work.
    However, if you are executing the same action via Acrobat then FDF and xFDF import/export should still work.
    Also, for designer based forms, you also have the option of merging the data into the PDF form using Adobe LiveCycle Forms (A server based product).
    Another server based solution is to Reader Extend your PDF form to allow local import/export of data using Adobe Reader.
    It really depends on what you want to do.
    So options are this:
    If your form is a Designer based forms:
    - Manually Import Data (in XML) into PDF Form using Acrobat Professional
    - Manually Import Data (in XML) into PDF Form* (Reader extended PDF form) using Adobe Reader
    - Merge Data Programmatically (in XML) into PDF Form using Adobe LiveCycle Forms
    If your form is an AcroForm (acrobat based form)
    - Programmatically merge FDF data into PDF Form using the FDF toolkit/Acrobat SDK
    - Manually Import Data in FDF/xFDF into PDF Form using Acrobat Professional.
    Rob W.
    http://www.ensemble.com/solutions/adobe

  • How to allow user to select pdf file on local machine and populate field with file name only

    Folks,
    I have a project requirement that I am stumped on.  I am admittedly a novice, so forgive questions that may seem obvious.
    My requirement is a form running on a client system where the user can click a button and select a PDF file name from a PDF on their local machine and then populate a form field with that file path & filename.  The file names vary between all machines, so there is no static list.  Note that the PDF is not embedded, nothing is executed, I simply need the file name.
    There are several of these on a form (20+), so manual name entry is too error prone.   I would like to use a 'browse' type dialog, but can not figure out how to implement it.
    I've looked at app.browseForFile, but the users can not install a javascript file in their adobe folder or any other files;  the functionality has to be integral with the original PDF. 
    Functionally, this is no different from the image object file browse, except that I need a PDF instead of an image file, so there doesn't seem like there should be a security issue that is any different from those surrounding the image object.
    I've been stumped on this for the entire week, and I have a deadline rapidly approaching, so any examples or suggestions (please remember I'm a novice) would be greatly appreciated! 

    Thanks for the reply Paul - do you have any sample code of how to attach the PDF?  Or how the user can select a PDF to open?  I might be able to attach it, retrieve the file name, and then un-attach it.
    Alternatively, do you know how to retrieve the file name from the imagePath object?  It will let you select PDF files, but I can't find info on how to retrieve the file name.   It should be the way you would retrieve the file name for an image.
    As a novice in this, thanks for your help and patience!

  • Maybe you are looking for

    • How to put the focus on the address bar, when opening a new tab in Safari?

      Dear users, I'm using Safari 6.0.3 (8536.28.10) under OSX 10.8.3. Until recently, whenever I opened a new tab in Safari, the focus was always on the address bar, which was quite useful. However, since last week, maybe after an update (I don't know ex

    • IDOC Very Urgent

      Hi all I need to pass Master Inspection Characteristics (MIC) data or any other data to XI in a receiver format. For that I need to create custom function module according to xml format. Then I need to send MIC data to custom idoc fields. So I called

    • Why do fonts appear distorted when...

      ...there's more than a single instance of Acrobat open at a time? The text was rendered to shape in Photoshop before being saved as a PDF, so the vector data would be retained despite losing editing capabilities. When I open the resulting PDF in acro

    • ATA 186 Reproducing DTMF tones from RFC2833 events

      I am trying to get my ATA 186 (running version SCCP 3.x under CCM 5.04a) to reproduce received rtp-events. This is supporting a third-party IVR system that is connected via analog ports. The IOS gateway that is sending the events is configured for dt

    • Replication feature of oracle9i

      we are trying to create and manage replication environment using replication management APIs. we'll be having standard/enterprise edition of database at master site and personal edition at materialized view site. do we have to install replication fea