CASE READ 1st Line for ORATAB

i have troublesome to export of the 1st line from output from the below script
This script basically lists all SIDs and ORACLE_HOMEs and echo for selection.
I want to automatically to set to line 1 for +ASM instances without prompting. As part of my script, i want to source +ASM instance and run the command automatically without prompt
The below scripts automatically picks up the last line. How do i change it to pick up the 1st line??
Script
if [ `uname -s` = SunOS ]
then
ORATAB=/var/opt/oracle/oratab
else
ORATAB=/etc/oratab
fi
if [ -s "$ORATAB" ]
then
#echo "Standby Oratab Entries:"
#echo " #      DATABASE  NAME       ORACLE_HOME"
#echo "-----   ------------------   -----------------------------------"
set -x
CURSOR=1
while read LINE
do
case $LINE in
\#*) ;; #comment line
"") ;; #null line
LASTSID=`echo $LINE | cut -f1 -d":"`
LASTHOME=`echo $LINE | cut -f2 -d":"`
printf "%5s %20s %40s\n" $CURSOR $LASTSID $LASTHOME
CURSOR=`expr $CURSOR + 1`
#CURSOR=1
esac
done < $ORATAB
#if [ $CURSOR -eq 2 ]
#then
#echo""
#echo "only one database found in oratab..."
echo $LASTSID
echo $LASTHOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib:/usr/lib64:/lib64:/lib:/usr/lib
SHLIB_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
SQLPATH=$ORACLE_HOME/rdbms/admin:$ORACLE_HOME/sqlplus/admin
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
PATH=/opt/oracle/local/bin:/usr/openwin/bin:/usr/sbin:/usr/bin:/usr/ucb:/etc:/bin:/sbin:$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$ORACLE_HOME/jdk/jre/bin:$ORACLE_HOME/Apache/Apache/bin:$ORACLE_HOME/Apache/perl/bin:/usr/local/bin:/bin:/sbin
`set -o vi`
PS1="$ORACLE_SID/`uname -n`-> "
alias rm="rm -f"
else
echo ""
echo " "
echo -n "Choose the Database  [ 1 - "`expr $CURSOR - 1`" ] "
#export SELECTION=1
export $CURSOR=1
#read SELECTION
$CURSOR=1
fi
Output
1           
+ASM1                
/u01/app/11.2.0/grid
2        
rdb1v001  /u01/app/oracle/product/11.2.0/dbhome_1
3       
rdb1v001r  /u01/app/oracle/product/11.2.0/dbhome_1
4          
testrj  /u01/app/oracle/product/11.2.0/dbhome_1
5          
rdbp01  /u01/app/oracle/product/11.2.0/dbhome_1
6        
rmb1r001  /u01/app/oracle/product/11.2.0/dbhome_1
rmb1r001
/u01/app/oracle/product/11.2.0/dbhome_1

Sorry I don't want to simply post my script here at OTN. I spent several months working on it and put a lot of thoughts into. I may at some time in the future share it, but it will have to be under different circumstances.
But This will not work as i need to source both SID and HOME
Why not? Simply query the appropriate information. SID and HOME are both stored in /etc/oratab. You simply need to fetch or search the appropriate column and return $1 or $2 from the line, which contain the SID or HOME information.
Get SID and HOME for +ASM:
$ var=`awk -F':' '$1 ~ /+ASM/ { print $1,$2 }' /etc/oratab`
$ echo $var
+ASM /u01/app/oracle/product/11.2.0/grid
Convert result into a variable array using space as delimeter and export each value:
$ var=(${var// / })
$ export a1=`echo ${var[0]}`
$ export a2=`echo ${var[1]}`
$ echo $a1
+ASM
$ echo $a2
/u01/app/oracle/product/11.2.0/grid
If you want to do this for other ASM instances, simply specify the instance name. You can also write a procedure to walk through a list of possible search strings using "for item in "ASM+ ASM1+ ASM2+" do; etc.", if you want to get fancy.

Similar Messages

  • SQL Loader - read 1st line to one table, rest of data to another

    Hi
    I looked around the FAQs and forums and find similar cases but not mine...
    I am running Oracle 9i and have a text file which has the 1st line as a control header and everything beneath it as data, something like this:
    14/07/2010|8
    12345678|0
    12345679|0
    12345680|10.87
    12345681|7655.8
    12345682|100
    12345683|0
    12345684|-90.44
    12345685|0
    The first (header) line has a date field and a counter (the number of records expected beneath it)
    The rest of the data is an account number and balance.
    Since SQL Loader is invoked outside of Oracle (Unix in my case) I assume I should create two tables, such as:
    Create table
    TIF_CURRENT_BALANCE_DTL
      ACCOUNT_REF_NO   VARCHAR2(30),  
      BALANCE_AMT      NUMBER(12,2)         
    Create table
    TIF_CURRENT_BALANCE_HDR
      HDR_DATE         DATE,  
      HDR_COUNT        NUMBER(10)
    );And use a control file which will load line 1 to TIF_CURRENT_BALANCE_HDR and other lines (SKIP=1) to TIF_CURRENT_BALANCE_DTL.
    Since the header/detail lines are not (necessarily) distinguishable, is there a way to achieve this, without modifying the input file in anyway?
    Thanks
    Martin

    Thanks for your reply - the solution should not be OS dependant as it will run on a Linux and UNIX installation.
    The DB will be (for now) Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    I looked at that web page you provided and had some hope with the ROWS option, but this is the number of rows to load before each commit.
    Any other solutions?
    I know I could load it to a common table (text and number) and then convert the values accordingly in the PL/SQL procedure which will run afterwards, but I feel loading the data in the final format is going to be faster.
    I am considering using SQL Load to load records (SKIPping row 1) into the DTL table and within the PL.SQL loading the 1st record and performing validation. Since the file has approx 2million rows and is processed daily, 1.99999 million records read with SQL Loader and 1 with conventional methods will still be a vast improvement!
    Thanks

  • Matrix - Help with setting 1st column for line numbers

    Hi,
    I have created a matrix on a custom form and would like to add line numbers to the # column line that of the quotation screen.
    The matrix itself is populated correct from the Query and LoadFromDataSource, and all the fields and columns are filled in correctly, the only column I am having trouble with is the 1st one for line numbers. My code for adding the line numbers is
    SBO_Application.MessageBox("Matrix Count: " & tMatrix.RowCount)
    For i = 1 To tMatrix.RowCount
          oEditText = tColumns.Item("#").Cells.Item(i).Specific
          oEditText.Value = i
    Next
    For the example I am using I get the message box appear:
    Matrix Count: 26
    So I know I should have the line number go from 1 to 26, however I only get 1 to 9 displayed, all the remaining lines are blank.
    Any ideas on why it stops at 9 or what I should do to correctly set the line numbers in the Number column like that of the system Quotation/Sales orders forms.
    Your help is much appreciated
    Matthew

    Hi,
    I tried changing it to the following as you suggested:
    SBO_Application.MessageBox("Matrix Count: " & tMatrix.VisualRowCount)
    For i = 1 To tMatrix.VisualRowCount
        oEditText = tColumns.Item("#").Cells.Item(i).Specific
        oEditText.Value = i
    Next
    The message box still displays 26, however my lines still only go up to number 9.
    Thanks for the quick response.

  • Function module for reading service line items of a po

    function module for reading service line items of a po.............I want to read data from eslh and esll tables to getthe service line details.....
    My requirement is if the item category is 9 I need to print the service line items. So I wan to read the data of service line items from a function module. I am not able to find a fm which fetches both elsh and esll data...

    Hi oskchaitanya ,
    use bapi BAPI_PO_GETDETAIL1.
    Regards
    REA

  • Scanning a line for a pattern ( cat ${0} | while read line )

    I am busy to create a dynamicaly menu from items inside the script itself.
    I will create some self reading/scanning code what builds the menu.
    When script get executed, it will look for itself on disk put it in a catalog and scan every line with an 'if' 'elfi' for '[ $choice -eq X ]; then'.
    Then next non empty line for '# title - description of code' part behind that if or elfi line, put that and the choice no. in $menuItemN var what is used to print the menu.
    with
    # start self scanning code
    cat ${0} | while read line
    # end self scanning code
    # create menu
    # the the chosen code between if's
    if [ $choice -eq 1 ] ; then
    # title - Drink coffee
    elfi [ $choice -eq 2 ] ; then
    # title - Eat pizza
    This line of code
    if [[ "$line" = ?(el)if*([[:space:]])*$choice*([[:space:]])-eq* ]] ; then
    reads the if's and elfi's fine, but also f.e the line itself.
    So I want to narrow down things, but I cant figure out how to use [ in a pattern.
    What do I have to put at the XXXXX
    if [[ "$line" = ?(el)if*([[:space:]])XXXX*$choice*([[:space:]])-eq* ]] ; then
    so that that line is only accepting ( one left square bracket and different number of spaces )
    if [ $choice -eq 1 ] ; then
    or
    elif [ $choice -eq 4 ] ; then
    Basically how do I use the left and right bracket in a pattern?

    After a good diner, but not helping with the dishes , this is for now my final.
    I did create it in a way that I only need to add code in the runLoop function. I don't need to alter var's, code or any thing else outside the runLoop. And it works fine.
    #!/bin/sh
    shopt -s extglob ## enable extended globs +(...), *(...), etc...
    declare -a menuArray
    handle_menu()
    ## print menu
    printf "_____________________________________________________________
    for index in {0..99}
    do
    if [[ -n "${menuArray[$index]}" ]]; then
    if [[ "$index" == "$exitChoice" ]]; then
    printf "
    fi
    printf " %3s. %s
    " "$index" "${menuArray[$index]}"
    fi
    done
    printf "_____________________________________________________________
    ## read user input
    read -p " Please choose an option :" choice
    ## user want to quit?
    if [[ $choice -eq $exitChoice ]] ; then
    printf " Bye bye!
    exit 0
    fi
    ## user did choose a wrong number?
    if [[ ! -n "${menuArray[$choice]}" ]]; then
    printf "
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    printf " # # # %s is Not an existing option!
    " "$choice"
    printf " # #
    printf " # # Try again ( %s for exit )
    " "${exitChoice}"
    printf " #
    printf " # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    fi
    build_menu()
    ## Build a menu by reading this script
    exitChoice=99 ## exit option number
    exitStr="Exit" ## exit menu text
    loopChoice=999 ## keeps the runloop rolling
    lineno=0
    while read line
    do
    ((lineno++))
    #echo - $line
    if [[ $line = ?(el)if+([[:space:]])[[+([[:space:]])$choice+([[:space:]])-eq+([[:space:]])?([1-9][0-9 ])*([[:space:]])]]+([[:space:]]);+([[:space:]])then* ]] ; then
    ## line should look like 'if [[ $choice -eq 1 ]] ; then' or 'elif [[ $choice -eq 2 ]] ; then # help'
    ## Between the different elements there has to be 1 or more spaces
    ## There could be a comment behind the statement
    #echo -
    #echo - "before :${line}--"
    line="${line%*([[:space:]])#*}" ## remove comments
    line="${line%%+([[:space:]])}" ## remove trailing spaces
    read title_line
    ((lineno++))
    #echo - "before N:${nline}--"
    title_line="${title_line%%+([[:space:]])}" ## remove trailing spaces
    if [[ "$title_line" = #*([[:space:]])[Tt]itle*([[:space:]])-*([[:space:]])+([[:alnum:]])* ]]; then
    ## line should look like '# Tilte - Description'
    ## Between the different element there has to be 1 or more spaces
    ## The 'T' of 'Title' text must be an upper or lowercase letter
    ## get choice number from line
    line="${line#?(el)if+([[:space:]])[[+([[:space:]])$choice+([[:space:]])-eq+([[:space:]])}"
    #echo - "Tear off beginning:${line}--"
    choiceNo="${line%%+([[:space:]])*}"
    #echo - "Tear off end :${choiceNo}--"
    ## compare if choice number already exists and if exists: Bail out wit error notification
    if [[ "${menuArray[$choiceNo]}" == "" ]]; then
    ## get title
    title_line="${title_line##*([[:space:]])[Tt]itle*([[:space:]])-+([[:space:]])}"
    #echo - "Tear off beginning:${title_line}--"
    title_line="${title_line%%+([[:space:]])}"
    #echo - "Tear off end :${title_line}--"
    ## add to menu
    menuArray[$choiceNo]="${title_line}"
    else
    errLine=$((lineno-1))
    printf "
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    printf " ## # Choice number already exists under name%s
    " "${menuArray[choiceNo]} "
    printf " ## #
    printf " ## # Correct your code ( choice number? ) at line %s
    " "${errLine}"
    printf " # Wil bail out!
    printf " ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    exit 1
    fi
    else ## no title in line
    errLine=$lineno
    printf "
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    printf " ## # Line after 'if' or 'elif' statement has no Title line
    printf " ## #
    printf " ## # Correct your code af line %s
    " "${errLine}"
    printf " # Wil bail out!
    printf " ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    exit 1
    fi ## if Title is there
    fi
    done <${0}
    ## add the exit code and title at the end of the menu array
    menuArray[$exitChoice]=${exitStr}
    start()
    build_menu
    choice=$loopChoice
    # Loop while the variable choice is equal 999 ( defaultChoice )
    while [ $choice -eq ${loopChoice} ]; do
    # print menu + read user input
    handle_menu
    runLoop
    choice=$loopChoice # only bail out on exit code ( at least default value 90 )
    done
    runLoop()
    ## this function should contain the choices with their code.
    ## the choice if statement should look like the following way
    ## 'if [[ $choice -eq 1 ]] ; then'
    ## or/and
    ## 'elif [[ $choice -eq 2 ]] ; then # help'
    ## YES, it should use $choice as a variable!!
    ## With in the next line the title, supplied in the following pattern
    ## '# title - Eat pizza'
    ## No need to put extra code in your code to have this running
    ## -------- insert your code here --------------------------------------------
    if [[ $choice -eq 1 ]] ; then
    # title - Drink coffee
    echo Drink beer
    elif [[ $choice -eq 2 ]] ; then # help
    # title - Eat pizza
    echo Eat pizza
    elif [[ $choice -eq 4 ]] ; then
    # title - Go Home
    echo "Go Home!"
    elif [[ $choice -eq 9 ]] ; then
    # title - Get out
    echo "Get out!"
    elif [[ $choice -eq 44 ]] ; then # ln;ln lknbl bs
    # title - Go to bed
    echo "44 Go sleep!"
    ## -------- insert your code in front of this line ----------------------------
    fi ## keep this as last
    # Start point
    start
    exit 0
    Still one question.
    Is there a kind of way to walk through an array and get directly the existing variables with a index number?
    Now I use
    for index in {0..99}
    do
    if [[ -n "${menuArray[$index]}" ]]; then
    if [[ "$index" == "$exitChoice" ]]; then
    printf "
    fi
    printf " %3s. %s
    " "$index" "${menuArray[$index]}"
    fi
    done
    I don't want a loop ( {0..99} ) and a known last index number ( 99 )
    Is there a way to find out the width om the current shell window?
    Also other hints, remarks are welcome.
    P.s if someone want to see the 'debug echo output', find&replace '#echo -' with 'echo -' and the other way arround

  • Not able to generate multiple lines for headers in report

    Hi,
    I am new to BI publisher and not able to generate multiple lines for headers. Please help me to resolve.
    I am using RTF template, data source as PS Query and XML file (system generated from the data source)
    When I am using system generated 'First XML' file, I am getting output in the follwoing format.
    TEAM_MEMBER, PROJECT_ID, NAME, START_DT
    e.g.
    EMP1 , 71000, Sample, 01-Jan-2010
    EMP1 , 72000, Sample, 01-Feb-2010
    EMP1 , 73000, Sample, 01-March-2010
    But I want the report to be generate with multiple projects for one employee like below format , for that I used 'Second XML' file but I am getting blank report.
    In short if there is one to many case, how to show in reports??? Please correct if I am going wrong.
    TEAM_MEMBER
    PROJECT_ID, NAME, START_DT
    PROJECT_ID, NAME, START_DT
    PROJECT_ID, NAME, START_DT
    e.g.
    EMP1
    71000, Sample, 01-Jan-2010
    72000, Sample, 01-Feb-2010
    73000, Sample, 01-March-2010
    **********First XML**************System generated XML ****************************
    <?xml version="1.0"?>
    <query numrows="2" queryname="SY_EMP_PROJECT" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="">
    <row rownumber="1">
    <TEAM_MEMBER>TEAM_MEMBER </TEAM_MEMBER>
    <PROJECT_ID>PROJECT_ID samp</PROJECT_ID>
    <NAME>NAME sample data</NAME>
    <START_DT>2010-08-25</START_DT>
    </row>
    <row rownumber="2">
    <TEAM_MEMBER>TEAM_MEMBER</TEAM_MEMBER>
    <PROJECT_ID>PROJECT_ID samp</PROJECT_ID>
    <NAME>NAME sample data</NAME>
    <START_DT>2010-08-25</START_DT>
    </row>
    </query>
    **********Second XML**************Manually created XML and using to show multiple projects for one employee****************
    <?xml version="1.0"?>
    <TEST numrows="2" queryname="SY_EMP_PROJECT" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="">
    <TEAM_MEMBER rownumber="1">
    <TEAM_MEMBER>1</TEAM_MEMBER>
    <EMPLOYEE_NAME>SAMPLE</EMPLOYEE_NAME>
    <PROJECT>
    <PROJECT_ID>1111</PROJECT_ID>
         <PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
    <START_DATE>01012010</START_DATE>
    </PROJECT>
    <PROJECT>
    <PROJECT_ID>1112</PROJECT_ID>
         <PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
    <START_DATE>01022010</START_DATE>
    </PROJECT>
    </TEAM_MEMBER>
    <TEAM_MEMBER rownumber="2">
    <TEAM_MEMBER>2</TEAM_MEMBER>
    <EMPLOYEE_NAME>SAMPLEC</EMPLOYEE_NAME>
    <PROJECT>
    <PROJECT_ID>1111</PROJECT_ID>
         <PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
    <START_DATE>01012010</START_DATE>
    </PROJECT>
    <PROJECT>
    <PROJECT_ID>1112</PROJECT_ID>
         <PROJECT_DESCR>SAMPLE</PROJECT_DESCR>
    <START_DATE>01022010</START_DATE>
    </PROJECT>
    </TEAM_MEMBER>
    </TEST>
    Edited by: ganeshtw on Aug 25, 2010 12:14 AM

    Hi,
    With your first xml you can print like
    EMP1
    71000, Sample, 01-Jan-2010
    72000, Sample, 01-Feb-2010
    73000, Sample, 01-March-2010While creating the RTF template you can use the Group by option.
    <?for-each-group:ROW;./columnname> then print the column name
    <?columnname?>
    --Then your table format
    71000, Sample, 01-Jan-2010
    72000, Sample, 01-Feb-2010
    73000, Sample, 01-March-2010
    <?end for-each-group?>
    Thanks.

  • SA Schedule lines for requirements within PTF

    Hello Gurus,
    I have a question that you can surely help me with.
    I have setup a scheduling agreement for a material, and with the source list setup the MRP now successfully generates schedule lines for all requirements that are outside of the planning time fence. However, if I put a requirement inside the planning time fence, then MRP does not create a schedule line just outside the PTF to cover that requirement, instead it creates a planned order just outside the PTF (or a purchase requisition if I change the "Create Purch. req." MRP control parameter).
    Why does it not create a delivery schedule line? The validity of agreement is set to 1st of april, so it is defined will in the past. The target quantity on the scheduling agreement is well above the current scheduled quantity.
    Thank you for any suggestions on this issue. I am sure it is just me who is being an MRP ignorant.

    Check the validity date of your Source List. It may be that it is outside the time frame of your requirements.
    Try setting it up to say, January 1st of this year, see what happens.
    Award points if useful.

  • Faulty line for over a month now but BT says it is...

    Has anyone got any suggestions, please?  I reported a faulty line on 22nd April - it had an increasing amount noise on it (which it has had for ages but had become unbearable) including clicking, and my broadband kept dropping.  I had done all the usual checks, disconnecting my home equipment and reconnecting it individually, and so on, and had checked my router which was fine.  My ISP insisted that it was due to a faulty line and said that I should report it to BT.  We have already had a fault repaired on the external line this year and one or two last year. 
    BT sent out an engineer on 24 April who traced the fault to 143m out from the junction box on our house.  He went to junction box two halfway down our drive and found an absolute mess of old cabling which had been patched and cut into and bundled up and patched again, in the 50 pair cable feeding our telephone service 35 pairs were unuseable and the cable very old and damaged. 
    He put in a report saying that the manhole in the street needed investigating and also drew up a plan to have the cable from the street supplying our property to be replaced as it is really unviable it is in such a mess, including the JB2 cabling which has various unused and dead cables involved as well as those supplying our house).  He contacted me to let me know that his manager had approved the cable replacement.
    On April 30 two engineers attended and found the cable lying in water at the bottom of the manhole with our wires all corroded.  They cut the wire back and recrimped it and then tied the cable up out of the water with a bit of blue nylon rope that was already down the manhole.  They also looked at JB2 and agreed that the cabling needed to be sorted out.  The engineers told me that someone would be out to sort out JB2 and left.  After their recrimping our wires in the manhole our voice service has improved - there is still some hissing but no clicking - but the line is still unable to carry data consistently and our broadband continues to drop. 
    However on my BT online account later that day the fault was shown as having been fixed.  I confirmed that the line was still faulty, however the case was closed anyway by 5th May even though no further work was done.  I rang customer services (again - another hour or two on the phone!) and they were very apologetic and said they would reopen the case.  However they did not - instead they opened a new case on 6th May, even though it is the same fault as reported on 22nd April.
    Later on 6th May my account showed that the line had been fixed and the case closed, which I saw on the 7th and reopened it.  On the 8th it showed that BT was going to investigate the fault and an hour later they shut the case again, saying it had been fixed.  On the 9th I reopened it again.  I rang customer services again, and they said that as the case had been closed I would have to start all over and have an engineer come out to check my equipment and line at my property.  We were going away on holiday for a week so I booked the appointment for the first working day after our return - 20th May. 
    On the morning of 20th May I checked our online account and it showed that the case had been closed again.  I rang customer services and sure enough the engineer's appointment had been cancelled.  So I made a new appointment for 23rd May.  The engineer has been today and tested the line from the junction box on the outside of our house (which is a good distance from our master socket) and said that while the line could carry voice it was not good enough to carry data properly.  He looked into JB2 and the manhole in the street (which of course he is not allowed to go into to do anything so he can only look) and said that the cable was old and damaged and need to be replaced! 
    I watched him type up his report and upload it to BT Openreach, stating that the fault was not repaired and that the cable needed to be replaced.  A couple of hours later I looked on my online account and found, with no real surprise, that the fault was showing as having been repaired and if I agreed they would shut the case down!
    The engineer and I have worked out an inexpensive way of replacing the cable which requires a minimum amount of excavation along the tarmac'd drive (which we only have a right of way over anyhow), instead of which the cable could be continued along the wall down to the pavement and then taken down and into the nearest manhole which is two feet from the wall.
    He has sent the A55 form in to his manager stating that the cable should be replaced in this way, (just as the last engineer did), so how can this fault be showing as fixed?
    In the meantime my broadband provider Demon can see that the broadband keeps dropping, but they apparently can't do much about it.  They buy ADSL provision from Cable & Wireless, who rent the line from BT, but Cable & Wireless can raise a fault with BT if the case is closed.  But the BT Openreach engineers are all in agreement and reporting the line as faulty, yet BT is pretending that it has been fixed.  Meanwhile my BT bill has arrived as usual and I am being asked to pay both BT and my internet provider as normal for a faulty service.
    A month in and I am really at my wits end as to how to get BT to make the necessary repair.  BT has claimed the fault has been fixed and closed the case several times since I first reported it on 22nd April, and shows no intention of doing what the engineers are all recommending which is to replace the old, faulty cable.  In the meantime I am being hotly pursued by BT to buy BT Infinity Broadband, yet the line isn't fit to carry it, since the copper which runs from the cab in the street is unfit for purpose.  Please let me know if you have any suggestions - we have been suffering with this old faulty line for some years now and it is just getting worse and worse.

    Thanks for your reply John, but while the immediate problem is with the broadband the actual voice fault when it was reported was old damaged cable.  All we have been given is a temporary fix, which is what yesterday's engineer put in his report.  He showed it to me before he submitted it so I know that is true.
    Both engineers who have attended in the last month have come to the same conclusion - that the cable is in a shocking state and needs to be replaced.  We may not have a voice problem currently but we have had two repairs for voice this year alone and several over the past few years as our line keeps breaking down.  The engineers are working their way through the cable as it corrodes and degrades trying to find clean pairs of copper wire to use.  In the meantime we have ongoing problems with our broadband dropping - all because BT won't just get on and replace the cable. 
    It may be expensive for BT to replace the cable - although the engineer and I have worked out a cheaper way to do it by continuing the wire along with wall down to the street rather than trying to dig up the whole run of cable under our neighbour's newly laid tarmac on the shared drive - but actually since we have to go through this performance of BT engineers followed by Openreach engineers attending our property every few months it seems a false economy to me! 
    The broadband is just 'hitching a ride' with the copper line, and two engineers have agreed that the copper line is shot to bits.  Once again the A55 has been cleared by the local team and passed to planning, because Openreach thinks that the cable needs to be replaced.  But the BT computer system keeps shutting it down.  I don't think on this occasion that it is reasonable for BT to refuse to deal with me as end user and just hand the problem on to my ISP - there is nothing they can do until the cable is replaced except reiterate what I have already told you.  If we are forced to go there, that will simply necessitate another bunch of engineers coming out and looking at the problem all over again - extra expense to BT - why not just get on an fix the problem that we all know is there?
    We have considered changing to BT Infinity as our area has fibre, but until the copper between us and the fibre has been replaced there is simply no point in giving even more money to BT for a service that will not be able to run at a good speed.  If BT mans up and treats us decently by agreeing to replace the cable we will certainly be looking at Infinity again.

  • No control line for line item - error while posting bd to accounting

    Hi all,
    Billing document showing err "no control line for line item" while posting to accounting doc.Sales document is complete no in completion logs.
    Previous errr: g/l missing for line item" in order incompletion after maintaining company code for customer, then refresh the g/l missing for line item is no more logs and showing the error "no control line for line item" while posting bd to accts.
    Please help
    Regards
    anush

    Hello Anush,
    if the company data of the payer was not created when the sales order has been created, then the system could not create the correct records in table VBREVK. Once the company data has been maintained the VBREVK records could be corrected by re-saving the sales, but only if no billing document exists.
    In your case you already created the billing document.
    Please try these step:
    1. reverse billing document
    2. run VA02 add a blank char to PO number, save
    3. create new billing document
    Best regards,
    Ivano.

  • Remove 1st & 2nd lines in 1st file, and 1st line in 2nd file. I want the headers to be the first line after the script runs!

    I have two files that look like this (Notepad++):
    In the first file, which has a date as a name and always ends in 'COV', I want to remove the 1st & 2nd lines.  All lines end in LF (LineFeed).  In the 2nd file, which has a date as a name and always ends in 'RSK', I want to remove the 1st line. 
    Basically I want only the headers.  I'm working with the code below.  I've tried several different iterations of
    reader.ReadLine().Skip(1);
    reader.ReadLine().Skip(2);
    reader.ReadLine().Skip(3);
    It never really gives me what I want, so I can't tell what's going on here.  I guess I'm missing something simple, but I don't know what.  Any ideas, anyone?
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;
    using System.Diagnostics;
    namespace ConsoleApplication1
    class Program
    static void Main(string[] args)
    string sourceDirectory = @"C:\Users\rshuell\Desktop\Downloads\Files";
    try
    var txtFiles = Directory.EnumerateFiles(sourceDirectory);
    foreach (string currentFile in txtFiles)
    if (currentFile.Contains("COV"))
    var items1 = new LinkedList<string>();
    using (var reader = new StreamReader(currentFile))
    reader.ReadLine().Skip(2); // skip 2lines
    string line;
    while ((line = reader.ReadLine()) != null)
    items1.AddLast(line.Replace("\"", ""));
    File.WriteAllLines(currentFile, items1);
    else
    var items2 = new LinkedList<string>();
    using (var reader = new StreamReader(currentFile))
    reader.ReadLine().Skip(1); // skip one line
    string line;
    while ((line = reader.ReadLine()) != null)
    items2.AddLast(line.Replace("\"", ""));
    File.WriteAllLines(currentFile, items2);
    catch (Exception ex)
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Call the ReadLine() twice if you want to skip the first two lines. Each call results in a single line being read:
    static void Main(string[] args)
    string sourceDirectory = @"C:\Users\rshuell\Desktop\Downloads\Files";
    try
    var txtFiles = Directory.EnumerateFiles(sourceDirectory);
    foreach (string currentFile in txtFiles)
    if (currentFile.Contains("COV"))
    var items1 = new LinkedList<string>();
    using (var reader = new StreamReader(currentFile))
    reader.ReadLine(); //read line 1
    reader.ReadLine(); //read line 2
    string line;
    while ((line = reader.ReadLine()) != null)
    items1.AddLast(line.Replace("\"", ""));
    File.WriteAllLines(currentFile, items1);
    else
    var items2 = new LinkedList<string>();
    using (var reader = new StreamReader(currentFile))
    reader.ReadLine(); // skip one line
    string line;
    while ((line = reader.ReadLine()) != null)
    items2.AddLast(line.Replace("\"", ""));
    File.WriteAllLines(currentFile, items2);
    catch (Exception ex)
    Calling the Skip method on the already read string returned by the ReadLine() method won't help you at all here. By the time you call the Skip method the line has already been read from the file. You must call the ReadLine() method for a new line being read.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • F110 Payment Proposal multiple payment lines for same vendor

    Hello,
    Question for the FI community regarding single payments for multiple invoices for the same vendor. Is there any other place that would dictate the grouping (or non grouping) of multiple payment proposal lines for same vendor payment?
    I understand that there are two places:
    FBZP - Change view 'Maintenance of Company Code Data for a Payment Method", the flag for 'Single payment for marked item'
    Vendor Master - Automatic payment transactions, flag for 'Individual pmnt'
    Is there anywhere else where this may be dictated? At my location, we have two company codes that make ACH payments, settings for FBZP (Single payment for marked item flag) and selected vendor for payment in the vendor master is identical. I get different results when viewing the payment proposal for each company code. Company Code A parses out individual line items for payment in the proposal, and Company Code B does not. When I change the flag via FBZP for Company Code A, this resolves the issue. When I make the same change for Company Code B, there is no change.
    In all of my testing, I have left the 'Individual pmnt' flag for both vendor masters unchecked.
    I'm hoping that somebody in the community here would be able to point me in the right direction to understand why I am getting differences. Is there somewhere else that I can check?
    Thanks everyone.

    Ravi,
    Thanks for your reply, however in my post I already mentioned I have tested out both options via FBZP as well as the vendor master. You are correct, in only one case regarding my situation.
    In my example for Company Code B, I have the following scenarios:
    1. FBZP - single payment for marked item checked, Vendor individual payment option not checked, result is a single payment item for multiple invoices
    2. FBZP - single payment for marked item checked, Vendor individual payment option is checked, result is multiple payment items for each invoice
    3. FBZP - single payment for marked item not checked, Vendor individual payment option not checked, result is a single payment item for multiple invoices
    4. FBZP - single payment for marked item not checked, Vendor individual payment option is checked, result is a multiple payment items for each invoice
    Are you saying that the option in FBZP simply enables the grouping/non grouping based on what the vendor master record payment option is? Typically, that option for vendors is not checked in either of our company codes, therefore if the only difference is the setting in FBZP, then why would I be getting only a single payment for multiple invoices in the case of scenario 1 listed above?
    That's why I am wondering if perhaps there is something elsewhere than FBZP and vendor master settings that could be affecting this.
    Comments please?

  • How to read complete line displayed thru ALV report on double click? urgent

    Hi guys,
    An ALV report is displayed using 'REUSE_ALV_LIST_DISPLAY' and i have a requirement such that i have to read the line item on which double click is done.
    I have to fetch the line item, field by field and not by characters. I have attached the function code and all using PF status.
    Please tell me an approach as how to fetch the line item on which double click is done.
    Points will be rewarded.
    Regards
    Rahul

    Hi  ..
    i did  report  with  belnr  , bukrs  ,  Gjahr  . which will  call the  transcation code  FB03 displaing thedocument  ...
    please  cut and  paste the report  it will work ..
    REPORT  zdemo_alvgrid                 .
    TABLES:   bkpf . "  ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
    BUKRS   like  bkpf-BUKRS,
    BELNR like  bkpf-BELNR,
    GJAHR like  bkpf-GJAHR,
    BLART like  bkpf-BLART,
    BLDAT like  bkpf-BLDAT,
    BUDAT like  bkpf-BUDAT,
    MONAT like  bkpf-MONAT,
    XBLNR like  bkpf-XBLNR ,
    *  ebeln TYPE ekpo-ebeln,
    *  ebelp TYPE ekpo-ebelp,
    *  statu TYPE ekpo-statu,
    *  aedat TYPE ekpo-aedat,
    *  matnr TYPE ekpo-matnr,
    *  menge TYPE ekpo-menge,
    *  meins TYPE ekpo-meins,
    *  netpr TYPE ekpo-netpr,
    *  peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you  more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    *               I.e. Field type may be required in-order for
    *                    the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'BUKRS'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BELNR'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      fieldcatalog-outputlen   = 10.
       fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
        append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'GJAHR'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
        append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLART'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLDAT'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BUDAT'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MONAT'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'XBLNR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    **  fieldcatalog-fieldname   = 'PEINH'.
    **  fieldcatalog-seltext_m   = 'Price Unit'.
    **  fieldcatalog-col_pos     = 8.
    **  append fieldcatalog to fieldcatalog.
    *  clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    *  gd_layout-totals_only        = 'X'.
    *  gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
    *                                         "click(press f2)
    *  gd_layout-zebra             = 'X'.
    *  gd_layout-group_change_edit = 'X'.
    *  gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
    *            i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
    *            it_special_groups       = gd_tabgroup
                it_events               = gt_events
                is_print                = gd_prntparams
                i_save                  = 'X'
    *            is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 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.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select BUKRS
    BELNR
    GJAHR
    BLART
    BLDAT
    BUDAT
    MONAT
    XBLNR  up to 10 rows
      from bkpf
      into table it_ekko.
    *select ebeln ebelp statu aedat matnr menge meins netpr peinh
    * up to 10 rows
    *  from ekpo
    *  into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    * Form  TOP-OF-PAGE                                                 *
    * ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    * Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    * Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    * Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
    *            i_logo             = 'Z_LOGO'.
    endform.
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
    *   Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'BELNR'.
    *     Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *     Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD   wa_ekko-bELNR  .
          SET PARAMETER ID 'MES' FIELD   wa_ekko-bUKRS  .
          SET PARAMETER ID 'DES' FIELD    wa_ekko-GJAHR .
    *     Sxecute transaction ME23N, and skip initial data entry screen
    *      CALL TRANSACTION 'FB03' AND SKIP first screen.
    SUBMIT RFBUEB00
    *        WITH ALCUR ...
    *        WITH ARCHOBJ ...
    *        WITH ARCH_SEL ...
    *        WITH ARUSETYP ...
    *        WITH AUTBEXNO ...
    *        WITH AUTH_BUK ...
    *        WITH AUTH_LDR ...
    *        WITH BR_AWKEY ...
    *        WITH BR_AWSYS ...
    *        WITH BR_AWTYP ...
            WITH BR_BELNR =  wa_ekko-bELNR
    *        WITH BR_BLART ...
    *        WITH BR_BLDAT ...
    *        WITH BR_BUDAT ...
            WITH BR_BUKRS =    wa_ekko-bUKRS
    *        WITH BR_CPUDT ...
            WITH BR_GJAHR  =  wa_ekko-GJAHR
    *        WITH BR_RLDNR ...
    *        WITH BR_SEQ ...
    *        WITH BR_USNAM ...
    *        WITH BR_XBLNR ...
    *        WITH EXCDT ...
    *        WITH P_STATS ...
    *        WITH STATISTK ...
    *        WITH STATUSD ...
    *        WITH STATUSL ...
    *        WITH STATUSM ...
    *        WITH STATUSS ...
    *        WITH STATUSV ...
    *        WITH TCODE ...
    *        WITH UNAME ...
    *        WITH XEMUCNV ...
    *        WITH XUSEAR ...
    *        WITH XUSEAS ...
    *        WITH XUSEDB
            AND RETURN  .
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
    *       Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
    *       Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    reward points if it is  usefull ...
    Girish

  • How to skip line for delimited file type?

    Hi, i wanna ask how to skip (example: the first two line) for delimited file type?
    Thanks...
    Here is my script
    Function NY_Skip06Center [strField, strRecord]
    ' FDM DataPump Import Script:
    'Created by: FDM_Admin
    'Date created: 2/28/2006
    Dim strEntity
    'Check first two characters of entity
    For strEntity = 1 to 6
    'Skip line
    Res.PblnSKip = True
    Next strEntity
    End if
    End Function
    But it returns this error when imported
    Error: An error occurred importing the file.
    Detail: Object variable or With block variable not set
    Anyone knows what's wrong
    Edited by: user649207 on Mar 19, 2010 2:15 AM
    Edited by: user649207 on Mar 19, 2010 3:04 AM

    strAcc = DW.Utilities.fParseString (strField, 1, 1, chr(9))
    I didn't look closely enough last time. The above is illogical. The parsestring function parses a string based on a delimiter.
    The function has these arguments:
    String to Parse
    How many fields are in the string
    The parsed field to return
    Field delimiter
    In the above, strField is returning the field specified in your import format. You are also saying that there is a total of 1 field. If that were the case, you wouldn't need to parse anything.
    I am guessing that your call needs to look something more like this:
    strAcc = DW.Utilities.fParseString (*strRecord*, *8*, 1, chr(9))
    Make sense?
    If not, maybe you can include a few sample lines from your data file and that will make it easier to help you.
    Is your import format fixed or delimited?

  • Clearmake: Warning: Too many command lines for "pcscfg.cfg"

    Hi,
    We are in the process of migrating an application(contains pro*C code) from oracle 9i to 10g.
    When the application is compiled on oracle 9i the compilation used complete with out any problems.
    After we changed the ORACLE_HOME parameter in our makefile to point to 10g home. clearmake
    gives the following Warning. though the build is successful
    clearmake: Warning: Too many command lines for "pcscfg.cfg"
    Could anybody please help me in getting rid of this warning?
    Regards
    Srikrishan

    Hi,
    I have removed all unwanted things from the makefile, but the problem is still there.
    I have included a sample program and the makefile which reproduces the problem.
    The problem goes away if I comment out 4th line from the makefile and use 5th line instead
    Could anybody please help?
    #################The contents of the make file are #####################
    targets: proctest
    #ORACLE_HOME= /data/oracle/product/9.2.0
    ORACLE_HOME= /data/tsd_oracle/hpux/10.2.0.2
    include $(ORACLE_HOME)/precomp/lib/env_precomp.mk
    #include /data/oracle/product/9.2.0/precomp/lib/env_precomp.mk
    ORACLEINCLUDES= -I$(ORACLE_HOME)/precomp/public
    PROCSYSINCLUDEOPT=sys_include='(/usr/include,/opt/aCC/include,/opt/aCC/include/iostream)'
    ALLPROCINCLUDEOPTS= $(PROCSYSINCLUDEOPT)
    PROCPPFLAGS= sqlcheck=full lines=yes code=cpp def_sqlcode=yes $(ALLPROCINCLUDEOPTS)
    ACC=/opt/aCC/bin/aCC
    ORACLELIBS= -L $(ORACLE_HOME)/lib32 -l:libclntsh.sl
    #===========================proc test==================================
    proctest:proctest.o
    $(ACC) -o proctest $(ORACLELIBS) proctest.o
    #========================= General target rules ============================
    proctest.o:
    $(ORACLE_HOME)/bin/$(PROC) $(PROCPPFLAGS) CPP_SUFFIX=cc iname=proctest.pc
    $(ACC) $(ORACLEINCLUDES) -c proctest.cc -o proctest.o
    #####################program (proc test.pc)#########################
    #include<stdlib.h>
    #include<iostream.h>
    #include<sqlca.h>
    #define UNAME_LEN 20
    #define PWD_LEN 20
    EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR username[UNAME_LEN]; // VARCHAR is an ORACLE supplied struct
    varchar password[PWD_LEN]; // varchar can be in lower case also
    EXEC SQL END DECLARE SECTION;
    void sql_error(char *msg);
    int main()
    EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error:");
    username.len = (unsigned short)strlen(strcpy((char *)username.arr, "scott"));
    password.len = (unsigned short)strlen(strcpy((char *)password.arr, "tiger"));
    EXEC SQL CONNECT :username IDENTIFIED BY :password;
    cout<<"Connected to oracle \n";
    return(0);
    void sql_error(char *msg)
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    cout << endl << msg << endl;
    cout << sqlca.sqlerrm.sqlerrmc << endl;
    EXEC SQL ROLLBACK RELEASE;
    exit(1);
    ####################################################################

  • Alv report to have 2 lines for column header

    How do I set the column header to have 2 lines?
    eg
              Week Ending  --- 1st  line
               09.10.2007    ---  2nd line
    My report always ends up with 2 detail lines when I tried to insert it into the catalog.

    Try this it may help you for multiple values for one instance....
    *Type-pools
    TYPE-POOLS: slis.
    Data declarations.
    DATA: BEGIN OF t_vbak OCCURS 0,
    vbeln TYPE vbeln,
    bstnk TYPE vbak-bstnk,
    erdat TYPE vbak-erdat,
    kunnr TYPE vbak-kunnr,
    END OF t_vbak.
    DATA: BEGIN OF t_vbap OCCURS 0,
    vbeln TYPE vbeln,
    matnr TYPE vbap-matnr,
    netpr TYPE vbap-netpr,
    waerk TYPE vbap-waerk,
    kwmeng TYPE vbap-kwmeng,
    meins TYPE vbap-meins,
    END OF t_vbap.
    DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
    DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
    DATA: v_repid TYPE syrepid.
    DATA: s_layout TYPE slis_layout_alv.
    DATA: v_tabname TYPE slis_tabname.
    DATA: t_events TYPE slis_t_event.
    start-of-selection event.
    START-OF-SELECTION.
    v_repid = sy-repid.
    Get the fieldcatalog for the first block
    PERFORM get_fieldcat1 CHANGING t_fieldcatalog1.
    Get the fieldcatalog for the second block
    PERFORM get_fieldcat2 CHANGING t_fieldcatalog2.
    Get the data for the first block
    SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
    INTO TABLE t_vbak
    FROM vbak WHERE vbeln > '0060000100'.
    Get the data for the second block
    SELECT vbeln matnr netpr waerk kwmeng meins UP TO 10
    ROWS
    INTO TABLE t_vbap
    FROM vbap WHERE vbeln > '0060000100'.
    init
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
    EXPORTING
    i_callback_program = v_repid.
    First block
    v_tabname = 'ITAB1'.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    is_layout = s_layout
    it_fieldcat = t_fieldcatalog1
    i_tabname = v_tabname
    it_events = t_events
    TABLES
    t_outtab = t_vbak.
    Second block
    v_tabname = 'ITAB2'.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
    EXPORTING
    is_layout = s_layout
    it_fieldcat = t_fieldcatalog2
    i_tabname = v_tabname
    it_events = t_events
    TABLES
    t_outtab = t_vbap.
    *Display
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    FORM GET_FIELDCAT1
    Get the field catalog for the first block
    FORM get_fieldcat1 CHANGING lt_fieldcatalog TYPE
    slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    Order number
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname = 'T_VBAK'.
    s_fieldcatalog-ref_tabname = 'VBAK'.
    s_fieldcatalog-ref_fieldname = 'VBELN'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Customer purchase order.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'BSTNK'.
    s_fieldcatalog-tabname = 'T_VBAK'.
    s_fieldcatalog-ref_tabname = 'VBAK'.
    s_fieldcatalog-ref_fieldname = 'BSTNK'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Creation date.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'ERDAT'.
    s_fieldcatalog-tabname = 'T_VBAK'.
    s_fieldcatalog-ref_tabname = 'VBAK'.
    s_fieldcatalog-ref_fieldname = 'ERDAT'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Customer
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'KUNNR'.
    s_fieldcatalog-tabname = 'T_VBAK'.
    s_fieldcatalog-ref_tabname = 'VBAK'.
    s_fieldcatalog-ref_fieldname = 'KUNNR'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    ENDFORM.
    FORM GET_FIELDCAT2
    Get the field catalog for the second block
    FORM get_fieldcat2 CHANGING lt_fieldcatalog TYPE
    slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    Order number
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'VBELN'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Material number
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'MATNR'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Net price
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'NETPR'.
    s_fieldcatalog-cfieldname = 'WAERK'.
    s_fieldcatalog-ctabname = 'T_VBAP'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Currency.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'WAERK'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'WAERK'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    Quantity
    s_fieldcatalog-col_pos = '5'.
    s_fieldcatalog-fieldname = 'KWMENG'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'KWMENG'.
    s_fieldcatalog-qfieldname = 'MEINS'.
    s_fieldcatalog-qtabname = 'T_VBAP'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    UOM
    s_fieldcatalog-col_pos = '6'.
    s_fieldcatalog-fieldname = 'MEINS'.
    s_fieldcatalog-tabname = 'T_VBAP'.
    s_fieldcatalog-ref_tabname = 'VBAP'.
    s_fieldcatalog-ref_fieldname = 'MEINS'.
    APPEND s_fieldcatalog TO lt_fieldcatalog.
    CLEAR s_fieldcatalog.
    ENDFORM.
    ALV Report to have two different Reports
    Plz Reward points if contents are useful,,,

Maybe you are looking for

  • How to use one itunes library with 2 different ipods.

    I have had a 30gig for a year, with over 2000 songs in the library, I just bought my wife a nano for christmas, how do i get songs from my library onto her nano????

  • Radius authentication with ISE - wrong IP address

    Hello, We are using ISE for radius authentication.  I have setup a new Cisco switch stack at one of our locations and setup the network device in ISE.  Unfortunately, when trying to authenticate, the ISE logs show a failure of "Could not locate Netwo

  • MacBook Pro to LG HGTV

    What is the cable I need to connect my 13"Macbook pro to a LG HDTV?

  • MORDY MY TOP 40 ILLUSTRATOR CS 4 QUESTIONS:

    MY TOP 40 ILLUSTRATOR CS 4 QUESTIONS: 1) Do print presets retain number of copies now? 2) Also, do sublayers behave normally with respect to locking/hiding? 3) Do swatches stay in list few now? 4) Can we set a default tool to be selected at startup?

  • Error when Writing Metadata to Files in Bridge (Mac) but not in Bridge (PC)

    We get an error when writing metadata to files in Bridge (Mac) but not in Bridge (PC). In the same drive and folder, the PC can successfully write a keyword to a file on the PC, where the Mac returns an error. I have researched this at the Adobe Know