Code - URGENT

Hi All,
At the moment in a query, i am viewing all info related to materials. The issue is, the material description is maintained in 6 different languages, but for few materials, only 3 or 4 are maintained. So when user queries, keeping the language as EN, he wont be able to see a few records. So i want to put a code in the query, where it checks if language is maintained in EN first, if it is there then output the record, if not then check if FR is maintained & so on, so that the user can view the material details atleast in one language. So can anyone help me with this code? Hope my question is clear. Await inputs
Vivek

Msg for Mr. Guy,
When i entered the code mentioned by you in 'Recording Processing' of SQ01, i get the following error when i tried to generate the infoset
Global syntax check
GET / GET LATE code / Code for Record Processing
Error in code for record processing
Incorrect logical expression: Comparison / SELECT-OPTION can only be followed by "AND", "OR" or ")"
Msg for Mr. Mahesh,
When i entered the code mentioned by you in 'Recording Processing' of SQ01, i get the following error when i tried to generate the infoset
Global syntax check
GET / GET LATE code / Code for Record Processing
Error in code for record processing
Field list without INTO clause is not allowed. itab "OR" INTO (f1....fn)" is not allowed
Kindly let me know what should i do?
Vivek

Similar Messages

  • Pulling the condition records - help in the ABAP code -urgent!!!!!

    hi folks,
    I need some urgent help here..
    I have discussed this portion before in the forum  but there are some changes and I need some help here.
    The code goes like this....
    select knumv kschl kbetr kwert
      from konv into table cdata
         for all entries in bodyitab21
        where konv~knumv = bodyitab21-knumv
                     and konv~kwert > 0.
    I am successfully pulling the data into cdata here..
    I need to check for various condition types that are around 100. I need to split them into two types because some condition types containe just pricing values while some others have values in % (but the value not stored in that format) To do the extra coding I have use two differetn case statements and that's what i have done here.
    <b>My probelm is I will have to check for each condition type, if the 'kwert' field has some value in it pull the data  and there is a condition text associcated to it in the table 'T685T' that needs to be pulled into the itab.
    This process has to be done for every condition type.</b>Given this scenario how can i do it?
        loop at cdata  into wac.
        case wac-kschl.
             when 'ZRAT' OR 'ZAGR'  OR 'ZRCR' OR 'Y098' OR 'Y007' OR 'ZREW' OR 'Y106' OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124' OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD' OR 'Y215' OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD' OR 'ZTHX' OR 'ZCOL'
    OR 'ZCFE' OR ZSPA' OR 'ZBOX' OR 'ZCOR' OR 'Y130' OR 'ZBOR'
    OR 'Y108' OR 'ZFPP' OR 'Y204' OR 'Y200' OR 'Y202' OR 'Y201' OR 'Y203' OR 'Y002' OR 'ZSCR' OR 'Y128' OR 'Y100' OR 'ZABS' OR 'ZSMG' OR 'ZFRE' OR 'ZREC' OR 'ZCOM' OR 'ZPMG' OR 'BEMG' OR 'ZDTI' OR'ZBET'.
    <b>***** the first set of these condition types have just values</b>     if wac-kbetr = ' ' AND wac-kwert = ' '.
                   continue.
                 else.
                  p = wac-kbetr.
                  i = p.
                  c = i.
                  MOVE c to w_accitab-zrate.
                     MOVE wac-kbetr to w_accitab-zrate.
                  MOVE wac-kwert to w_accitab-zsubtotal.
                endif.
        when 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR'
         OR 'ZECD' 'ZAC1' OR 'ZAC%' OR 'ZAC2' OR 'ZSED' OR 'ZRFQ' OR 'ZIMP' OR 'ZERR' OR 'ZECD' 'ZQUD' OR 'ZEMP' OR 'Y101' OR 'Y012' OR 'ZCHU' OR 'Y054' OR 'Y065' OR 'Y066' OR 'Y067' OR 'Y068' OR 'Y069' OR 'Y096'
    OR 'Y103' OR 'Y010' OR 'Y070' OR 'Y071' OR
    'Y072' OR 'Y073' OR 'Y074' OR 'Y075' OR 'Y076'
    OR 'Y077' OR 'Y078' OR 'Y079' OR 'Y156' OR OR 'Y148'
    OR 'Y102' OR 'Y205' OR 'Y206' OR 'Y207' OR 'Y208' OR
    'Y209' OR 'Y213' OR 'Y210' OR 'Y211' OR 'Y212' OR 'Z%DS'
    OR 'Z%DO' OR 'Y113' OR 'Y151' OR 'Y152' OR 'Y153' OR
    'Y154' OR 'Y155' OR 'Y147' OR'Z%PB' OR 'Y142' OR 'Y131'
    OR 'Y141' OR 'Y149' OR 'ZDEO' OR 'Z%DR' OR 'Y115' OR
    'Y116' OR 'Y095' OR 'Y084' OR 'ZSA$' OR 'ZSA%' OR
    'ZPA$' OR 'ZPA%'.
    the second set of these condition types have just values that has to be converted into %.
               if wac-kbetr = ' ' AND wac-kwert = ' '.
                clear w_accitab-zrate.
                continue.
              else.
                p = wac-kbetr.
                p = p / 10.
                if p < 1.
                  rate+0(1) = '-'.
                endif.
                if i = 0.
                  clear w_accitab-zrate.
                 else.
                i = p.
                c = i.
                shift c right deleting trailing '-'.
                concatenate rate c '%' into rate.
                condense rate no-gaps.
                     MOVE wac-kbetr to w_accitab-zrate.
                MOVE rate to w_accitab-zrate.
                clear rate.
                MOVE wac-kwert to w_accitab-zsubtotal.
              endif.
            endif.
    Thanks alot in advance.
    Santhosh

    Maybe this will help you,  otherwise I'm missing something.
    [code]
    data: begin of wac,
          kschl type t685t-kschl,
          vtext type t685t-vtext,
          end of wac.
    case wac-kschl.
    when 'ZRAT' or 'ZAGR' or 'ZRCR' or 'Y098' or 'Y007' or 'ZREW' or 'Y106'
    or 'ZTSR' or 'Y127' or 'Y125' or 'Y126' or 'Y124' or 'Y157' or 'Y092' or
      'Y085' or 'Y090' or 'ZMZD' or 'Y215' or 'Y214' or 'Y111' or 'ZC$D' or
         'ZAUD' or 'ZTHX' or 'ZCOL' or 'ZCFE' or 'ZSPA' or 'ZBOX' or 'ZCOR'
    or 'Y130' or 'ZBOR' or 'Y108' or 'ZFPP' or 'Y204' or 'Y200' or 'Y202' or
      'Y201' or 'Y203' or 'Y002' or 'ZSCR' or 'Y128' or 'Y100' or 'ZABS' or
         'ZSMG' or 'ZFRE' or 'ZREC' or 'ZCOM' or 'ZPMG' or 'BEMG' or 'ZDTI'
            or'ZBET'.
    Some code
      when 'ZSED' or 'ZRFQ' or 'ZIMP' or 'ZERR'
    or 'ZECD' or 'ZAC1' or 'ZAC%' or 'ZAC2' or 'ZSED' or 'ZRFQ' or 'ZIMP' or
      'ZERR' or 'ZECD' or 'ZQUD' or 'ZEMP' or 'Y101' or 'Y012' or 'ZCHU' or
      'Y054' or 'Y065' or 'Y066' or 'Y067' or 'Y068' or 'Y069' or 'Y096'
      or 'Y103' or 'Y010' or 'Y070' or 'Y071' or
      'Y072' or 'Y073' or 'Y074' or 'Y075' or 'Y076'
      or 'Y077' or 'Y078' or 'Y079' or 'Y156' or 'Y148'
      or 'Y102' or 'Y205' or 'Y206' or 'Y207' or 'Y208' or
      'Y209' or 'Y213' or 'Y210' or 'Y211' or 'Y212' or 'Z%DS'
      or 'Z%DO' or 'Y113' or 'Y151' or 'Y152' or 'Y153' or
      'Y154' or 'Y155' or 'Y147' or'Z%PB' or 'Y142' or 'Y131'
      or 'Y141' or 'Y149' or 'ZDEO' or 'Z%DR' or 'Y115' or
      'Y116' or 'Y095' or 'Y084' or 'ZSA$' or 'ZSA%' or
      'ZPA$' or 'ZPA%'.
    Some code
    endcase.
    select single vtext into wac-vtext from t685t
                  where spras = sy-langu
                    and kschl = wac-kschl.
    write:/ wac-kschl, wac-vtext.
    [/code]
    Regards,
    Rich Heilman

  • Check code ( urgent help needed from ABAP guys working on FI/CO)

    hi all,
    check my code & give me solution for getting only offsetting acounts depending on particular HKONT.
    plz i need its solution urgently.
    REPORT zglaccline NO STANDARD PAGE HEADING                              
                       LINE-SIZE 300                                         
                       LINE-COUNT 65(3).                                                                               
    TABLES : bkpf, bseg.                                                                               
    DATA : BEGIN OF it_bkpf OCCURS 0,                                       
            bukrs LIKE bkpf-bukrs,                                           
            belnr LIKE bkpf-belnr,                                           
            gjahr LIKE bkpf-gjahr,                                           
            monat LIKE bkpf-monat,                                           
            budat LIKE bkpf-budat,                                           
            brnch LIKE bkpf-brnch,                                           
            xblnr LIKE bkpf-xblnr,                                           
            waers LIKE bkpf-waers,                                           
            END OF it_bkpf.                                                                               
    DATA : BEGIN OF it_bseg OCCURS 0,                                        
    gsber LIKE bseg-gsber,                                                   
    hkont LIKE bseg-hkont,                                                   
    kunnr LIKE bseg-kunnr,                                                   
    sgtxt LIKE bseg-sgtxt,                                                   
    bschl LIKE bseg-bschl,                                                   
    wrbtr LIKE bseg-wrbtr,                                                   
    dmbtr LIKE bseg-dmbtr,                                                   
    pswsl LIKE bseg-pswsl,                                                   
    kostl LIKE bseg-kostl,                                                   
    prctr LIKE bseg-prctr,                                                   
    aufnr LIKE bseg-aufnr,                                                   
    shkzg LIKE bseg-shkzg,                                                   
    augbl LIKE bseg-augbl,                                                   
    END OF it_bseg.                                                                               
    DATA : BEGIN OF it_res OCCURS 0,                                           
    bukrs LIKE bkpf-bukrs,                                                    
    gjahr LIKE bkpf-gjahr,                                                    
    monat LIKE bkpf-monat,                                                    
    belnr LIKE bkpf-belnr,                                                    
    budat LIKE bkpf-budat,                                                    
    brnch LIKE bkpf-brnch,                                                    
    gsber LIKE bseg-gsber,                                                    
    hkont LIKE bseg-hkont,                                                    
    kunnr LIKE bseg-kunnr,                                                    
    bschl LIKE bseg-bschl,                                                    
    prctr LIKE bseg-prctr,                                                    
    kostl LIKE bseg-kostl,                                                    
    aufnr LIKE bseg-aufnr,                                                    
    pswsl LIKE bseg-pswsl,                                                    
    wrbtr LIKE bseg-wrbtr,                                                                               
    waers LIKE bkpf-waers,                                                 
    dmbtr LIKE bseg-dmbtr,                                                 
    xblnr LIKE bkpf-xblnr,                                                 
    txt50 LIKE skat-txt50,                                                 
    sgtxt LIKE bseg-sgtxt,                                                 
    shkzg LIKE bseg-shkzg,                                                 
    END OF it_res.                                                                               
    DATA : BEGIN OF itab_head OCCURS 0,                                     
           name1(20) TYPE c,                                                
           END OF itab_head.                                                
    SELECTION-SCREEN BEGIN OF BLOCK b_2 WITH FRAME TITLE text-002.          
    PARAMETERS : p_sel1 RADIOBUTTON GROUP sel,                              
                 p_sel2 RADIOBUTTON GROUP sel,                              
                 p_sel3 RADIOBUTTON GROUP sel.                              
    SELECTION-SCREEN END OF BLOCK b_2.                                      
    SELECTION-SCREEN SKIP 1.                                                
    SELECTION-SCREEN BEGIN OF BLOCK b_1 WITH FRAME TITLE text-001.          
    PARAMETER p_bukrs LIKE bkpf-bukrs DEFAULT 'ML' OBLIGATORY.              
    SELECT-OPTIONS : s_belnr FOR bkpf-belnr.                                
    SELECT-OPTIONS : s_gjahr FOR bkpf-gjahr OBLIGATORY.                     
    SELECT-OPTIONS : s_monat FOR bkpf-monat.                                
    SELECT-OPTIONS : s_blart FOR bkpf-blart.                                
    SELECT-OPTIONS : s_budat FOR bkpf-budat.                                
    SELECT-OPTIONS : s_waers FOR bkpf-waers.                                
    SELECT-OPTIONS : s_hkont FOR bseg-hkont.                                
    SELECT-OPTIONS : s_bldat FOR bkpf-bldat.                                
    SELECTION-SCREEN END OF BLOCK b_1.                                                                               
    SELECT bukrs belnr gjahr monat budat brnch xblnr waers                  
       INTO CORRESPONDING FIELDS OF TABLE it_bkpf                           
       FROM bkpf                                                            
       WHERE bukrs = p_bukrs                                                
       AND belnr IN s_belnr                                                 
       AND gjahr IN s_gjahr                                                 
       AND monat IN s_monat                                                 
       AND blart IN s_blart                                                 
       AND budat IN s_budat                                                 
       AND bldat IN s_bldat                                                 
       AND waers IN s_waers.                                                                               
    IF NOT it_bkpf[] IS INITIAL.                                            
      LOOP AT it_bkpf.                                                      
    IF p_sel1 = 'X'.                                                        
        SELECT gsber hkont kunnr sgtxt bschl wrbtr pswsl kostl shkzg        
                            dmbtr prctr aufnr augdt augbl                               
           INTO CORRESPONDING FIELDS OF TABLE it_bseg                       
           FROM bseg                                                        
           WHERE bukrs = it_bkpf-bukrs                                      
           AND belnr   = it_bkpf-belnr                                      
           AND gjahr   = it_bkpf-gjahr                                      
           AND pswsl   = it_bkpf-waers                                      
           AND hkont  IN s_hkont.                                           
    ELSEIF p_sel2 = 'X'.                                                    
        SELECT gsber hkont kunnr sgtxt bschl wrbtr pswsl kostl shkzg        
                dmbtr prctr aufnr augdt augbl                               
           INTO CORRESPONDING FIELDS OF TABLE it_bseg                       
           FROM bseg                                                        
           WHERE bukrs = it_bkpf-bukrs                                      
           AND belnr   = it_bkpf-belnr                                      
           AND gjahr   = it_bkpf-gjahr                                      
           AND pswsl   = it_bkpf-waers.                                    
          AND koart <> 'S'.                                              
    ENDIF.                                                                 
        IF sy-subrc EQ 0.                                                  
          LOOP AT it_bseg.                                                 
            SELECT SINGLE txt50 INTO it_res-txt50                          
                 FROM skat                                                 
                 WHERE spras = 'EN'                                        
                 AND   ktopl = 'PCA'                                       
                 AND   saknr = it_bseg-hkont.                                                                               
    it_res-bukrs = it_bkpf-bukrs.                                  
            it_res-gjahr = it_bkpf-gjahr.                                  
            it_res-monat = it_bkpf-monat.                                  
            it_res-gsber = it_bseg-gsber.                                  
            it_res-belnr = it_bkpf-belnr.                                  
            it_res-budat = it_bkpf-budat.                                  
            it_res-brnch = it_bkpf-brnch.                                  
            it_res-kunnr = it_bseg-kunnr.                                  
            it_res-hkont = it_bseg-hkont.                                  
            it_res-sgtxt = it_bseg-sgtxt.                                  
            it_res-bschl = it_bseg-bschl.                                  
            it_res-wrbtr = it_bseg-wrbtr.                                  
            it_res-pswsl = it_bseg-pswsl.                                  
            it_res-waers = it_bkpf-waers.                                  
            it_res-dmbtr = it_bseg-dmbtr.                                  
            it_res-kostl = it_bseg-kostl.                                  
            it_res-prctr = it_bseg-prctr.                                  
            it_res-aufnr = it_bseg-aufnr.                                  
            it_res-shkzg = it_bseg-shkzg.                                  
           it_res-augbl = it_bseg-augbl.                                 
            it_res-xblnr = it_bkpf-xblnr.                                  
            APPEND it_res.                                                 
            CLEAR it_res.                                                  
          ENDLOOP.                                                         
          CLEAR it_bkpf.                                                   
        ENDIF.                                                             
      ENDLOOP.                                                             
    ENDIF.                                                                 
    LOOP AT it_res.                                                        
      IF it_res-shkzg EQ 'H'.                                              
        it_res-wrbtr = it_res-wrbtr * -1.                                  
        it_res-dmbtr = it_res-dmbtr * -1.                                  
      ENDIF.                                                               
      WRITE : /2(4) it_res-bukrs,                                          
               13(4) it_res-gjahr,                                         
               21(2) it_res-monat,                                         
               31(10) it_res-belnr,                                        
               44(10) it_res-budat,                                        
               55(4) it_res-brnch,                                         
               60(4) it_res-gsber,                                          
               70(10) it_res-hkont,                                         
               82(10) it_res-kunnr,                                         
               94(2) it_res-bschl,                                          
               104(10) it_res-prctr,                                        
              116(10)  it_res-kostl,                                        
              128(12)  it_res-aufnr,                                        
              142(5)  it_res-pswsl,                                         
              148(13)  it_res-wrbtr,                                        
              164(5)  it_res-waers,                                         
              170(13)  it_res-dmbtr,                                        
             187(16)   it_res-xblnr,                                        
              205(50)  it_res-sgtxt.                                        
      MODIFY it_res.                                                        
      CLEAR it_res.                                                         
    ENDLOOP.                                                                
    plz give soltuion i am looking for it.
    i will aslo reward all ur precious effort.
    otherwise if anyone have any code on my reqirement then plz send it to me in my id- [email protected]
    thanks
    Message was edited by: sanjeev singh

    Hi
    You should a selection in BSIS and BSAS table instead of BKPF and BSEG:
    DATA : BEGIN OF it_res OCCURS 0,
    bukrs LIKE bkpf-bukrs,
    gjahr LIKE bkpf-gjahr,
    monat LIKE bkpf-monat,
    belnr LIKE bkpf-belnr,
    budat LIKE bkpf-budat,
    brnch LIKE bkpf-brnch,
    gsber LIKE bseg-gsber,
    hkont LIKE bseg-hkont,
    kunnr LIKE bseg-kunnr,
    bschl LIKE bseg-bschl,
    prctr LIKE bseg-prctr,
    kostl LIKE bseg-kostl,
    aufnr LIKE bseg-aufnr,
    pswsl LIKE bseg-pswsl,
    wrbtr LIKE bseg-wrbtr,
    waers LIKE bkpf-waers,
    dmbtr LIKE bseg-dmbtr,
    xblnr LIKE bkpf-xblnr,
    txt50 LIKE skat-txt50,
    sgtxt LIKE bseg-sgtxt,
    shkzg LIKE bseg-shkzg,
    END OF it_res.
    Open Item
    SELECT *
    INTO CORRESPONDING FIELDS OF TABLE it_res
    FROM <b>BSIS</b>
    WHERE bukrs = p_bukrs
    <b>AND HKONT IN S_HKONT</b>
    AND belnr IN s_belnr
    AND gjahr IN s_gjahr
    AND monat IN s_monat
    AND blart IN s_blart
    AND budat IN s_budat
    AND bldat IN s_bldat
    AND waers IN s_waers.
    Cleared Item
    SELECT *
    APPENDING CORRESPONDING FIELDS OF TABLE it_res
    FROM <b>BSAS</b>
    WHERE bukrs = p_bukrs
    <b>AND HKONT IN S_HKONT</b>
    AND belnr IN s_belnr
    AND gjahr IN s_gjahr
    AND monat IN s_monat
    AND blart IN s_blart
    AND budat IN s_budat
    AND bldat IN s_bldat
    AND waers IN s_waers.
    Max
    Message was edited by: max bianchi

  • PRT file doesn't work (printer codes) (urgent)

    Hi,
    I've got a small problem using a custom prt file for printing reports on a Epson TM-T88 printer.
    I'm trying to use the printer codes which are in the programming manual of the Epson printer for cutting the paper.
    But it doesn't work.
    This is the prt-file:
    printer "kassabon"
    before report esc "@"
    after report dec (27) dec (86) 1 dec (27) dec (105)
    Who can solve this problem?
    It's very urgent.
    Thanks in advance!
    null

    Nobody?

  • Diff in OPU3 and OPU5 T-codes - urgent

    Dear All,
    Can you please tell me the diff bet OPU3 and OPU5 t codes..........as there is common setting for  SCHEDULING CONTROL FOR DETAIL SCHEDULING section.........i.e for Scheduling type and Start in Past..........if this setting in both T-code are made different , then system will consider which one while scheduling..............waiting for your experts opinion on urgent basic..........
    Best Regards
    Sharad

    hi Pradeep,
    Thanks for reply..........Actually I want schedule now planned orders........I am using planning strategy 40 for hight level FERTt material and 70 for HALB lower lever assy........with mixed indicator 1..........so that with mixed indicator I am trying to get fixed pegging relationship between finshed product and assy planned order..........But eariler my settings were to start in past say 5 days for order in OPU5........with backward scheduling.......but because of this I am start dates for planned orders were getting in past...............Then I removed setting 5 days to 0 days for "Start in past" so that system will go backward for scheduling and then start forward automatically if start date is going in past.........and it should moved all order with their pegging relationship.................This is the reason I raised question saying difference in both code........as I had not changed setting in OPU3............
                          But my problem is that system is doing scheduling and when dates are calculated by backwards and determined dates are going backwards i.e. in past then scheduling is going again forward and this is I want......but start date for order assy level all orders are from today's date........But actually I want to shift all assy level orders with pegging relationship............which is not happening.........pl guide if have any idea............thanks in advance........
    Best Regards
    Sharad

  • Query Not displaying data for a particluar Cost centre code(urgent) !!!!!!

    Hi Folks,
    I have an infoset which is on top of two ODSs.
    Data for a particular cost center code present in both the ODSs.
    There is no data prsent in RSISET for that CC.
    Also the query is not showing any data for that CC.
    Data is not showin in RSRT for that CC ,but the SQL stament is getting generated  for that CC.
    Already Checked the infoset key fileds settings and all....
    Y its happening like this any ideas???
    Need your help buddies urgent issue.

    Please check weather the links are established between the info objects properly in the infoset.

  • Debugging virtual characterstics code--Urgent

    Hi All,
    I am not able to debug the code written for virtual characterstics.
    Uisng RSRT, I tried to debug.I have put break points also in the code.
    But it is not going to the code I have written.
    Please help me reagrding this.
    This is very urgent.
    Thanks in advance!

    Where have u written the code for vir char?
    Are u using BADI ?

  • Discount Condition type is picking Tax Code(URGENT)

    Dear All,
    I have a very serious problem on Condition types and Tax codes.
    I have configured the pricing procedure with two taxes (China).
    Sr.No   Condition Type    TAX Code
    1               VAT                  V7
    2.             CONC                V6
    Now, If i will give some Customer discount Condition type then System is picking picking Tax code as V7.For that i have not maintanied any Condition records in VK11.
    What should be the reason for this?
    Since it is very Urgent Issue,Please Guide me on the same
    Thanks
    Vinay

    Have you run the country installation program before you started the customisation. This is supposed to install the entire information required to configure the tax scenarios for the particular country. If you are trying to create the tax codes and the procedureson the vanilla system, then you need to work very closely with FI because the posting for tax is done from the tax procedure in FI. As an SD or MM consultant we are only interested in the Taxes on sales and purchases and their customisation. The procedure and the Tax codes are created in FI.
    This is the first thing that is normally done after you copy client 000 to start your customisation. The coountry installation program does not run if you ahve made changes to the client.
    regards
    Jude

  • Please suggest a correction in the code: Urgent

    I am capturing the Material Document No., Material No., Material Description, Quantity etc. into a main_table in my code so as to write/print labels containing GRN details (movement type '105') using se38. These labels are to be pasted on the material received in stores, the exact requirement is 100% material identification sticker on all items to maintain FIFO. Obviously the no. of these stickers, to be printed, shall solely depend on the Quantity of a particular material received.
    I have written the following piece of code to print the captured information of GRN. The problem is that my code is unable to track the change in material document number. For example if I have 10 nos of quantity for a particular material say 1001 and 5 no.s of quantity for a subsequent material 1002. I should get 10 labels for 1001 and 5 for 1002 but my code is giving me 10 labels for 1002 also.
    Hope you got it.
    Please suggest the necessary correction on the following code.You can execute the following code and get a real time feeling of my problem.
    REPORT  ZMM_GRN_LABEL_REPORT_38.
    TABLES : MKPF, MSEG, MAKT.
    DATA : BEGIN OF I_MKPF OCCURS 0,
           MBLNR LIKE MSEG-MBLNR,
           BLDAT LIKE MKPF-BLDAT,
           MJAHR LIKE MKPF-MJAHR,
           END OF I_MKPF.
    DATA : BEGIN OF I_MSEG OCCURS 0,
           MBLNR LIKE MSEG-MBLNR,
           MATNR LIKE MSEG-MATNR,
           EBELN LIKE MSEG-EBELN,
           LIFNR LIKE MSEG-LIFNR,
           MENGE LIKE MSEG-MENGE,
           END OF I_MSEG.
    DATA : BEGIN OF I_MAKT OCCURS 0,
           MATNR LIKE MAKT-MATNR,
           MAKTX LIKE MAKT-MAKTX,
           END OF I_MAKT.
    DATA : BEGIN OF I_LFA1 OCCURS 0,
           LIFNR LIKE LFA1-LIFNR,
           NAME1 LIKE LFA1-NAME1,
           END OF I_LFA1.
    DATA: BEGIN OF MAIN_TABLE OCCURS 0,
          MBLNR LIKE MSEG-MBLNR,
          MATNR LIKE MSEG-MATNR,
          BLDAT LIKE MKPF-BLDAT,
          MAKTX LIKE MAKT-MAKTX,
          MENGE LIKE MSEG-MENGE,
          MJAHR LIKE MSEG-MJAHR,
          EBELN LIKE MSEG-EBELN,
          LIFNR LIKE MSEG-LIFNR,
          NAME1 LIKE LFA1-NAME1,
          END OF MAIN_TABLE.
    DATA : N LIKE MSEG-MENGE.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_MBLNR FOR MSEG-MBLNR.
    PARAMETERS : P_GJAHR LIKE MSEG-GJAHR.
    SELECTION-SCREEN END OF BLOCK B1.
    select MBLNR MJAHR BLDAT
    into corresponding fields of
    table I_MKPF
    from Mkpf
    where
    MBLNR in S_MBLNR and
    MJAHR EQ p_GJAHR.
    LOOP AT I_MKPF.
    MAIN_TABLE-MBLNR = I_MKPF-MBLNR.
    MAIN_TABLE-MJAHR = I_MKPF-MJAHR.
    MAIN_TABLE-BLDAT = I_MKPF-BLDAT.
    APPEND MAIN_TABLE.
    CLEAR MAIN_TABLE.
    ENDLOOP.
    IF I_MKPF[] IS NOT INITIAL.
    SELECT MBLNR MATNR EBELN LIFNR MENGE
    INTO CORRESPONDING FIELDS OF
    TABLE I_MSEG FROM
    MSEG
    FOR ALL ENTRIES IN I_MKPF
    WHERE
    MBLNR = I_MKPF-MBLNR.
    ENDIF.
    LOOP AT I_MSEG.
    LOOP AT MAIN_TABLE WHERE MBLNR = I_MSEG-MBLNR.
    MAIN_TABLE-MATNR = I_MSEG-MATNR.
    MAIN_TABLE-EBELN = I_MSEG-EBELN.
    MAIN_TABLE-LIFNR = I_MSEG-LIFNR.
    MAIN_TABLE-MENGE = I_MSEG-MENGE.
    MODIFY MAIN_TABLE INDEX SY-TABIX.
    ENDLOOP.
    ENDLOOP.
    IF I_MSEG[] IS NOT INITIAL.
    SELECT MATNR MAKTX
    INTO CORRESPONDING FIELDS OF
    TABLE I_MAKT FROM MAKT
    WHERE
    MATNR = I_MSEG-MATNR.
    ENDIF.
    LOOP AT I_MAKT.
    LOOP AT MAIN_TABLE WHERE MATNR = I_MAKT-MATNR.
    MAIN_TABLE-MAKTX = I_MAKT-MAKTX.
    MODIFY MAIN_TABLE INDEX SY-TABIX.
    ENDLOOP.
    ENDLOOP.
    IF I_MSEG[] IS NOT INITIAL.
    SELECT LIFNR NAME1
    INTO CORRESPONDING FIELDS OF
    TABLE I_LFA1 FROM LFA1
    FOR ALL ENTRIES IN I_MSEG
    WHERE
    LIFNR = I_MSEG-LIFNR.
    ENDIF.
    LOOP AT I_LFA1.
    LOOP AT MAIN_TABLE WHERE LIFNR = I_LFA1-LIFNR.
    MAIN_TABLE-NAME1 = I_LFA1-NAME1.
    MODIFY MAIN_TABLE INDEX SY-TABIX.
    ENDLOOP.
    ENDLOOP.
    ******************************Problem lies somewhere here
    N = MAIN_TABLE-MENGE.
    DO N TIMES.
    SORT MAIN_TABLE BY MBLNR.
    LOOP AT MAIN_TABLE.
    WRITE :/5 MAIN_TABLE-MBLNR.
    WRITE :/5 MAIN_TABLE-MAKTX, 50 MAIN_TABLE-MATNR.
    ENDLOOP.
    ENDDO.

    Hello,
    Take one new table with three fields ie. it_no with mblnr, matnr and menge.
    collect data to new table form main_table.
    and replace your doubtful code by
    SORT MAIN_TABLE BY MBLNR.
    loop at it_no.
    N = it_no-MENGE.
    DO N TIMES.
    LOOP AT MAIN_TABLE where matnr = it_no-matnr.
    WRITE :/5 MAIN_TABLE-MBLNR.
    WRITE :/5 MAIN_TABLE-MAKTX, 50 MAIN_TABLE-MATNR.
    ENDLOOP.
    ENDDO.
    endloop.
    regards,
    Naimesh

  • Problem in Filling Pool, In ConnectionPooling Code:Urgent Plz

    Hi All,
    I m using this program for Connection Pooling.
    import java.sql.*;
    import javax.sql.*;
    import java.util.*;
    import java.io.*;
    import javax.naming.*;
    public class ConnectionPool implements Runnable{
      private DataSource datasource;
      private int maxConnections;
      private int initialConnections;
      private boolean waitIfBusy;
      private boolean connectionPending = false;
      private Vector<java.sql.Connection> availableConnections;
      private Vector<java.sql.Connection> busyConnections;
      public ConnectionPool()throws SQLException {
        try{
             Context ic = new InitialContext();
              this.datasource = (DataSource)ic.lookup("java:msgds");                    
              System.out.println("DataSource Found msgds");
         }catch(Exception e){
              System.out.println("Error in ConnectionPool COnstructor While Locatin ashishds");
        this.waitIfBusy = true;   
        this.waitIfBusy = waitIfBusy;
        this.maxConnections = 5;
        this.initialConnections = 2;
        availableConnections = new Vector<java.sql.Connection>(2);
        busyConnections = new Vector<java.sql.Connection>();
        for(int i=0; i<initialConnections; i++) {
          availableConnections.addElement(makeNewConnection());
      public synchronized Connection getConnection()
          throws SQLException {
        if (!availableConnections.isEmpty()) {
          Connection existingConnection =
            (Connection)availableConnections.lastElement();
          int lastIndex = availableConnections.size() - 1;
          availableConnections.removeElementAt(lastIndex);
          // If connection on available list is closed (e.g.,
          // it timed out), then remove it from available list
          // and repeat the process of obtaining a connection.
          // Also wake up threads that were waiting for a
          // connection because maxConnection limit was reached.
          if (existingConnection.isClosed()) {
            notifyAll(); // Freed up a spot for anybody waiting
            return(getConnection());
          } else {
            busyConnections.addElement(existingConnection);
            return(existingConnection);
        } else {
          // Three possible cases:
          // 1) You haven't reached maxConnections limit. So
          //    establish one in the background if there isn't
          //    already one pending, then wait for
          //    the next available connection (whether or not
          //    it was the newly established one).
          // 2) You reached maxConnections limit and waitIfBusy
          //    flag is false. Throw SQLException in such a case.
          // 3) You reached maxConnections limit and waitIfBusy
          //    flag is true. Then do the same thing as in second
          //    part of step 1: wait for next available connection.
          if ((totalConnections() < maxConnections) &&
              !connectionPending) {
            makeBackgroundConnection();
          } else if (!waitIfBusy) {
            throw new SQLException("Connection limit reached");
          // Wait for either a new connection to be established
          // (if you called makeBackgroundConnection) or for
          // an existing connection to be freed up.
          try {
            wait();
          } catch(InterruptedException ie) {}
          // Someone freed up a connection, so try again.
          return(getConnection());
      // You can't just make a new connection in the foreground
      // when none are available, since this can take several
      // seconds with a slow network connection. Instead,
      // start a thread that establishes a new connection,
      // then wait. You get woken up either when the new connection
      // is established or if someone finishes with an existing
      // connection.
      private void makeBackgroundConnection() {
        connectionPending = true;
        try {
          Thread connectThread = new Thread(this);
          connectThread.start();
        } catch(OutOfMemoryError oome) {
          // Give up on new connection
      public void run() {
        try {
          Connection connection = makeNewConnection();
          synchronized(this) {
            availableConnections.addElement(connection);
            connectionPending = false;
            notifyAll();
        } catch(Exception e) { // SQLException or OutOfMemory
          // Give up on new connection and wait for existing one
          // to free up.
      // This explicitly makes a new connection. Called in
      // the foreground when initializing the ConnectionPool,
      // and called in the background when running.
      private Connection makeNewConnection()
          throws SQLException {
        try {    
          // Establish network connection to database
          Connection connection = datasource.getConnection();
          return(connection);
        } catch(Exception cnfe) {
          // Simplify try/catch blocks of people using this by
          // throwing only one exception type.
          throw new SQLException("Error in makeNewConnection() : " +cnfe);
      public synchronized void free(Connection connection) {
        busyConnections.removeElement(connection);
        availableConnections.addElement(connection);
        // Wake up threads that are waiting for a connection
        notifyAll();
      public synchronized int totalConnections() {
        return(availableConnections.size() +
               busyConnections.size());
      /** Close all the connections. Use with caution:
       *  be sure no connections are in use before
       *  calling. Note that you are not <I>required</I> to
       *  call this when done with a ConnectionPool, since
       *  connections are guaranteed to be closed when
       *  garbage collected. But this method gives more control
       *  regarding when the connections are closed.
      public synchronized void closeAllConnections() {
        closeConnections(availableConnections);
        availableConnections = new Vector<java.sql.Connection>();
        closeConnections(busyConnections);
        busyConnections = new Vector<java.sql.Connection>();
      private void closeConnections(Vector connections) {
        try {
          for(int i=0; i<connections.size(); i++) {
            Connection connection =
              (Connection)connections.elementAt(i);
            if (!connection.isClosed()) {
              connection.close();
        } catch(SQLException sqle) {
          // Ignore errors; garbage collect anyhow
      public synchronized String toString() {
        String info =
          "ConnectionPool(Data Source is :"+datasource+ ")" +
          ", available=" + availableConnections.size() +
          ", busy=" + busyConnections.size() +
          ", max=" + maxConnections;
        return(info);
    }To Test This code, I had created one Servlet. In This Servlet I m calling like this:
    in
    init(){
         connectionPool = new ConnectionPool();
    }in
    in
    service(){
         private ConnectionPool connectionPool=null;
         connection = connectionPool.getConnection();
    }in destroy of
    destroy{
         if(connectionPool != null){
                  connectionPool.closeAllConnections();     
    }The Problem is that, Many a times it work, many a times it shows following Error:
    09:56:35,109 WARN  [JBossManagedConnectionPool] Unable to fill pool
    org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException:
    Listener refused the connection with the following error:
    ORA-12516, TNS:listener could not find available handler with matching protocol stack
    The Connection descriptor used by the client was:
    192.168.1.8:1521
            at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFa
    ctory.java:177)
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConn
    ectionPool.java:539)
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:486)
            at org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:74)
            at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12516, TNS:listener could not find available handler with matching protocol stack
    The Connection descriptor used by the client was:
    192.168.1.8:1521
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
            at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
            at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
            at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
            at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
            at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFa
    ctory.java:169)
            ... 4 moreI M using JBoss 4.0, With OracleXE. I had defined my DataSource-> msgds in mydb-ds.xml of deploy folder of JBoss.
    which is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <datasources>
      <local-tx-datasource>
        <jndi-name>msgds</jndi-name>
        <connection-url>jdbc:oracle:thin:@192.168.1.8:1521</connection-url>   
        <driver-class>oracle.jdbc.OracleDriver</driver-class>
        <!-- The login and password -->
        <user-name>ashish</user-name>
        <password>ashish</password>
        <min-pool-size>5</min-pool-size>
        <max-pool-size>100</max-pool-size>
        <idle-timeout-minutes>0</idle-timeout-minutes>
      </local-tx-datasource>
    </datasources>I want to know whether This is a right approach to do Connection Pooling. How can I implement this Using Commons.
    What changes i need to made in my mydb-ds.xml if I use Commons Package and also in the code.

    never ask for help to be sent to your email, always post in this thread so that if someone else has the same question they can get the help too.
    this should help get you started... just make sure you get the apache dbcp package (you may need some commons things too, like commons pool)
    private BasicDataSource dataSource;
    * This function actually initializes the datasource, which is
    * in charge of setting up the BasicDataSource, which handles
    * all the database pooling.
    protected synchronized void initDataSource() {
         loadProperties(); // this loads my database properties from a config file
         try {
              dataSource = new BasicDataSource();
              dataSource.setDefaultAutoCommit(true);
              dataSource.setDefaultCatalog(catalogName);
              dataSource.setDriverClassName(jdbcDriver);
              dataSource.setUsername(jdbcUserID);
              dataSource.setPassword(jdbcPassword);
              dataSource.setUrl(jdbcURL);
              dataSource.setMinIdle(minCons);
              dataSource.setMaxIdle(maxCons);
              dataSource.setMaxActive(maxCons);
              dataSource.setMaxWait(5000); // milliseconds to wait for connection if none are available
              dataSource.setAccessToUnderlyingConnectionAllowed(true);
              // will validate each connection before handing it out
              dataSource.setTestOnBorrow(true);
              dataSource.setValidationQuery("select getDate()");
              // setup to test idle objects in the pool
              dataSource.setTestWhileIdle(true);
              dataSource.setTimeBetweenEvictionRunsMillis(600000); // run every 10 minutes
              dataSource.setMinEvictableIdleTimeMillis(60000);  // only examine connections idle for more than 10 minutes
              dataSource.setNumTestsPerEvictionRun(-3); // when this is negative one Nth of connections will be examined
         } catch (Exception e) {
              //whatever you want
    public Connection getConnection() {
         try {
              Connection con = dataSource.getConnection();
              if(con == null) {
                   throw new Exception("Error: DataSource gave a null connection object");
              return con;
         } catch (Exception e) {
              // whatever
    public void freeConnection(Connection con) {
         freeConnection(con, false);
    public void freeConnection(Connection con, boolean isError) {
         try {
              if(con == null) return;
              if(!con.isClosed()) {
                   if(isError && !con.getAutoCommit()) {
                        con.rollback();
                   con.clearWarnings();
                   con.close(); // this adds the con back to the pool
         } catch(Exception e) {
              // whatever
    }     

  • Error while running PING program using applet. Pls correct the code.-urgent

    Can anyone pls correct the error in the below code.
    Program : TestExec1
    Using : Applet
    Logic : Trying to display the ping status in the text area but it returns error...!
    CODING
    import java.awt.*;
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.*;
    /*<applet code="TestExec1" width=380 height=150>
    </applet>
    public class TestExec1 extends Applet
    String line = null;
    TextArea outputArea;
    Process p;     
         public void init()
              outputArea = new TextArea(20,20);
         public void start()
              try
                        Process p= Runtime.getRuntime().exec("ping 192.168.100.192 -t");
                        BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
                        while ((line = in.readLine()) != null)
                             outputArea.append("\n" + line);
                             System.out.println(line);
              catch (IOException e)
                        e.printStackTrace();
    Error : C:\Program Files\Java\jdk1.6.0_02\bin>appletviewer TestExec1.java
    java.security.AccessControlException: access denied (java.io.FilePermission <<AL
    L FILES>> execute)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:323)
    at java.security.AccessController.checkPermission(AccessController.java:
    546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkExec(SecurityManager.java:782)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:447)
    at java.lang.Runtime.exec(Runtime.java:593)
    at java.lang.Runtime.exec(Runtime.java:431)
    at java.lang.Runtime.exec(Runtime.java:328)
    at TestExec1.start(TestExec1.java:31)
    at sun.applet.AppletPanel.run(AppletPanel.java:458)
    at java.lang.Thread.run(Thread.java:619)
    Regards
    ESM

    java.security.AccessControlException: access denied (java.io.FilePermission
    <<ALL FILES>> execute)This message tells you that the applet does not have permission to access/execute files. Access may be granted by either signing the applet, which allows the user to grant (or not grant) the access when running the applet, or by adding the necessary permission file to the user's computer.
    See http://java.sun.com/javase/6/docs/technotes/guides/security/index.html

  • Execute html file from java code - urgent!!!

    Hi,
    I need help!!
    My application should open html file that located in my computer
    it should be open when some line in JList was choosen
    my question is: How can I open html file from my application
    I work with window XP
    I tried this one :
    Runtime.getRuntime().exec(cmdLine);
    but it doesn't work
    the exeption was: CreateProccess
    Please help! it's urgent!!!!

    http://forum.java.sun.com/thread.jsp?forum=31&thread=497600

  • ABAP Code - Urgent

    Hi All,
    This code is not working properly. Say, after first pass through the loop, l_bukrs has value '100', the second pass throught he loop is again taking '100' without going to the next value of l_bukrs. 
    LOOP AT I_T_DATA....    
    clear: l_salesorg, l_dischan, l_matnr, l_bukrs.
    SELECT SINGLE BUKRS
         INTO (l_bukrs)
         FROM T001K
         INNER JOIN T001W ON T001KBWKEY = T001WBWKEY.
        SELECT SINGLE TARGET1 TARGET2
        INTO (l_salesorg, l_dischan)
        from ZABC
        where VALID_FROM le sy-datum
          and SOUR2_FROM ge l_bukrs
          and SOUR2_TO le l_bukrs.
        case sy-subrc.
          when 0.
          WHEN 4.
        endcase.
    ENDLOOP. "I_T_DATA.
    Thanks

    Hi Guys,
    This is how it is:
    LOOP AT I_T_DATA....
    clear: l_salesorg, l_dischan, l_matnr, l_bukrs.
         SELECT SINGLE BUKRS
         INTO (l_bukrs)
         FROM T001K
         INNER JOIN T001W ON T001KBWKEY = T001WBWKEY
         WHERE T001W~WERKS = i_t_data-WERKS.
    SELECT SINGLE TARGET1 TARGET2
    INTO (l_salesorg, l_dischan)
    from ZABC
    where VALID_FROM le sy-datum
    and SOUR3_FROM ge i_t_data-prctr
    and SOUR3_TO le i_t_data-prctr
    and SOUR2_FROM ge l_bukrs
    and SOUR2_TO le l_bukrs
    and SOUR1_FROM = 'C100'
    and SOUR1_TO = 'C100'.
    case sy-subrc.
    when 0.
    WHEN 4.
    endcase.
    ENDLOOP. "I_T_DATA.
    The first SELECT return values for BUKRS. The second SELECT does not return any values. i.e. l_salesorg and l_dischan are still not getting populated.
    Thanks
    Message was edited by: Sachin Guptha

  • Error in code: Urgent, Please help, thanks alot

    I'm getting two errors with the following code. The code is supposed to read in a text file with the format
    11
    blue casual
    green athletic
    red athletic
    The first number represents the numbers of socks. The code is supposed to ouput the number of pairs, so if there were 2 red athletic , it would say
    1 matching pair
    1 pair of red athletic
    If possible can someone run my code to see if they can get it to output that, I'm having a hard time doing it.
    here is the code
    import java.io.*;
    public class Socks {
    public static void main(String args[])
    try
         String socks[1000];
    int pairs[500];
    int numOfsocks;
    int i;
    int j;     
    FileReader fr = new FileReader("test.txt");
    BufferedReader inFile = new BufferedReader(fr);
    numOfsocks = Integer.parseInt(inFile.readLine());
    int possiblePairs = numOfsocks/2;
    for(i = 0; i < numOfsocks; i++)
    socks[i] = inFile.readLine();
    for(i = 0; i <= possiblePairs;i++)
         for(j = i; j<=possiblePairs;j++)
         if (socks.equalsIgnoreCase(socks[j]))
              pairs[i] = i++;
    for(i = 0; i <= possiblePairs;i++);
    if(pairs[i] >= 2)
    System.out.println(pairs[i]/2 + " pairs" + socks[i]);
    inFile.close();     
    catch(IOException e){}
              System.out.println("File Not Found or no File Specified");
    --------------------Configuration: Socks - JDK version 1.3.1_04 <Default>--------------------
    C:\Socks\Socks.java:13: ']' expected
         String socks[1000];
    ^
    C:\Socks\Socks.java:14: ']' expected
    int pairs[500];
    ^
    2 errors

    consider the following
    not for copying
    but for studying working code
    to help clarify ideas
    import java.io.*;
    list items and count of each item
    in a list of socks
    file has list of socks ...
    4
    red sock
    green sock
    blue sock
    green sock
    the first line is n = count of socks
    if no socks match, there are n items
    for example : 3 items in ...
    3
    red sock
    blue sock
    green sock
    if all socks match there is one item
    for example : 1 item in ...
    3
    red sock
    red sock
    red sock
    if socks come in pairs, there are at most n/2 items
    for example : 2 items in ...
    4
    red sock
    green sock
    red sock
    green sock
    program does not assume that socks come in pairs !!
    public class Socks {
    public static void main(String args[]) throws IOException
    String[] socks = new String[1000];
    int numOfsocks;
    String[] item = new String[1000];
    int[] count = new int[1000]; // initializes each count to zero
    int totalcount = 0;
    int i;
    int j;
    boolean ifound;
    FileReader fr = new FileReader("test.txt");
    BufferedReader inFile = new BufferedReader(fr);
    numOfsocks = Integer.parseInt(inFile.readLine());
    for (i = 0; i < numOfsocks; i++)
    socks[ i ] = inFile.readLine();
    inFile.close();
    for (i = 0; i < numOfsocks; i++) {
    ifound = false;
    for (j = 0; j < totalcount; j++) {
    if (socks[ i ].equalsIgnoreCase(item[j])) {
    ifound = true;
    count[j]++; // increase count for matched item
    break; // exit "for j loop"
    } // for j
    // sock not found so add it to item list ...
    if (ifound == false) {
    item[totalcount] = socks[ i ];
    count[totalcount] = 1;
    totalcount++;
    } // for i
    for (i = 0; i < totalcount; i++)
    System.out.println (item[ i ] + ", count = " + count[ i ]);
    } // class

  • Check the code - URGENT!

    HI All,
    To fetch the fallowing required fields from the related tables by the selection criteria Material No and Posting dates. Using ALV.
    I have written code for that but its not showing any results..plz go through my code and if possible rectify it.
    I am also attaching the selection criteria details and table with required field.
    Field Name Description Required level Reference Table
    MATNR Material No. Selection Criteria. (MARC)
    BUDAT Posting Date Selection criteria. (MKPF)
    MAKTX material Description Layout (MAKT)
    BEDAT PO Date Layout (EKKO)
    EBELN Purchase Order No. Layout (EKPO)
    MENGE Purchase Order Qty. Layout (EKPO)
    BPRME Order Price Unit Layout (EKPO)
    NETWR PO Net Value Layout (EKPO)
    BSTMG GR QTY Layout (MSEG)
    DMBTR GR Value Layout (MSEG)
    BPRBM Invoice Qty Layout (EKBE)
    REFWR Invoice value Layout (EKBE)
    here is my code:-
    TABLES: marc,
            mkpf,
            mseg,
            ekko,
            ekpo,
            ekbe,
            rseg.
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
          matnr LIKE marc-matnr,
          budat LIKE ekbe-budat,
          maktx LIKE makt-maktx,
          bedat LIKE ekko-bedat,
          ebeln LIKE mseg-ebeln,
          menge LIKE mseg-menge,
          bprme LIKE mseg-bprme,
          netwr LIKE ekpo-netwr,
          bstmg LIKE mseg-bstmg,
          dmbtr LIKE mseg-dmbtr,
          bprbm LIKE rseg-bprbm,
          refwr LIKE ekbe-refwr,
    END OF itab.
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    wa_fieldcat TYPE slis_fieldcat_alv.
    DATA v_repid TYPE sy-repid.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_matnr FOR marc-matnr,
                    s_budat FOR mkpf-budat.
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
      v_repid = sy-repid.
    START-OF-SELECTION.
    SELECT werks smbln bstmg dmbtr matnr ebeln FROM mseg INTO
    CORRESPONDING FIELDS OF TABLE itab
       WHERE matnr IN s_matnr.
    **ENDSELECT.
    SELECT SINGLE lifnr FROM ekko INTO CORRESPONDING FIELDS OF itab
       WHERE ebeln = mseg-ebeln.
    SELECT ebeln menge FROM ekpo INTO CORRESPONDING FIELDS OF itab
       WHERE ebeln = mseg-ebeln.
    ENDSELECT.
    SELECT ebeln belnr refwr budat FROM ekbe INTO CORRESPONDING FIELDS OF
    itab
    WHERE budat IN s_budat AND
           ebeln = mseg-ebeln.
    ENDSELECT.
    SELECT SINGLE matnr FROM marc INTO itab
    WHERE matnr = mseg-matnr.
    **APPEND itab.
    **END-OF-SELECTION.
    SELECT matnr ebeln menge bprme bstmg dmbtr FROM mseg INTO
    CORRESPONDING FIELDS OF TABLE itab
       WHERE matnr IN s_matnr.
    SELECT matnr maktx FROM makt INTO CORRESPONDING FIELDS OF TABLE itab
    WHERE matnr = mseg-matnr.
    SELECT ebeln bedat FROM ekko INTO CORRESPONDING FIELDS OF TABLE itab
    WHERE ebeln = mseg-ebeln.
    SELECT ebeln netwr FROM ekpo INTO CORRESPONDING FIELDS OF TABLE itab
    WHERE ebeln = mseg-ebeln.
    SELECT ebeln bprbm FROM rseg INTO CORRESPONDING FIELDS OF TABLE itab
    WHERE ebeln = mseg-ebeln.
    SELECT budat ebeln refwr FROM ekbe INTO CORRESPONDING FIELDS OF TABLE itab
    WHERE budat IN s_budat AND
           ebeln = mseg-ebeln.
      SELECT matnr ebeln menge bprme bstmg dmbtr FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab WHERE matnr IN s_matnr.
      SELECT matnr maktx FROM makt INTO CORRESPONDING FIELDS OF TABLE itab FOR ALL ENTRIES IN itab WHERE matnr = itab-matnr.
      SELECT ebeln bedat FROM ekko INTO CORRESPONDING FIELDS OF TABLE itab FOR ALL ENTRIES IN itab WHERE ebeln = itab-ebeln.
      SELECT ebeln netwr FROM ekpo INTO CORRESPONDING FIELDS OF TABLE itab FOR ALL ENTRIES IN itab WHERE ebeln = itab-ebeln.
      SELECT ebeln bprbm FROM rseg INTO CORRESPONDING FIELDS OF TABLE itab FOR ALL ENTRIES IN itab WHERE ebeln = itab-ebeln.
      SELECT budat ebeln refwr FROM ekbe INTO CORRESPONDING FIELDS OF
        TABLE itab FOR ALL ENTRIES IN itab
      WHERE budat IN s_budat AND
      ebeln = itab-ebeln.
      APPEND itab.
      PERFORM build_fieldcatlog.
      PERFORM display_alv_report.
    LOOP AT itab.
    *WRITE:/ itab-menge, itab-werks, itab-smbln, itab-bstmg, itab-matnr,
    *itab-ebeln, itab-lifnr, itab-menge, itab-belnr, itab-refwr, itab-budat.
    ENDLOOP.
    *&      Form  build_fieldcatlog
          text
    -->  p1        text
    <--  p2        text
    FORM build_fieldcatlog .              "Form BUILD_FIELDCATLOG, Start
      wa_fieldcat-fieldname = 'maktx'.
      wa_fieldcat-seltext_m = 'maktx.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'bedat'.
      wa_fieldcat-seltext_m = 'bedat.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'EBELN'.
      wa_fieldcat-seltext_m = 'ebeln.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'MENGE'.
      wa_fieldcat-seltext_m = 'menge.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'bprme'.
      wa_fieldcat-seltext_m = 'bprme.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'netwr'.
      wa_fieldcat-seltext_m = 'netwr.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'BSTMG'.
      wa_fieldcat-seltext_m = 'bstmg.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'dmbtr'.
      wa_fieldcat-seltext_m = 'dmbtr.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'bprbm'.
      wa_fieldcat-seltext_m = 'bprbm'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'REFWR'.
      wa_fieldcat-seltext_m = 'refwr.'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    ENDFORM.                    "build_fieldcatlog
    " build_fieldcatlog        "Form BUILD_FIELDCATLOG, End
    *&      Form  display_alv_report
          text
    FORM display_alv_report.      "Form DISPLAY_ALV_REPORT, Start
      v_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program     = v_repid
          it_fieldcat            = i_fieldcat[]
          i_callback_top_of_page = 'TOP-OF-PAGE'
          i_save                 = 'A'
        TABLES
          t_outtab               = itab.
    ENDFORM.                    "display_alv_report
    TOP-OF-PAGE.
      WRITE:/ 'Purchase request Print program'.
    END-OF-PAGE.

    hi,
    put a break point in ur select statement and check whether sy-subrc eq to 0 or 4. i think ur select staement is not executing.
    and generally matnr is of 18 character length so use call FM 'CONVERSION_ALPHA_EXIT_INPUT'  as
    p_matnr like mara-matnr.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input         = p_matnr
    IMPORTING
       OUTPUT        = matnr
    use this for ebeln also if ur select statement doesn't work.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • Help in Controller Code-Urgent

    Navigation:
    By Clicking on HR UAE Employee SelfService responsibility,
    We get Professional Details
    In the Professional Details, we have to Click Competence Profile.
    By clicking on Competence Profile, it will navigate another page.
    In that Screen .there will list of Competences, Skills for particular Employee.
    Both Competence and Skill are going to Store in a same Column
    i.e. Attribute1 (column) in table per_competences.
    Based on the Attribute1 value we can differentiate the Skill and Competence.
    If Attribute1----Yes means it’s a Skill
    Attribute1-----No means it’s a Competence.
    For both Skill and Competence we have individual Correct marked pencil symbols are there.
    By Clicking on pencil Symbol we can edit the competences, skills.
    Imp Note: Both Skills, Competence having separate Pencil Symbols.
    Requirement:
    Now the Requirement is, the competence’s pencil marked Correct Symbol should be inactive,
    Skill Correct button should be active for an employee.
    Competence Correct button inactive means, the correct button should be visible in Shaded format. By Clicking on that nothing should be happen.
    And all the above requirement is specific to UAE Business Group only.
    Solution prepared by me:
    I have extended the Controller; I have defined one VO in Controller.
    I have moved this Extended Controller to the server path, and I bounced the apache, opmn servers.
    And I have added Custom Controller path in Personalization page.
    Result:
    The result im getting is, when login as an employee, In the Competence Screen it is allowing me when Im Clicking on Competence Correct box. It is navigating to another Page,
    In that Page there is Dropdown box (Profesiciency level).
    Previously it is having values like
    1-Unaware
    2-Aware
    3-perform under supervision
    4-perform Unsupervised
    5-lead / Coach perform Unsupervised
    Before to extending CO, it is showing like as above.
    After extending Controller, In the proficiency level (drop down box) the above values (1- Unaware, 2- Aware, 3- perform under supervision, 4- perform Unsupervised, 5- lead / Coach perform Unsupervised) are not coming. They are disabled.
    I think the controller code is effecting here. But it has to effect in the before screen, at correct box. The correct button should not allow when we clicked on that.
    OA Framework     12.1.1
    Oracle OA Extension     10.1.3 - build 1089
    Business Components     10.1.3.3
    Im giving Extended Controller Code. For code see below.
    package petrofac.oracle.apps.per.selfservice.competency.profile.webui;
    //petrofac.oracle.apps.per.selfservice.competency.profile.webui.xxskillupdationCO
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    //import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    import oracle.apps.per.selfservice.competency.profile.webui.OverviewPageCO;
    import oracle.apps.fnd.framework.OAFwkConstants;
    //import oracle.apps.fnd.framework.webui.beans.OAImageBean;
    import oracle.apps.fnd.framework.webui.beans.OAImageBean;
    //import oracle.apps.fnd.framework.webui.beans.OASwitcherBean;
    import oracle.jbo.ViewObject;
    import oracle.jbo.Row;
    public class xxSkillUpdationCO extends OverviewPageCO {
    public xxSkillUpdationCO() {
    public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
    // String apprSysType = pageContext.getParameter("pSystemType");
    String apprSysType = pageContext.getParameter("pSystemType");
    super.processRequest(pageContext, webBean);
    //Get the Application Module
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (am.getOADBTransaction().isLoggingEnabled(OAFwkConstants.STATEMENT)) {
    pageContext.writeDiagnostics(this, "pSystemType = " + apprSysType,
    OAFwkConstants.STATEMENT);
    //Create a VO to query employee related information.
    ViewObject SkillUpdationVO = am.findViewObject("pfSkillUpdationVO");
    //Check if VO exists. If exists, then create the VO.
    if (SkillUpdationVO == null) {
    StringBuffer query = new StringBuffer();
    //check if attribute1 is yes or not
    query.append(" SELECT ");
    query.append(" ( ");
    query.append(" CASE ");
    query.append(" WHEN pc.attribute1 = 'Yes' ");
    query.append(" THEN 1 ");
    query.append(" ELSE 0 ");
    query.append(" END ) is_yes ");
    query.append("FROM per_all_people_f ppf, ");
    query.append(" per_competence_elements pce, ");
    query.append(" per_competences pc ");
    query.append("WHERE ppf.person_id = pce.person_id (+) ");
    query.append("AND pce.competence_id = pc.competence_id ");
    query.append("AND TRUNC(SYSDATE) BETWEEN ppf.effective_start_date AND NVL(ppf.effective_end_date, SYSDATE) ");
    // query.append("AND TRUNC(SYSDATE) BETWEEN pas.effective_start_date AND NVL(pas.effective_end_date, SYSDATE) ");
    query.append("AND ppf.person_id = :1 ");
    SkillUpdationVO =
    am.createViewObjectFromQueryStmt("pfSkillUpdationVO",
    query.toString());
    SkillUpdationVO.setWhereClauseParams(null);
    SkillUpdationVO.setWhereClauseParam(0,
    pageContext.getEmployeeId() + "");
    //execute the query
    SkillUpdationVO.executeQuery();
    if (SkillUpdationVO.hasNext()) {
    Row row = SkillUpdationVO.first();
    if (am.getOADBTransaction().isLoggingEnabled(OAFwkConstants.STATEMENT)) {
    pageContext.writeDiagnostics(this,
    "ATTRIBUTE1 =" + row.getAttribute(0).toString(),
    OAFwkConstants.STATEMENT);
    // pageContext.writeDiagnostics(this, "EndDate ="+row.getAttribute(2).toString(), OAFwkConstants.STATEMENT);
    if ("1".equals(row.getAttribute(0))) {
    OAImageBean hrCorrectImageBean=(OAImageBean)webBean.findChildRecursive("HrCorrect");
    hrCorrectImageBean.setFireActionForSubmit(null,null,null,false);
    /*OAImageBean hrCorrectImageBean=(OAImageBean)webBean.findChildRecursive("HrCorrect");
    hrCorrectImageBean.setFireActionForSubmit(null,null,null,false);*/

    OA Framework Forum would be the right place to ask this.

Maybe you are looking for

  • HOST command does not seem to work in deployment system

    I am developing forms software for a SUSE Linux system, but the HOST command does not seem to operate correctly when used in conjunction with Application Server. All I am trying to do is launch Adobe Acrobat reader as a background job using the comma

  • Dladm and lacp

    Hi, i installed the e1000g driver on my t2000. now i want to use linkaggregation with dladm. I setup 1 aggregate with 2 interfaces, each interface is physically connected to another switch (2 cisco 6500 trunked). The setup of the trunking with dladm

  • Odd circumstances re:system restore, and updated iTunes

    I've always ran iTunes perfectly fine, but I recently updated it, but ran into other problems with software I installed later... suffice it to say, I had to restore to a time before I updated iTunes to get my other programs running. After that, I was

  • Training and event mgmt (automatic mail)

    hello friends, i hav a doubt.. is it possible to send a mail aotumatically to the invities who attend the training???? actually i tried in correspondance where we hav an option to send a mail which i hav checked.. then i clicked on output,,,, but it

  • Filmstrip image limit cs4 windows

    Hey there, I'm using Bridge in cs4 for windows 7. I'm trying to add a nice flimstrip to my site. I selected 23 images but bridge is only showing the first 10.... is there any way around this? because if it's limited to 10 images that is very very poo