Howto populate a combobox using DBDatasource?

Hi!
How can I populate my combobox with values using a DBDatasource binded to it?
It show only the last record with the following code
and I cannot select any other values.
oDBDSItemCode = oForm.DataSources.DBDataSources.Add("OITM")           
ocbItemCode.DataBind.SetBound(True, "OITM", "ItemCode")
oDBDSItemCode.Query()
For x = 0 To oDBDSItemCode.size - 1
    oDBDSItemCode.Offset = x
Next

Hello Zoltan
I don't think you can populate a ComboBox with the DBDataSource binded to it and I don't think that is the way you should use it.
If I'm right, what you want to do is populate a combobox from the OITM table, and I guess to save is as a foreign key in an other table.
I think you should use the following code,
  - it adds the DBDataSource OITM that wil allows you to populate the combo
  - it link the combobox to the table where you want to save the item code
  - It adds the valid value to the combo
oDBDSItemCode = oForm.DataSources.DBDataSources.Add("OITM") 
ocbItemCode.DataBind.SetBound(True, "name_of_the_table_you_want_to_save_the_data", "Foreign_key_field_name")
oDBDSItemCode.Query()
For x = 0 To oDBDSItemCode.size - 1
    ocbItemCode.ValidValues.Add(oDBDSItemCode.GetValue("ItemCode",i),oDBDSItemCode.GetValue("ItemName",i))
Next

Similar Messages

  • To populate a ComboBox according to a screen field

    Hi folks!  I'm newbie on ABAP and I have the following problem:
    I have a screen field.  According with the data entered on this field I want to populate a ComboBox using the function VRM_SET_VALUES, but I can't found a proper event to do the population.
    The "at selection-screen on field_name" option is executed at the end, with all checks, but not after I live or change the first field.  Anybody knows a solution for it?
    Thanks in advance.

    Check the below code:
    *& Report  YSAMPLE12                                                   *
    REPORT  ysample12                               .
    DATA: i_dynpfields TYPE dynpread OCCURS 0 WITH HEADER LINE.
    TYPE-POOLS : vrm.
    DATA : vrm_data TYPE vrm_values.
    DATA : wa_vrm LIKE LINE OF vrm_data.
    PARAMETERS : p_val TYPE c.
    PARAMETERS : p_opt(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.
    AT SELECTION-SCREEN.
      REFRESH: i_dynpfields.
      i_dynpfields-fieldname = 'P_VAL'.
      APPEND i_dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname                         = sy-repid
          dynumb                         = sy-dynnr
      TRANSLATE_TO_UPPER             = ' '
      REQUEST                        = ' '
      PERFORM_CONVERSION_EXITS       = ' '
      PERFORM_INPUT_CONVERSION       = ' '
      DETERMINE_LOOP_INDEX           = ' '
        TABLES
          dynpfields                     = i_dynpfields
    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.
    AT SELECTION-SCREEN OUTPUT.
      REFRESH: vrm_data.
      READ TABLE i_dynpfields WITH KEY fieldname = 'P_VAL'.
      IF i_dynpfields-fieldvalue = 'A'.
        wa_vrm-key = '1'.
        wa_vrm-text = 'Create'.
        APPEND wa_vrm TO vrm_data.
        wa_vrm-key = '2'.
        wa_vrm-text = 'Change'.
        APPEND wa_vrm TO vrm_data.
        wa_vrm-key = '3'.
        wa_vrm-text = 'Delete'.
        APPEND wa_vrm TO vrm_data.
      ELSEIF i_dynpfields-fieldvalue = 'B'.
        wa_vrm-key = '4'.
        wa_vrm-text = 'Copy'.
        APPEND wa_vrm TO vrm_data.
      ENDIF.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'P_OPT'
          values          = vrm_data
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
    U have press enter after giving value in the P_VAL.
    Regards,
    Prakash.

  • Populating a Combobox using Remoting with AMF and PHP

    Hello all
    I am using Zend framework and Flex 3.4 to create a webapp. I am stuck at how to populate a combobox dynamically using the service I created in PHP.
    In some of examples I saw that result of database query was being converted into XML and then sent to Flex. This seems a little too time-consuming if I have to do it every time. I saw some examples in Adobe Docs about Remoting with AMF and PHP. That seems like a better approach although how it would be applicable here is beyond me right now.
    Can somebody guide me in correct direction?
    Thanks and Regards
    Shivik

    Try this: http://code.google.com/p/as3flexdb/ is very easy to use and it
    will help.
    All you need to populate a combo is:
    <mx:ComboBox dataProvider="{query.Records} /

  • To retive data into a combobox using a dataprovider

    Hi guys,
    I am a bit new to flex so plz if anyone can help me on this
    I am trinying to populate a combobox with the a data
    provider in
    this way:
    <mx:ComboBox id="cboGroup" height="22" width="100"
    dataProvider="{httpEditPartyMaster.lastResult.result.row.attribute('GROUPNAME')}"/
    Is right to do it in this way because i am not getting any
    data into
    the combobox ?
    This is how i am requesting to my java application:
    public function getGroup():void{
    var params:Object = new Object();
    params.tname = "groups";
    params.column = "groupname";
    httpEditPartyMaster.url ="querytable.do";
    httpEditPartyMaster.request = params;
    httpEditPartyMaster.send();
    <mx:HTTPService id="httpEditPartyMaster"
    resultFormat="xml"
    method="POST" result="processRequest();" />
    regards ,
    Mario.

    DBConsole is for SYSTEM or SYS or a user with DBA privilege.
    I wouldn't understand why use EM to update tables, use SQL*Plus instead, it would be more simple and less cpu consuming.
    Anyway, from the maintenance page you can launch a iSQL*Plus window, which would be more or less similar at SQL*Plus, to run any insertion queries.
    Nicolas.

  • How to select item in combobox using database?

    I inserted some data in oracle database using comboboxes and to retrieve that data from oracle database.my problem, How to select the item in combobox using that data(retrieve data)?

    Not quite sure what you're asking; do you want to show some value in the combo box selected when the page loads? Then you need to use the "selected" key word in the correspoding <option> element.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Populate City file using LSM workbench

    I need to know how to populate 'City File' using LSM workbench. It would be extremely helpful if anyone answers the following questions:
    1) Where to get the US regional structure source data?
    2) How to convert it to SAP uploadable format?
    3) How to upload the data to SAP system?
    In other words, I need to know the steps of the process to populate SAP US regional structure from scratch.
    Thanks in Advance.

    I need to know how to populate 'City File' using LSM workbench. It would be extremely helpful if anyone answers the following questions:
    1) Where to get the US regional structure source data?
    2) How to convert it to SAP uploadable format?
    3) How to upload the data to SAP system?
    In other words, I need to know the steps of the process to populate SAP US regional structure from scratch.
    Thanks in Advance.

  • How to populate tag_capturedetails field using a datepicker

    So, here is what I am trying to do. I have the online shop layout template -  Individual Product-Large - being used as the page prior to shopping cart used by the customer to finalize the selection of the product. The product is actually a service with a defined start date. I would like to have the customer select a start date using the datepicker (JQUERY UI Widget) that I have succesfully installed on this page.
    My question is probably not a very smart one, but how in the world do you get the information chosen on the date picker to populate the tag_capturedetails field.  I have tried all weekend and have searched everywhere, but have not found any reference to this with a working solution. Any help on this would be super appreciated.  Here is my code for the page as described:
    <link type="text/css" href="/css/custom-theme/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="/Javascript/jquery-ui-1.8.21.custom.min.js"></script>
    <h2 style="text-align: left;">
    <table>
        <tbody>
            <tr>
                <td rowspan="4" style="background-image: url(http://www.solderlab.com/images/cssimg/blue-gradient.jpg); padding-right: 25px; padding-left: 25px; background-attachment: scroll; padding-top: 10px; text-align: left; vertical-align: top;">
                <h4><span style="font-size: 13px;"><span style="font-weight: normal; font-family: arial; font-size: 13px;">{tag_description}</span><span style="font-weight: normal; font-family: arial; font-size: 13px;">{tag_smallimage}</span></span></h4>
                </td>
                <td style="padding-top: 20px; text-align: center; vertical-align: top;"><span style="font-family: arial; font-size: 16px;">{tag_largeimage}</span></td>
            </tr>
            <tr>
                <td style="white-space: nowrap;"><span style="font-family: arial; font-size: 16px;">Click on an image to expand {tag_poplets}</span> </td>
            </tr>
            <tr>
                <td></td>
            </tr>
            <tr>
                <td style="background-image: url(http://www.solderlab.com/gray-gradient.gif); padding-right: 20px; padding-left: 20px; padding-bottom: 10px; text-align: left; vertical-align: top; white-space: nowrap;"><span style="font-family: arial; font-size: 16px;"><span style="font-size: 20px; font-family: arial;">Configure your quote or order: </span><br />
                <span style="font-size: 20px; font-family: arial;"> Product: {tag_name}</span></span>
                <div><span style="font-family: arial; font-size: 16px;">{tag_custom3} {tag_grouping}</span></div>
                <div><span style="font-family: arial; font-size: 16px;">{tag_custom2} {tag_addtocartinputfield}</span></div>
                <div><span name="date" id="details" style="display: none; font-family: arial; font-size: 16px;">{tag_capturedetails, Specify your start date}<br />
                </span></div>
                <meta charset="utf-8" />
                <script>
         $(function() {
    $( ".selector" ).datepicker({ altField: "#actualDate" });
    //getter
    var altField = $( ".selector" ).datepicker( "option", "details" );
    //setter
    $( ".selector" ).datepicker( "option", "details", "#actualDate" );
              $( "#datepicker" ).datepicker({
                   showOn: "button",
                   buttonImage: "/images/calendar.gif",
                   buttonImageOnly: true
         </script>
                <div class="demo">
                <p><span style="font-family: arial; font-size: 16px;">STEP 3: Select your test start date:
                </span><input type="text" id="datepicker" /></p>
                <p><span style="font-size: medium; font-family: arial; color: #ffffff;">{tag_custom1}<br />
                </span><span style="font-size: medium; font-family: arial; color: #ffffff;">{tag_custom4}</span></p>
                </div>
                <div><span style="font-family: arial; font-size: 16px;">{tag_buynow, Go to Cart}</span></div>
                </td>
            </tr>
        </tbody>
    </table>
    <table>
    </table>
    </h2>
    <div style="text-align: center;"><em><br />
    </em></div>

    Hi Mihai
    Thank you for your reply. I was beginning to think that no-one could answer this one. Am what I am trying to do even possible?

  • How to populate the ranges using FM for the SELECTs

    Hi,
    I am still working on the FM to create a generic extractor. I went through the debugger but I am still unable to determine how the ranges are populated. RSA3 always gives me zero values for the results.
    There is a RANGE statement in the sample FM and the following statements for SELECTs
      RANGES: L_R_CARRID  FOR SFLIGHT-CARRID,
              L_R_CONNID  FOR SFLIGHT-CONNID.
    and...
          LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CARRID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
            APPEND L_R_CARRID.
          ENDLOOP.
          LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
            MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
            APPEND L_R_CONNID.
          ENDLOOP.
    My question is how is L_R_CONNID and L_R_CARRID populated with low and high values for the SELECT statements? I tried to find the DS 0SAPI_SFLIGHT_SIMPLE to run and see how it is set up but there is no such DS.
    Would someone take the time to say something about this in  several sentences? I have my own code and it seems that it is not populating the values for the SELECTs when I debug from RSA3 when I provide the low and high values.
    Would I normally populate the low and high values from the InfoPackage 'Data Selection' tab once I have implemented in BW or ready to test in BW? That would mean I have to choose those fields as selections from RSO2. Anyway, I think I have asked about this but I am hoping to get an answer to get this going...
    Appreciate any replies.

    Hi
    Here is an example of an extractor that uses
    both method's, if the InfoPackage selection exist's
    it overrides the TVARV selection (which is the default).
    FUNCTION ZBW_TC_FORECAST_SO_EXTRACTOR.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(I_REQUNR) TYPE  SBIWA_S_INTERFACE-REQUNR
    *"     VALUE(I_DSOURCE) TYPE  SBIWA_S_INTERFACE-ISOURCE OPTIONAL
    *"     VALUE(I_CHABASNM) TYPE  SBIWA_S_INTERFACE-CHABASNM OPTIONAL
    *"     VALUE(I_MAXSIZE) TYPE  SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
    *"     VALUE(I_INITFLAG) TYPE  SBIWA_S_INTERFACE-INITFLAG OPTIONAL
    *"     VALUE(I_UPDMODE) TYPE  SBIWA_S_INTERFACE-UPDMODE OPTIONAL
    *"     VALUE(I_DATAPAKID) TYPE  SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
    *"     VALUE(I_PRIVATE_MODE) OPTIONAL
    *"     VALUE(I_CALLMODE) TYPE  ROARCHD200-CALLMODE OPTIONAL
    *"  TABLES
    *"      I_T_SELECT TYPE  SBIWA_T_SELECT OPTIONAL
    *"      I_T_FIELDS TYPE  SBIWA_T_FIELDS OPTIONAL
    *"      E_T_DATA STRUCTURE  ZBW_TC_FORECASTING_EXT_STR OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    *"      HIERARCHY_NOT_FOUND
    Change History                                                      *
    Mod. #  |  Date    |  Developer     |  Description                  *
    *RD3K915762|06/21/2005| SRangaraj      | Change selection of open SO   *
             |          |                | data to include deleted matls *
             |          |                | and obsolete items too        *
    RD3K915888|06/29/2005| SRANGARAJ      | Add ext matl grp and lab offce
             |          |                | filters for data-selection    *
    The input parameter I_DATAPAKID is not supported yet !
    Auxiliary Selection criteria structure
      DATA: L_S_SELECT TYPE SBIWA_S_SELECT.
    Maximum number of lines for DB table
      STATICS L_MAXSIZE TYPE SBIWA_S_INTERFACE-MAXSIZE.
    Parameter I_PRIVATE_MODE:
    Some applications might want to use this function module for other
    purposes as well (e.g. data supply for OLTP reporting tools). If the
    processing logic has to be different in this case, use the optional
    parameter I_PRIVATE_MODE (not supplied by BIW !) to distinguish
    between BIW calls (I_PRIVATE_MODE = SPACE) and other calls
    (I_PRIVATE_MODE = X).
    If the message handling has to be different as well, define Your own
    messaging macro which interprets parameter I_PRIVATE_MODE. When
    called by BIW, it should use the LOG_WRITE macro, otherwise do what
    You want.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
      IF I_INITFLAG = SBIWA_C_FLAG_ON.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    The input parameter I_DATAPAKID is not supported yet !
    Invalid second initialization call -> error exit
        IF NOT G_FLAG_INTERFACE_INITIALIZED IS INITIAL.
          IF 1 = 2. MESSAGE E008(R3). ENDIF.
          LOG_WRITE 'E'                    "message type
                    'R3'                   "message class
                    '008'                  "message number
                    ' '                    "message variable 1
                    ' '.                   "message variable 2
          RAISE ERROR_PASSED_TO_MESS_HANDLER.
        ENDIF.
    Check InfoSource validity
        CASE I_DSOURCE.
          WHEN 'ZBW_TC_SO_EXTRACT'.
          WHEN OTHERS.
            IF 1 = 2. MESSAGE E009(R3). ENDIF.
            LOG_WRITE 'E'                  "message type
                      'R3'                 "message class
                      '009'                "message number
                      I_DSOURCE            "message variable 1
                      ' '.                 "message variable 2
            RAISE ERROR_PASSED_TO_MESS_HANDLER.
        ENDCASE.
    Check for supported update mode
       CASE I_UPDMODE.
         WHEN 'F'.
         WHEN OTHERS.
           IF 1 = 2. MESSAGE E011(R3). ENDIF.
           LOG_WRITE 'E'                  "message type
                     'R3'                 "message class
                     '011'                "message number
                     I_UPDMODE            "message variable 1
                     ' '.                 "message variable 2
           RAISE ERROR_PASSED_TO_MESS_HANDLER.
       ENDCASE.
    Check for obligatory selection criteria
       READ TABLE I_T_SELECT INTO L_S_SELECT WITH KEY FIELDNM = 'PGMID'.
       IF SY-SUBRC <> 0.
         IF 1 = 2. MESSAGE E010(R3). ENDIF.
         LOG_WRITE 'E'                    "message type
                   'R3'                   "message class
                   '010'                  "message number
                   'PGMID'                "message variable 1
                   ' '.                   "message variable 2
         RAISE ERROR_PASSED_TO_MESS_HANDLER.
       ENDIF.
        APPEND LINES OF I_T_SELECT TO G_T_SELECT.
    Fill parameter buffer for data extraction calls
        G_S_INTERFACE-REQUNR    = I_REQUNR.
        G_S_INTERFACE-ISOURCE   = I_DSOURCE.
        G_S_INTERFACE-MAXSIZE   = I_MAXSIZE.
        G_S_INTERFACE-INITFLAG  = I_INITFLAG.
        G_S_INTERFACE-UPDMODE   = I_UPDMODE.
        G_S_INTERFACE-DATAPAKID = I_DATAPAKID.
        G_FLAG_INTERFACE_INITIALIZED = SBIWA_C_FLAG_ON.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
        APPEND LINES OF I_T_FIELDS TO G_T_FIELDS.
    Fill range tables for fixed InfoSources. In the case of generated
    InfoSources, the usage of a dynamical SELECT statement might be
    more reasonable. BIW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
        LOOP AT G_T_SELECT INTO L_S_SELECT.
          CASE L_S_SELECT-FIELDNM.
            WHEN 'PRDHA'.
              WGF_PRDHA_LENGTH = STRLEN( L_S_SELECT-LOW ).
              IF WGF_PRDHA_LENGTH = 6.  "PARTIAL PRDHA
                 WGF_PRDHA = L_S_SELECT-LOW.
                 CONCATENATE WGF_PRDHA '%' INTO WGF_PRDHA.
              ELSEIF WGF_PRDHA_LENGTH = 12.  "FULL PRDHA
              MOVE-CORRESPONDING L_S_SELECT TO L_R_PRDHA.
              APPEND L_R_PRDHA.
              ENDIF.
            WHEN 'MATKL'.
              MOVE-CORRESPONDING L_S_SELECT TO L_R_MATKL.
              APPEND L_R_MATKL.
          ENDCASE.
        ENDLOOP.
    reset the index of where we are in the gt_header table
      g_tabix = 0.
      perform populate_default_variables.
      perform get_data.
      perform build_detail.
        EXIT.
      ENDIF.                 "Initialization mode or data extraction ?
    Data transfer: First Call      OPEN CURSOR + FETCH
                   Following Calls FETCH only
    First data package -> OPEN CURSOR
       IF G_COUNTER_DATAPAKID = 0.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between InfoSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
      DESCRIBE TABLE LT_DATA LINES l_count.
      IF g_tabix GE l_count.
        RAISE no_more_data.
      ENDIF.
    *CLEAN UP THE OUTPUT TABLE
      refresh E_T_DATA.
      LOOP AT LT_DATA FROM G_TABIX INTO LS_DATA.
        APPEND LS_DATA TO E_T_DATA.
    Set global counter
        g_tabix = g_tabix + 1.
      ENDLOOP.
       G_COUNTER_DATAPAKID = G_COUNTER_DATAPAKID + 1.
    ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.
    Forms
    ***INCLUDE LZBW_TC_FORECAST_SO_EXTF01 .
    *&      Form  populate_default_variables
          text
    -->  p1        text
    <--  p2        text
    FORM populate_default_variables.
      data: wlf_name like tvarv-name.
      clear: R_prdh3[], wlf_name.
    *get the exclusion range from tvarv for the product hierarchy in
    *question
      concatenate 'ZBW_EXL_' WGF_PRDHA(6) INTO WLF_NAME.
    SELECT LOW FROM TVARV INTO R_prdh3-low WHERE
                                 NAME = WLF_NAME.
      move:  'I'    to R_prdh3-sign,
             'EQ'   to R_prdh3-option.
      append R_prdh3.
      clear R_prdh3.
    ENDSELECT.
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
    CLEAR L_R_LABOR[].
    SELECT LOW FROM TVARV INTO L_R_LABOR-Low WHERE
                                 NAME = 'ZBW_TC_FORECAST_LAB_OFF'.
      move:  'I'    to L_R_LABOR-sign,
             'EQ'   to L_R_LABOR-option.
      append L_R_LABOR.
      clear L_R_LABOR.
    ENDSELECT.
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
    ENDFORM.                    " populate_default_variables
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    FORM get_data.
      data: wlf_lmeng like vbep-lmeng.
    *get all deliveries for date range for either a range of product hrchy
    *or a like value
      refresh int_records1.
      if wgf_prdha ne space.
        select ivbeln iposnr iKLMENG jvkorg i~werks
               imatnr imeins mprdha mmatkl
        from vbap as i
           INNER JOIN VBAK AS j
           ON ( jvbeln = ivbeln
                and j~vbtyp = 'C' )
           INNER JOIN vbuk AS k
           ON ( kvbeln = ivbeln
                and k~lfgsk <> 'C'
                and k~gbstk <> 'C' )
           INNER JOIN vbup AS l
           ON ( lvbeln = ivbeln and
                lposnr = iposnr
                and l~lfgsa <> 'C'
                and l~gbsta <> 'C' )
           INNER JOIN mara AS m
           ON ( mmatnr = imatnr
    {Start of insert by SRangaraj on June 21, 2005 >>RD3K915762
                and m~lvorm eq ' '
                and m~mstae ne '99'
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                and m~extwg = '080' )
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
           INNER JOIN marc AS n
           ON ( nmatnr = imatnr
                and nwerks = iwerks
                and n~lvorm eq ' ' )
    }End of insert by SRangaraj on June 21, 2005 >>RD3K915762
        into table int_records1 where ( i~abgru = '  '
                                     and i~klmeng > 0
                                     and m~prdha like wgf_prdha
                                     and m~matkl in l_r_matkl
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                                     and m~labor in l_r_labor ).
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
      elseif not l_r_prdha[] is initial and wgf_prdha = space.
        select ivbeln iposnr iKLMENG jvkorg i~werks
               imatnr imeins mprdha mmatkl
        from vbap as i
           INNER JOIN VBAK AS j
           ON ( jvbeln = ivbeln
                and j~vbtyp = 'C' )
           INNER JOIN vbuk AS k
           ON ( kvbeln = ivbeln
                and k~lfgsk <> 'C'
                and k~gbstk <> 'C' )
           INNER JOIN vbup AS l
           ON ( lvbeln = ivbeln and
                lposnr = iposnr
                and l~lfgsa <> 'C'
                and l~gbsta <> 'C' )
           INNER JOIN mara AS m
           ON ( mmatnr = imatnr
    {Start of insert by SRangaraj on June 21, 2005 >>RD3K915762
                and m~lvorm eq ' '
                and m~mstae ne '99'
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                and m~extwg = '080' )
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
           INNER JOIN marc AS n
           ON ( nmatnr = imatnr
                and nwerks = iwerks
                and n~lvorm eq ' ' )
    }End of insert by SRangaraj on June 21, 2005 >>RD3K915762
        into table int_records1 where ( i~abgru = '  '
                                     and i~klmeng > 0
                                     and m~prdha in l_r_prdha
                                     and m~matkl in l_r_matkl
    {Start of insert by SRangaraj on June 29, 2005 >>RD3K915888
                                     and m~labor in l_r_labor ).
    }End of insert by SRangaraj on June 29, 2005 >>RD3K915888
    endif.
        sort int_records1 by vbeln posnr.
        delete adjacent duplicates from int_records1 comparing
        vbeln posnr.
    *remove unnecessary records
        if not r_prdh3[] is initial.
        DELETE INT_RECORDS1 WHERE PRDHA+6(3) IN r_prdh3.
        endif.
    *get the schedule lines for all of the above records and
    *get the lowest schedule line date per so line item
         if not int_records1[] is initial.
         refresh int_records3.
         select vbeln posnr etenr mbdat into table int_records3
         from vbep for all entries in int_records1
                           where vbeln = int_records1-vbeln and
                                 posnr = int_records1-posnr and
                                 lmeng > 0.
         sort int_records3 by vbeln posnr etenr mbdat ascending.
         loop at int_Records1.
           loop at int_records3 where vbeln = int_records1-vbeln
                                  and posnr = int_records1-posnr.
             int_records1-mbdat = int_records3-mbdat.
             modify int_records1.
             exit.
            endloop.
         endloop.
         refresh int_records3. free int_records3.
         refresh int_records2.
    *get the deliveries and calculate the open quantities
        select vbelv posnv vbeln posnn rfmng plmin
                    from vbfa into table int_records2
                                  for all entries in int_Records1
                                  where vbelv = int_records1-vbeln
                                    and posnv = int_records1-posnr
                                    and VBTYP_N = 'J'. "Dels
    *calculate open quantities next
         loop at int_records1.
           clear wlf_lmeng.
           clear int_records2.
           loop at int_records2 where vbelv = int_records1-vbeln
                                    and posnv = int_records1-posnr.
           case int_records2-plmin.
             when '-'.
              wlf_lmeng = wlf_lmeng - int_records2-rfmng.
             when others.  "just add
              wlf_lmeng = wlf_lmeng + int_records2-rfmng.
            endcase.
           endloop.
           int_records1-klmeng = int_records1-klmeng - wlf_lmeng.
           int_records1-vbeln_dl = int_records2-vbeln.
           int_records1-posnr_dl = int_records2-posnn.
           modify int_records1.
        endloop.
        endif.
        delete int_records1 where klmeng le 0.
        refresh int_records2. free int_Records2.
    ENDFORM.                    " get_data
    *&      Form  build_detail
          text
    -->  p1        text
    <--  p2        text
    FORM build_detail.
        LOOP AT int_records1.
    *DO INDIVIDUAL MOVES - ITS FASTER THAN MOVE-CORRESPONDING
        move: int_records1-vkorg    to LS_DATA-VKORG,
              int_records1-werks    to LS_DATA-WERKS,
              int_records1-matnr    to LS_DATA-MATNR,
              int_records1-klmeng   to LS_DATA-KLMENG,
              int_records1-mbdat(6) to LS_DATA-YEARMONTH,
              int_records1-meins    TO LS_DATA-MEINS,
              int_records1-vbeln    TO LS_DATA-VGBEL,
              int_records1-posnr    TO LS_DATA-VGPOS,
              int_records1-vbeln_dl TO LS_DATA-VBELN,
              int_records1-posnr_dl TO LS_DATA-POSNR,
              int_records1-mbdat    to LS_DATA-WADAT_IST,
              int_records1-PRDHA    to LS_DATA-PRDHA,
              int_records1-matkl    to LS_DATA-MATKL.
        APPEND LS_DATA TO LT_DATA.
        clear: LS_DATA.
        ENDLOOP.
    ENDFORM.                    " build_detail

  • How could I populate S012 to use Sap standard analyse?

    Hello,
    I would like to work with Mce3 and mce7 to analyse the performance of my purchase activities...  Although i have gotten problem to populate the LIS table.
    I accessed s012 table in se16n transaction. I noticed there are some datas in this table, but it is not necessary correct, probably because it has not atualized correct.
    The field theoric quantity is Ok! So, any order I create in sap the Lis can read and my quantity change. It shows that I dont have a connection problem properly.
    The data just is added in table after Migo , miro... when is it insert ?
    Have anyone used the LIS informations to help me ? What is my configuration problem?
    Here , we use purchase order and Scheduling Agreement!
    I m glad for your help!
    Thank you, very much!

    if you have not changed the update rules for S012, then it just works as designed by SAP.
    However, this may not always be the way users would like to see the data.
    The goods receipt is allocated to the period of PO creation, and not to the period when the receipt actually happened.
    So many companies have created a S912 structure and amended the update rules to their own needs.

  • Populate Error Message using  MB_MIGO_BADI

    Hi Friends,
      My requirement is whenever the user does a goods receipt using transaction "MIGO" I need to check whether the item selected has an indicator "Delivery Completed" at the PO level and if this indicator is set for this PO item I need to throw an Error message and should not allow the user to create a GR against that item. I have implemented the BADI "MB_MIGO_BADI" for this purpose and I am using the method "POST_DOCUMENT" to check the PO item and throw an error message, bu the issue is afterI  throw an error message and when the user tries to exit from the transaction MIGO using the exit button, the system throws an short dump " Screen: Illegal message" because the program attempted to issue a " " message during "Exit Command" processing. In order to avoid this i tried the method "CHECK_ITEM" to populate the error message to application log, it works fine but I am not able to get the line item details inside this method. I even tried to import the line item details from the method "LINE_MODIFY" and then use it in "CHECK_ITEM" method, but the issue here is CHECK_ITEM is called only once for all the line item, ""LINE_MODIFY" was called every time i change the line item, so I was not able to use it. Can you please let me know if there is any other better way to achieve this.
    As per the below weblog, this scenario is available as part of the standard in ECC Ehp4, but unfortunately we are on Ehp1.
    Delivery Complete Indicator of PO and Goods Receipt

    Dear Imran,
       To achieve the best possible solution you have to use two methods of this BADI in combination with each other. These two methods are 'LINE_MODIFY' and 'CHECK_ITEM'.
       The method 'LINE_MODIFY' will be called every time there is some activity on the MIGO screen. In this method you will have both the item line id and the item structure available in the interface. You will need to create a class attribute which is an internal table of a locally defined structure. The first field of this  structure will be the line_item_id and the second will be the item structure itself. The first time when this method is called for a line item a new entry is inserted into this class level attribute. For each subsequent time this structure needs to be updated with the new values comparing the line item id.
      The method 'CHECK_ITEM' will be called when you press the 'CHECK' or the 'POST' buttons. In this method based on the line item id the corresponding item structure will be obtained from the class level attribute. Using the data of the structure you can then perform your validations and populate the BAPIRET2_TAB parameter with the message details which will then be dispayed in the popup message box in MIGO.
      Hope this helps.
    Best regards,
    Pradip

  • How to populate the table using webservice

    Hi,
    i have created the web service from function module and  integrated this web service in interactive form using New data connection.
    I have drag and drop all field into the form table and test the form,but its not populate table.
    if any script need for this,
    Kindly explain in detail or give the sample code.
    Thanks in advance
    Parthasarathi

    Dear folks
    M about to create a midlet
    application in which i need to populate my table
    with the current stock exchange values. Since these
    values get changed dynamically , I planned to use
    streaming. Since m new to streaming ,pls someone
    come up to guide me in right path. M using Canvas
    application. I appreciate all the repliesthats fine and funny....
    let me tell you something, in GCF everything you fetch through GPRS is bound to come as an inputstream and whatever request you send is passed as outputstream. so if you have worked with GCF, you have worked with streaming already. isn't it.
    SD

  • How to populate the table using streaming data

    Dear folks
    M about to create a midlet application in which i need to populate my table with the current stock exchange values. Since these values get changed dynamically , I planned to use streaming. Since m new to streaming ,pls someone come up to guide me in right path. M using Canvas application. I appreciate all the replies

    Dear folks
    M about to create a midlet
    application in which i need to populate my table
    with the current stock exchange values. Since these
    values get changed dynamically , I planned to use
    streaming. Since m new to streaming ,pls someone
    come up to guide me in right path. M using Canvas
    application. I appreciate all the repliesthats fine and funny....
    let me tell you something, in GCF everything you fetch through GPRS is bound to come as an inputstream and whatever request you send is passed as outputstream. so if you have worked with GCF, you have worked with streaming already. isn't it.
    SD

  • Default value of combobox using dynamic LOV in Oracle Portal form

    We are trying to specify the deafult value of a combobox on a form that derives it options from a dynamic LOV. The option value is a number and the display is text.
    E.g.
    <Option value="1">Books
    <Option value="2">CDs
    We have tried various ways of setting the default option to be selected on the Combobox. First, we tried using a sql query to return a number from a table (sql query returns number -> in the default value type field). Next, we tried to use a constant number (default value: 2, default value type: constant). In neither case, did the Oracle Portal form pre-select our default choice in the drop-down list.
    Any suggestions? I browsed the other forum articles on this topic and noticed several folks believed it was a bug in Portal. We are using Portal version 3.0.9 (latest App Server for the Ebusiness Suite). Thanks in advance.

    You can manually add the select list (or for that matter anything else) to a wizard created form. If the select list is for an existing item, simply change the "Display As" setting from Text to a Select List based on the LOV you create. Any changes made will then be applied by the update process.
    cheers,
    Ron

  • Update User Defined Field using DBDataSource

    Hi All,
    I'm trying to update the user defined field using the DBDataSource object.  However an error occurred - "Item is not a User-Defined Field".
    The code used is as follows:
    Dim oDS as SAPbouiCOM.DBDataSource
    Dim oForm as SAPbouiCOM.Form
    Set oForm = SBO_Application.Forms.GetForm("139", 1)
    Set oDS = oForm.DataSources.DBDataSources.Item("ORDR")
    oDS.SetValue("U_Field1",oDS.Offset,"abc")
    Please help.

    If you haven´t put the field directly in the standard form the user defined fields are in a different form. This form has the same type but with "-" before it.
    So so should use this code to get the user defined fields form:
    Set oForm = SBO_Application.Forms.GetForm("-139", 1)
    Maybe this can be the cause

  • Facing problem while adding combobox using gridbaglayout

    HI, I have used gridbaglayout in my panel. after adding the gridbaglayout, if i select long value combobox does't display all the value of the selected value. Why?
    This is my code
    cboPrioritySearchValue = new JComboBox();
    cboPrioritySearchValue.setBackground(Color.white);
    cboPrioritySearchValue.addItem("ALL");
    cboPrioritySearchValue.addItem(Priority.NOT.getValue());
    cboPrioritySearchValue.addItem(Priority.ONE.getValue());
    cboPrioritySearchValue.addItem(Priority.TWO.getValue());
    cboPrioritySearchValue.addItem(Priority.THREE.getValue());
    cboPrioritySearchValue.addItem(Priority.FOUR.getValue());
    setConstraints(gbc,gbc.WEST,gbc.NONE,2,1,2,8,new Insets(2,5,5,5),0,0,0,0);
    gbl.setConstraints(cboPrioritySearchValue,gbc);
    panel.add(cboPrioritySearchValue);This is my setConstraints method,
    public GridBagConstraints setConstraints(GridBagConstraints gbc, int anchor,int fill,
                                                 int gridw, int gridh, int gridx, int gridy,
                                                 Insets insets, int ipadx, int ipady,
                                                 int weightx, int weighty)
            gbc.anchor     = anchor;
            gbc.fill       = fill;
            gbc.gridwidth  = gridw;
            gbc.gridheight = gridh;
            gbc.gridx      = gridx;
            gbc.gridy      = gridy;
            gbc.insets     = insets;
            gbc.ipadx      = ipadx;
            gbc.ipady      = ipady;
            gbc.weightx    = weightx;
            gbc.weighty    = weighty;
            return gbc;
        }Edited by: JavaHeroPrince on May 13, 2010 6:58 AM

    Thanks Pete, hopefully its only a temporary problem.Short answer: It is (well ... hopefully).
    Long answer: My server's dying regularly because all the connections fill up in CLOSE_WAIT states. This doesn't seem to have the same root cause as the reported bugs that I can find (issues with older JDKs) so I'm interested in investigating it beyond just upgrading everything to the latest and crossing my fingers. Unfortunately that will take time and I'm a bit pressed for spare time at the moment - so: my apologies; the domain is likely to be down until after the weekend at least.
    After the weekend I'll re-target sscce.org (and .com and .net which I acquired a little while back) to a different server that's not suffering from the problem. Or if Andrew prefers I'll target a server under his control.

Maybe you are looking for

  • Can't sign in or make purchase on iTunes 7.7.1

    When I try to sign in or purchase a song this message appears: "We could not complete your iTunes request. The requested keychain was invalid. Open keychain access and run keychain first aid, then try again." I did all that and it didn't help. I've b

  • [java.nio] StreamCorruptedException when deserializing objects

    Hello everybody! I made a messaging (chat) program using java.io where all the client-server communication is done by serializing small objects. Now I would like to covert the server side to the NIO concept and I'm already struck. I successfully pass

  • Protocols or COntent type used by the iPod Maps app

    I use the Map app on my iPod Touch (2G) all the time. Today I am on vacation and in spite of the fact that I have good WiFi connectivity, two apps will not function at all: The NY Times reader and the Apple Maps app. While you can use Safari to bring

  • OIM : End user should be able to edit his resource data

    Hi, When the end user logs in and requests for AD resource, he does not see the AD resource form. All the data for the form is prepopulated according to some predefined rules. What i want to do is to allow the End-user to modify his AD form data. How

  • No taxing on unplanned delivery cost

    Hi all, I have an invoice in MIRO where I have manually entered the QST provincial tax - lets say $350.49. When I click simulate, the QST amount is fine (stays the same at 350.49). But when I add an unplanned delivery cost of $5, the QST amount incre