Need to generate Asterisks into a Triangle!

Hey there.
I'm having a bit of trouble progressing with my Uni work, i've been here for weeks trying to suss it. Unfortunately I am not very good when it comes to Java and I'm struggling like hell.
What i need to do is write a public instance method called toString() which takes no arguements. The method should return a string which is made up by concatenating strings of asterisks, which are separated by the new line character. If the instance variable orientation references the string "up" the strings should be of ever increasing lengthfrom 1 up to the value of the instance variable size. If the instance variable orientation references the string "down" the strings should be of ever decreasing lengthfrom the value of the size down to 1.
Note that the method must return the string object it has constructed. It should not output it either to a dialogue box or by using System.out.println(). You should use a loop to construct the string that has to be returned; each iteration should involve adding an extra row of asterisks to the string by using concatenation.
Further up in the code, I have the following:
public class Triangle
   /* instance variables */
   int size; // the size of the triangle; an integer between 2 and 10 inclusive
   String orientation; // either "up" or "down"
    * Constructor for objects of class Triangle.
   public Triangle()
      super();
      this.size = 5;
      this.orientation = "up";
   }And here is my failed attempt at the code:
public String toString(){
String aResult;
if(orientation == "up"){
String asterisk = "*";
for(int b=0; b<size; b++){
aResult = asterisk + System.getProperty("line.separator") + asterisk + System.getProperty("line.separator");
return aResult;
}Any help or a shove in the right direction would be a greatly appreciated!
Kind Regards
Thanks

Here's how you could do it (see the comments in the toString() method):
public class Triangle {
    private int size;
    private boolean up;
    public Triangle(int s, boolean u) {
        size = s;
        up = u;
    public String toString() {
        StringBuilder b = new StringBuilder();
        loop from 1 to 'size'
            'numAsterisks' <- what should this be when 'up'==tue?
                              and what should it be when 'up'==false?
            loop from 1 to 'numAsterisks'
                append an asterisk to 'b'
            end loop
            append an new line to 'b'
        end loop
        return b.toString();
    public static void main(String[] args) {
        Triangle t = new Triangle(5, true);
        System.out.println(t);
}

Similar Messages

  • Reg : I need to generate a file name sequence number.

    Dear All,
    I need to generate file name in sequence number. Now i have generated file in specific folder. In that folder file i am reading one by one and generating. Problem is folder file some names having special characte those names are not generating while reading 'Cat' Caommand in shell script. Instad of that i want to generate files in 1.ldt,2.ldt to etc..
    Please guide me how to generate in specific folder.
    Thanks in advance.
    Best Regards,
    Velu.

    First, LabVIEW 7 allows you to pass string and path data types directly into the Matlab script node. Otherwise, in LV <= 6.1 you can do the following:
    In LabVIEW, convert the string to an array of U8s using the String to Byte Array function. Then pass the U8 array into the Matlab script node as a Real Vector type. Finally, in Matlab, convert the Real Vector to a string using the char() function. For example:
    stringAsString = char(stringAsRealVector)
    Attached is an image that shows how to do this.
    Good luck,
    -Jim
    Attachments:
    Matlab_Script_Node_String_Input.GIF ‏6 KB

  • Importing BOBJ Generated Reports Into ERP 6.0

    Hi,
    Our BOBJ developer has generated couple of datamart ABAP reports, which need to be imported into R/3 system. Can anybody advice how to import these reports into R/3 system? Is there any standard procedure for this?
    Thanks,
    Kris

    BO reports cannot be imported into an R/3 system.
    I am not sure if I understand your question correctly though. What kind of reports (WebI, Crystal etc) are you talking about? Do you want that your R/3 users will be able to view the report from SAP GUI?
    Regards,
    Stratos

  • Need to generate barcodes

    Hi
    I need to generate barcodes
    i've been told that it is possible by report builder, can anyone help me with some hints?
    Thanks
    Tony G.

    If you are using 9i, there is a way of including barcodes using a Javabean - see 'Building Reports with Oracle9i Reports'. This works, but you may find that you can only get 1000 barcodes into a single report file, as the process creates a temporary file for each barcode and the structure of the file names only allows for 1000 different names (!). I TARed this and it became a bug which is supposedly fixed in later versions of 9i - we aren't in a position to upgrade, so I can't confirm this.

  • IPhoto needs to generate thumbnails, then freezes. What can I do?

         When I open iPhoto, it says that it needs to generate thumbnails. As it does, popups say "Alert cannot find file." There are about one to two hundred of these popups, and they have two buttons: "Find file" and "cancel." A loading bar shows the progress, but it only advances when I click "cancel." After an infuriating twenty minutes, the status bar is finally complete, only to have iPhoto freeze. It cancels logout and shutdown; the only way to get out of it is to perform a cold stop. What can I do?
         I should tell you that my photo library is enourmous. It has almost seven thousand high-quality photos and videos. Is this part of the problem?
    Thank you,
    MrMacMan1

    Seven thousand photos is not a big library these days. We've seen reports from people with in excess of 300,000 images in their. I have a library more than 6 times the size of yours, so we can take it that the quantity is not an issue.
    iPhoto is telling you what the problem is - it can't find the files that are meant to be in the Library.
    Are you running a Managed or a Referenced Library?
    A Managed Library, is the default setting, and iPhoto copies files into the iPhoto Library when Importing. The files are then stored in the Library package
    A Referenced Library is when iPhoto is NOT copying the files into the iPhoto Library when importing because you made a change at iPhoto -> Preferences -> Advanced. (You unchecked the option to copy files into the Library on import) The files are then stored where ever you put them and not in the Library package. In this scenario you are responsible for the File Management. 

  • Need to convert values into coma separated

    Need to convert values into coma separated
    I have a string value that stores data like 'NYK,IND,SGP,GER'
    FOR EXAMPLE
    V_CITY_CODE = 'NYK,IND,SGP,GER'
    When I query
    select * from city where city_code = V_CITY_CODE;I get no rows, this is because V_CITY_CODE has all city code as single code.
    I need a function to search , and replace with ','.
    I tried using instr and replace but was unable to convert it.
    could some one pls assist me.
    thanks in advance
    Saz

    Looking for this?
    SQL> select * from emp
      2  /
         EMPNO     DEPTNO ENAME                                 SAL DOJ       JOB
             1          1 Karthick                               80 03-DEC-11
             2          1 Karthick_1                             90 23-NOV-11
             3          2 Ram                                    80 03-DEC-11
             4          2 Ram_1                                  90 23-NOV-11
    SQL> var v_ename varchar2(1000)
    SQL> exec :v_ename := 'Karthick,Karthick_1'
    PL/SQL procedure successfully completed.
    SQL> select *
      2    from emp
      3   where ename in (
      4                     select regexp_substr(val, '[^,]+', 1, level)
      5                        from (select :v_ename val from dual)
      6                    connect by level <= length(val) - length(replace(val, ','))+1
      7                  ) 
      8  /
         EMPNO     DEPTNO ENAME                                 SAL DOJ       JOB
             1          1 Karthick                               80 03-DEC-11
             2          1 Karthick_1                             90 23-NOV-11

  • Need to generate a Index xml file for corresponding Report PDF file.

    Need to generate a Index xml file for corresponding Report PDF file.
    Currently in fusion we are generating a pdf file using given Rtf template and dataModal source through Ess BIPJobType.xml .
    This is generating pdf successfully.
    As per requirement from Oracle GSI team, they need index xml file of corresponding generated pdf file for their own business scenario.
    Please see the following attached sample file .
    PDf file : https://kix.oraclecorp.com/KIX/uploads1/Jan-2013/354962/docs/BPA_Print_Trx-_output.pdf
    Index file : https://kix.oraclecorp.com/KIX/uploads1/Jan-2013/354962/docs/o39861053.out.idx.txt
    In R12 ,
         We are doing this through java API call to FOProcessor and build the pdf. Here is sample snapshot :
         xmlStream = PrintInvoiceThread.generateXML(pCpContext, logFile, outFile, dbCon, list, aLog, debugFlag);
         OADocumentProcessor docProc = new OADocumentProcessor(xmlStream, tmpDir);
         docProc.process();
         PrintInvoiceThread :
              out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
                   out.print("<xapi:requestset ");
                   out.println("<xapi:filesystem output=\"" + outFile.getFileName() + "\"/>");
                   out.println("<xapi:indexfile output=\"" + outFile.getFileName() + ".idx\">");
                   out.println(" <totalpages>${VAR_TOTAL_PAGES}</totalpages>");
                   out.println(" <totaldocuments>${VAR_TOTAL_DOCS}</totaldocuments>");
                   out.println("</xapi:indexfile>");
                   out.println("<xapi:document output-type=\"pdf\">");
    out.println("<xapi:customcontents>");
    XMLDocument idxDoc = new XMLDocument();
    idxDoc.setEncoding("UTF-8");
    ((XMLElement)(generator.buildIndexItems(idxDoc, am, row)).getDocumentElement()).print(out);
    idxDoc = null;
    out.println("</xapi:customcontents>");
         In r12 we have a privilege to use page number variable through oracle.apps.xdo.batch.ControlFile
              public static final String VAR_BEGIN_PAGE = "${VAR_BEGIN_PAGE}";
              public static final String VAR_END_PAGE = "${VAR_END_PAGE}";
              public static final String VAR_TOTAL_DOCS = "${VAR_TOTAL_DOCS}";
              public static final String VAR_TOTAL_PAGES = "${VAR_TOTAL_PAGES}";
    Is there any similar java library which do the same thing in fusion .
    Note: I checked in the BIP doc http://docs.oracle.com/cd/E21764_01/bi.1111/e18863/javaapis.htm#CIHHDDEH
              Section 7.11.3.2 Invoking Processors with InputStream .
    But this is not helping much to me. Is there any other document/view-let which covers these thing .
    Appreciate any help/suggestions.
    -anjani prasad
    I have attached these java file in kixs : https://kix.oraclecorp.com/KIX/display.php?labelId=3755&articleId=354962
    PrintInvoiceThread
    InvoiceXmlBuilder
    Control.java

    You can find the steps here.
    http://weblogic-wonders.com/weblogic/2009/11/29/plan-xml-usage-for-message-driven-bean/
    http://weblogic-wonders.com/weblogic/2009/12/16/invalidation-interval-secs/

  • HT4113 My friends locked my iphone and now it says that i need to plug it into itunes. I cant find any info on how to unlock it, what do i do?

    My iphone got locked and it says i need to plug it into itunes. But i cant find any info on  itunes on how to unlock it, what do i do?

    See here: http://support.apple.com/kb/HT1212
    Don't let them touch your phone again.

  • I have a normal report , i need to make it into ALV,

    Hi,
    i have a normal report and i need to make it into ALV Report in ECC5.0version. when i making it into ALV its giving blank.
    can any one help me out to make below code in to ALV report.
    REPORT ZSAMPLE line-size 260
                      line-count 65
                      no standard page heading.
    ====================================================================
    TABLES *********************************
    ====================================================================
    tables : bseg,
             bkpf,
             kna1,
             bsid,
             bsad,
             knb1.
    data : begin of customer_tab occurs 0,
              kunnr         like kna1-kunnr,
              name1         like kna1-name1,
              flag(1)       type c,
           end of customer_tab.
    data : begin of customerdoc_tab occurs 0,
              kunnr         like kna1-kunnr,
              belnr         like bkpf-belnr,
              gjahr         like bkpf-gjahr,
              monat         like bkpf-monat,
           end of customerdoc_tab.
    data : begin of doc_tab occurs 0,
              belnr         like bkpf-belnr,
              gjahr         like bkpf-gjahr,
              monat         like bkpf-monat,
           end of doc_tab.
    DATA: BEGIN OF BSID_TAB OCCURS 0,
             BUKRS LIKE BSID-BUKRS,
             PRCTR LIKE BSID-PRCTR,
             KUNNR LIKE BSID-KUNNR,
             FLAG(1),
             UMSKZ LIKE BSID-UMSKZ,
             BLART LIKE BSID-BLART,
             BELNR LIKE BSID-BELNR,
             BUZEI LIKE BSID-BUZEI,
             NETDT LIKE BSID-ZFBDT,
             ZFBDT LIKE BSID-ZFBDT,
             BUDAT LIKE BSID-BUDAT,
             BLDAT LIKE BSID-BLDAT,
             BSCHL LIKE BSID-BSCHL,
             DMBTR LIKE BSID-DMBTR,
             SHKZG LIKE BSID-SHKZG,
             ZBD1T LIKE BSID-ZBD1T,
             ZBD2T LIKE BSID-ZBD2T,
             ZBD3T LIKE BSID-ZBD3T,
             REBZG LIKE BSID-REBZG,
             REBZT LIKE BSID-REBZT,
             KOART LIKE BSEG-KOART,
             SK1DT LIKE FAEDE-SK1DT,
             SK2DT LIKE FAEDE-SK2DT,
             DAYSD LIKE SY-TABIX,
          END OF BSID_TAB.
    ranges : r_bukrs for bsid-bukrs,
             r_kunnr for kna1-kunnr.
    ===================================================================
    VARIABLES *******************************
    ===================================================================
    data : v_belnr     like  bseg-belnr,
           v_gjahr     like  bkpf-gjahr,
           v_monat     like  bkpf-monat,
           v_ttlc      type  p,
           v_flag(1)   type  c,
           V_COUNT1(4) TYPE  N,
           V_COUNT2(4) TYPE  N,
           V_COUNT3(4) TYPE  N,
           V_COUNT4(4) TYPE  N,
           V_COUNT5(4) TYPE  N,
           V_COUNT6(4) TYPE  N,
           V_COUNT7(4) TYPE  N,
           V_COUNT8(4) TYPE  N,
           V_COUNT9(4) TYPE  N,
           V_COUNT10(4) TYPE  N,
           V_NET1      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 1
           V_NET2      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 2
           V_NET3      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 3
           V_NET4      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 4
           V_NET5      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 5
           V_NET6      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 6
           V_NET7      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 7
           V_NET8      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 8
           V_NET9      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 9
           V_NET10      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 10
           V_NET11      LIKE  BSID-DMBTR, "CALCULATE CUSTOMER AGE 11
           V_NET       LIKE  BSID-DMBTR, "Total Balance of Customer
           V_ttlNET1   LIKE  BSID-DMBTR,
           V_ttlNET2   LIKE  BSID-DMBTR,
           V_ttlNET3   LIKE  BSID-DMBTR,
           V_ttlNET4   LIKE  BSID-DMBTR,
           V_ttlNET5   LIKE  BSID-DMBTR,
           V_ttlNET6   LIKE  BSID-DMBTR,
           V_ttlNET7   LIKE  BSID-DMBTR,
           V_ttlNET8   LIKE  BSID-DMBTR,
           V_ttlNET9   LIKE  BSID-DMBTR,
           V_ttlNET10   LIKE  BSID-DMBTR,
           V_ttlNET11   LIKE  BSID-DMBTR,
           V_ttlNET    LIKE  BSID-DMBTR,
           v_kunnr     like  bseg-kunnr,
           V_BUTXT     like t001-butxt.
    ===================================================================
    SELECTION SCREEN ****************************
    ===================================================================
    selection-screen begin of block b1 with frame title text-001.
    parameters :     p_bukrs    like bseg-bukrs obligatory.
    select-options : s_kunnr    for  kna1-kunnr,
                     s_BRSCH    for  kna1-BRSCH,
                     s_REGIO    for  kna1-REGIO,
                     s_KTOKD    for  kna1-KTOKD,
                     s_BUSAB    for  knb1-BUSAB.
    selection-screen: end of block b1.
    selection-screen begin of block b2 with frame title text-003.
    PARAMETERS: DAT LIKE SY-DATUM DEFAULT SY-DATUM.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 01(30) TEXT-002.
    SELECTION-SCREEN POSITION POS_LOW.
    *PARAMETERS: RASTBIS1 LIKE RFPDO1-ALLGROGR DEFAULT '000'.
    *PARAMETERS: RASTBIS2 LIKE RFPDO1-ALLGROGR DEFAULT '030'.
    *PARAMETERS: RASTBIS3 LIKE RFPDO1-ALLGROGR DEFAULT '060'.
    *PARAMETERS: RASTBIS4 LIKE RFPDO1-ALLGROGR DEFAULT '090'.
    *PARAMETERS: RASTBIS5 LIKE RFPDO1-ALLGROGR DEFAULT '120'.
    PARAMETERS: RASTBIS1(4) type n DEFAULT '0000'.
    PARAMETERS: RASTBIS2(4) type n DEFAULT '0030'.
    PARAMETERS: RASTBIS3(4) type n DEFAULT '0060'.
    PARAMETERS: RASTBIS4(4) type n DEFAULT '0090'.
    PARAMETERS: RASTBIS5(4) type n DEFAULT '0120'.
    PARAMETERS: RASTBIS6(4) type n DEFAULT '0150'.
    PARAMETERS: RASTBIS7(4) type n DEFAULT '0180'.
    PARAMETERS: RASTBIS8(4) type n DEFAULT '0210'.
    PARAMETERS: RASTBIS9(4) type n DEFAULT '0240'.
    PARAMETERS: RASTBIS0(4) type n DEFAULT '0270'.
    SELECTION-SCREEN END OF LINE.
    Noted item removed as per FI instruction
    PARAMETERS: P_STAND AS CHECKBOX default 'X',
               P_NOTED AS CHECKBOX ,
                P_SPCAL AS CHECKBOX .
    selection-screen: end of block b2.
    selection-screen begin of block b3 with frame.
    PARAMETERS: allgline like RFPDO1-allgline .
    Parameters : p_balyes type c radiobutton group grp9 default 'X',
                 p_balno  type c radiobutton group grp9.
    selection-screen: end of block b3.
    Check for the Select option
    AT SELECTION-SCREEN.
    IF P_STAND = '' AND P_SPCAL = '' .
      MESSAGE E398(00) WITH 'PLEASE CHOOSE AT LEAST ONE G/L INDICATOR!'.
    ENDIF.
    Check for Company code Authorization
      authority-check object 'F_BKPF_BUK'
         ID 'BUKRS' FIELD p_bukrs
         ID 'ACTVT' FIELD '03'.
      if sy-subrc ne 0.
       message e398(00) with 'You are not Authorized for CC ' p_bukrs.
      Endif.
    ===================================================================
    START-OF-SELECTION ****************************
    ===================================================================
    START-OF-SELECTION.
    V_COUNT1 = RASTBIS1 + 1.
    V_COUNT2 = RASTBIS2 + 1.
    V_COUNT3 = RASTBIS3 + 1.
    V_COUNT4 = RASTBIS4 + 1.
    V_COUNT5 = RASTBIS5 + 1.
    V_COUNT6 = RASTBIS6 + 1.
    V_COUNT7 = RASTBIS7 + 1.
    V_COUNT8 = RASTBIS8 + 1.
    V_COUNT9 = RASTBIS9 + 1.
    V_COUNT10 = RASTBIS0 + 1.
    perform extract_data.
    ===================================================================
    At line Selection *****************************
    ===================================================================
    at line-selection.
    if sy-lilli >= 9 .
       refresh r_bukrs.
       move p_bukrs to r_bukrs-low.
       move 'I' to r_bukrs-sign.
       move 'EQ' to r_bukrs-option.
       append r_bukrs.
       refresh r_kunnr.
       move customer_tab-kunnr to r_kunnr-low.
       move 'I' to r_kunnr-sign.
       move 'EQ' to r_kunnr-option.
       append r_kunnr.
       submit ZFARVR0040  and return
        with p_bukrs = p_bukrs
        with dat     = dat
        with p_stand = p_stand
        with p_spcal = P_SPCAL
        with s_kunnr in r_kunnr.
    endif.
    ===================================================================
    Top of Page *******************************
    ===================================================================
    TOP-OF-PAGE.
      SELECT SINGLE BUTXT FROM T001 INTO V_BUTXT
                          WHERE BUKRS = p_BUKRS .
      WRITE:/73'Customers Aging Analysis',140'PAGE NO.',
      SY-PAGNO.
      WRITE:/002 'COMPANY',
             011 P_BUKRS,
             017 V_BUTXT,
             055 allgline centered,
             140 'DATE :',
             150 sy-datum .
      write:/002 'User',
             011 sy-UNAME,
             140 'Time :',
             150 sy-UZEIT.
      SKIP.
      format color col_heading intensified off.
      WRITE:/  SY-ULINE,
                  SY-VLINE,002 'Customer',
              012 SY-VLINE,013 'Name',
              043 SY-VLINE,048 'CURRENT',
              061 SY-VLINE,065 'FROM  ',V_COUNT1,
              079 SY-VLINE,083 'FROM  ',V_COUNT2,
              097 SY-VLINE,101 'FROM  ',V_COUNT3,
              115 SY-VLINE,119 'FROM  ',V_COUNT4,
              133 SY-VLINE,137 'FROM  ',V_COUNT5,
              151 SY-VLINE,155 'FROM  ',V_COUNT6,
              169 SY-VLINE,173 'FROM  ',V_COUNT7,
              187 SY-VLINE,191 'FROM  ',V_COUNT8,
              205 SY-VLINE,209 'FROM  ',V_COUNT9,
              223 SY-VLINE,228 'FROM  ',V_COUNT10,
              243 SY-VLINE,248 'TOTAL',
              268 SY-VLINE.
      WRITE:/      SY-VLINE,002 'Number',
               12  SY-VLINE,
               43  SY-VLINE,
               061 SY-VLINE,065 'TO    ',RASTBIS2,
               079 SY-VLINE,083 'TO    ',RASTBIS3,
               097 SY-VLINE,101 'TO    ',RASTBIS4,
               115 SY-VLINE,119 'TO    ',RASTBIS5,
               133 SY-VLINE,137 'FROM  ',RASTBIS6,
               151 SY-VLINE,155 'FROM  ',RASTBIS7,
               169 SY-VLINE,173 'FROM  ',RASTBIS8,
               187 SY-VLINE,191 'FROM  ',RASTBIS9,
               205 SY-VLINE,209 'FROM  ',RASTBIS0,
               223 SY-VLINE,
               243 SY-VLINE,
               268 SY-VLINE,
               SY-ULINE.
      format color off.
    ===================================================================
    END-OF-SELECTION ***************************
    ===================================================================
    end-of-selection.
    ===================================================================
    Form : Extract_Data *
    ===================================================================
    form extract_data.
    Select the Customers
       Select t1~kunnr t2~name1
         into corresponding fields of table  customer_tab
         from knb1 as t1 inner join kna1 as t2
              on t2~kunnr = t1~kunnr
                   where t1~bukrs = p_bukrs
                     and t1~kunnr in s_kunnr
                     and t1~BUSAB in s_busab
                     and t2~regio in s_regio
                     and t2~BRSCH in s_BRSCH
                     and t2~KTOKD in s_KTOKD.
       if sy-subrc <> 0.
          message e398(00) with 'No Customers Selected'.
       endif.
       sort customer_tab.
       describe table customer_tab lines v_ttlc.
       v_ttlc = v_ttlc + 10.
       loop at customer_tab.
          v_net1 = 0.
          v_net2 = 0.
          v_net3 = 0.
          v_net4 = 0.
          v_net5 = 0.
          v_net6 = 0.
          v_net7 = 0.
          v_net8 = 0.
          v_net9 = 0.
          v_net10 = 0.
          v_net11 = 0.
          v_net  = 0.
          perform calculate_ageing
                    using
                      p_bukrs
                      customer_tab-kunnr
                      dat
                      RASTBIS1
                      RASTBIS2
                      RASTBIS3
                      RASTBIS4
                      RASTBIS5
                      RASTBIS6
                      RASTBIS7
                      RASTBIS8
                      RASTBIS9
                      RASTBIS0
                      P_STAND
                      ' ' "noted item
                      P_SPCAL
                   changing
                      v_net1
                      v_net2
                      v_net3
                      v_net4
                      v_net5
                      v_net6
                      v_net7
                      v_net8
                      v_net9
                      v_net10
                      v_net11
                      v_net.
          if p_balyes = 'X' or v_net > 0.
            format color col_total.
            write:/  sy-vline,
                    002 customer_tab-kunnr,
                    012 SY-VLINE,013(30) customer_tab-name1,
                    043 SY-VLINE,044(16)  v_net1,
                    061 SY-VLINE,062(16)  v_net2,
                    079 SY-VLINE,080(16)  v_net3,
                    097 SY-VLINE,098(16)  v_net4,
                    115 SY-VLINE,116(16)  v_net5,
                    133 SY-VLINE,134(16)  v_net6,
                    151 SY-VLINE,152(16)  v_net7,
                    169 SY-VLINE,170(16)  v_net8,
                    187 SY-VLINE,188(16)  v_net9,
                    205 SY-VLINE,206(16)  v_net10,
                    223 SY-VLINE,224(16)  v_net11,
                    239 SY-VLINE,240(16)  v_net,
                    258 SY-VLINE.
             format color off.
             hide : customer_tab-kunnr.
             v_ttlnet1 = v_ttlnet1 + v_net1.
             v_ttlnet2 = v_ttlnet2 + v_net2.
             v_ttlnet3 = v_ttlnet3 + v_net3.
             v_ttlnet4 = v_ttlnet4 + v_net4.
             v_ttlnet5 = v_ttlnet5 + v_net5.
             v_ttlnet6 = v_ttlnet6 + v_net6.
             v_ttlnet7 = v_ttlnet7 + v_net7.
             v_ttlnet8 = v_ttlnet8 + v_net8.
             v_ttlnet9 = v_ttlnet9 + v_net9.
             v_ttlnet10 = v_ttlnet10 + v_net10.
             v_ttlnet11 = v_ttlnet11 + v_net11.
             v_ttlnet  = v_ttlnet  + v_net.
          endif.
       endloop.
       ULINE.
           format color col_total.
           write:/  sy-vline,
                    012 SY-VLINE,012(30) ' T O T A L',
                    043 SY-VLINE,044(16)  v_ttlnet1,
                    061 SY-VLINE,062(16)  v_ttlnet2,
                    079 SY-VLINE,080(16)  v_ttlnet3,
                    097 SY-VLINE,098(16)  v_ttlnet4,
                    115 SY-VLINE,116(16)  v_ttlnet5,
                    133 SY-VLINE,134(16)  v_ttlnet6,
                    151 SY-VLINE,152(16)  v_ttlnet7,
                    169 SY-VLINE,170(16)  v_ttlnet8,
                    187 SY-VLINE,188(16)  v_ttlnet9,
                    205 SY-VLINE,206(16)  v_ttlnet10,
                    223 SY-VLINE,224(16)  v_ttlnet11,
                    239 SY-VLINE,240(16)  v_ttlnet,
                    258 SY-VLINE.
          format color off.
       ULINE.
    endform.
    Function to Calculate Aging.
    Form calculate_ageing using
                            bukrs
                            kunnr
                            dat
                            RASTBIS1
                            RASTBIS2
                            RASTBIS3
                            RASTBIS4
                            RASTBIS5
                            RASTBIS6
                            RASTBIS7
                            RASTBIS8
                            RASTBIS9
                            RASTBIS0
                            P_STAND
                            P_NOTED
                            P_SPCAL
                          changing
                            v_net1
                            v_net2
                            v_net3
                            v_net4
                            v_net5
                            v_net6
                            v_net7
                            v_net8
                            v_net9
                            v_net10
                            v_net11
                            v_net.
    DATA: BEGIN OF BSID_TAB1 OCCURS 0,
             BUKRS LIKE BSID-BUKRS,
             PRCTR LIKE BSID-PRCTR,
             KUNNR LIKE BSID-KUNNR,
             FLAG(1),
             UMSKZ LIKE BSID-UMSKZ,
             BLART LIKE BSID-BLART,
             BELNR LIKE BSID-BELNR,
             BUZEI LIKE BSID-BUZEI,
             NETDT LIKE BSID-ZFBDT,
             ZFBDT LIKE BSID-ZFBDT,
             BUDAT LIKE BSID-BUDAT,
             BLDAT LIKE BSID-BLDAT,
             BSCHL LIKE BSID-BSCHL,
             DMBTR LIKE BSID-DMBTR,
             SHKZG LIKE BSID-SHKZG,
             ZBD1T LIKE BSID-ZBD1T,
             ZBD2T LIKE BSID-ZBD2T,
             ZBD3T LIKE BSID-ZBD3T,
             REBZG LIKE BSID-REBZG,
             REBZT LIKE BSID-REBZT,
             KOART LIKE BSEG-KOART,
             SK1DT LIKE FAEDE-SK1DT,
             SK2DT LIKE FAEDE-SK2DT,
             DAYSD LIKE SY-TABIX,
          END OF BSID_TAB1.
    RANGES: R_UMSKZ FOR BSID-UMSKZ.
    Data : V_ZFBDT     Like  bsid-ZFBDT,
           V_ZBD1T     Like  bsid-ZBD1T,
           V_ZBD2T     Like  bsid-ZBD2T,
           V_ZBD3T     Like  bsid-ZBD3T,
           V_LINES(8)  TYPE n.
    IF P_NOTED = 'X'.     "CHECK NOTED ITEMS
      R_UMSKZ-SIGN = 'I'.
      R_UMSKZ-OPTION = 'EQ'.
      R_UMSKZ-LOW = 'D'.
      APPEND R_UMSKZ.
      R_UMSKZ-SIGN = 'I'.
      R_UMSKZ-OPTION = 'EQ'.
      R_UMSKZ-LOW = 'L'.
      APPEND R_UMSKZ.
    ENDIF.
    IF P_STAND = 'X'.    "CHECK STANDARD ITEMS
      R_UMSKZ-SIGN = 'I'.
      R_UMSKZ-OPTION = 'EQ'.
      R_UMSKZ-LOW = ' '.
      APPEND R_UMSKZ.
    ENDIF.
    IF P_SPCAL = 'X'.    "CHECK SPECIAL G/L TRANSACTION
      R_UMSKZ-SIGN = 'I'.
      R_UMSKZ-OPTION = 'EQ'.
      R_UMSKZ-LOW = 'A'.
      APPEND R_UMSKZ.
      R_UMSKZ-SIGN = 'I'.
      R_UMSKZ-OPTION = 'EQ'.
      R_UMSKZ-LOW = 'B'.
      APPEND R_UMSKZ.
    ENDIF.
    SELECT * FROM BSID INTO CORRESPONDING FIELDS OF TABLE BSID_TAB
               WHERE BUKRS = BUKRS AND
                     budat <= dat  AND
                     KUNNR = KUNNR AND
                     UMSKZ in R_UMSKZ.
    SELECT * FROM BSAD appending CORRESPONDING FIELDS OF TABLE BSID_TAB
               WHERE BUKRS = BUKRS AND
                     budat <= dat  AND
                     augdt >= dat  AND
                     KUNNR = KUNNR AND
                     UMSKZ in R_UMSKZ.
    DESCRIBE TABLE BSID_TAB LINES V_LINES.
    LOOP AT BSID_TAB.
        if bsid_tab-BLART = 'DZ'.
          Select single ZFBDT ZBD1T ZBD2T ZBD3T
            into (V_ZFBDT,V_ZBD1T,V_ZBD2T,V_ZBD3T)
            from bsid where BUKRS = BUKRS
                        and kunnr = bsid_tab-kunnr
                        and BELNR = bsid_tab-REBZG.
          if sy-subrc = 0.
             bsid_tab-ZFBDT = V_ZFBDT.
             bsid_tab-ZBD1T = V_ZBD1T.
             bsid_tab-ZBD2T = V_ZBD2T.
             bsid_tab-ZBD3T = V_ZBD3T.
          else.
             Select single ZFBDT ZBD1T ZBD2T ZBD3T
               into (V_ZFBDT,V_ZBD1T,V_ZBD2T,V_ZBD3T)
               from bsad where BUKRS = BUKRS
                           and kunnr = bsid_tab-kunnr
                           and BELNR = bsid_tab-REBZG.
             if sy-subrc <> 0.
               bsid_tab-ZFBDT = V_ZFBDT.
               bsid_tab-ZBD1T = V_ZBD1T.
               bsid_tab-ZBD2T = V_ZBD2T.
               bsid_tab-ZBD3T = V_ZBD3T.
             endif.
          endif.
        endif.
        IF BSID_TAB-SHKZG = 'H'.
          BSID_TAB-DMBTR = BSID_TAB-DMBTR * ( - 1 ).
        ENDIF.
        bsid_tab-netdt = bsid_tab-ZFBDT.
      bsid_tab-netdt = bsid_tab-budat.
        bsid_tab-koart = 'D'.
        MODIFY BSID_TAB.
       PERFORM CALC_DUE_DATE USING BSID_TAB.
        BSID_TAB-DAYSD = DAT - BSID_TAB-NETDT.
        IF BSID_TAB-DAYSD <= RASTBIS1.
          V_NET1 = V_NET1 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <= RASTBIS2.
          V_NET2 = V_NET2 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <= RASTBIS3.
          V_NET3 = V_NET3 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <= RASTBIS4.
          V_NET4 = V_NET4 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <= RASTBIS5.
          V_NET5 = V_NET5 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <= RASTBIS6.
          V_NET6 = V_NET6 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <= RASTBIS7.
          V_NET7 = V_NET7 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <= RASTBIS5.
          V_NET8 = V_NET8 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <= RASTBIS9.
          V_NET9 = V_NET9 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD <=  RASTBIS0.
          V_NET10 = V_NET10 + BSID_TAB-DMBTR.
        ELSEIF BSID_TAB-DAYSD >  RASTBIS0.
          V_NET11 = V_NET11 + BSID_TAB-DMBTR.
        ENDIF.
        V_NET = V_NET + BSID_TAB-DMBTR.
        MODIFY BSID_TAB.
    ENDLOOP.
    endform.
    Calculate Due Date
    FORM CALC_DUE_DATE USING P_BSID_TAB STRUCTURE BSID_TAB.
      DATA : REFE TYPE P.
    IF P_BSID_TAB-KOART = 'K' OR P_BSID_TAB-KOART = 'D'.
      IF P_BSID_TAB-ZFBDT IS INITIAL.
        P_BSID_TAB-ZFBDT = P_BSID_TAB-BLDAT.
      ENDIF.
    *Nettofälligkeit bestimmen--
      IF NOT P_BSID_TAB-ZBD3T IS INITIAL.
        REFE = P_BSID_TAB-ZBD3T.
      ELSE.
        IF NOT P_BSID_TAB-ZBD2T IS INITIAL.
          REFE = P_BSID_TAB-ZBD2T.
        ELSE.
          REFE = P_BSID_TAB-ZBD1T.
        ENDIF.
      ENDIF.
    *Nichtrechnungsbezogene Gutschriften sind sofort fällig--
      IF P_BSID_TAB-KOART = 'D' AND P_BSID_TAB-SHKZG = 'H'
      OR P_BSID_TAB-KOART = 'K' AND P_BSID_TAB-SHKZG = 'S'.
        IF P_BSID_TAB-REBZG IS INITIAL.
          REFE = 0.
        ENDIF.
      ENDIF.
      P_BSID_TAB-NETDT = P_BSID_TAB-ZFBDT + REFE.
    *Skontofälligkeiten bestimmen--
      IF NOT P_BSID_TAB-ZBD2T IS INITIAL.
        P_BSID_TAB-SK2DT = P_BSID_TAB-ZFBDT + P_BSID_TAB-ZBD2T.
      ELSE.
        P_BSID_TAB-SK2DT = P_BSID_TAB-NETDT.
      ENDIF.
      IF NOT P_BSID_TAB-ZBD1T IS INITIAL
      OR NOT P_BSID_TAB-ZBD2T IS INITIAL.
        P_BSID_TAB-SK1DT = P_BSID_TAB-ZFBDT + P_BSID_TAB-ZBD1T.
      ELSE.
        P_BSID_TAB-SK1DT = P_BSID_TAB-NETDT.
      ENDIF.
    *Nichtrechnungsbezogene Gutschriften sind sofort fällig--
      IF P_BSID_TAB-KOART = 'D' AND P_BSID_TAB-SHKZG = 'H'
      OR P_BSID_TAB-KOART = 'K' AND P_BSID_TAB-SHKZG = 'S'.
        IF P_BSID_TAB-REBZG IS INITIAL.
          P_BSID_TAB-SK2DT = P_BSID_TAB-NETDT.
          P_BSID_TAB-SK1DT = P_BSID_TAB-NETDT.
        ENDIF.
      ENDIF.
    ELSE.
       MESSAGE E122 RAISING ACCOUNT_TYPE_NOT_SUPPORTED.
    ENDIF.
    E_FAEDE = FAEDE.
    ENDFORM.

    Hi,
    As vijay said...
    1.Declare One final Internal table which you want to show the data
    2 . populate the fieldcatalog using the FM or Manually using the itab in step1
    3. Collect the Data into final internal table which you created in Step 1.
    4. pass the fieldcat and Internal table to ALV FM.
    chk out the prg below i have created your program but i donn knw wht are the output fields... chk your prg
    *REPORT ZALVTEST .
    REPORT ZSAMPLE line-size 260
    line-count 65
    no standard page heading.
    TYPE-POOLS: SLIS.
    ====================================================================
    TABLES *********************************
    ====================================================================
    tables : bseg,
    bkpf,
    kna1,
    bsid,
    bsad,
    knb1.
    data : begin of customer_tab occurs 0,
    kunnr like kna1-kunnr,
    name1 like kna1-name1,
    flag(1) type c,
    end of customer_tab.
    data : begin of customerdoc_tab occurs 0,
    kunnr like kna1-kunnr,
    belnr like bkpf-belnr,
    gjahr like bkpf-gjahr,
    monat like bkpf-monat,
    end of customerdoc_tab.
    data : begin of doc_tab occurs 0,
    belnr like bkpf-belnr,
    gjahr like bkpf-gjahr,
    monat like bkpf-monat,
    end of doc_tab.
    DATA: BEGIN OF BSID_TAB OCCURS 0,
    BUKRS LIKE BSID-BUKRS,
    PRCTR LIKE BSID-PRCTR,
    KUNNR LIKE BSID-KUNNR,
    FLAG(1),
    UMSKZ LIKE BSID-UMSKZ,
    BLART LIKE BSID-BLART,
    BELNR LIKE BSID-BELNR,
    BUZEI LIKE BSID-BUZEI,
    NETDT LIKE BSID-ZFBDT,
    ZFBDT LIKE BSID-ZFBDT,
    BUDAT LIKE BSID-BUDAT,
    BLDAT LIKE BSID-BLDAT,
    BSCHL LIKE BSID-BSCHL,
    DMBTR LIKE BSID-DMBTR,
    SHKZG LIKE BSID-SHKZG,
    ZBD1T LIKE BSID-ZBD1T,
    ZBD2T LIKE BSID-ZBD2T,
    ZBD3T LIKE BSID-ZBD3T,
    REBZG LIKE BSID-REBZG,
    REBZT LIKE BSID-REBZT,
    KOART LIKE BSEG-KOART,
    SK1DT LIKE FAEDE-SK1DT,
    SK2DT LIKE FAEDE-SK2DT,
    DAYSD LIKE SY-TABIX,
    END OF BSID_TAB.
    ranges : r_bukrs for bsid-bukrs,
    r_kunnr for kna1-kunnr.
    ===================================================================
    VARIABLES *******************************
    ===================================================================
    data : v_belnr like bseg-belnr,
    v_gjahr like bkpf-gjahr,
    v_monat like bkpf-monat,
    v_ttlc type p,
    v_flag(1) type c,
    V_COUNT1(4) TYPE N,
    V_COUNT2(4) TYPE N,
    V_COUNT3(4) TYPE N,
    V_COUNT4(4) TYPE N,
    V_COUNT5(4) TYPE N,
    V_COUNT6(4) TYPE N,
    V_COUNT7(4) TYPE N,
    V_COUNT8(4) TYPE N,
    V_COUNT9(4) TYPE N,
    V_COUNT10(4) TYPE N,
    V_NET1 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 1
    V_NET2 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 2
    V_NET3 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 3
    V_NET4 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 4
    V_NET5 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 5
    V_NET6 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 6
    V_NET7 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 7
    V_NET8 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 8
    V_NET9 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 9
    V_NET10 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 10
    V_NET11 LIKE BSID-DMBTR, "CALCULATE CUSTOMER AGE 11
    V_NET LIKE BSID-DMBTR, "Total Balance of Customer
    V_ttlNET1 LIKE BSID-DMBTR,
    V_ttlNET2 LIKE BSID-DMBTR,
    V_ttlNET3 LIKE BSID-DMBTR,
    V_ttlNET4 LIKE BSID-DMBTR,
    V_ttlNET5 LIKE BSID-DMBTR,
    V_ttlNET6 LIKE BSID-DMBTR,
    V_ttlNET7 LIKE BSID-DMBTR,
    V_ttlNET8 LIKE BSID-DMBTR,
    V_ttlNET9 LIKE BSID-DMBTR,
    V_ttlNET10 LIKE BSID-DMBTR,
    V_ttlNET11 LIKE BSID-DMBTR,
    V_ttlNET LIKE BSID-DMBTR,
    v_kunnr like bseg-kunnr,
    V_BUTXT like t001-butxt.
    ********Declare Data Areas for List Viewer ***********
    DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          FIELDCAT_LN LIKE LINE OF FIELDCAT,
          FIELD TYPE SLIS_FIELDNAME,
          COL_POS TYPE I ,
          PGM LIKE SY-REPID,
          FIELD_VALUE(20),
          TABLE_NAME(10).
    ===================================================================
    SELECTION SCREEN ****************************
    ===================================================================
    selection-screen begin of block b1 with frame title text-001.
    parameters : p_bukrs like bseg-bukrs obligatory.
    select-options : s_kunnr for kna1-kunnr,
    s_BRSCH for kna1-BRSCH,
    s_REGIO for kna1-REGIO,
    s_KTOKD for kna1-KTOKD,
    s_BUSAB for knb1-BUSAB.
    selection-screen: end of block b1.
    selection-screen begin of block b2 with frame title text-003.
    PARAMETERS: DAT LIKE SY-DATUM DEFAULT SY-DATUM.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 01(30) TEXT-002.
    SELECTION-SCREEN POSITION POS_LOW.
    *PARAMETERS: RASTBIS1 LIKE RFPDO1-ALLGROGR DEFAULT '000'.
    *PARAMETERS: RASTBIS2 LIKE RFPDO1-ALLGROGR DEFAULT '030'.
    *PARAMETERS: RASTBIS3 LIKE RFPDO1-ALLGROGR DEFAULT '060'.
    *PARAMETERS: RASTBIS4 LIKE RFPDO1-ALLGROGR DEFAULT '090'.
    *PARAMETERS: RASTBIS5 LIKE RFPDO1-ALLGROGR DEFAULT '120'.
    PARAMETERS: RASTBIS1(4) type n DEFAULT '0000'.
    PARAMETERS: RASTBIS2(4) type n DEFAULT '0030'.
    PARAMETERS: RASTBIS3(4) type n DEFAULT '0060'.
    PARAMETERS: RASTBIS4(4) type n DEFAULT '0090'.
    PARAMETERS: RASTBIS5(4) type n DEFAULT '0120'.
    PARAMETERS: RASTBIS6(4) type n DEFAULT '0150'.
    PARAMETERS: RASTBIS7(4) type n DEFAULT '0180'.
    PARAMETERS: RASTBIS8(4) type n DEFAULT '0210'.
    PARAMETERS: RASTBIS9(4) type n DEFAULT '0240'.
    PARAMETERS: RASTBIS0(4) type n DEFAULT '0270'.
    SELECTION-SCREEN END OF LINE.
    Noted item removed as per FI instruction
    PARAMETERS: P_STAND AS CHECKBOX default 'X',
    P_NOTED AS CHECKBOX ,
    P_SPCAL AS CHECKBOX .
    selection-screen: end of block b2.
    selection-screen begin of block b3 with frame.
    PARAMETERS: allgline like RFPDO1-allgline .
    Parameters : p_balyes type c radiobutton group grp9 default 'X',
    p_balno type c radiobutton group grp9.
    selection-screen: end of block b3.
    Check for the Select option
    AT SELECTION-SCREEN.
    IF P_STAND = '' AND P_SPCAL = '' .
    MESSAGE E398(00) WITH 'PLEASE CHOOSE AT LEAST ONE G/L INDICATOR!'.
    ENDIF.
    Check for Company code Authorization
    authority-check object 'F_BKPF_BUK'
    ID 'BUKRS' FIELD p_bukrs
    ID 'ACTVT' FIELD '03'.
    if sy-subrc ne 0.
    message e398(00) with 'You are not Authorized for CC ' p_bukrs.
    Endif.
    ===================================================================
    START-OF-SELECTION ****************************
    ===================================================================
    START-OF-SELECTION.
    V_COUNT1 = RASTBIS1 + 1.
    V_COUNT2 = RASTBIS2 + 1.
    V_COUNT3 = RASTBIS3 + 1.
    V_COUNT4 = RASTBIS4 + 1.
    V_COUNT5 = RASTBIS5 + 1.
    V_COUNT6 = RASTBIS6 + 1.
    V_COUNT7 = RASTBIS7 + 1.
    V_COUNT8 = RASTBIS8 + 1.
    V_COUNT9 = RASTBIS9 + 1.
    V_COUNT10 = RASTBIS0 + 1.
    perform extract_data.
    Build Field Catalogs **************************
      PERFORM BUILD_FIELDCAT.
    *******Start List Viewer *******************************
      PERFORM START_LIST_VIEWER.
    ===================================================================
    At line Selection *****************************
    ===================================================================
    at line-selection.
    if sy-lilli >= 9 .
    refresh r_bukrs.
    move p_bukrs to r_bukrs-low.
    move 'I' to r_bukrs-sign.
    move 'EQ' to r_bukrs-option.
    append r_bukrs.
    refresh r_kunnr.
    move customer_tab-kunnr to r_kunnr-low.
    move 'I' to r_kunnr-sign.
    move 'EQ' to r_kunnr-option.
    append r_kunnr.
    submit ZFARVR0040 and return
    with p_bukrs = p_bukrs
    with dat = dat
    with p_stand = p_stand
    with p_spcal = P_SPCAL
    with s_kunnr in r_kunnr.
    endif.
    ===================================================================
    Top of Page *******************************
    ===================================================================
    TOP-OF-PAGE.
    SELECT SINGLE BUTXT FROM T001 INTO V_BUTXT
    WHERE BUKRS = p_BUKRS .
    WRITE:/73'Customers Aging Analysis',140'PAGE NO.',
    SY-PAGNO.
    WRITE:/002 'COMPANY',
    011 P_BUKRS,
    017 V_BUTXT,
    055 allgline centered,
    140 'DATE :',
    150 sy-datum .
    write:/002 'User',
    011 sy-UNAME,
    140 'Time :',
    150 sy-UZEIT.
    SKIP.
    format color col_heading intensified off.
    WRITE:/ SY-ULINE,
    SY-VLINE,002 'Customer',
    012 SY-VLINE,013 'Name',
    043 SY-VLINE,048 'CURRENT',
    061 SY-VLINE,065 'FROM ',V_COUNT1,
    079 SY-VLINE,083 'FROM ',V_COUNT2,
    097 SY-VLINE,101 'FROM ',V_COUNT3,
    115 SY-VLINE,119 'FROM ',V_COUNT4,
    133 SY-VLINE,137 'FROM ',V_COUNT5,
    151 SY-VLINE,155 'FROM ',V_COUNT6,
    169 SY-VLINE,173 'FROM ',V_COUNT7,
    187 SY-VLINE,191 'FROM ',V_COUNT8,
    205 SY-VLINE,209 'FROM ',V_COUNT9,
    223 SY-VLINE,228 'FROM ',V_COUNT10,
    243 SY-VLINE,248 'TOTAL',
    268 SY-VLINE.
    WRITE:/ SY-VLINE,002 'Number',
    12 SY-VLINE,
    43 SY-VLINE,
    061 SY-VLINE,065 'TO ',RASTBIS2,
    079 SY-VLINE,083 'TO ',RASTBIS3,
    097 SY-VLINE,101 'TO ',RASTBIS4,
    115 SY-VLINE,119 'TO ',RASTBIS5,
    133 SY-VLINE,137 'FROM ',RASTBIS6,
    151 SY-VLINE,155 'FROM ',RASTBIS7,
    169 SY-VLINE,173 'FROM ',RASTBIS8,
    187 SY-VLINE,191 'FROM ',RASTBIS9,
    205 SY-VLINE,209 'FROM ',RASTBIS0,
    223 SY-VLINE,
    243 SY-VLINE,
    268 SY-VLINE,
    SY-ULINE.
    format color off.
    ===================================================================
    END-OF-SELECTION ***************************
    ===================================================================
    end-of-selection.
    ===================================================================
    Form : Extract_Data *
    ===================================================================
    form extract_data.
    Select the Customers
    Select t1~kunnr t2~name1
    into corresponding fields of table customer_tab
    from knb1 as t1 inner join kna1 as t2
    on t2~kunnr = t1~kunnr
    where t1~bukrs = p_bukrs
    and t1~kunnr in s_kunnr
    and t1~BUSAB in s_busab
    and t2~regio in s_regio
    and t2~BRSCH in s_BRSCH
    and t2~KTOKD in s_KTOKD.
    if sy-subrc <> 0.
    message e398(00) with 'No Customers Selected'.
    endif.
    sort customer_tab.
    describe table customer_tab lines v_ttlc.
    v_ttlc = v_ttlc + 10.
    loop at customer_tab.
    v_net1 = 0.
    v_net2 = 0.
    v_net3 = 0.
    v_net4 = 0.
    v_net5 = 0.
    v_net6 = 0.
    v_net7 = 0.
    v_net8 = 0.
    v_net9 = 0.
    v_net10 = 0.
    v_net11 = 0.
    v_net = 0.
    perform calculate_ageing
    using
    p_bukrs
    customer_tab-kunnr
    dat
    RASTBIS1
    RASTBIS2
    RASTBIS3
    RASTBIS4
    RASTBIS5
    RASTBIS6
    RASTBIS7
    RASTBIS8
    RASTBIS9
    RASTBIS0
    P_STAND
    ' ' "noted item
    P_SPCAL
    changing
    v_net1
    v_net2
    v_net3
    v_net4
    v_net5
    v_net6
    v_net7
    v_net8
    v_net9
    v_net10
    v_net11
    v_net.
    if p_balyes = 'X' or v_net > 0.
    format color col_total.
    write:/ sy-vline,
    002 customer_tab-kunnr,
    012 SY-VLINE,013(30) customer_tab-name1,
    043 SY-VLINE,044(16) v_net1,
    061 SY-VLINE,062(16) v_net2,
    079 SY-VLINE,080(16) v_net3,
    097 SY-VLINE,098(16) v_net4,
    115 SY-VLINE,116(16) v_net5,
    133 SY-VLINE,134(16) v_net6,
    151 SY-VLINE,152(16) v_net7,
    169 SY-VLINE,170(16) v_net8,
    187 SY-VLINE,188(16) v_net9,
    205 SY-VLINE,206(16) v_net10,
    223 SY-VLINE,224(16) v_net11,
    239 SY-VLINE,240(16) v_net,
    258 SY-VLINE.
    format color off.
    hide : customer_tab-kunnr.
    v_ttlnet1 = v_ttlnet1 + v_net1.
    v_ttlnet2 = v_ttlnet2 + v_net2.
    v_ttlnet3 = v_ttlnet3 + v_net3.
    v_ttlnet4 = v_ttlnet4 + v_net4.
    v_ttlnet5 = v_ttlnet5 + v_net5.
    v_ttlnet6 = v_ttlnet6 + v_net6.
    v_ttlnet7 = v_ttlnet7 + v_net7.
    v_ttlnet8 = v_ttlnet8 + v_net8.
    v_ttlnet9 = v_ttlnet9 + v_net9.
    v_ttlnet10 = v_ttlnet10 + v_net10.
    v_ttlnet11 = v_ttlnet11 + v_net11.
    v_ttlnet = v_ttlnet + v_net.
    endif.
    endloop.
    ULINE.
    format color col_total.
    write:/ sy-vline,
    012 SY-VLINE,012(30) ' T O T A L',
    043 SY-VLINE,044(16) v_ttlnet1,
    061 SY-VLINE,062(16) v_ttlnet2,
    079 SY-VLINE,080(16) v_ttlnet3,
    097 SY-VLINE,098(16) v_ttlnet4,
    115 SY-VLINE,116(16) v_ttlnet5,
    133 SY-VLINE,134(16) v_ttlnet6,
    151 SY-VLINE,152(16) v_ttlnet7,
    169 SY-VLINE,170(16) v_ttlnet8,
    187 SY-VLINE,188(16) v_ttlnet9,
    205 SY-VLINE,206(16) v_ttlnet10,
    223 SY-VLINE,224(16) v_ttlnet11,
    239 SY-VLINE,240(16) v_ttlnet,
    258 SY-VLINE.
    format color off.
    ULINE.
    endform.
    Function to Calculate Aging.
    Form calculate_ageing using
    bukrs
    kunnr
    dat
    RASTBIS1
    RASTBIS2
    RASTBIS3
    RASTBIS4
    RASTBIS5
    RASTBIS6
    RASTBIS7
    RASTBIS8
    RASTBIS9
    RASTBIS0
    P_STAND
    P_NOTED
    P_SPCAL
    changing
    v_net1
    v_net2
    v_net3
    v_net4
    v_net5
    v_net6
    v_net7
    v_net8
    v_net9
    v_net10
    v_net11
    v_net.
    DATA: BEGIN OF BSID_TAB1 OCCURS 0,
    BUKRS LIKE BSID-BUKRS,
    PRCTR LIKE BSID-PRCTR,
    KUNNR LIKE BSID-KUNNR,
    FLAG(1),
    UMSKZ LIKE BSID-UMSKZ,
    BLART LIKE BSID-BLART,
    BELNR LIKE BSID-BELNR,
    BUZEI LIKE BSID-BUZEI,
    NETDT LIKE BSID-ZFBDT,
    ZFBDT LIKE BSID-ZFBDT,
    BUDAT LIKE BSID-BUDAT,
    BLDAT LIKE BSID-BLDAT,
    BSCHL LIKE BSID-BSCHL,
    DMBTR LIKE BSID-DMBTR,
    SHKZG LIKE BSID-SHKZG,
    ZBD1T LIKE BSID-ZBD1T,
    ZBD2T LIKE BSID-ZBD2T,
    ZBD3T LIKE BSID-ZBD3T,
    REBZG LIKE BSID-REBZG,
    REBZT LIKE BSID-REBZT,
    KOART LIKE BSEG-KOART,
    SK1DT LIKE FAEDE-SK1DT,
    SK2DT LIKE FAEDE-SK2DT,
    DAYSD LIKE SY-TABIX,
    END OF BSID_TAB1.
    RANGES: R_UMSKZ FOR BSID-UMSKZ.
    Data : V_ZFBDT Like bsid-ZFBDT,
    V_ZBD1T Like bsid-ZBD1T,
    V_ZBD2T Like bsid-ZBD2T,
    V_ZBD3T Like bsid-ZBD3T,
    V_LINES(8) TYPE n.
    IF P_NOTED = 'X'. "CHECK NOTED ITEMS
    R_UMSKZ-SIGN = 'I'.
    R_UMSKZ-OPTION = 'EQ'.
    R_UMSKZ-LOW = 'D'.
    APPEND R_UMSKZ.
    R_UMSKZ-SIGN = 'I'.
    R_UMSKZ-OPTION = 'EQ'.
    R_UMSKZ-LOW = 'L'.
    APPEND R_UMSKZ.
    ENDIF.
    IF P_STAND = 'X'. "CHECK STANDARD ITEMS
    R_UMSKZ-SIGN = 'I'.
    R_UMSKZ-OPTION = 'EQ'.
    R_UMSKZ-LOW = ' '.
    APPEND R_UMSKZ.
    ENDIF.
    IF P_SPCAL = 'X'. "CHECK SPECIAL G/L TRANSACTION
    R_UMSKZ-SIGN = 'I'.
    R_UMSKZ-OPTION = 'EQ'.
    R_UMSKZ-LOW = 'A'.
    APPEND R_UMSKZ.
    R_UMSKZ-SIGN = 'I'.
    R_UMSKZ-OPTION = 'EQ'.
    R_UMSKZ-LOW = 'B'.
    APPEND R_UMSKZ.
    ENDIF.
    SELECT * FROM BSID INTO CORRESPONDING FIELDS OF TABLE BSID_TAB
    WHERE BUKRS = BUKRS AND
    budat <= dat AND
    KUNNR = KUNNR AND
    UMSKZ in R_UMSKZ.
    SELECT * FROM BSAD appending CORRESPONDING FIELDS OF TABLE BSID_TAB
    WHERE BUKRS = BUKRS AND
    budat <= dat AND
    augdt >= dat AND
    KUNNR = KUNNR AND
    UMSKZ in R_UMSKZ.
    DESCRIBE TABLE BSID_TAB LINES V_LINES.
    LOOP AT BSID_TAB.
    if bsid_tab-BLART = 'DZ'.
    Select single ZFBDT ZBD1T ZBD2T ZBD3T
    into (V_ZFBDT,V_ZBD1T,V_ZBD2T,V_ZBD3T)
    from bsid where BUKRS = BUKRS
    and kunnr = bsid_tab-kunnr
    and BELNR = bsid_tab-REBZG.
    if sy-subrc = 0.
    bsid_tab-ZFBDT = V_ZFBDT.
    bsid_tab-ZBD1T = V_ZBD1T.
    bsid_tab-ZBD2T = V_ZBD2T.
    bsid_tab-ZBD3T = V_ZBD3T.
    else.
    Select single ZFBDT ZBD1T ZBD2T ZBD3T
    into (V_ZFBDT,V_ZBD1T,V_ZBD2T,V_ZBD3T)
    from bsad where BUKRS = BUKRS
    and kunnr = bsid_tab-kunnr
    and BELNR = bsid_tab-REBZG.
    if sy-subrc <> 0.
    bsid_tab-ZFBDT = V_ZFBDT.
    bsid_tab-ZBD1T = V_ZBD1T.
    bsid_tab-ZBD2T = V_ZBD2T.
    bsid_tab-ZBD3T = V_ZBD3T.
    endif.
    endif.
    endif.
    IF BSID_TAB-SHKZG = 'H'.
    BSID_TAB-DMBTR = BSID_TAB-DMBTR * ( - 1 ).
    ENDIF.
    bsid_tab-netdt = bsid_tab-ZFBDT.
    bsid_tab-netdt = bsid_tab-budat.
    bsid_tab-koart = 'D'.
    MODIFY BSID_TAB.
    PERFORM CALC_DUE_DATE USING BSID_TAB.
    BSID_TAB-DAYSD = DAT - BSID_TAB-NETDT.
    IF BSID_TAB-DAYSD <= RASTBIS1.
    V_NET1 = V_NET1 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS2.
    V_NET2 = V_NET2 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS3.
    V_NET3 = V_NET3 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS4.
    V_NET4 = V_NET4 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS5.
    V_NET5 = V_NET5 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS6.
    V_NET6 = V_NET6 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS7.
    V_NET7 = V_NET7 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS5.
    V_NET8 = V_NET8 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS9.
    V_NET9 = V_NET9 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD <= RASTBIS0.
    V_NET10 = V_NET10 + BSID_TAB-DMBTR.
    ELSEIF BSID_TAB-DAYSD > RASTBIS0.
    V_NET11 = V_NET11 + BSID_TAB-DMBTR.
    ENDIF.
    V_NET = V_NET + BSID_TAB-DMBTR.
    MODIFY BSID_TAB.
    ENDLOOP.
    endform.
    Calculate Due Date
    FORM CALC_DUE_DATE USING P_BSID_TAB STRUCTURE BSID_TAB.
    DATA : REFE TYPE P.
    IF P_BSID_TAB-KOART = 'K' OR P_BSID_TAB-KOART = 'D'.
    IF P_BSID_TAB-ZFBDT IS INITIAL.
    P_BSID_TAB-ZFBDT = P_BSID_TAB-BLDAT.
    ENDIF.
    *Nettofälligkeit bestimmen--
    IF NOT P_BSID_TAB-ZBD3T IS INITIAL.
    REFE = P_BSID_TAB-ZBD3T.
    ELSE.
    IF NOT P_BSID_TAB-ZBD2T IS INITIAL.
    REFE = P_BSID_TAB-ZBD2T.
    ELSE.
    REFE = P_BSID_TAB-ZBD1T.
    ENDIF.
    ENDIF.
    *Nichtrechnungsbezogene Gutschriften sind sofort fällig--
    IF P_BSID_TAB-KOART = 'D' AND P_BSID_TAB-SHKZG = 'H'
    OR P_BSID_TAB-KOART = 'K' AND P_BSID_TAB-SHKZG = 'S'.
    IF P_BSID_TAB-REBZG IS INITIAL.
    REFE = 0.
    ENDIF.
    ENDIF.
    P_BSID_TAB-NETDT = P_BSID_TAB-ZFBDT + REFE.
    *Skontofälligkeiten bestimmen--
    IF NOT P_BSID_TAB-ZBD2T IS INITIAL.
    P_BSID_TAB-SK2DT = P_BSID_TAB-ZFBDT + P_BSID_TAB-ZBD2T.
    ELSE.
    P_BSID_TAB-SK2DT = P_BSID_TAB-NETDT.
    ENDIF.
    IF NOT P_BSID_TAB-ZBD1T IS INITIAL
    OR NOT P_BSID_TAB-ZBD2T IS INITIAL.
    P_BSID_TAB-SK1DT = P_BSID_TAB-ZFBDT + P_BSID_TAB-ZBD1T.
    ELSE.
    P_BSID_TAB-SK1DT = P_BSID_TAB-NETDT.
    ENDIF.
    *Nichtrechnungsbezogene Gutschriften sind sofort fällig--
    IF P_BSID_TAB-KOART = 'D' AND P_BSID_TAB-SHKZG = 'H'
    OR P_BSID_TAB-KOART = 'K' AND P_BSID_TAB-SHKZG = 'S'.
    IF P_BSID_TAB-REBZG IS INITIAL.
    P_BSID_TAB-SK2DT = P_BSID_TAB-NETDT.
    P_BSID_TAB-SK1DT = P_BSID_TAB-NETDT.
    ENDIF.
    ENDIF.
    ELSE.
    MESSAGE E122 RAISING ACCOUNT_TYPE_NOT_SUPPORTED.
    ENDIF.
    E_FAEDE = FAEDE.
    ENDFORM.
    *&      Form  BUILD_FIELDCAT
    FORM BUILD_FIELDCAT .
      PGM = SY-REPID.
      FIELD      = 'give field name'.
      TABLE_NAME = 'give table name'.
      PERFORM FIELDCAT_FILL USING FIELD.
    and so on for the no. of fields you want to display
    ENDFORM.                    " BUILD_FIELDCAT
    *&      Form  START_LIST_VIEWER
    FORM START_LIST_VIEWER.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
       I_INTERFACE_CHECK              = ' '
         I_CALLBACK_PROGRAM             = PGM
       I_CALLBACK_PF_STATUS_SET       = ' '
         I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
       I_STRUCTURE_NAME               =
       IS_LAYOUT                      =
         IT_FIELDCAT                    = FIELDCAT
       IT_EXCLUDING                   =
       IT_SPECIAL_GROUPS              =
       IT_SORT                        =
       IT_FILTER                      =
       IS_SEL_HIDE                    =
         I_DEFAULT                      = 'X'
         I_SAVE                         = 'A'
       IS_VARIANT                     =
       IT_EVENTS                      =
       IT_EVENT_EXIT                  =
       IS_PRINT                       =
       IS_REPREP_ID                   =
       I_SCREEN_START_COLUMN          = 0
       I_SCREEN_START_LINE            = 0
       I_SCREEN_END_COLUMN            = 0
       I_SCREEN_END_LINE              = 0
       IR_SALV_LIST_ADAPTER           =
       IT_EXCEPT_QINFO                =
       I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
       E_EXIT_CAUSED_BY_CALLER        =
       ES_EXIT_CAUSED_BY_USER         =
       TABLES
         T_OUTTAB                       = FINAL TAB(OUTPUT STATEMENTS TABLE)
      EXCEPTIONS
        PROGRAM_ERROR                   = 1
        OTHERS                          = 2.
    ENDFORM.                    " START_LIST_VIEWER
    *&      Form  FIELDCAT_FILL
          text
    FORM FIELDCAT_FILL USING FIELD_VALUE.
      ADD 1 TO COL_POS.
      FIELDCAT_LN-REF_TABNAME = TABLE_NAME.
      FIELDCAT_LN-FIELDNAME = FIELD_VALUE.
      FIELDCAT_LN-KEY = SPACE.
      FIELDCAT_LN-DO_SUM = SPACE.
      FIELDCAT_LN-COL_POS = COL_POS.
      FIELDCAT_LN-NO_OUT = SPACE.
      FIELDCAT_LN-QFIELDNAME = SPACE.
      FIELDCAT_LN-HOTSPOT = SPACE.
      APPEND FIELDCAT_LN TO FIELDCAT.
    ENDFORM.                    " FIELDCAT_FILL
    Reward points if you find this helpful
    Regards,
    Harini

  • My daughters ipod touch was stolen yesterday on her bus ride home. she did how ever get it back today but the person tried so many times to get into it that it says "disabled" how can i fix this or do i need to take it into apple

    Hello, I would like to know if any one could tell me how to fix my daughters ipod touch or if I need to take it into an apple store. One of the kids on her school bus stole it out of her backpack. My daughter got it back today at school but went to turn it on and the kid that stole it I guess tried to many times to get into so now when you turn it on it says "DISABLED". Can anyone please help!!!!   Thank you, Julie

    Wipe it clean and restore it. You should then be able to rename the iPod and set up an account with iTunes. I hope this helps!

  • HT1212 my ipod touch has been disabled and needs to be plugged into itunes to reset it. However, the computer it was last synched with has broken and I don't know what to do!

    my ipod touch has been disabled and needs to be plugged into itunes to reset it. However, the computer it was last synched with has broken and I don't know what to do!

    You need to place the device in recovery mode.
    Instructions here >  iOS: Unable to update or restore
    "If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present"

  • I have got an iphone 3g and when i got it it was jailbroken so i went to restore it but it failed now it says i need to plug it into itunes all the time. what do i do?

    i have got an iphone 3g and when i got it it was jailbroken so i went to restore it but it failed now it says i need to plug it into itunes all the time. what do i do?

    Kidcomeleon wrote:
    i have got an iphone 3g and when i got it it was jailbroken so i went to restore it but it failed now it says i need to plug it into itunes all the time. what do i do?
    Plug it into iTunes.

  • Need to generate the excel file with diffrent sheets using utl_file package

    Hi,
    Sorry for previous message in which I had missed the usage of " UTL_FILE " package
    I need to generate the excel file with diffrent sheets . Currently I am generating the data in three diffrent excel files using
    " UTL_File " package and my requirement is to generate this in a single excel file with diffrent sheets.
    Please help on this
    Thanks & Regards,
    Krishna Vyavahare

    Hello 10866107,
    at Re: How to save a query result and export it to, say excell? you can find links to different solutions. At least the packages behind second and fourth link support more than one worksheet.
    Regards
    Marcus

  • Need to generate excel file with different sheets

    Hi,
    I need to generate the excel file with diffrent sheets . Currently I am generating the data in three diffrent excel files
    and my requirement is to generate this in a single excel file with diffrent sheets.
    Please help on this
    Thanks & Regards,
    Krishna Vyavahare

    I'm not able to realize how Oracle will help in the problem. You may probably want to look at some [.net forums|http://www.google.com.sg/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS280&q=.net+forums&btnG=Google+Search&meta=lr%3D] about this.
    Cheers
    Sarma.

  • Output of RFC needs to be converted into PDF format

    Hi Experts,
    In the ESS screen, we have to provide one link for every employee. When the user will click on the link, one letter in PDF format should be displayed to the user. This PDF will act as a "Address Certificate". The address certificate will contain information related with name, address, passport details etc. How we can achieve this?
    In my view, we will have to create one Z-RFC. The ABAPer will create the Z-RFC. Now the input for the Z RFC will be employee no. The output will be Name, Address and Passport details.
    The information provided in table format needs to be converted into PDF form. How we can do so? What all services needs to be activated for this?
    Regards,
    Gary

    Hi Gary,
    When you say the ESS screen, what do you mean by this is it ECC side or in Portal Side.
    It its in Portal side then, I think you need to create a WebDynpro application which display output through ADOBE forms. For that you need to have basic WebDynpro knowledge.
    Apart from that ADS needs to be configured. There are sevrel tutorial available in SDN. For creating a WebDynpro Application with Adobe Interactive forms.
    Do let me know if you require more information.
    Regards,

Maybe you are looking for

  • G3 not booting from Master HD. from slave gets bomb in OS 9.2

    G3 B&W, 350 mhz, 320 Ram under 10.3.9 or 9.2. 2 HD's - 100 gb master with 10.3.9, partitioned into 6 drives, and slave is original 30gb under 9.2, partitioned into 4 drives. I was having trouble with it yesterday, so I put the 10.3 install disk in to

  • Not displaying igoogle themes on secondary user

    I am running windows 7 on a new hp laptop with a i3 core. The secondary user on this machine has igoogle for the home page and it will not display the theme and some icons on the home page. I have uninstalled and reinstalled firefox and adobe flash a

  • Given a XSD, and a XPath- ways to find the type of the XPath leaf element

    Given a XSD, and an XPath (refering to an element in a XML document satifying that XSD), is there an utility which return the "type" of the given XPath element. One approach just to traverse the XSD tree, generated by the XSDBuilder, as per the eleme

  • Email address and uploading through DPS

    I have a Professional account for DPS and with that, I use the Adobe ID-related email address (that was registered to the account when it was set up) to upload my folios. But say my company needs to build and upload say 3 folios in one day - do all t

  • Help,about session array in JSP

    Maybe It is a simple question for you.But it really trouble me.How to store an array into session variable and how to retrive it out from sesson,