Dynamic List for IN Operator

I'm just wondering if there is anyway this is possible. I have a function which generates a list of ids which I am using in my where clause. It looks something like the following:
SELECT blah from blahblah
WHERE blahblahblah IN function_blah(####)
function_blah returns a list of values. Is there anyway to rewrite this to work.

Thanks for the help everybody, but it looks like this actually ruins the performance enhancements I was trying to acheive. It calls the function for every row in eb_par as opposed to the valid rows in rpr_par at the time of the join.
SELECT DISTINCT eb.circuitid AS ethernetbearerid, top.topologyid AS rprringid
FROM topology top,
toprelobjects top_rel,
topconnection top_conn,
circuit rpr_seg,
port rpr_port,
port rpr_par,
port eb_par,
port eb_port,
circuit eb,
circuitcircuit eb_ef,
circuit ef
WHERE top.topologyid = #######
--AND (top.topologyid = i_SelectionID OR i_SelectionID = 0)
AND top_rel.toprelobjects2topology = top.topologyid
AND top_conn.topconnection2toprelobjects = top_rel.toprelobjectsid
AND rpr_seg.circuitid = top_conn.topconnection2object
AND rpr_port.portid IN (rpr_seg.circuit2startport, rpr_seg.circuit2endport)
AND rpr_par.portid = rpr_port.parentport2port
AND eb_par.port2card IN (SELECT * FROM TABLE(CAST (pkgrprpathsupport.getchildcard(rpr_par.port2card) AS t_numberlist)))
AND eb_port.parentport2port = eb_par.portid
AND eb_port.portid IN (eb.circuit2startport, eb.circuit2endport)
AND eb_ef.uses2circuit(+) = eb.circuitid
AND ef.circuitid(+) = eb_ef.usedby2circuit
AND eb.circuit2circuittype = ##########
AND ef.circuit2circuittype(+) = ##########
AND top.topology2topologytype = ##########
ORDER BY rprringid, ethernetbearerid;

Similar Messages

  • PM Order: get PRT list for an operation

    Hi expert,
    I need to get the PRT list for an operation for a PM order (in particolar I need the documents related to a specific operation).
    Do you know if exist a FM?
    Any suggest?
    Thanks
    Salvatore

    This is my solution:
    PARAMETERS: p_aufpl LIKE affh-aufpl.
    DATA: it_affh TYPE STANDARD TABLE OF affh WITH HEADER LINE.
    DATA: it_affhd TYPE STANDARD TABLE OF affhd WITH HEADER LINE.
    DATA: aufpl_tab TYPE STANDARD TABLE OF aufpl_pre WITH HEADER LINE.
    SELECT * FROM affh INTO CORRESPONDING FIELDS OF TABLE it_affh
    WHERE aufpl = p_aufpl.
    LOOP AT it_affh.
    *  MOVE-CORRESPONDING it_affh TO it_affhd.
    **  APPEND it_affhd.
      MOVE-CORRESPONDING it_affh TO aufpl_tab.
      APPEND aufpl_tab.
    ENDLOOP.
    CALL FUNCTION 'CF_BT_CO_AFFH_PRE_READ_FROM_DB'
         TABLES
              aufpl_tab = aufpl_tab
    *            ORD_TAB   = AUFNR_TAB
         EXCEPTIONS
              OTHERS    = 1.
    CALL FUNCTION 'CF_BT_CO_AFFHD_TAB_GET'
    *                EXPORTING
    *                  i_aufpl                 = p_aufpl
    *                  I_APLZL                 =
    *                  I_NO_DELETED            = ' '
    *                  I_NO_PHYS_DELETED       = ' '
    *                  I_FLG_STATX             = 'X'
    TABLES
       affhd_tab               = it_affhd
    *                EXCEPTIONS
    *                  NOT_FOUND               = 1
    *                  OTHERS                  = 2
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE: 'fine'.
    LOOP AT it_affhd.
      WRITE: / it_affhd-doknr.
    ENDLOOP.

  • Print Picking list for late operation in WO

    Hello Experts,
    I am not an expert in PP module, however i have a requirement to be able to generate a picking list automatically in a Work order for the components which are assigned to an operation that will happen in futur.
    Let say we have a WO with 8 operations, and the operation 8 will begin 3 months after the release of the WO.
    Does SAP manage in standard a printing of pick list for component that will be usd in WO at the last operation?
    Thanks for your help
    Regards

    Hi,
    Thanks for feedback,
    As i understand, it is possible to release operation by operation in the work Order ? can you please indicate me how to perform that?
    And if it is the case, does it mean after each release the picking list is printed?
    As i know there is only one release flag (green) to release all the work order.

  • Dynamic List for IC accounts with attrribute of R

    Hi,
    I'm trying to create a dynamic account list for all IC equity accounts. When using HS.Account.IsICP =True, the list does not include a couple of accounts that are set as "R" in the metadata? Does anyone know how to handle this?
    I am working in HFM v 11.1.2.
    Thanks

    Thanks for the suggestion. I got a suggestion from tech support to replace "If HS.Account.IsICP(AcctLi(i)) = True Then" with "if (strcomp(Hs.Account.isICP(AcctLi(i)),"True",vbTextCompare)=0) then" and this seems to have solved the issue. I'm not sure why the first statement would not have picked up the "R" but I'm not going to argue with success. Here is the text for the dynamic list to pick up all intercompany balance sheet accounts used in the equity classification for cash flow analysis in case it helps anyone:
    AcctLi=HS.Account.List("BalanceSheet","[Base]")
                   For i = Lbound(AcctLi) to Ubound(AcctLi)
                   C2Acct = HS.Account.C2Top(AcctLi(i))
                   If UCase(Left(C2Acct, 6)) = "EQUITY" Then
                   if (strcomp(Hs.Account.isICP(AcctLi(i)),"True",vbTextCompare)=0) then
                        HS.AddMemberToList AcctLi(i)
                   End if 'Hs.account.ISICP
                   End if 'UCase
                   Next

  • Dynamic List for Country and City

    I want to create two drop down list for Country and City. So if the user selects a country from dropdown list the other drop down list should automatically be refreshed tos how its corresponding cities.
    I tried using JCOMBOBOX but there is no method in this class there i can pass the data at run time.
    Can any one pls send me a sample code?
    Thanks

    Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.
    edit
    pinto_g, please post your questions to an appropriate forum in future.
    Edited by: DarrylBurke

  • Dynamic Dropdown for Country can Phone Code

    Hi,
    Can anyone show me how to create a Dynamic List for Country and Phone Code. Select a country from dropdown menu and it reloads the page to show the coutry phone code in a text field.
    Example:
    -- It shows a list of country
    -- When a country is selected, it populate the selected country phone code to a text box on the same page.
    Let say, Choose UK country and it auto populate the Phone Code "44" to the text field box on the same page.
    Please advice.
    Thank you

    I exactly know the solution you need.
    But please dont forget to award me the 4 duke dollars if you are satisfied with my solution.
    The solution:
    <select size="1" name="country" onChange="myFunc()">
    <option value="">Please select ..</option>
    <option value="0001$91">India</option>
    <option value="0002$81">Japan</option>
    <option value="0003$44">UK</option>
    </select>
    <p><input type="text" name="myTextField" size="5"></p>
    <script>
    function myFunc()
    var ind =document.forms[0].country.selectedIndex;
    if(ind!= -1)
    var phoneCd = document.forms[0].country[ind].value.substring(5);
    alert(phoneCd );
         document.forms[0].myTextField.value=phoneCd
    else
    document.forms[0].myTextField.value="";
    //alert("my 4 duke dollars pls ;-)");
    </script>
    As you can see in the above dropdown menu "country" that I have defined the phone code in the value after the "$" symbol.
    Simply substring the portion after the $ symbol and you get the phone code.
    Lemme know if this helps ..
    -Rohit
    Message was edited by:
    RohitKumar

  • ADF: Issue in selectOneChoice - dynamic list

    Hi,
    On my ADF page i have two selectOneChoice drop downs, one for CompanyName and other for DepartmentId. CompanyName drop down will get populated once the user logs in based on his credentials so, this is based on a query(having a where condition: where user='aaa'). CompanyName is fetched from the COMPANY table where CompanyId is the primary key. I wish to use Dynamic list for the selectOneChoice where base data source is the view based on 'select * from COMPANY' and the list data source is the view on 'select * from COMPANY where user='aaa''.
    DepartmentName is fetched from DEPARTMENT table(CompanyId is the foreign key here).
    I am using Dynamic list because i need to display CompanyName on the page whereas the backing bean needs to refer to the corresponding CompanyId as the DepartmentId drop down is based on 'select * from DEPARTMENT where CompanyId=<selected CompanyId>'.
    When i trying to run the ADF page, i am getting the following error:
    *<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Too many objects match the primary key oracle.jbo.Key[149 ].*
    oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[149 ].
    *     at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:598)*
    Here oracle.jbo.Key[149 ] : 149 is the CompanyId of the selected CompanyName.
    Kindly help me resolve this issue.
    Thanks in advance.

    Hi,
    Thanks for reply!
    Can you please tell me what is base data source and list data source. I mean in my example of code which query points to base data source and which one points to list data source?
    Among the below options which one should be base data source and which one is list data source?
    1. 'select * from COMPANY'
    2. 'select * from COMPANY where user='aaa''
    Thanks.

  • Dynamic List in BAPI

    Hi Guys,
    Recently i have started working with BAPI's.Can ne1 plz tell me how to get the dynamic list for the BAPI....i dont knw wt to gv in the output field mapping.
    Thanks & Regards
    Anshul Bhat
    SAP - BI

    For this to work you first need a form with a drop down box. For the entry list you choose dynamic and then search and choose BAPI_GL_ACC_GETLIST.
    For the "find data service" step you have to choose "Account_list" for the output port.
    When you see the "assigned value" column set a hard coded value for your companycode input field (I set '1000' for our company). For the output fields choose @GL_ACCOUNT for both value and text (you can change the text output field later to one of the @LONG_TEXT or @SHORT_TEXT to better visualize which account name is available).
    Check the sort box to sort the list.
    Close, deploy and run to see if the list is populated. It works super for me.
    Henning Strand

  • How to create a dynamic entry list for an input field in VC(ce 7.1)

    Hello all,
    I have an Input field, i need to create a Dynamic Entry List for it in VC(ce 7.1).
    How can this be done.
    Thanks in Advance.
    Thanks and Regards,
    Santhosh Guptha N

    Hi Santhosh,
    You can define Dynamic entry list for Drop down list and combo box but not for input field.
    [Refer this|http://help.sap.com/saphelp_nwce10/helpdata/en/2a/28249060dd4dbc872f6266f4557364/frameset.htm] for defining entry list.
    Let me know if it helped.
    Regards,
    Dharmi

  • Attribute substitution  not working in templates for dynamic lists

    Hi all,
    dynamic lists were introduced in APEX 4.1 and they can be used for drop-down menus. I am trying to use attribute substitution #A01#...#A10# in the templates without success.
    Here is a sample select statement
    <pre>
    SELECT level,
    short_title label,
    'f?p=myapp:1:0::::MYAPP_ID:'||id target,
    'NO' is_current,
    NULL image,
    'm'||TO_CHAR(id) attribute1
    FROM mytable
    START WITH parent_id = :MYAPP_ROOT_ID
    CONNECT BY PRIOR id = parent_id
    ORDER SIBLINGS BY seq_in_parent
    </pre>
    and here a snippet from the template
    List Template Noncurrent
    &lt;li class=&quot;dhtmlMenuItem&quot;&gt;&lt;a id=&quot;#A01#&quot; href=&quot;#LINK#&quot;&gt;#TEXT#&lt;/a&gt;&lt;/li&gt;
    The substitution is not being made. It looks like a bug but maybe I'm missing something.
    Any help would be greatly appreciated.
    Regards Garry

    Hi Garry,
    When the list query is parsed, it's not the column alias that deciphers which parameters you're trying to set, it's the positioning of the parameter in the query itself. So, for example, if a user wishes to set the #A01# attribute, like in your case, then the value returned by the 8th parameter in the query will be used. In your original query, you only supplied 6 parameters i.e. up to the image attribute setting. If you're not setting anything for the image attributes, then you simply set those values to null. The syntax for the query should be similar to the following:
    select level,
           labelValue               label,
           [targetValue]            target,
           [is_current]             is_current_list_entry,
           [imageValue]             image,
           [imageAttributeValue]    image_attribute,
           [imageAltValue]          image_alt_attribute,
           [attribute1]             attribute1,
           [attribute2]             attribute2,
           [attribute3]             attribute3,
           [attribute4]             attribute4,
           [attribute5]             attribute5,
           [attribute6]             attribute6,
           [attribute7]             attribute7,
           [attribute8]             attribute8,
           [attribute9]             attribute9,
           [attribute10]            attribute10
    from ...
    where ...
    order by ...Regards,
    Hilary

  • Ho to Write Query for dynamic in sql server for IN operation.

    hi ,
    we was write store procedure dynamically for IN operation,when i select 4 values it was update only 3 item last selected values are not update .if select more then 5 it will showing the below error
    ALTER PROCEDURE [dbo].[UpdateEMPdetails]
    @NID varchar(50),
    @EID nvarchar(max),
    @RT bit,
    @Ackd bit,
    @VerifiedBy varchar(80),
    @TableName varchar(100)
    as
    declare @SqlQueary nvarchar(max)
    set @SqlQueary = 'update '+ @TableName +' set RT='+CAST(@Rt AS CHAR(1))+',Ackd='+CAST(@Ackd AS CHAR(1)) +',Verified_By='''+@VerifiedBy+''' where NID='''+@NID+''' and ' +
    ' EID in('''+ @EID+''''+')'
    print @SqlQueary
    exec UpdateEMPdetails 'EMP14-302',"000008922','00000010242','000008923','00000010242','0000008922','00000010242','0000008922','00000010242",1,1,'xyz','EMPTB'
    when i run this one we will getting the below error
    Msg 103, Level 15, State 4, Line 1
    The identifier that starts with '0000008922','00000010242','00000008922','00000010242','0000008922','000000010242','00' is too long. Maximum length is 128.

    Hi PS_L,
    This is the forum for SharePoint .For your question please use the related Forum, following link is SQL
    Server Forum:
    http://social.technet.microsoft.com/Forums/sqlserver/en-us/home?category=sqlserver 
    This question, I think if you change "000008922','00000010242','000008923','00000010242','0000008922','00000010242','0000008922','00000010242"
    to  N'''000008922'',''00000010242'',''000008923'',''00000010242'',''0000008922'',''00000010242'',''0000008922'',''00000010242''' will solve it. 
    Qiao Wei
    TechNet Community Support

  • Problem in displaying dynamic values in dropdown list for each row

    I want to display dynamic values in a drop down list for each row, and these values depends on the column value in each row(ptaid), based on each ptaid i need to fetch values for drop down list. so how can i achieve this..
    Thanks
    Babu

    Babu,
    This has been discussed in many old threads, try to find them. Also u can refer to article "Dependent Dynamic message choicelists ", at my blog
    http://www.mukx.blogspot.com/
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • DYNAMIC LOV FOR SELECT LIST

    hi to all,
    i've a question regarding lov query based select list:
    For a certain user i need that the lov display a list
    if app_user = BACK_OFFICE I NEED THAT ther query on wich is populated the
    select list is qry 1.
    if app_user is another (consultant) i need query 2 for populating the select list
    1) select name|| ' ' || fname D, id K from partner
    2) select name|| ' ' || fname D, id K from partner WHERE UNAME=(:APP_USER)
    Any solutions would be greatly appreciated.
    Another solution would be to have 2 different apps (one for back-office, one for external consultant), but there i should always duplicate all changes to the second one, loosing a lot of time.
    Now thinking as well to use hidden fields.
    If not clear enough please ask me.
    Thanx a lot.
    Message was edited by:
    Marcello Nocito

    I think one solution wold be to create two different named querys, one containing query 1 and the second query 2. Than u must create an Application Item(like a session variable) in wich u will store you condition. If you want to use the app_user variable u allready have it so you don't need to create it any more. On your page where u want to display the different select list u create two items, one with the query 1 as source and a second item(select list) having the source query 2. Then you must add a condition display on both of them like. Item one is displayed when Value of Item in expression 1 equals expression 2. And you pust :APP_USER in expression 1 and BACK_OFFICE in expression 2. And for the other item, that contains query 2, you put the opposite condition Value of item in expression 1 is not equal to expression 2, and expression 1 is :APP_USER and in expression 2 is BACK_OFFICE.
    Hope this helps.
    Florin

  • Error editing task sequence: Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" From XML into WMI

    I've started getting an intermittent error editing my Windows 7 OSD task sequence.  Sometimes I can open the TS to edit, but when I try to apply changes I get the error.  Other times I get the error when trying to open the TS.  If I try again
    right away, I still get the error, but if I wait a few minutes and try again sometimes it will open the TS. 
    The error reads:
    ConfigMgr Error Object:instance of SMS_Extended Status{Description = "Failed to load dynamic properties for class \"SMS_TaskSequence_ApplyWindowsSettingsAction\" from XML into WMI";Error Code = 2147943746;File = "e:\\qfe\\nts\\sms\\siteserver\\sdk_provider\\smsprov\\ssptspackage.cpp";Line = 3454;Operation = "ExecMethod";ParameterInfo = "SMS_TaskSequencePackage";ProviderName = "WinMgmt";StatusCode = 2147749889;}
    Coinciding with this error, I show the following entries in the TaskSequenceProvider.log file: 
    [PID: 7608] Invoking method SMS_TaskSequence.LoadFromXml
    TaskSequenceProvider
    Failed to protect memory buffer, hr=0x80070542
    TaskSequenceProvider
    Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" from XML into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load node Apply Windows Settings from XML into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "PostInstall" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "Execute Task Sequence" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load XML for the task sequence into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    [PID: 7608] Done with method SMS_TaskSequence.LoadFromXml
    TaskSequenceProvider
    Setting status complete:  status code = 0x80070542; Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" from XML into WMI
    TaskSequenceProvider
    I exported the task sequence and checked in "object.xml" for the "ApplyWindowsSettingsAction", to see if there was something odd in the xml, but I don't find anything that jumps out as being wrong.  Here's the section of XML for
    that step.  I've removed identifying info, and replaced it with a generic term in bold.
    <step type="SMS_TaskSequence_ApplyWindowsSettingsAction" name="Apply Windows Settings" description="" runIn="WinPE" successCodeList="0" runFromNet="false"><action>osdwinsettings.exe /config</action><defaultVarList><variable name="OSDLocalAdminPassword" property="AdminPassword"></variable><variable name="OSDComputerName" property="ComputerName">%_SMSTSMachineName%</variable><variable name="OSDProductKey" property="ProductKey"></variable><variable name="OSDRandomAdminPassword" property="RandomAdminPassword">false</variable><variable name="OSDRegisteredOrgName" property="RegisteredOrgName">COMPANY NAME</variable><variable name="OSDRegisteredUserName" property="RegisteredUserName">COMPANY NAME</variable><variable name="OSDServerLicenseConnectionLimit" property="ServerLicenseConnectionLimit">5</variable><variable name="OSDTimeZone" property="TimeZone">Central Standard Time</variable></defaultVarList></step><step type="SMS_TaskSequence_ApplyNetworkSettingsAction" name="Apply Network Settings" description="" runIn="WinPEandFullOS" successCodeList="0" runFromNet="false"><action>osdnetsettings.exe configure</action><defaultVarList><variable name="OSDDomainName" property="DomainName">DOMAIN.COM</variable><variable name="OSDJoinPassword" property="DomainPassword"></variable><variable name="OSDJoinAccount" property="DomainUsername">DOMAIN ACCOUNT</variable><variable name="OSDEnableTCPIPFiltering" property="EnableTCPIPFiltering" hidden="true">false</variable><variable name="OSDNetworkJoinType" property="NetworkJoinType">0</variable><variable name="OSDAdapterCount" property="NumAdapters" hidden="true">0</variable></defaultVarList></step>
    Is there any other log I should check for a clue on this issue?  What could be causing this error?

    Thanks for sharing that!  I tend to save contacting MS support until after I've exhausted other options.  I'm always afraid that I'll spend the $500 to open a case and then it turns out to be something simple that I would have found if I had just
    kept working on it myself a little longer.
    It looks like that link is for an update released in February as KB3023562.  I downloaded and installed it. I'll try opening/editing/saving the task sequence a few times today to see if the issue is resolved.  
    After I had already installed it, I thought to look up that update in configmgr.  The update is listed as superseded by 2 other updates.  The newest of those is KB3046049, which just installed last night with the other March patches, so it's possible
    that I didn't need to install KB3023562 after all.  

  • How to use dynamic query for this ??

    hi , i am new to ABAP. i got a requirement to write  dynamic query for the following code.
    kindly address. two set of queries are same.but condition is different.
    .IF p_psd EQ ' '.
    *C--End of change DF 1232137- (Transport # :CIDK980530 )
    *C--FETCH THE Deliverd Quantiity and Material Number
        SELECT aufnr "ORDER number
               wemng "Quantity of goods received for the order item
               matnr "MATERIAL NUMBER
               pwerk "PLANT
               dauat "Order Type
               FROM afpo
               INTO TABLE t_afpo
               WHERE aufnr IN s_order
               AND   wemng IN s_dqt
               AND   matnr IN s_matnr
               AND   pwerk IN s_plant
               AND   dauat = c_ro.
        IF sy-subrc = 0.
          SORT t_afpo BY aufnr matnr pwerk.
    *C--FETCH THE OBJECT NUMBER
          SELECT aufnr "ORDER number
                 objnr "Object number
                 FROM aufk
                 INTO TABLE t_aufk
                 FOR ALL ENTRIES IN t_afpo
                 WHERE aufnr = t_afpo-aufnr.
          IF sy-subrc = 0.
            SORT t_aufk BY aufnr objnr.
    *C--FETCH THE Target Quantiity
            SELECT aufnr "ORDER number
                   gamng "Total order quantity target quantity
                   FROM afko
                   INTO TABLE t_afko
                   FOR ALL ENTRIES IN t_afpo
                   WHERE aufnr = t_afpo-aufnr
                   AND   gamng IN s_tqt.
            IF sy-subrc = 0.
              SORT t_afko BY aufnr .
            ENDIF.
          ENDIF.
        ELSE.
          MESSAGE text-e03 TYPE c_s. " No data for the selection criteria
          LEAVE LIST-PROCESSING.
        ENDIF.
    *C--Begin of change DF 1232137- (Transport # :CIDK980530 )
      ENDIF.
      IF p_psd EQ c_x.
        SELECT aufnr "ORDER number
               wemng "Quantity of goods received for the order item
               matnr "MATERIAL NUMBER
               pwerk "PLANT
               dauat "Order Type
               FROM afpo
               INTO TABLE t_afpo
               WHERE aufnr IN s_order
               AND   wemng > 0
               AND   matnr IN s_matnr
               AND   pwerk IN s_plant
               AND   dauat = c_ro.
    if sy-subrc = 0.
    *C--FETCH THE OBJECT NUMBER
        IF  NOT t_afpo[] IS INITIAL.
          SORT t_afpo BY aufnr matnr pwerk.
          SELECT aufnr "ORDER number
                 objnr "Object number
                 FROM aufk
                 INTO TABLE t_aufk
                 FOR ALL ENTRIES IN t_afpo
                 WHERE aufnr = t_afpo-aufnr.
          IF sy-subrc = 0.
            SORT t_afko BY aufnr gamng.
          ELSE.
            MESSAGE text-e03 TYPE c_s. " No data for the selection criteria
            LEAVE LIST-PROCESSING.
          ENDIF.
        ENDIF.
        IF NOT t_afpo[] IS INITIAL.
    *C--FETCH THE Target Quantiity
          SELECT aufnr "ORDER number
                 gamng "Total order quantity target quantity
                 FROM afko
                 INTO TABLE t_afko
                 FOR ALL ENTRIES IN t_afpo
                 WHERE aufnr = t_afpo-aufnr
                 AND   gamng <> t_afpo-wemng .
          IF sy-subrc = 0.
            SORT t_afko BY aufnr gamng.
          ELSE.
            MESSAGE text-e03 TYPE c_s. " No data for the selection criteria
            LEAVE LIST-PROCESSING.
          ENDIF.
        ENDIF.
      ELSE.
        MESSAGE text-e03 TYPE c_s. " No data for the selection criteria
        LEAVE LIST-PROCESSING.
      ENDIF.
    Edited by: Thomas Zloch on Jan 5, 2011 1:30 PM please use code tags

    Hi friend,
    Try using MACRO and dynamic WHERE condition.
    Group simialr Select statements under a Macro.
    Build a dynamic where by checking conditions
    Call macro passing dynamic where condition.
    TABLES afpo.
    DATA: str TYPE string.
    *Macro definition
    DEFINE operation.
      select single *
           from afpo into afpo
           where (&1).    " Dynamic condition
    END-OF-DEFINITION.
    *Build dynamic WHERE by checking some conditions
    *If conditon 
    CONCATENATE 'AUFNR = ''000000700008''' 'AND POSNR = ''0001''' INTO str SEPARATED BY space.
    *Else
    CONCATENATE 'AUFNR = ''000000700008''' 'AND POSNR = ''0002''' INTO str SEPARATED BY space.
    *Endif.
    *Call Macro passing dynamic WHERE condition
    operation str.

Maybe you are looking for

  • Epson R3000 media mismatch error

    Hi, I've loaded two types of fine art paper in the front media tray of my Epson R3000 and selected the paper type in the print settings that match the size of the paper (eg. A4 Fr.-Fine Art(Borderless- Retain Size)).  I've then chosen the relevant Ep

  • High volumn data send from R/3

    Hi I want to send the high volum data like 10 MB file (per day at once). Which is the better method to send the data? (RFC,IDOC,XML,PROXY...) Ravi

  • How can i eject a dvd that seems to be in a reading loop

    how can i eject a dvd that seems to be in a reading loop

  • How to make JTabbedPane Title component take up entire tab width?

    Starting with JDK 1.6, JTabbedPane has been enhanced to allow you to specify an arbitrary Component for the title of a tab (I think before, you could only specify a JLabel and/or icon). We make use of this in our application by specifying a Panel wit

  • Texts of the Datasourcetree

    Hi! Does somebody know something about the texts of Datasourcetree in BW? In the Myself system datasource tree there are the names of application components (in English though, they should be in Finnish) but not for datasources. In datasource tree of