Select staments??

Hi,
  For one of my requirement i need some quires.Please help me.
Queires : To retrive the name1,name2
logic   : pick customer No from MHND-KUNNR and use table kna1-name1.
logic   : pick customer No from MHND-KUNNR and use the table kna1-name2.
for Address Line 1 to retrive the ADRC(HOUSE_NUM1),ADRC(STREET).
logic: Pick the address number from the table KNA1 and then go to the table ADRC to pull the relevant field.
for Address Line 2 to retrive the ADRC(STR_SUPPL1 ),ADRC(STR_SUPPL2 ),ADRC(STR_SUPPL2 ).
logic: Pick the address number from the table KNA1 and then go to the table ADRC to pull the relevant field.
for contact tel number ADR2(TEL_NUMBER)
logic: Pls extract the Address number from Table T001 and then extract telephone sequence no.2 from table ADR2
Please help me how to write the select quires?
Regards,
srihitha

Hi Srihitha,
Please see the below piese of code this can be helpful to fetch the required data.
Note: Based on the fields in my selection screen i.e, BUKRS i have got the remaining data....in your case you may have some other key fields of MHND table so you can use them also in where clause where required.
if you could have given the fields which you will have with you from table MHND we can have INNER JOINS for some tables.
But the below queries may be helpful to you or they may atleast give you an idea to proceed.
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS: s_bukrs FOR mhnd-bukrs.
SELECTION-SCREEN END OF BLOCK b1.
TYPES: BEGIN OF ty_names,
       kunnr TYPE kunnr,
       name1 TYPE name1_gp,
       name2 TYPE name2_gp,
       adrnr TYPE adrnr,
       END OF ty_names,
       BEGIN OF ty_kunnr,
       kunnr TYPE kunnr,
       END OF ty_kunnr,
       BEGIN OF ty_address,
       house_num1 TYPE ad_hsnm1,
       street     TYPE ad_street,
       str_supp1  TYPE ad_strspp1,
       str_supp2  TYPE ad_strspp2,
       str_supp3  TYPE ad_strspp3,
       END OF ty_address,
       BEGIN OF ty_telephone,
       tel_number TYPE ad_tlnmbr,
       adrnr      TYPE adrnr,
       END OF ty_telephone.
DATA: lt_names TYPE STANDARD TABLE OF ty_names,
      lt_kunnr TYPE STANDARD TABLE OF ty_kunnr,
      lt_address TYPE STANDARD TABLE OF ty_address,
      lt_telephone TYPE STANDARD TABLE OF ty_telephone.
REFRESH: lt_names,
         lt_kunnr,
         lt_address,
         lt_telephone.
IF NOT s_bukrs IS INITIAL.
  SELECT kunnr
    INTO TABLE lt_kunnr
    FROM mhnd
    WHERE bukrs IN s_bukrs.
  IF sy-subrc EQ 0.
    SELECT kunnr
           name1
           name2
           adrnr
      INTO TABLE lt_names
      FROM kna1
      FOR ALL ENTRIES IN lt_kunnr
      WHERE kunnr = lt_kunnr-kunnr.
    IF sy-subrc EQ 0.
      SELECT  house_num1
              street
              str_suppl1
              str_suppl2
              str_suppl3
          INTO TABLE lt_address
          FROM adrc
          FOR ALL ENTRIES IN lt_names
          WHERE addrnumber = lt_names-adrnr.
      IF sy-subrc EQ 0.
do nothing
      ENDIF.
      SELECT tel_number
             addrnumber
        INTO TABLE lt_telephone
        FROM adr2
        FOR ALL ENTRIES IN lt_names
        WHERE addrnumber = lt_names-adrnr.
      IF sy-subrc EQ 0.
do nothing
      ENDIF.
    ENDIF.
  ENDIF.
ENDIF.
Regards,
Rasheed.

Similar Messages

  • NestedSlects In Select Staments with clubbing of 5 tables with Order Clause

    Hi Experts,
    I need to execute on Oracle Qurey in Receiver JDBC.
    The oracle select Query contains
    1. Many Select statments in the parent select statment
    2. In side child select stament there are standard SQL fiunctions like.. NVL()
    3. Parent select statements is operating on 5 tables...
    4. There is big where clause, in side the where clause thare are some more select statments and standard SQL functions
    5. It has order by caluse as well.
    On total, it was a full pledged SQL Select statment, which has all types and varieties of twists in side it.
    Clinet is not agreeing for Stored Procedure. He just want to execute Big Select statment form XI and get back the resltant rows.
    It is Sync scenario...
    Can this be achived using XI by using Recever JDBC adatper by passing XML SQL statment..
    Thanks
    Subbu

    Hi Raj,
    Thanks you very much for your quick link, and i have gone through all the links/blogs before i posted the question. I heave searched total SDN and I am not sure that XI has this capability.
    Do you have any experiences or suggestions on the limitations on XML SQL format, when we are doing to querying such a complex select statement form XI. Because i dont know how much impact
    Please share your thoughts. 
    Thanks
    Subrahmanyam

  • Types of select staments

    hi,
    can u tell me, how many ways we can fetch data.
    means , different types of select staments used in sap abap.
    please help me.
    regards
    subhasis

    Hi,
    Better place cursor on Select keyword and press F1, plenty of documentation available with examples.
    Or execute transaction ABAPDOCU and see.
    Regards,
    Satish

  • Trouble with a SELECT stament?Is this is a bug or am i an idiot

    DB version:10g Enterprise Edition Release 10.2.0.3.0
    I have a simple SELECT statement like
    SELECT ship_dtl.track_id,{color:#ff0000}_{color}ship_dtl.cons_id from ship_dtl
    If there is a space between coma and ship_dtl.cons_id in the query(a red underscore is used above to show the space). This query will give the error
    {noformat}ERROR at line 1:
    ORA-00942: table or view does not exist
    {noformat}
    But i don't get this issue with other tables. Why is this happening?
    Edited by: canine_Joe on Sep 4, 2008 3:04 AM

    canine_Joe wrote:
    How many lines of output do i to post to convince you?Ok, well let me be blunt...
    It's not a bug. It can't possibly be.
    Thousands, if not millions, of Oracle developers have been writing queries with or without spaces between their columns in the select clause for a long time now without any issue.
    The fact that Oracle is reporting the table is not found indicates that there's some other issue at hand.
    What version of SQL*Plus are you using against your 10.2.0.3 database? Maybe that's out of date and has a bug or is incompatible with 10.2.0.3. for some reason.
    What user/schema owns the table and what user is running the SQL?
    What permissions are on the table?
    What synomyms exist?
    Is there a problem with keyboard mappings on your client or the language settings on client or Oracle server, so the space isn't really a space character?
    How about taking your query with the space and doing...
    select dump('SELECT ship_dtl.track_id, ship_dtl.cons_id from ship_dtl;') from dual;and seeing what each character is in the string, just to confirm it's a chr 32 (space).
    There may be other reasons too...

  • "Check Statistics" in the Performance tab. How to see SELECT statement?

    Hi,
    In a previous mail on SDN, it was explained (see below) that the "Check Statistics" in the Performance tab, under Manage in the context of a cube, executes the SELECT stament below.
    Would you happen to know how to see the SELECT statements that the "Check Statistics" command executes as mentioned in the posting below?
    Thanks
    ====================================
    When you hit the Check Statistics tab, it isn't just the fact tables that are checked, but also all master data tables for all the InfoObjects (characteristics) that are in the cubes dimensions.
    Checking nbr of rows inserted, last analyzed dates, etc.
    SELECT
    T.TABLE_NAME, M.PARTITION_NAME, TO_CHAR (T.LAST_ANALYZED, 'YYYYMMDDHH24MISS'), T.NUM_ROWS,
    M.INSERTS, M.UPDATES, M.DELETES, M.TRUNCATED
    FROM
    USER_TABLES T LEFT OUTER JOIN USER_TAB_MODIFICATIONS M ON T.TABLE_NAME = M.TABLE_NAME
    WHERE
    T.TABLE_NAME = '/BI0/PWBS_ELEMT' AND M.PARTITION_NAME IS NULL
    When you Refresh the stats, all the tables that need stats refreshed, are refreshed again. SInce InfoCube queries access the various master data tables in quereis, it makes sense that SAP would check their status.
    In looking at some of the results in 7.0, I'm not sure that the 30 day check is being doen as it was in 3.5. This is one area SAP retooled quite a bit.
    Yellow only indicates that there could be a problem. You could have stale DB stats on a table, but if they don't cause the DB optimizer to choose a poor execution plan, then it has no impact.
    Good DB stats are vital to query performance and old stats could be responsible for poor performance. I'm just syaing that the Statistics check yellow light status is not a definitive indicator.
    If your DBA has BRCONNECT running daily, you really should not have to worry about stats collection on the BW side except in cases immediately after large loads /deletes, and the nightly BRCONNECT hasn't run.
    BRCONNECT should produce a lof every time it runs showing you all the tables that it determeined should have stats refreshed. That might be worth a review. It should be running daily. If it is not being run, then you need to look at running stats collection from the BW side, either in Process Chains or via InfoCube automatisms.
    Best bet is to use ST04 to get Explain Plans of a poor running InfoCube query and then it can be reviewed to see where the time is being spent and whether stats ate a culprit.

    Hi,
    Thanks, this is what I came up with:
    st05,
    check SQL Trace, Activate Trace
    Now, in Rsa1
    on Cube, Cube1,
    Manage, Performance tab, Check Statistics
    Again, back to st05
    Deactivate Trace
    then click on Displace Trace
    Now, in the trace display, after scanning through  the output,
    “ … how do I see the SELECT statements that the "Check Statistics" command executes …”
    I will appreciate your help.

  • Select Statment Error (SQL)

    Dear Friends,
      LOOP AT IT_ZSD012_001 INTO WA_ZSD012_001.
        SELECT  A~MATNR A~LABST A~UMLME A~INSME A~EINME A~SPEME A~RETME B~MTART
          APPENDING TABLE IT_INVENTORY
          FROM  MARD AS A
          INNER JOIN MARA AS B ON B~MATNR EQ A~MATNR
          WHERE A~MATNR = '1.1.1'
          and   A~WERKS EQ  WA_ZSD012_001-PARAM_1
          AND   A~LGORT EQ  WA_ZSD012_001-VALUE
          AND   A~LABST GT 0
          OR    ( A~UMLME GT 0
          OR    A~INSME GT 0
          OR    A~EINME GT 0
          OR    A~SPEME GT 0
          OR    A~RETME GT 0 )
          AND   B~MTART IN ('ZFG1' , 'ZFG4' , 'ZR12' ).
      ENDLOOP.
    this is my code (select statement)
    but this is not working, when i execute this so many materials came to the itab it should come only "1.1.1"
    my requirement is i want to get data from MARD agaist WERKS, LGORT and also MARA-MTART in that groups.
    its came with zero inventory, i want to avid them how can i do this.
    hope you can understand what i an said?
    Thanks in advanced

    Hi Nelson,
    For better performance try to avoid using join statements. Use for all entries instead.
    Never use select staments in Loops.
    try your code following way
    if it_zsd012_001 is not initial.
       select matnr labst umlme insme einme speme retme
          from mard
          appending table it_inventory
          for all entries in it_asd012_001
          where matnr = '1.1.1'
          and   werks = it_asd012_001-param_1
          and   lgort = it_asd012_001-value
          and  (labst gt 0 or insme gt 0 or einme gt 0 or speme gt 0 or retme gt 0).
           if sy-subrc eq o.
                select mtart from mara
                       into table it_mara
                        for all entries in it_inventory
                        where matnr = it_enventoty-matnr
                        and   mtart in ('ZFG1' , 'ZFG4' , 'ZR12' ).
            endif.
            endif.
    "Then just merge two table into third one.
    Hope it will help to solve your query,
    Pratik

  • Select-option parameter passed to function module

    hi,
    I have passed the select-option parameter as a table to my function module,
    suppose i have passed it as date(it contains field date-high and date-low)
    In my function module while i am looping the table and selecting the data according to date_low,it is going to select only the data according to date_low.
    since the table contains only one row.
    loop at date.
    select the data according to date_low.
    date_low = date_low +1.
    modify date_low.
    endloop.
    how can i select all the data from date_low and date_high?

    Hi,
    there is issue  design of ur FM .
    You have to put 2 table parametrs or 2 import paremeters in the FM ,after that with in the Function module fill the internal table of type ranges (say itab).
    After filling the ranges internal table, this can be used in ur select stament just as select option ( select ...where podat in itab)
    revrt back if any issues.
    regards,
    Naveen

  • Is it better to use bapi_salesorder_getlist than select statements?

    hi experts,
    in terms of performance, which is better in getting a list of salesorders is it better bapi_salesorder_getlist or select statements?
    for bapi_salesorder_getlist, i will not get all of the fields so i would still use select.
    Message was edited by:
            maui bayog

    Hi,
    If ur requiremetn is specific and can be solved using bapi_salesorder_getlist then only use it, otherwise, use select stament which is more useful for reports as it gives o/p as required and not a predefined limited output.  Now u may get sufficient fields but , in future if requirement will change then for small change u may be in problem.
    Bapis are very userful for specifc and limited tasks.
    Jogdand M B

  • Select statment & form block

    Hi,
    I have one issue here which is:
    Oracle 10g
    Suppose you have a select stament which contain
    A lot of columns can i reflect this statment in form
    Block and apply delete update insert action in this block
    Regards,
    Edited by: kingadmin on Aug 19, 2012 10:31 PM

    Is this a onetime task? If so, i would
    -create a database view
    -create an INSTEAD-OF-trigger on the view
    -base your block on the view.
    It might be that you have to change the key-mode of the block to maybe "Non-Updateable" and that you have to create your own ON-LOCk-trigger.m(Depends on the complexity of the view)

  • JOIN Vs SELECT

    Hi All,
    I have  arequirement to improve the perofrmance of an extractor. It has to get data from two tables. Is it good to have a single JOIN to pickup all columns or better to have two separet SELECT staments. Currently the seacrh field (WHERE Clause) uses primary key but there is no index available on it. This SQL statement will come in my user exit. Please tell me which is a better option.
    1. Create a single JOIN statment and make sure both columns in the WHERE has INDEX created on the search field.
    2. Create two individual SELECT stament and have INDEX created on the WHERE clause on the search field.
    I would like to go with Option 1. Is it better than Option 2?
    Ideas welcome.
    Alex(Arthur Samson)

    Hi Alex,
    I recommend option 1. You are however going to have indexes so, option 1 is better as you have just one hit to the database. In the second option, there will be 2 requests going to the database. So, some communication time can be saved.
    Thanks and Regards
    Subray Hegde

  • Passing select parameter

    Hi All,
    I have got a built-in procedure:pakage1.procedure1
    It takes parameters separated by |.
    Once we pass the parameters and run this process query,we update a set of tables/views.
    One parameter I need to pass is a select statement as follows:
    select 'Today is'||' '||to_char(sysdate,'MONTH')||' '||'to_char(sysdate,'YEAR')||' '||' '||'thanks'
    But if I pass this I get an error "between ||".
    As,parameters are separated by |,this select stament with concatenation gives error.
    Please advise if there is any workaround for this.

    As you can see from the execution sequence that follows, I don't see any error on using the query you posted:
    SQL> --
    SQL> -- run the query in sqlplus
    SQL> select to_char(sysdate, '"The report for "FMMonth FmYYYY "is now ready"') from dual;
    TO_CHAR(SYSDATE,'"THEREPORTFOR"FMMONTHFMYYYY"ISNOWREADY"')
    The report for July 2008 is now ready
    SQL>
    SQL> --
    SQL> -- create a procedure that takes a "|" delimited string as a parameter
    SQL> --
    SQL> create or replace procedure my_proc (p_str in varchar2)
      2  is
      3    v_str1   varchar2(1000);
      4    v_str2   varchar2(1000);
      5    v_str3   varchar2(1000);
      6    v_output varchar2(1000);
      7  begin
      8    dbms_output.put_line('You entered: '||p_str);
      9    v_str1 := substr(p_str, 1, instr(p_str,'|',1,1) - 1);
    10    v_str2 := substr(p_str, instr(p_str,'|',1,1) + 1, instr(p_str,'|',1,2) - instr(p_str,'|',1,1) - 1);
    11    v_str3 := substr(p_str, instr(p_str,'|',1,2) + 1);
    12    dbms_output.put_line('Individual tokens are:');
    13    dbms_output.put_line(rpad('-',40,'-'));
    14    dbms_output.put_line('v_str1 = '||v_str1);
    15    dbms_output.put_line('v_str2 = '||v_str2);
    16    dbms_output.put_line('v_str3 = '||v_str3);
    17    dbms_output.put_line(rpad('-',40,'-'));
    18    dbms_output.put_line('Now executing v_str2');
    19    execute immediate v_str2 into v_output;
    20    dbms_output.put_line(rpad('-',40,'-'));
    21    dbms_output.put_line('v_output = '||v_output);
    22  end;
    23  /
    Procedure created.
    SQL>
    SQL> --
    SQL> -- now test the procedure by passing the query as a part of the "|" delimited string
    SQL> --
    SQL> exec my_proc('this is string 1|select to_char(sysdate, ''"The report for "FMMonth FmYYYY "is now ready"'') from dual|this is string 3');
    You entered: this is string 1|select to_char(sysdate, '"The report for "FMMonth FmYYYY "is now ready"') from dual|this is string 3
    Individual tokens are:
    v_str1 = this is string 1
    v_str2 = select to_char(sysdate, '"The report for "FMMonth FmYYYY "is now ready"') from dual
    v_str3 = this is string 3
    Now executing v_str2
    v_output = The report for July 2008 is now ready
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    SQL>You may want to check a few things:
    - Are you mixing up the single and double quotes ?
    - Are you escaping all single quotes while passing the query as an input (VARCHAR2) parameter ?
    - Are you dropping off the semi-colon at the end ? (It should not be passed).
    If you post your sqlplus session (like I did above) or post a small and reproducible testcase, then that should help - I've never experienced an ephiphany. ;)
    isotope

  • Small Doubt Regarding SY-MANDT

    Hi All,
         SELECT changenr FROM cdhdr CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE it_cdhdr
                                             WHERE mandant = syst-mandt
                                             AND   objectclas = 'MATERIAL'
                                             AND   objectid   = wa_matl-matnr
                                             AND   tcode      = 'MM02'.
         I have written the select stament as shown above.
         In this i have a doubt like adding a field sy-mandt  in the where condition will increase the Efficiency of program or not.
    regards,
    raghu.

    Hi..
    No doubt the efficency would be affected but from business point of view there will many  things that need to be checked as in:
    If you are viewing data from CDHDR and CDPOS which is client specific then you are not viewing complete data.
    These tables give us and document changes made to a particular object in SAP but if anything is cross client like company code(lets assume) then changes to it wont be visible in all the clients..
    so there can be some key information you can miss out while working on some of the objects.
    else in this case its good to make query cross client.
    regards
    vishal

  • Some faqs can u solve dis answers asp

    1) How do u handle table control in bdc?
    2) What is diff b/w normal functional modules and BAPI's fm's?
    3)what is fct-code of at- line- selection?
    4)why do u  use subroutine pool in scripts?
    5)name few performance techniques?
    6)in how many ways u can design interactive reprt?
    7)what is the need of table maintainance option at the begin of table creation?
    8)what is the system landscape?
    9)what is the use of submit command in exe program?
    10)how do u create secondary index?
    11) what is the diff b/w sap memory and abap memory?
    what is the max size of date records?
    2)what is the max size of IDOC?
    3)what is the relationship b/w ALE and EDI?
    4)when u have data transfer, why do u chose IDOC's?
    5)i have 200 records how u decide how many records should execute per IDOc?
    6)ALE customizing method?
    7)how do u define logical systems and assign logical systems to clients?
    8)what is change pointer technique?&what is need of change pointer technique?
    1) name the events in order in case of classical report?
    2)if i put write statemnt in at slection-screen,does it works?
    3)can u call multilple selctio screen in one report?
    4)what is diff b/w integration & at slection-screen ouput?
    5) i have a requirement like  i have 3 radio butons in one group,
    if i select one radio button then remaining radio buttons  are invisible what is the code for this?
    6) how do u decide which method is suite for paricular requirement if not specified in bdc?
    i.e session or  call transction?
    7)what is BAPI?
    8)how BAPI differ from  ALE?
    9) steps of configuring of EDI?
    10) is layout set is client dependent or not?
    11)how to transfer layout sets  to test client side?
    12)what is the protect......end protect?
    13) for what purposeu create multiple wqidows in one page?
    14)what are diff areas wher ucan ouput text in main window?
    15)what method u use to output text in    (top........endtop) or write_form?
    16)what is the reason for use of write_form rather than top------endtop?
    1)i need a logo on the right hand side of corner . how do u handle that?
    2)what is the standard table for storing standard symbols?
    3)how do u represent page no in scripts & total page nos?
    4)what is the transaction code for dump analysis?
    5)when top-of-page vent triggred?
    6)can i plce write stament in any event?does it works?
    7)what is the use of end-of-selection event?
    8)what is stop& exit?
    9)what happens if i plce write statement in end-of-selction?
    10)what is sy-ttill?
    11)does the value of sy-subrc chnge after if and write stament?
    12)what is bdc & types of bdc?
    13)when do u choose session , call transaction methods?
    14)how may types of symbols? what are they?
    15)what is the diff b/w constant & variable symbols?
    16)what are the parameters in open_form & start_form?
    17)does text orientation(190degrees ,145 degrees) is possible in sap scripts?
    18)how do u delete text from a layoutset window?
    19)what  are u need to take care  while transporting the request? for exeampl u developed a exit ,whta care do u take?
    20) what wil u do for preparing technical specs form functional specs?
    21) what is addres....endaddress in sap scripts?
    22)which method  do u prefer synchronous or asynchronous?
    23)what is output type?
    24)what does slection-screen of RBDMIDOC contains?
    25)what parameters u specifyng in RFc destination?
    26)what customiging y do to transfer the data from one logical systme to another logical system?
    27)can u explain brifely how idoc's genrated?
    28)if i just extend the idoc, what are the things u need to do?can i extend the same ouboud program?
    29)can u just explain what partner profile contains?
    30)what are process codes?
    31)if i just develop a gui status using pf-status.is it confined to single program or can be used for any other programs?
    32)what is client?
    33)what is diff b/w se01,se09,se10,stms  transction codes?
    34)what is the diff b/w select single * from kna1 and select * from kna1 for all entries?
    35)in subroutines paramaters are changing & using .what is the diff b/w them?
    1) what is the diff b/w scripts & smart forms?
    2)what are the function module used in smart forms?
    3)what are the function module? what is the use of them?
    4)what is the index? what is the secodary index ? whta is uses of them?
    5)what is the table  technical characteristics?
    6)waht is buffering? types?
    7)what is the use of interactive reprt?
    8)what is the use of alv?
    9)what are problems  u have faced when u r doing projecs?
    10)what is the diff b/w template & tables?
    11)which function module used for transferring from one version to anthoer version?
    12) what determines the sequence in events blocks are processed?
    13)in what case are otional parameters  allowed in the passig of parameters?
    a) functions  b) forms
    14)what relationship can be  esatblished in watch points?
    15)what are requiremets of reading hashed internal table?
    16)what does a context object provides?
    17)what access methods are avaliable  for accessing internal table?
    18)what operations are allowed when processing data of records in internal  table?
    19)what tasks could be performed in SAPNET?
    20)what is search  help?
    21)what is the lock object?
    22)what is diff b/w domain and data elemnt?
    23)what is diff b/w check table and value table?
    24)what are the control break statements?
    25)how to display SUM?
    26)what is the diff b/w select single  & select upto one row?
    27)collect what it did?
    28)how to findout data in internal table?
    29)syntax for describe statement?
    30)hwo to findout if internal table is empty or not?
    31)hwo to transfer data from one internal table to another internal table?
    32)how to modify internal table?
    33)Read statement syntax?
    34)what is the default event?
    35)i have write only top-of-page event in that  write: / 'welcome' what will happen?
    36)what is message-d?
    37)what is the diff b/w with events &  without events?
    38)what is the purpose of Direct input method?
    39)what is local object?
    40)is it possible  to back ground process in call transaction? how?
    41)what are diff types of errors?
    42)what are the diff types function modules used in layout set?
    43)what is the diff b/w open_form & start_form?
    44) how to define  logo?
    45)after modification how to send modified form to modified print program?
    46)what are the symbols in sap scripts? functionality of them?
    47)how to write a Report in another Report?
    48)syntx fr submitt &what it did?
    49)what is the land scape of ABAP?
    50)what is index? types?
    51)hwo many secondary indexe are possible to create?
    52)what is diff b/w select single * from & select upto one row?
    53)in my 100 records 55th record is need some changes and that record how to send body to header line?
    54) what is the use of indexs?
    55)what is the diff b/w page area & roll area?
    56)diff b/w interface & conversion?
    57)how we configured ports andpartner-profiles?
    58)what si the Enhancement and what u had did with user-exist?
    59)who can extend Idoc?
    60)how many types of select staments?
    61)what is header line?
    62)what is diff b/w internal table work area & table work area?
    63)if we don't have header line what will happen?
    64)when the user-exist will triggered? for which purpose u have used and where u have written?
    65) how we linked the tables?
    66)in at selection-screen and at user-command event which one is triggred?
    67)what is the use of at pf-status? where did u use it?
    68)is it possible to run Host command inSAP environment? how do u run it?
    69)what are user-exists? what is involved in writting them? what precautions are needed?
    70)what is the version management?
    71)if u send the objects from dev server to production server,but get some  bugs so those bugs how to handle?
    72)if u upload the data after that. i din't put committ,then what happen?
    73)how to maintain dataintegrity?
    74) how to validate fields?
    1)how u connect the unix platform from SAP server?
    2)what is database object ? Runtime object?
    3)How to populate BDC table control?
    4)How to implemnt intreactive  list in alv?tell me fumnction module for that?
    5)How to transfer from data list to transactions?
    6)How can u add anew field to Script?
    7)what are problems in processing batch input session?
    8)diff b/w select-options & ranges?
    9)what is meant by satck list?
    10)if u don't have header line for internal table what will happen?
    11)what is the max no of calling modes stacked at one time is?
    12)what is collect command ? how it is works?
    13)if u want come back from 15th list to basic list waht will u do?
    14)what is the default mode of transfers data to and from application server?
    15)what is the purpose of EXTRACT parameter?
    16) how will u delete duplicate records from internal table?
    17)in for all entries clause of select statement ,if internal table is empty what will happen?
    18) How can u find the no of records in a table?
    19)Billing and invoice details are where stored?
    20)what is the typical structure of ABAp program?
    21)what is diff b/w ABAP program &user defiend program?
    22)can a transperent table exists in a data dictionary and not in the physical database?y/n
    23)diff b/w Collect & Append?
    24)logical unit of work means?
    25) How many types of  lock objects exists? what are they?
    26)what will u don inSPRO?
    27)how many tyeps buffers?
    28) what wil do by Maintainance generator?
    29) what is o/p type? what is done by this?
    30)program for BAPI?
    31)what is ALE implementation progarm?
    32) say the function code to catch function code F2?
    33) what is IDOC& how u can extend the IDOC?
    34)what is the advantage of LSMW?
    35)how many types of symbols u have on scripts & in which order they can executes?
    36)what is purpose of data conversion into SAP format from Legacy?
    37) what si the t-code for watch the flat file in application serever?
    38) what is purpose of driver program?
    39)what is contents of Functional Spec?
    40)what is contents of Technical Spec?
    41)How do u diasble a control in a selection-screen logic?
    42)what is source structure?
    43)what is target structure?
    44)if u don't have the access to modify the print program then how do u insert the text elemnts?
    45)how can u call report in another program?
    46)specify the events for classic & intractive  reports in order?
    47)say some usally used system fields in our programs?
    48)how can u create check box in alv?
    49)diff b/w select-options & parameters?
    50)how can u create  labels in scripts?
    51)how u display the data in scripts?
    52)What is the diff b/w At selection-screen output & initialization?
    53)how u trap the errors in call transations?
    54)diff b/w scripts & smart forms?
    55)types of internal tables & explain them?
    56)how many types of loops?
    57)Diff b/w Synchronous & Asynchronous RFC
    58)How u place data in table cotrol?
    59)what are the methods execute in LSMW?
    60)diff b/w sy-index & sy-tabix?
    61) in call transaction bckground process which mode u prefer?
    62)what is configuration of ALE?
    63) what are all read operations in itab?
    64)diff b/w search help & pov, which one trigger first?
    65)where u can u do the validations in report?
    66)what are the events in Module program?
    67)diff b/w call transactions & session method and wher trap erros in both methods? how?
    68)diff b/w scripts & reports?
    69)how u define text elemnts inscripts?
    70)what are the function modules inscripts?
    71)how u diplay the data in scripts?
    72)how  do u do  the perfomance testing?
    1)when it wll triggerd initialization event? Before how many events will triggerd?what are they?
    2)how many types of meaasges ?
    3)what is use of Dump analysis?
    4)what is the use for all entries?
    5)what Is the diff  b/w check & continue?
    6)whenever use EXIt statement whappend in loop … endloop   and within subroutines,  within start-of-selection ,with in end-of-selectio  and in initialization?
    7)what is the diff b/w value table and check table?
    8)in data element level I used search help and in domain level I used value table which will be shows our criteria?
    9)without doing any changes in printprogarm  I want to add some fields how can?
    10)how many mainwindows in one page? What is the use of remaing main windows?
    11)what is sy-index & sy-tabix?
    12)what are the qualities u have to maintain to ur developments?
    13)Smart forms are client  independent how u  justify that?
    14)in keyindexex what is the relationship 1:n?
    15)in dynpro how can insert radio butto?
    16)How can u use search help?
    17)in MEDRUCk(ME21)  I have changes some fields so immediate those changes send to Vendor through e-mail or fax? What is procedure?
    18) I worked in foreground one session successfully so tommarow I have to work same session in back ground then what happen?
    19)in bdc table control wher u have to face problem?
    20)In alv grid  control at the top  I want header/ how can u display?
    21)how can u print long text in scripts?
    22)how to display Text every 4 lines after?
    1)how can  u create u r own types in an ABAP report?
    2)which system variable is encounted in loop counter?
    3) which system variable is store the record counter?
    4)does a select statement carry out any authorization chek?
    5)what is function of environment variable sy-lisel in interactive reports?
    6)how can we identify which button is pressed?
    7)diff b/w se09 ,Se10?
    8)table in which entry for development class is made?
    9)which client is authorized to create the workbench oragnizer configuration?
    10)can we provide more than one PBO PAI for one screen?
    11)which view can even possess one table?
    12)What are field symbols?
    13)which is ued to release to lock?
    14)what are the various types of customer –exists?
    15)what is port?
    16)what  are the selection-text?
    17)can we use  perform in SAP scripts?
    18)what is the t.code for table maintainance?
    1)write  validation logic for parameters option? Wher do u write ?(in at selection-screen or start-of-selection)?
    2)what is the diff b/w  ‘  ‘IN’ jn where condition and without ‘IN’ condition in where condition?
    3)how can u display 21st secondary list ?explain procedure?(code?)
    4)what is the diff b/w sorted and hashed tables?
    5)can write statement in initialization triggers first or write statemnt in start-of-selection?
    6)what can ud o if have no authorization to recording in BDC?(without F1 and Technical help)?
    7)what is the diff b/w SAPLUW and DBLUW?
    8)expalin VPN process?
    9)what is the text in reports and scripts?
    10)how can u  release ur objects to end user?
    11)write genereal statement to display dat-range?
    12)explain pricing procedure in sap?
    13)how can u display barcodes in sap scripts?
    14)explain flow of S.D?
    15)what are the performance techniques expect Modularization techniques I want remaning?
    1)what is the purpose of initialization?
    2)what are control break  statements?
    3)what is the diff b/w ‘at new and ‘on change’?
    4)what is the use of end-of-selection?
    5)in Runtime analysis what ar the main area will be displaying for tunnning?
    6)what are the ways to improve the performance the report?
    7)What is the diff b/w maintainance view and databe view?
    8)what are the type of search help?
    9)what is the diff b/w include structure and append structure?
    10)how can we generate new item in BDC program or the transaction ME21?
    11) in calltransaction while transferring the data what happens idf the power goes off?
    12) what are the standard  programs for  transfer the data for material master and vendor master?
    13)whare we can assign the page size?
    14)how can we call a subroutine in scripts?
    15)how many max pages  we have to design for script ?
    16) what is use of protected and end protected?
    17)what are the types of functional modules?
    18)how many types of screen filed validations? What ate they?
    19)how to convert  the scripts to smartforms?
    20)what is the history of purchase order? Wher is it store?
    21)can  we debug smartforms ?
    22)what is the material history and where is it store?
    23)what are the functional modules ued in ALV?
    24)what is the fieldcatalog merge use?
    25)how u print the heading in ALV ?
    26)what is the t.code for BDC?
    27)what is the purpose of application server?
    28)what are the text elements ? what is the use of text elements ?
    29)how u create vertical line  and horizanatal line in reports?
    30)what is the purpose header line?
    31)what is the purpose of occur  clause?what default area it occupies?
    32)what are  text elements?
    33)how many secondary indexes we can  create for a table?
    34)What is the ue of st05?
    35)what is the foriegn key table?and check table?
    36)what are some essential steps for loggig changes made to SAP data?

    Hi Mahesh,
    Very good questions.  Infact it's very difficult to answer all the questions.
    You can search many FAQs in net...
    If you have any specific questions related to single topic, Post message for each.
    I can send some of FAQ documents to u
    Answers
    1) Using Index like Field(1)-1st record field , Field(2) - 2nd record field etc... in Table control.. we can handle BDC
    2) BAPI will be programmed using OO concepts more.. and as Interfacing is more enhanced here than normal FM.
    etc...
    Regards,
    Manjunatha

  • Discoverer Plus 10gR2 not show data when the script of view have package

    Hi my friends.
    I have a problem with discoverer plus, I don't know is a problem or I'm doing something wrong.
    I have a four views, the views containg in the SELECT stament and WHERE clause packages, example:
    SELECT d.price,
    d.total,
    d.min,
    d.mx,
    TO_CHAR (SYSDATE, 'q') quarter,
    d.fid,
    k_xdcd_qry.f_xdc_obt_price (d.prod, d.id) --> package
    k_xpxpd_qry.f_xpeds_salary_ca_u (
    d.prod,
    d.id) xp --> package
    FROM px_prices_proc c,
    xp_sla_max d,
    xmp_sla_puc b
    WHERE a.prod = b.prod
    AND a.id = b.id
    AND a.prod = k_xps_tools.f_obt_prod --> package
    When I used the views on discoverer plus for construct the report, when execute the query not show data.
    Appreciate it if you could help or tell me I'm doing wrong or does not support Discoverer Plus package execution.

    Hi Tux,
    This appears to be a grant issue. Apparently, you have granted execute with respect to this package to the EUL owner or the view would not have compiled. If you have not given EUL owner the grant option, I would recommend doing this as well.
    This appears to be an Oracle APPS EUL (tell me if I am wrong). If this is the case, it goes without saying that APPS will need to be granted the execute privilege.
    Also, by default, a stored package executes with the privileges of its owner. If your custom package was designed this way, are the objects which it references received the appropriate grant? I assume you tested this, but I am concerned that the line, a.prod = k_xps_tools.f_obt_prod, in the where clause could be resulting in the Null set being returned.
    Patrick

  • Code snippet in a ALV report

    hello experts
    I would like to calclute the invoice value and display in the output (invoice value = VBEP-NETWR/VBEP-FKIMG) , where should i add the code? In the select stament? code help is higly appreciated.
    Thanks
    mohan 
    follows the program
    Global structure of list
    type-pools: slis.
    tables: likp,
            lips,
            vbfa,
            kssk,
            klah,
            ausp,
            cabn,
            vbak,
            mara,
            vbrk,
            ser01,
            vbpa,
            nast,
            zseri,
            ltap,
            pa0001,
            kna1,
            objk,
            viqmel,
            viqmma.
    types:  begin of i_delivery,
                 vbeln like likp-vbeln,
                 posnr  like lips-posnr,
                 kunnr like likp-kunnr,
                 kunag like likp-kunag,
                 vkorg  like vbak-vkorg,
                 matnr  like lips-matnr,
                 lfart  like likp-lfart,
                 arktx  like vbap-arktx,
                 vgbel  like lips-vgbel,
                 vgpos  like lips-vgpos,
                 pstyv   like lips-pstyv,
                 wadat type likp-wadat,
                 lfdat type likp-lfdat,
                 prodh type lips-prodh,
                 lfimg type lips-lfimg,
                 vkbur type lips-vkbur,
                 werks type lips-werks,
                 vkgrp type lips-vkgrp,
                 mvgr1 type lips-mvgr1,
                 sernr like equi-sernr,
                 sernp like equi-sernr,
                 equnr like equi-equnr,
                 kttxt like qpct-kurztext,
                 bstnk  like vbak-bstnk,
                 vbelv  like lips-vgbel,
                 posnv  like lips-posnv,
                 uecha  like lips-uecha,
                 ernam  like vbak-ernam,
                 erdat like vbak-erdat,
                 serail like lips-serail,
                 anzsn like lips-anzsn,
                 auart like vbak-auart ,
                 netwr like vbap-netwr,
                 fstno like vbpa-pernr,
                 fstnm like pa0001-ename,
                 ename like pa0001-ename,
                 qname like ltap-qname,
                 name1 like kna1-name1,
                 name3 like kna1-name2,
                 pernr like vbpa-pernr,
                 aufnr like viqmel-aufnr,
                 qmnum like viqmel-qmnum,
                 mngrp like viqmma-mngrp,
                 qmcod like viqmel-qmcod,
                 qmcol like viqmma-mncod,
                 cotxt(20),
             end of i_delivery.
    Global structure of list
    */ Selection and Input Parameters
    selection-screen begin of block block2 with frame title text-003.
    select-options: s_vkorg for likp-vkorg no intervals.
    select-options: s_vbeln  for likp-vbeln,
                    s_lfart  for likp-lfart,
                    s_kunnr  for likp-kunnr,
                    s_erdat  for likp-erdat,
                    s_wadat  for likp-wadat,
                    s_werks  for lips-werks,
                    s_matnr  for lips-matnr,
                    s_prodh  for lips-prodh,
                    s_qmnum for viqmel-qmnum.
    selection-screen end of block block2.
    selection-screen begin of block block4 with frame title text-002.
    select-options:  s_vbelv for vbak-vbeln,
                     s_auart for vbak-auart.
    selection-screen end of block block4.
    parameters: p_vari like disvariant-variant.
    ranges: r_vbeln for likp-vbeln.
    data:   gt_fieldcat type slis_t_fieldcat_alv.
    data:   gt_outtab type i_delivery occurs 0 with header line,
            rt_outtab1 type i_delivery occurs 0 with header line,
            i_nast type nast occurs 0 with header line,
            gt_list_top_of_page type slis_t_listheader,
            gt_events   type slis_t_event,
            gc_formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.
    data:   g_repid like sy-repid,
             g_count like sy-tabix.
    data: begin of i_serial occurs 0,
            obknr type ser01-obknr,
            lief_nr type ser01-lief_nr,
            posnr type ser01-posnr,
            anzsn type ser01-anzsn,
          end of i_serial.
    data: begin of i_object_numbers occurs 0,
            obknr type objk-obknr,
            obzae type objk-obzae,
            sernr type objk-sernr,
            equnr type objk-equnr,
            matnr type objk-matnr,
            taser type objk-taser,
          end of i_object_numbers.
    data:   g_save(1) type c,
           g_default(1) TYPE c,
            g_exit(1) type c,
            gx_variant like disvariant,
            g_variant like disvariant.
    data:  g_mnkat like viqmma-mnkat,
           g_mngrp like viqmma-mngrp,
           g_atinn like ausp-atinn.
    Initialization fieldcatalog
    initialization.
      g_repid = sy-repid.
      perform fieldcat_init using gt_fieldcat[].
    move: 'I' to  s_vkorg-sign,
           'EQ' to  s_vkorg-option,
           '5090' to s_vkorg-low.
      append  s_vkorg.
      move: 'I' to  s_lfart-sign,
           'EQ' to s_lfart-option,
           'LF' to s_lfart-low.
      append  s_lfart.
      g_save = 'A'.
      perform variant_init.
    Get default variant
      gx_variant = g_variant.
      call function 'REUSE_ALV_VARIANT_DEFAULT_GET'
           exporting
                i_save     = g_save
           changing
                cs_variant = gx_variant
           exceptions
                not_found  = 2.
      if sy-subrc = 0.
        p_vari = gx_variant-variant.
      endif.
    at selection-screen on value-request for p_vari.
      perform f4_for_variant.
    at selection-screen.
      perform pai_of_selection_screen.
    Start of Selection
    start-of-selection.
      perform e03_eventtab_build using gt_events[].
      perform select_data tables gt_outtab.
    Display list
    end-of-selection.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_background_id         = 'ALV_BACKGROUND'
                i_callback_user_command = 'USER_COMMAND'
                is_variant              = g_variant
                i_save                  = g_save
                i_callback_program      = g_repid
                it_fieldcat             = gt_fieldcat[]
           tables
                t_outtab                = gt_outtab.
       Forms
    Initialization fieldcatalog
    form fieldcat_init
          using rt_fieldcat type slis_t_fieldcat_alv.
      data: ls_fieldcat type slis_fieldcat_alv.
      data: pos type i value 1.
      clear ls_fieldcat.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'VBELN'.
      ls_fieldcat-seltext_s     = 'Delivery'.
      ls_fieldcat-seltext_m     = 'Delivery'.
      ls_fieldcat-key           = 'X'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'POSNR'.
      ls_fieldcat-key           = 'X'.
      ls_fieldcat-seltext_s     = 'Item'.
      ls_fieldcat-seltext_m     = 'Item'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'LFART'.
      ls_fieldcat-seltext_s     = 'Del Type'.
      ls_fieldcat-seltext_m     = 'Delivery Type'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'VGBEL'.
      ls_fieldcat-seltext_s     = 'Source Doc'.
      ls_fieldcat-seltext_m     = 'Source Doc'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'AUART'.
      ls_fieldcat-seltext_s     = 'Type'.
      ls_fieldcat-seltext_m     = 'Type'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'KUNNR'.
      ls_fieldcat-seltext_s     = 'Customer'.
      ls_fieldcat-seltext_m     = 'Customer'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'NAME1'.
      ls_fieldcat-seltext_s     = 'Name'.
      ls_fieldcat-seltext_m     = 'Name1'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'WERKS'.
      ls_fieldcat-seltext_s     = 'Plant'.
      ls_fieldcat-seltext_m     = 'Plant'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'MATNR'.
      ls_fieldcat-seltext_s     = 'Material'.
      ls_fieldcat-seltext_m     = 'Material'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'MVGR1'.
      ls_fieldcat-seltext_s     = 'Speciality'.
      ls_fieldcat-seltext_m     = 'Speciality'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
    pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'PRODH'.
      ls_fieldcat-seltext_s     = 'Hierarchy'.
      ls_fieldcat-seltext_m     = 'Prod Hierarchy'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'ARKTX'.
      ls_fieldcat-seltext_s     = 'Description'.
      ls_fieldcat-seltext_m     = 'Description'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'ERNAM'.
      ls_fieldcat-seltext_s     = 'Created By'.
      ls_fieldcat-seltext_m     = 'Created By'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'ERDAT'.
      ls_fieldcat-seltext_s     = 'Created On'.
      ls_fieldcat-seltext_m     = 'Created On'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'WADAT'.
      ls_fieldcat-seltext_s     = 'GoodsMvt.Date'.
      ls_fieldcat-seltext_m     = 'Goods Mvt Date'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'SERNR'.
      ls_fieldcat-seltext_s     = 'Serial Shipped'.
      ls_fieldcat-seltext_m     = 'Serial Shipped'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'SERNP'.
      ls_fieldcat-seltext_s     = 'Old Serial'.
      ls_fieldcat-seltext_m     = 'Old Serial'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'VBELV'.
      ls_fieldcat-seltext_s     = 'Invoice'.
      ls_fieldcat-seltext_m     = 'Invoice'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'NETWR'.
      ls_fieldcat-seltext_s     = 'Invoice Amt'.
      ls_fieldcat-seltext_m     = 'Invoice Value'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'QMNUM'.
      ls_fieldcat-seltext_s     = 'Notification'.
      ls_fieldcat-seltext_m     = 'Notification'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'QMCOD'.
      ls_fieldcat-seltext_s     = 'Rep LevKST'.
      ls_fieldcat-seltext_m     = 'Repair Level KST'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
    pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'COTXT'.
      ls_fieldcat-seltext_s     = 'CdTXT KST'.
      ls_fieldcat-seltext_m     = 'Repair Level Text KST'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
      pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'QMCOL'.
      ls_fieldcat-seltext_s     = 'Rep LevKSE'.
      ls_fieldcat-seltext_m     = 'Repair Level KSE'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
    pos = pos + 1.
      ls_fieldcat-col_pos       =  pos.
      ls_fieldcat-fieldname     = 'KTTXT'.
      ls_fieldcat-seltext_s     = 'CdTXT KSE'.
      ls_fieldcat-seltext_m     = 'Repair Level Text KSE'.
      append ls_fieldcat to rt_fieldcat.
      clear ls_fieldcat.
    endform.   "fieldcat_init
    Data selection
    form select_data tables rt_outtab like gt_outtab[].
      clear: r_vbeln[].
    Read all Invoices for the Selection
      select distinct h~vbeln  h~kunnr h~kunag
                     d~posnr  d~matnr d~anzsn
                     d~serail d~vgbel d~vgpos
                     d~posnv  d~lfimg d~arktx
                     d~uecha  h~lfart h~erdat
                     h~ernam  h~lfdat d~prodh
                     h~vkorg  d~vkbur d~vkgrp
                     d~mvgr1  h~wadat_ist d~pstyv
                     d~werks
             into (rt_outtab-vbeln, rt_outtab-kunnr,
                    rt_outtab-kunag, rt_outtab-posnr,
                    rt_outtab-matnr, rt_outtab-anzsn,
                    rt_outtab-serail, rt_outtab-vgbel,
                    rt_outtab-vgpos,  rt_outtab-posnv,
                    rt_outtab-lfimg,  rt_outtab-arktx,
                    rt_outtab-uecha, rt_outtab-lfart,
                    rt_outtab-erdat, rt_outtab-ernam,
                    rt_outtab-lfdat, rt_outtab-prodh,
                    rt_outtab-vkorg, rt_outtab-vkbur,
                    rt_outtab-vkgrp, rt_outtab-mvgr1,
                    rt_outtab-wadat, rt_outtab-pstyv,
                    rt_outtab-werks)
            from likp as h inner join lips as d
                     on h~vbeln = d~vbeln
                    where h~vbeln in s_vbeln
                    and  h~vkorg in s_vkorg
                    and  h~lfart in s_lfart
                     and  h~kunnr in s_kunnr
                     and  h~erdat in s_erdat
                     and  d~matnr in s_matnr
                     and  d~werks in s_werks
                     and  d~prodh in s_prodh
                     and  d~vgbel in s_vbelv
                     and  d~matnr like 'S%'.
        select single * from vbak where vbeln = rt_outtab-vgbel.
        if: sy-subrc eq 0.
          move vbak-vbeln to rt_outtab-vgbel.
          move vbak-auart to rt_outtab-auart.
        endif.
        select single * from mara where matnr = rt_outtab-matnr
                                    and  mtart eq 'FERT'.
        check sy-subrc eq 0.
        if not rt_outtab-posnv is initial.
          rt_outtab-vgpos = rt_outtab-posnv.
        endif.
        clear: vbfa.
        select single vbeln rfwrt into (rt_outtab-vbelv, rt_outtab-netwr)
    from vbfa  where vbelv eq rt_outtab-vbeln
                               and   posnv eq rt_outtab-posnr
                               and   vbtyp_n eq 'M'.
        append rt_outtab.
        if not  r_vbeln-low is initial.
          if r_vbeln-low gt rt_outtab-vbeln.
            r_vbeln-low =  rt_outtab-vbeln.
          endif.
          if r_vbeln-high lt rt_outtab-vbeln.
            r_vbeln-high =  rt_outtab-vbeln.
          endif.
        else.
          r_vbeln-low  =  rt_outtab-vbeln.
          r_vbeln-high =  rt_outtab-vbeln.
        endif.
        clear: rt_outtab.
      endselect.
      if not r_vbeln is initial.
        move: 'I' to  r_vbeln-sign,
               'BT' to  r_vbeln-option.
        append r_vbeln.
        select * into corresponding fields of table i_serial
                                  from   ser01 where lief_nr in r_vbeln.
      endif.
      sort i_serial.
      if not i_serial[] is initial.
        select * into corresponding fields of table i_object_numbers
                                   from   objk
                                   for all entries in i_serial
                                   where obknr eq i_serial-obknr
                                   and  taser eq 'SER01'.
      endif.
      sort i_object_numbers by  obknr obzae.
      loop at rt_outtab.
    Read the Sold To Name
        select single name1 into rt_outtab-name1
                          from kna1 where kunnr eq rt_outtab-kunnr.
    Read Ship-to Customer
        clear: objk.
        if not rt_outtab-serail is initial.
          read table i_serial with key lief_nr = rt_outtab-vbeln
                                        posnr = rt_outtab-posnr.
          if sy-subrc eq 0.
            do i_serial-anzsn times.
              read table i_object_numbers  with key obknr = i_serial-obknr
                                                    matnr = rt_outtab-matnr
                                                binary search.
              if sy-subrc eq 0.
                rt_outtab-sernr = i_object_numbers-sernr.
                delete i_object_numbers index sy-tabix.
                move '1'   to rt_outtab-lfimg.
    clear: rt_outtab-aufnr, rt_outtab-qmnum,
                         rt_outtab-equnr, rt_outtab-qmcod, g_mngrp, g_mnkat.
    select single aufnr qmnum equnr qmcod qmgrp qmkat
                            into (rt_outtab-aufnr, rt_outtab-qmnum,
                         rt_outtab-equnr, rt_outtab-qmcod, g_mngrp, g_mnkat)
                         from viqmel  where matnr = rt_outtab-matnr
                             and serialnr = rt_outtab-sernr
                             and qmart  eq 'S4'
                             and qmnum in s_qmnum.
    clear: rt_outtab-cotxt.
    select single kurztext into rt_outtab-cotxt
                             from qpct where katalogart eq g_mnkat
                              and codegruppe eq  g_mngrp
                              and code eq rt_outtab-qmcod
                              and sprache eq sy-langu.
    Read Serial Number from Name Plate Data.
                clear: klah, kssk, ausp, cabn, g_atinn.
                select single atinn into (g_atinn) from cabn
                                    where atnam = 'SBANK_SERIAL_NUMBER'.
                select single  atwrt
                      into  (rt_outtab-sernp)
                      from  ( klah as a inner join kssk as k
                               on aclint = kclint )
                          join ausp as p
                                on kobjek = pobjek
                                and p~atinn = g_atinn
                                and pklart = aklart
                      where a~klart = '002'
                       and  a~class = 'KSE_SN_ENDOSCOPES'
                        and  k~objek = rt_outtab-equnr.
    *KSE Repair level (activity code text from KSE-SM07 code group)
    clear: rt_outtab-qmcol, g_mngrp, g_mnkat.
                clear: rt_outtab-qmcol.
                clear:   g_mnkat, g_mngrp.
                select single mnkat mngrp mncod into
                                    (g_mnkat, g_mngrp, rt_outtab-qmcol)
                              from viqmma where qmnum = rt_outtab-qmnum
                                    and  mngrp eq 'KSE-SM07'
                                    and kzloesch eq space.
    clear: rt_outtab-kttxt.
                select single kurztext into rt_outtab-kttxt
                             from qpct where katalogart eq g_mnkat
                                    and codegruppe eq  g_mngrp
                                    and code eq rt_outtab-qmcol
                                    and sprache eq sy-langu.
                rt_outtab1 = rt_outtab.
                append rt_outtab1.
              endif.
            enddo.
          endif.
          endif.
        endloop.
        clear: rt_outtab[].
        rt_outtab[] = rt_outtab1[].
        sort rt_outtab by vbeln posnr.
      endform.
          FORM get_repname                                              *
    -->  P_VBELN                                                       *
    -->  P_POSNR                                                       *
    -->  P_PERNR                                                       *
    -->  P_ENAME                                                       *
    form get_repname using  p_vbeln
                              p_posnr
                     changing  p_pernr
                              p_ename. "
      data: i_vbpa like vbpa occurs 0 with header line.
      clear: i_vbpa[].
      call function 'Z_DETERMINE_ACTIVE_SALES_REP'
           exporting
                g_salesdocument = p_vbeln
                g_sales_item    = p_posnr
           tables
                st_vbpa         = i_vbpa.
      read table i_vbpa index 1.
      if sy-subrc = 0.
        p_pernr = i_vbpa-pernr.
        select single ename into p_ename
          from pa0001
         where pernr = i_vbpa-pernr.
      endif.
    endform.                    " get_repname
          FORM E03_EVENTTAB_BUILD                                       *
    -->  E03_LT_EVENTS                                                 *
    form e03_eventtab_build using e03_lt_events type slis_t_event.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = e03_lt_events.
      read table e03_lt_events with key name =  slis_ev_top_of_page
                               into ls_event.
      if sy-subrc = 0.
        move gc_formname_top_of_page to ls_event-form.
        append ls_event to e03_lt_events.
      endif.
    endform.
          FORM TOP_OF_PAGE                                              *
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = gt_list_top_of_page.
    endform.
    *&      Form  USER_COMMAND
    form user_command  using r_ucomm like sy-ucomm
                             rs_selfield type slis_selfield.
      case r_ucomm.
        when '&IC1'.
          perform display_delivery using r_ucomm
                                        rs_selfield.
      endcase.
    endform.
    *&      Form  display_delivery
    form display_delivery
    using r_ucomm like sy-ucomm
                                 rs_selfield type slis_selfield.
      case rs_selfield-sel_tab_field.
        when '1-VBELN'.
          set parameter id 'VL' field rs_selfield-value.
          call transaction 'VL03N' and skip first screen.
        when '1-VBELV'.
          set parameter id 'VF' field rs_selfield-value.
          call transaction 'VF03N' and skip first screen.
      endcase.
    endform.
    *&      Form  VARIANT_INIT
          text
    -->  p1        text
    <--  p2        text
    form variant_init.
      clear g_variant.
      g_variant-report = g_repid.
    endform.                               " VARIANT_INIT
    *&      Form  F4_FOR_VARIANT
          text
    -->  p1        text
    <--  p2        text
    form f4_for_variant.
      call function 'REUSE_ALV_VARIANT_F4'
           exporting
                is_variant          = g_variant
                i_save              = g_save
              it_default_fieldcat =
           importing
                e_exit              = g_exit
                es_variant          = gx_variant
           exceptions
                not_found = 2.
      if sy-subrc = 2.
        message id sy-msgid type 'S'      number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      else.
        if g_exit = space.
          p_vari = gx_variant-variant.
        endif.
      endif.
    endform.
    *&      Form  PAI_OF_SELECTION_SCREEN
          text
    form pai_of_selection_screen.
      if not p_vari is initial.
        move g_variant to gx_variant.
        move p_vari to gx_variant-variant.
        call function 'REUSE_ALV_VARIANT_EXISTENCE'
             exporting
                  i_save     = g_save
             changing
                  cs_variant = gx_variant.
        g_variant = gx_variant.
      else.
        perform variant_init.
      endif.
    endform.

    Well, I've made some assumptions here, but I think this will work.  Of course you need to create a new field in your internal table to hold the calculated value.  Here I call it INVVALUE.   The issue here is that I'm a little concerned with the SELECT to VBFA, not sure that this is correct if you are trying to get the billing document.
    form select_data tables rt_outtab like gt_outtab[].
      clear: r_vbeln[].
    * Read all Invoices for the Selection
      select distinct h~vbeln h~kunnr h~kunag
      d~posnr d~matnr d~anzsn
      d~serail d~vgbel d~vgpos
      d~posnv d~lfimg d~arktx
      d~uecha h~lfart h~erdat
      h~ernam h~lfdat d~prodh
      h~vkorg d~vkbur d~vkgrp
      d~mvgr1 h~wadat_ist d~pstyv
      d~werks
      into (rt_outtab-vbeln, rt_outtab-kunnr,
      rt_outtab-kunag, rt_outtab-posnr,
      rt_outtab-matnr, rt_outtab-anzsn,
      rt_outtab-serail, rt_outtab-vgbel,
      rt_outtab-vgpos, rt_outtab-posnv,
      rt_outtab-lfimg, rt_outtab-arktx,
      rt_outtab-uecha, rt_outtab-lfart,
      rt_outtab-erdat, rt_outtab-ernam,
      rt_outtab-lfdat, rt_outtab-prodh,
      rt_outtab-vkorg, rt_outtab-vkbur,
      rt_outtab-vkgrp, rt_outtab-mvgr1,
      rt_outtab-wadat, rt_outtab-pstyv,
      rt_outtab-werks)
      from likp as h inner join lips as d
      on h~vbeln = d~vbeln
      where h~vbeln in s_vbeln
      and h~vkorg in s_vkorg
      and h~lfart in s_lfart
      and h~kunnr in s_kunnr
      and h~erdat in s_erdat
      and d~matnr in s_matnr
      and d~werks in s_werks
      and d~prodh in s_prodh
      and d~vgbel in s_vbelv
      and d~matnr like 'S%'.
        select single * from vbak where vbeln = rt_outtab-vgbel.
        if: sy-subrc eq 0.
          move vbak-vbeln to rt_outtab-vgbel.
          move vbak-auart to rt_outtab-auart.
        endif.
        select single * from mara where matnr = rt_outtab-matnr
        and mtart eq 'FERT'.
        check sy-subrc eq 0.
        if not rt_outtab-posnv is initial.
          rt_outtab-vgpos = rt_outtab-posnv.
        endif.
        clear: vbfa.
    <b>    select single vbeln rfwrt into (rt_outtab-vbelv, rt_outtab-netwr)
        from vbfa where vbelv eq rt_outtab-vbeln
        and posnv eq rt_outtab-posnr
        and vbtyp_n eq 'M'.</b>
    <b>    data: xvbrp type vbrp.
        select Single * from vbrp into xvbrp
                        where vbeln = rt_outtab-vbeln   " Need to be billing document
                          and posnr = rt_outtab-posnr.
         rt_outtab-INVVALUE = xvbrp-netwr / xvbrp-fkimg. </b>               
        append rt_outtab.
        if not r_vbeln-low is initial.
          if r_vbeln-low gt rt_outtab-vbeln.
            r_vbeln-low = rt_outtab-vbeln.
          endif.
          if r_vbeln-high lt rt_outtab-vbeln.
            r_vbeln-high = rt_outtab-vbeln.
          endif.
        else.
          r_vbeln-low = rt_outtab-vbeln.
          r_vbeln-high = rt_outtab-vbeln.
        endif.
        clear: rt_outtab.
      endselect.
    Regards,
    Rich Heilman

Maybe you are looking for

  • Can delete photos from 'Camera roll' but not 'Photo Library'

    Please excuse my ignorance in advance! I needed to delete some photos as I couldn't download any apps or take any more photos until I freed some space (not sure why as according to itunes I have nearly 2GB free). I recently updated iphone software an

  • Macbook Pro air port or ethernet not working.

    I one of the original macbook pro with the glossy screen, its not reading the Airport or ethernet port? what would be causing this? its not showing up in system preferences or anything. the only thing that shows up is firewhire and bluetooth. any sug

  • Xmonad/Xmobar - How do you display volume in xmobar?

    I would like it to indicate the current percentage of volume and mute indication. Is anyone generous enough to help or share?

  • IMac slot-loader as a video display for a G4 tower?

    Can I use my iMac slot-loader (OS 9,2,2,) as a video display for a G4 tower?  I have a redundant model of each and I'd like to drum them into use.  How could I set it up? Thanks

  • New Toshiba Laptop with Windows 8 mouse disappears

    I received a Toshiba Satellite Laptop for Christmas and it is running Windows 8. I started using it and it worked fine, but I started using Internet Explorer and the mouse froze, but I could still use my keyboard to get back to the start-page and mov