How to pick up the CDHDR-CHANGE ID value, based on EBELN at where condition

TYPES: BEGIN OF TY_CDHDR,
       OBJECTID TYPE CDHDR-OBJECTID,
       USERNAME TYPE CDHDR-USERNAME,
       UDATE TYPE CDHDR-UDATE,
       END OF TY_CDHDR.   
  SELECT ebeln bukrs bsart aedat ernam lifnr ekorg
         FROM ekko
         INTO TABLE gt_ekko
         WHERE ebeln IN s_ebeln
           AND bsart IN s_bsart
           AND bedat IN s_bedat
           AND ernam IN s_ernam.
  IF sy-subrc EQ 0.
    SELECT ebeln ebelp matnr
      FROM ekpo
      INTO TABLE gt_ekpo
      FOR ALL ENTRIES IN gt_ekko
      WHERE ebeln EQ gt_ekko-ebeln
        AND matnr IN s_matnr.
    IF gt_ekpo[] IS NOT INITIAL.
      SELECT ebeln ebelp etenr eindt menge
       FROM eket
       INTO TABLE gt_eket
       FOR ALL ENTRIES IN gt_ekpo
       WHERE ebeln EQ gt_ekpo-ebeln
         AND ebelp EQ gt_ekpo-ebelp.
      IF sy-subrc EQ 0.
    SELECT objectid username udate
          FROM cdhdr
          INTO TABLE gt_cdhdr
          WHERE changeid EQ gt_ekpo-ebeln.
This is the exsisting code where i am getting a dump. Can you guys help me in this.

Hi super3013,
Modifiy as below :
TYPES: BEGIN OF TY_CDHDR,
OBJECTID TYPE CDHDR-OBJECTID,
USERNAME TYPE CDHDR-USERNAME,
UDATE TYPE CDHDR-UDATE,
END OF TY_CDHDR.
SELECT ebeln bukrs bsart aedat ernam lifnr ekorg
FROM ekko INTO TABLE gt_ekko
  WHERE ebeln IN s_ebeln
    AND bsart IN s_bsart
    AND bedat IN s_bedat
    AND ernam IN s_ernam.
IF NOT gt_ekko[] IS INITIAL.
SELECT ebeln ebelp matnr
FROM ekpo INTO TABLE gt_ekpo
FOR ALL ENTRIES IN gt_ekko
  WHERE ebeln EQ gt_ekko-ebeln
    AND matnr IN s_matnr.
ENDIF. 
IF gt_ekpo[] IS NOT INITIAL.
SELECT ebeln ebelp etenr eindt menge
FROM eket INTO TABLE gt_eket
FOR ALL ENTRIES IN gt_ekpo
  WHERE ebeln EQ gt_ekpo-ebeln
    AND ebelp EQ gt_ekpo-ebelp.
SELECT objectid username udate
FROM cdhdr
INTO TABLE gt_cdhdr
FOR ALL ENTRIES IN gt_ekpo 
*  WHERE changeid EQ gt_ekpo-ebeln. 
  WHERE CHANGENR EQ gt_ekpo-ebeln.   
ENDIF.
There is no changeid Field of 90 chars in table CDHDR (but we have OBJECTID - 90 Char)
There is a field CHANGENR which is of 10 chars make use of it (Document change number).

Similar Messages

  • How to look up the first line item value based on several line items

    Hi Expert,
    I have one start routine in my transformation. But, I want to optimize it and only extract the first required line item. Can anyone help? thanks
    SELECT
    number
    item
    char3
    char4
    char5
    char6
    FROM
    /bi0/adsoa00
    t_dsoa into table t_itab
    FOR ALL ENTRIES IN
    source_package
    WHERE
    number EQ source_package-number
    AND item between '1' and '99'. -> question, if there are more than one value and I always want to fill the first item, could I use any ABAP syntax like exit or up to row 1 in the code.

    you can sort the table after the select and use delete adjacent duplicates to keep only the first or last item

  • How do I get the last changed date & time of a file in app server?

    Hi Experts,
    How do I get the last changed date & time of a file in app server?
    Thanks!
    - Anthony -

    Hi,
    that's what I use...
      CALL 'C_DIR_READ_FINISH'.             " just to be sure
      CALL 'C_DIR_READ_START' ID 'DIR' FIELD p_path.
      IF sy-subrc <> 0.
        EXIT. "Error
      ENDIF.
      DO.
        CLEAR l_srvfil.
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD l_srvfil-type
          ID 'NAME'   FIELD l_srvfil-file
          ID 'LEN'    FIELD l_srvfil-size
          ID 'OWNER'  FIELD l_srvfil-owner
          ID 'MTIME'  FIELD l_mtime
          ID 'MODE'   FIELD l_srvfil-attri.
    *    l_srvfil-dir = p_path .
        IF sy-subrc = 1.
          EXIT.
        ENDIF." sy-subrc <> 0.
        PERFORM p_to_date_time_tz
          USING    l_mtime
          CHANGING l_srvfil-mod_time
                   l_srvfil-mod_date.
        TRANSLATE l_srvfil-type TO UPPER CASE.               "#EC TRANSLANG
        PERFORM translate_attribute CHANGING l_srvfil-attri.
        CHECK:
          NOT l_srvfil-file = '.',
          l_srvfil-type = 'D' OR
          l_srvfil-type = 'F' .
        APPEND l_srvfil TO lt_srvfil.
      ENDDO.
      CHECK NOT lt_srvfil IS INITIAL.
      pt_srvfil = lt_srvfil.
    FORM p_to_date_time_tz  USING    p_ptime  TYPE p
                            CHANGING p_time   TYPE syuzeit
                                     p_date   TYPE sydatum.
      DATA:
        l_abaptstamp TYPE timestamp,
        l_time       TYPE int4,
        l_opcode     TYPE x VALUE 3,
        l_abstamp    TYPE abstamp.
      l_time = p_ptime.
      CALL 'RstrDateConv'
        ID 'OPCODE' FIELD l_opcode
        ID 'TIMESTAMP' FIELD l_time
        ID 'ABAPSTAMP' FIELD l_abstamp.
      l_abaptstamp = l_abstamp.
      CONVERT TIME STAMP l_abaptstamp TIME ZONE sy-zonlo INTO DATE p_date
          TIME p_time.
    ENDFORM.                    " p_to_date_time_tz
    Regards,
    Clemens

  • How can I save the jpg change the compression?

    how can I save the jpg change the compression fpr smaler files?

    Sorry, this can not be changed.
    You may want to change the image dimension.
    Thanks!

  • How can we transport the standard changed OTR texts w.r.t translation?

    How can we transport the standard changed OTR texts with out effecting the translation concept.?
    means i need to see the text in different languages which ever logged in.

    using the function module SOTR_API_WB_TRANSLATE you can maintain translation in different languages for the OTR texts maintained in your WDA.
    No need to transport,you can directly execute this FM by passing the below parameters:
    SOURCE_LANGU                    EN
    TARGET_LANGU                    FR
    PGMID                           LIMU
    OBJECT                          WDYV
    OBJ_NAME                        %
    FLAG_STRING
    EDIT_MODE                       T

  • How to hide/unhide the all Treenodes on Treeview based on Checkbox changed event in Sharepoint custom webpart Sitecollections

    How to  hide/unhide the all Treenodes on Treeview based on Checkbox changed event?
    Checkbox(Control)
    1.Checkbox Checked:(Action below like)
     if user click on  Checkbox, all the treenodes on treeview is hide.
    2.Checkbox Unchecked(Action below like)
    If user uncheck the Checkbox  all the treenodes on treeview is unhode.
    Could you please help me how to do above one.
    Badri

    Hi,
    According to your post, my understanding is that you want to hide/show the TreeView when the Checkbox checked/unchecked.
    We can use jQuery to achieve it, the following script for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    $("input[type=checkbox]").click(function () {
    if (this.checked) {
    $("#TreeViewID").hide();
    } else {
    $("#TreeViewID").show();
    </script>
    More information:
    http://dineshsharepoint.blogspot.com/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How can I pull the BUKRS (company code) value, for a X_USER (sy-uname) inpu

    HI Experts,
    Pls. clarify that, How can I pull the BUKRS (company code) value, for a X_USER (sy-uname) as input?
    ThanQ.

    Check with USRM1 Table
    give user name (Uname ) and you get company code (BUKRS)
    also check with other tables : USRM* in SE11
    Thanks
    Seshu

  • How can I know the database is using Cost Based or Rule Based?

    Hi all expertise,
    How can I know the database is using Cost Based or Rule Based?
    If cost based it is using, what methods are need to use to minimize the cost when database is running? And which tables I can see the performance of the database?
    Thanks
    Amy

    how to see database setting ?
    use this
    SQL> sho parameter optimizer
    NAME TYPE VALUE
    optimizer_dynamic_sampling integer 1
    optimizer_features_enable string 9.2.0
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    optimizer_max_permutations integer 2000
    optimizer_mode string CHOOSE
    choose means if table statistics is available then it will use cost
    else
    use rule based optimizer
    for seeing performnace of table use
    set autotrace on
    and run your query
    if it doen't show cost.it means it use rule based
    for using cost based
    u will calculate table statistics
    9i
    dbms_stats.gather_table_stats('owner','table');
    8i
    analyze table <table_name> compute statistics;
    hope it will help you
    kuljeet pal singh

  • How can I fetch the element's attribute value by AS in a mxml file?

    Sample code:
    <mx:MenuBar id="myMenuBar" labelField="@label"
    width="100%">
    <mx:XMLList>
    <menuitem label="MenuItem A">
    <menuitem label="SubMenuItem A-1" enabled="false"/>
    <menuitem label="SubMenuItem A-2"/>
    </menuitem>
    </mx:XMLList>
    </mx:MenuBar>
    How can I fetch the myMenuBar's width value by AS in a mxml
    file. I can't find any API about it!

    quote:
    Originally posted by:
    atta707
    myMenuBar.width
    assuming your AS file/class has access to this component
    under the same id, myMenuBar.
    Yes,you are right. Width is a existed property in myMenuBar
    object in AS. I ignore this case.
    But now, I want to fectch attribute "label"'s value in
    <menuitem label="MenuItem A">.
    How can I get attribute "label"'s value if "label" is
    additional attribute for the element.

  • How to pick up the 3d model after change the picture control to the Opengl control?

    Colleagues,
    I have a problem when I use the cvi.I need to draw a 3D model use the opengl in the picture control,and pick up the mode.For example,I transfer the picture control to the Opengl control,then draw a cube and sphere by Opengl。And I want to pick up them。Such as,when mouse click the cube,it will show a MessagbBox("a cube");when mouse click the sphere,it will show a MessagbBox("a sphere");But it doesn't work.
    I'm a chinese student and juse begin to learm the cvi.And my English isn't very good.I don't know whether the problem has been clear.Anyone can help me?

    I haven't used the OpenGL CVI addition for years, but IIRC there is (was?)
    no callback associated to it. Meaning that some actions are defined within
    the OpenGL control, such as rotation/zoom, but that's it.
    Guillaume Dargaud
    http://www.gdargaud.net/

  • How to pick up the latest report instance of a schedueld report

    Hi,
    I am supporting a custom application (.NET), which has to pick up the latest report instance by accepting the Report ID.
    At times, the application does seems to be pick up the wrong (older) instance. This is not happening all the times but certain reports behaves this way once a while.
    This is how the application seems to be determining the latest instance.
    SELECT * FROM CI_INFOOBJECTS
    WHERE SI_PROGID = 'CrystalEnterprise.Report'
    AND SI_INSTANCE_OBJECT = 1
    AND SI_SCHEDULE_STATUS = 1
    AND SI_PARENTID= '" + id + "'
    ORDER BY SI_ID DESC
    Once the above statement returns all the available instances it just pick up the very first instance and returns it back to the application and it gets displayed through the Report Viewer.
    My question here is that, does this order (ORDER BY SI_ID DESC) will always return me the latest instance first? When I manually verify the instance ID, it seems to be getting incremented eventhough it is a random number.
    When I review the InfoView code, which also seems to be doing the same thing I have found that it is using SI_UPDATE_TS instead of SI_ID.
    Could someone please tell me which is the correct one to use? I tried by could not able to find references anywhere.
    Environment: BO XI R2 - SP2

    Jason,
    Thanks for the info. The query builder o/p and the application o/p are the same. When this situation happened last time I just simply deleted those older instances from the history and left only the current one.
    This has forced the query to return the only available instance, which is the current one.
    My suspect here is that, the SI_ID of a new instance is smaller than the older instance...
    for example,
    Instance 1 - 10023
    Instance 2 - 12344
    Instance 3 - 9892
    Is this possible?? Since I have deleted the older instances I have no way to confirm this case unless it happens again.
    The BO documentation about SI_ID reads like this...
    "This property is used to uniquely identify an object. The number is assigned at creation time, and is never changed until the object is destroyed. You should never hard-code this number, however, since if the object is destroyed the number may be assigned to another object. No two objects have the same ID, even if they are different types of objects; that is, you will never find a report that has the same ID as a folder."
    As it claims that an ID can be re-used if the object is destoryed I assume that though the new ID will be unique there is no guarantee that it will be bigger than the previous instance of the same object.
    But the problem is that I dont have a documentation proof to claim this hence asking help from the guru's here...
    Regards,
    Elan.

  • How to pick up the last value of the input string

    Hi there,
    I have a requirement in which I have to pick up the last value of the input string.
    I don't know the field length, it could be 10 line, it could be 4 line and it could be even 1 line.
    Another problem is that the field contains all the alphanumeric values so the sort function is not working.
    I believe I need to write a UDF but not sure exact what and how.
    Can some body please help me solving this issue.
    Input.
    1.Abc
    2.abc123atxx.com
    3.(980)771-2341
    4.
    5.518VR50V58AD10DSAYBDSAFDSIEGHA:1
    In that case I only need to pickup the last value i.e. 518VR50V58AD10DSAYBDSAFDSIEGHA:1
    Output
    518VR50V58AD10DSAYBDSAFDSIEGHA:1
    Note:
    1. Length is unknown
    2. Alphanumeric data
    Thanks,

    Hi karthick Lakkar,
    Thanks for your quick response but unfortunately I am getting mapping exception.
    What I did is create a UDF with 2 input
    INPUT
    a string
    b string
    and then this code
    int Length=Integer.parseInt(a);
    int requiredLength=Integer.parseInt(b);
    if(Length<=requiredLength)
    return(a);
    else
    return a.substring((Length-requiredLength),Length);
    I am wondering about the input as well.
    At present I am doing
    KTEXT + KTEXT --- UDF
    + does represent concat, means same input will go to the UDF
    This is the error which I am getting
    Exception:[java.lang.NumberFormatException: For input string: "Kevin Farrar"] in class com.sap.xi.tf._MM_XXXXXXXXXXXXXX_ method calculate[Kevin Farrar, Kevin Farrar, com.sap.aii.mappingtool.tf7.rt.Context@6dbf19db]

  • How to pick up the tcode MB51 search speed

    hi
    in the TCODE MB51 selection screen of header data block.
    if only set reference field(MKPF-XBLNR) for SELECT CONDITION.
    the query will be comparatively slow.because the mkpf table is very large in my system.
    how to pick up.
    in other table exist index for reference field to link material document????
    thank you .

    Hi,
    For Material document the following are the tables;
    MKPF     Material document (no index for XBLNR)
    MSEG   Material document (item level)
    MLHD     Material Ledger Document: Header
    1. Generate Index...
    2. Modify the report to make sure the user entres the few combination from Item data  & Posting date from Header data...
    Thanks,
    Prabhu Rajesh

  • How can i see the document change for project in CN60

    Dear all,
    i want to see the project change in the report.
    i know i can see it using cn60
    but now, the system states that there is no data.
    i have ticked document change in the project profile.
    it seems useless.
    could anyone tell me how i can see the change documents?
    is there anything else i shall config?
    thanks a lot.
    Judy

    Hiu2026.
    Regardingu2026.cn60
    Tick change documents in the project profile on the right side.
    Not in the under status management. Section.
    Run transaction CJEN for project
    And check in cn60.
    Regarding checking changes in cj20n.
    Cj20nu2026.click on the WBS/Activity(which one u want to see).
    Editmenuu2026.status.....systemstatus/userstatus.
    Go to extramenuu2026..change documentsu2026.all.
    Check in Allchangesu2026.and history.
    I hope it will reach your req.
    Experts....plz correct me if im wrong.
    Regards
    Chandra

  • How to pick out the main body/article when surrounded by ads ?

    Hi all,
    First of all, not exactly sure where I should post this, so please let me know a better forum if you know of one.
    I am working with a linguisitic search engine that takes pdf articles and indexes them based on lists of keywords, and then does word counts. For this latest project the pdfs are downloads of newpaper articles, typically 1 to 2 pages long. My linguistic engine works on these fine but because these are downloads from the web, the pdfs have extraneous advertisements and links (and so on) surrounding the main article. This leads to false negatives and so I need to get rid of the things around the main body. If the articles were all written with the same format  (e.g. headline at the top and then some sort of copyright at the end) I 'd be able to focus the linguistics engine solely on the article. Unfortunately that is not the case. What I am considering now is some sort of pre-processing using some sort of pdf editor. From what I understand text in the pdf format is stored in elements which describe the layout. Typically, within an article the width of the actual article remains the same. The article typically spans a larger width than say something like an advertisement which contains a link and a description. Would it be possible to pick out the text elements based on something like width or font-type and then save just those portions to another pdf or text file? Can one do such things with Acrobat or the SDK? I'll have about 5-10,000 docs to work on. Thus I need an automated procedure. Going thru manually and copying&pasting the relevant portions will be too tedious. Thanks for any suggestions.

    It's really hard to say what will be possible without the benefit of seeing a typical example. It's not generally true that "...text in the pdf format is stored in elements which describe the layout..." If the ads are in consistent locations (e.g., on the right 2 inches of the page), you can automate the redaction process using JavaScript.

Maybe you are looking for

  • G5 needs a new OS arrrgh

    Processor Memory Processor speed: - 2 x 1.8 GHz Processor Type: - PPC, G5 Number of Cores: - 1 Bus Speed: - 900 MHz Cache: - 512K per processor 64-bit Support: - No Turbo Boost: - No Installed RAM: - 512 MB Max. Amount: - 4.0 GB Amount of Slots: - 4

  • What are the different licences?

    I'm thinking about getting the Production Premium suite, but I'm slightly confused about the different licences... As far as I can tell, there's a student licence, and a "normal" one... Is that all of them?  Also, what are the restrictions for each?

  • How is the FM Tuner going to work?

    I know no one has this yet but there isn't really enough info on apple.com to tell us how this works. Is it going to be Wi-Fi only? Does it pick up radio tower frequency's? I would like to listen to a local radio station in the morning while at work

  • Arabic localization changes don't change the left to right Alignment

    Hi all, We are using localization for our application and the supported locales (registered in faces-config.xml) are English and Arabic. When the language is changed as per user preferences , the corresponding Arabic values are read from the bundle p

  • Real Application Testing 10g 64 bits?

    32 bits version is available here: http://www.oracle.com/technology/software/products/database/oracle10g/realapptesting.html But anyone know when Real Application Testing for 10g 64 bits will be out?