Encrypting Programs using 2 keywords(2 square cipher)?

Hello, I am trying to create a program that can encrypt and save files using 2 keywords. (it's part of a course I'm starting). At the moment, I have created a program that can encrypt messages with ONE keyword. 
If someone could provide a solution to my problem - that would be absolutely wonderful. 
thanks.

This is what I've done so far ; 
it encrypted messages using only ONE keyword
'text window setup
TextWindow.Title = "Encryption Program - Task 2"
'get message
start: 
TextWindow.ForegroundColor = "green"
TextWindow.BackgroundColor = "blue"
TextWindow.WriteLine("Please enter your message.")
Message = TextWindow.Read()
Characters = Text.GetSubText(Message,1,1)
WordCharacterCode = Text.GetCharacterCode(Characters)
'message error check
If WordCharacterCode < 65 Or WordCharacterCode > 122 Or WordCharacterCode < 97 And WordCharacterCode> 90 Then
  TextWindow.ForegroundColor = "red"
  TextWindow.WriteLine("ERROR - Please try again")
  Goto start
  EndIf
'get keyword
TextWindow.WriteLine("Please enter a keyword")
key = TextWindow.Read()
KeyCharacter = Text.GetSubText(key,1,1)
KeyCharacterCode = Text.GetCharacterCode(KeyCharacter)
'keyword error check
If KeyCharacterCode < 65 Or KeyCharacterCode > 122 Or KeyCharacterCode < 97 And KeyCharacterCode > 90 Then 
   TextWindow.ForegroundColor = "red"
  TextWindow.WriteLine("**ERROR - Please try again**")
  Goto start
Else 
  EncryptLowerCase()
EndIf
'suborutine - encrypts message
Sub EncryptLowerCase 
TextWindow.ForegroundColor = "green"
TextWindow.BackgroundColor = "black"
count = 1 
While Text.GetLength(keyword) < Text.GetLength(Message)
  If count > Text.GetLength(key) Then 
    count = 1
  EndIf 
  keyletter = Text.GetSubText(key,count,1)
  keyword = keyword + keyletter
  count = count + 1
EndWhile
For i = 1 To Text.GetLength(Message)
  charscode = Text.GetCharacterCode(Text.GetSubText(Message,i,1)) - 96
  keycharscode = Text.GetCharacterCode(Text.GetSubText(keyword,i,1)) - 96
  encryptedchar = Text.GetCharacter(Math.Remainder(keycharscode + charscode,26)+96)
  encrypted = encrypted + encryptedchar
EndFor
'text window setup
TextWindow.Title = "Encryption Program - Task 2"
'get message
start: 
TextWindow.ForegroundColor = "green"
TextWindow.BackgroundColor = "blue"
TextWindow.WriteLine("Please enter your message.")
Message = TextWindow.Read()
Characters = Text.GetSubText(Message,1,1)
WordCharacterCode = Text.GetCharacterCode(Characters)
'message error check
If WordCharacterCode < 65 Or WordCharacterCode > 122 Or WordCharacterCode < 97 And WordCharacterCode> 90 Then
  TextWindow.ForegroundColor = "red"
  TextWindow.WriteLine("ERROR - Please try again")
  Goto start
  EndIf
'get keyword
TextWindow.WriteLine("Please enter a keyword")
key = TextWindow.Read()
KeyCharacter = Text.GetSubText(key,1,1)
KeyCharacterCode = Text.GetCharacterCode(KeyCharacter)
'keyword error check
If KeyCharacterCode < 65 Or KeyCharacterCode > 122 Or KeyCharacterCode < 97 And KeyCharacterCode > 90 Then 
   TextWindow.ForegroundColor = "red"
  TextWindow.WriteLine("**ERROR - Please try again**")
  Goto start
Else 
  EncryptLowerCase()
EndIf
'suborutine - encrypts message
Sub EncryptLowerCase 
TextWindow.ForegroundColor = "green"
TextWindow.BackgroundColor = "black"
count = 1 
While Text.GetLength(keyword) < Text.GetLength(Message)
  If count > Text.GetLength(key) Then 
    count = 1
  EndIf 
  keyletter = Text.GetSubText(key,count,1)
  keyword = keyword + keyletter
  count = count + 1
EndWhile
For i = 1 To Text.GetLength(Message)
  charscode = Text.GetCharacterCode(Text.GetSubText(Message,i,1)) - 96
  keycharscode = Text.GetCharacterCode(Text.GetSubText(keyword,i,1)) - 96
  encryptedchar = Text.GetCharacter(Math.Remainder(keycharscode + charscode,26)+96)
  encrypted = encrypted + encryptedchar
EndFor
'text window setup
TextWindow.Title = "Encryption Program - Task 2"
'get message
start: 
TextWindow.ForegroundColor = "green"
TextWindow.BackgroundColor = "blue"
TextWindow.WriteLine("Please enter your message.")
Message = TextWindow.Read()
Characters = Text.GetSubText(Message,1,1)
WordCharacterCode = Text.GetCharacterCode(Characters)
'message error check
If WordCharacterCode < 65 Or WordCharacterCode > 122 Or WordCharacterCode < 97 And WordCharacterCode> 90 Then
  TextWindow.ForegroundColor = "red"
  TextWindow.WriteLine("ERROR - Please try again")
  Goto start
  EndIf
'get keyword
TextWindow.WriteLine("Please enter a keyword")
key = TextWindow.Read()
KeyCharacter = Text.GetSubText(key,1,1)
KeyCharacterCode = Text.GetCharacterCode(KeyCharacter)
'keyword error check
If KeyCharacterCode < 65 Or KeyCharacterCode > 122 Or KeyCharacterCode < 97 And KeyCharacterCode > 90 Then 
   TextWindow.ForegroundColor = "red"
  TextWindow.WriteLine("**ERROR - Please try again**")
  Goto start
Else 
  EncryptLowerCase()
EndIf
'suborutine - encrypts message
Sub EncryptLowerCase 
TextWindow.ForegroundColor = "green"
TextWindow.BackgroundColor = "black"
count = 1 
While Text.GetLength(keyword) < Text.GetLength(Message)
  If count > Text.GetLength(key) Then 
    count = 1
  EndIf 
  keyletter = Text.GetSubText(key,count,1)
  keyword = keyword + keyletter
  count = count + 1
EndWhile
For i = 1 To Text.GetLength(Message)
  charscode = Text.GetCharacterCode(Text.GetSubText(Message,i,1)) - 96
  keycharscode = Text.GetCharacterCode(Text.GetSubText(keyword,i,1)) - 96
  encryptedchar = Text.GetCharacter(Math.Remainder(keycharscode + charscode,26)+96)
  encrypted = encrypted + encryptedchar
EndFor
'text window setup
TextWindow.Title = "Encryption Program - Task 2"
'get message
start: 
TextWindow.ForegroundColor = "green"
TextWindow.BackgroundColor = "blue"
TextWindow.WriteLine("Please enter your message.")
Message = TextWindow.Read()
Characters = Text.GetSubText(Message,1,1)
WordCharacterCode = Text.GetCharacterCode(Characters)
'message error check
If WordCharacterCode < 65 Or WordCharacterCode > 122 Or WordCharacterCode < 97 And WordCharacterCode> 90 Then
  TextWindow.ForegroundColor = "red"
  TextWindow.WriteLine("ERROR - Please try again")
  Goto start
  EndIf
'get keyword
TextWindow.WriteLine("Please enter a keyword")
key = TextWindow.Read()
KeyCharacter = Text.GetSubText(key,1,1)
KeyCharacterCode = Text.GetCharacterCode(KeyCharacter)
'keyword error check
If KeyCharacterCode < 65 Or KeyCharacterCode > 122 Or KeyCharacterCode < 97 And KeyCharacterCode > 90 Then 
   TextWindow.ForegroundColor = "red"
  TextWindow.WriteLine("**ERROR - Please try again**")
  Goto start
Else 
  EncryptLowerCase()
EndIf
'suborutine - encrypts message
Sub EncryptLowerCase 
TextWindow.ForegroundColor = "green"
TextWindow.BackgroundColor = "black"
count = 1 
While Text.GetLength(keyword) < Text.GetLength(Message)
  If count > Text.GetLength(key) Then 
    count = 1
  EndIf 
  keyletter = Text.GetSubText(key,count,1)
  keyword = keyword + keyletter
  count = count + 1
EndWhile
For i = 1 To Text.GetLength(Message)
  charscode = Text.GetCharacterCode(Text.GetSubText(Message,i,1)) - 96
  keycharscode = Text.GetCharacterCode(Text.GetSubText(keyword,i,1)) - 96
  encryptedchar = Text.GetCharacter(Math.Remainder(keycharscode + charscode,26)+96)
  encrypted = encrypted + encryptedchar
EndFor

Similar Messages

  • Can you explain when using keywords and addding them to various clips pressing ctrl and a number eg. 1 or 2 it simply closes down FCPX.  Just to the dock as would th yellow -sign. As you gather I am new to this program having only used Final Cut Express 4

    Can you explain when using keywords and addding them to various clips pressing ctrl and a number eg. 1 or 2 it simply closes down FCPX.  Just to the dock as would the yellow -sign.  I am new to this program having only used Final Cut Express 4 previously.
    iMac (early 2009) 24in 2.93GHz 4GB 1066MHz DDR3 SDRAM (To be upgraded ot 8GB in the nextfew days) os x 10.7.2 Lion
    Re: Why don't my arrows on the time line operate and allow me to move to the start and end of the timeline. Iam using the trial version 

    Check System Preferences. I think Control-1 is used by something in the OS now. Switch it off. It's a major p[ain the way the OS is taking over more and more of the keyboard, allowing less options for application use.

  • Bash: Passphrase encryption program

    Bash: Passphrase encryption program
    I wrote this a while back while playing with gpg.
    #!/bin/bash
    # Passphrase encryption program
    # Created by Dave Crouse 01-13-2006
    # Reads input from text editor and encrypts to screen.
    clear
    echo " Passphrase Encryption Program";
    echo "--------------------------------------------------"; echo "";
    which $EDITOR &>/dev/null
    if [ $? != "0" ];
    then
    echo "It appears that you do not have a text editor set in your .bashrc file.";
    echo "What editor would you like to use ? " ;
    read EDITOR ; echo "";
    fi
    echo "Enter the name/comment for this message :"
    read comment
    $EDITOR passphraseencryption
    gpg --armor --comment "$comment" --no-options --output passphraseencryption.gpg --symmetric passphraseencryption
    shred -u passphraseencryption ; clear
    echo "Outputting passphrase encrypted message"; echo "" ; echo "" ;
    cat passphraseencryption.gpg ; echo "" ; echo "" ;
    shred -u passphraseencryption.gpg ;
    exit
    After you run the program, it outputs something like this.......
    -----BEGIN PGP MESSAGE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: KEY: Linux is cool
    jA0EAwMC5l8nNDuWf2lgyaJl2VwbtOWttdVlNC2wtpI22jcRkJOUnph/xzvYoac1
    zXznkxunRyT7elT668dTSREdKrZ7H7geGtVkeu2eRFALlXkDVSg5m80nntGzG88r
    6UGjqIG3nOjztOOGrOODDTYidCoPYwEAaVZADU827lpycUeqiA9+zH5oQl9eFHEO
    cYK9G2LnWR0CMY7KFadocPX3o3u1CBeZJsObTonFIty7FYQ=
    =mlIy
    -----END PGP MESSAGE-----
    The "key" for this message is "Linux is cool" .... of course you wouldn't put the key in the name/comment section like i did, but mine was for illustrative purposes only.
    I'm sure the program could be improved, use the temp file/ do more error checking etc... but this was just a "quick-n-dirty" way to create an encrypted message
    Hope you like it.

    I didn't test it, just a style suggestion:
    Instead of:
    which $EDITOR &>/dev/null
    if [ $? != "0" ];
    then
    use:
    if [ -z "$EDITOR" ]; then
    # $EDITOR not set
    And you don't need "exit" at the end or ";" at the end of a line

  • Encryption Program

    Ok, so here's the deal:
    For school I have to create an encryption program that will read a string from the user, ask them for an alphabet that it will use to encrypt it then encrypt the phrase. This is my code:
    * This program asks the user for a phrase and encrypts it
    * @author Michael S
    * @version v13.37 March 4, 2008
    import java.io.*;
    import java.lang.*;
    public class EncryptA
        public static void main (String[] args) { // main method string
          String temp1;
          String temp2;
          String phrase;
          String encphrase;
          String encAlph[] = {"","","","","","","","","","","","","","","","","","","","","","","","","",""};
          String encalphrase;
          int k; 
          int i;
          int q;
          String phtemp;
          String altemp;
          int phraselength;
          String alphaArray[] = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}; // the elements in the main array
          //  prompt the user to enter their word(s)
          System.out.print("Enter your phrase to be encrypted, then hit enter."); // Asks the user to enter the phrase
          System.out.println(); // prints a blank line
          //  open up standard input
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          //  read the phrase from the command-line; need to use try/catch with the
          //  readLine() method
          temp1 = ""; // initilizing temp
          System.out.println(); // print a blank line
          try { // try
          temp1 = br.readLine(); // temp is equal to what the user just entered            
          } // end of try
          catch (IOException ioe) { // catch the exceptions
             System.out.print("You're doing it wrong, try again."); // give the user a message telling them that they need to try again
             System.out.println(); // print a blank line
          } // end of catch
          catch (NumberFormatException e) { // catch the numeric exceptions
             System.out.print("You're doing it wrong, try again."); // give the user a message telling them that they need to try again
             System.out.println(); // print a blank line
          } // end of catch
          phraselength = temp1.length(); // length is equal to the number of characters in the phrase
          phrase = temp1;
          //  prompt the user to enter their word(s)
          System.out.println(); // blank line
          System.out.print("Enter the encrypted alphabet you want to use, then hit enter."); // Asks the user to enter the phrase
          System.out.println(); // prints a blank line
          temp2 = ""; // initilizing temp
          System.out.println(); // print a blank line
          try { // try
          temp2 = br.readLine(); // temp is equal to what the user just entered            
          } // end of try
          catch (IOException ioe) { // catch the exceptions
             System.out.print("You're doing it wrong, try again."); // give the user a message telling them that they need to try again
             System.out.println(); // print a blank line
          } // end of catch
          catch (NumberFormatException e) { // catch the numeric exceptions
             System.out.print("You're doing it wrong, try again."); // give the user a message telling them that they need to try again
             System.out.println(); // print a blank line
          } // end of catch
          encalphrase = temp2;
          q = 0;
          while (q < 26) {
          encAlph[q] = "" + encalphrase.charAt(q); // assigning temp2 to encAlph at "a"
          q++; // add 1 to q
          i = 0;
          k = 0;
          encphrase = "";
          while (i < phraselength) {
              while (k < 26) {
                  phtemp = "" + phrase.charAt(i);
                  altemp = alphaArray[k];
                  if (phtemp.compareTo(altemp) != 0) {
                      encphrase = "" + encphrase;
                  if (phtemp.equals(altemp)) {
                      encphrase = "" + encphrase + encAlph[k];
                  if (phtemp.equalsIgnoreCase(" ")) {
                      encphrase = "" + encphrase + " ";
                    k++;   
                i++;
            } // end of beginning while
          k = 0;
          System.out.println(); // print a blank line
          System.out.println("This is what you entered: " + temp1); // tells the user that this is what they entered
          System.out.println("Your phrase you entered has " + phraselength + " characters.");
          System.out.print("This is the contents of encAlph[]: ");
          while ( k < 26 ) {
          System.out.print(encAlph[k]);
          k++;
          System.out.println();
          System.out.println("Your encrypted phrase is: " + encphrase);
          i = 0;
    }When I compile it, I get no errors, and this is what the terminal window looks like:
    Enter your phrase to be encrypted, then hit enter.
    hello
    Enter the encrypted alphabet you want to use, then hit enter.
    qwertyuiopasdfghjklzxcvbnm
    This is what you entered: hello
    Your phrase you entered has 5 characters.
    This is the contents of encAlph[]: qwertyuiopasdfghjklzxcvbnm
    Your encrypted phrase is: iThe problem is, I get "i" as the encrypted phrase, when I didn't even enter an "i". This applies for any phrase I enter. Any idea what is wrong and how to fix it? Or another way to do encryption? Any help at all is appreciated :)

    Ok, I still don't understand what you people are trying to say. I know why it isn't working, the loop with the variable "q" isn't looping for some reason. I have it set up 100% correct, and it isn't looping. Can anyone tell me why it is not looping?
    q = 0;
          k = 0;
          while (q < 5) {
              while (k < 26) {
                  phtemp = "" + phrase.charAt(q);
                  altemp = alphaArray[k];
                  if (phtemp.compareTo(altemp) != 0) {
                      System.out.println("No change.");
                  if (phtemp.equals(altemp)) {
                      encphrase = "" + encphrase + encAlph[k];
                      System.out.println("Strings are equal.");
                  if (phtemp.equalsIgnoreCase(" ")) {
                      encphrase = "" + encphrase + " ";
                      System.out.println("There is a space.");
                    k++;
                } // end of k while
            q++;
        }// end of q while

  • Is there any Profile option available to encrypt and use APPS password Oracle Application Host script

    @Hi, How do we encrypt APPS password usage  in Oracle Application Host script and still let it be used in encrypted format (eg.$1, $FCP_LOGIN should not show plain text password).
    Appreciate the process along with any Profile available to place this control.
    Concurrent Program Setup Option SECURE/ENCRYPT controls $1, $FCP_LOGIN respectively, but Developer still has access to view/log the APPS Password.
    Can we have a System profile or an Apps DBA level Setup to encrypt and use the APPS/Password.
    Thanks in Advance
    Lakshmi

    Are you linking the host script to fndcpesr? E.g.:
    Host script defined with prog extension:
    XXSCRIPT.prog
    Move it to relevant dir:
    $XX_TOP/bin
    Create a soft link to fndcpesr
    ln -s $FND_TOP/bin/fndcpesr XXSCRIPT

  • Encrypted document using Apple File Security won't open

    Back in 2000 I was using an iMac G3 with OS 9. I created a MS word document with MS 2000 and encrypted it using the Apple File Security. Since then I have upgraded to an iMac G5 with OS 10.4 and OS 9 for older applications.
    Since this is a legal document, I now need to decrypt it and I am not sure if I used a password to encrypt this document. I have opened up the key chain in OS 9 and, I don't see any saved passwords. I have opened up MS Word and don't see anything about a password for this application. When I open up the encrypted document it shows it to be over 300 pages, and when I select "Get Info" it shows that this document is unlocked, but I see on the desktop the document with a yellow key symbol.
    Is this a locked document? Why does it ask me for a password when I don't see any password in the key chain? What does the yellow key symbol mean?
    I really need to decrypt this document and their are a lot of programs that will decrypt a word document but you have to be running Windows and not OS X or 9.
    Can any one give me any suggestions on how I can decrypt this word document that was encrypted with Apple File Security.
    Thanks,
    DaisyMay

    Open Apple File Security and use it to decompress or decrypt the file. Any item can be encrypted with Apple File Security, and no other application will decrypt that format; the mechanism isn't the same as used in some Word versions. The Locked setting in the Get Info window controls something else. A password doesn't need to be stored in the keychain to be applied to an encrypted item; the file itself stores the encrypted password.
    (48403)

  • Control another program using java

    how can i control outlook express from my java program
    for example i want to view in a textarea the text email that is being delivered

    the reason i wanted to do that is that i created an encryption program, and i want to use this program to encrypt emails.If you have any other ideas of how this can be achieved please share them with me.

  • How to place header and footer  in OO-ALV program using class

    How to place header and footer  in OO-ALV program using class tell me wat r the class we shold use and their attributes as well

    Hi Venkatesh,
    Take a look at this how to [ABAP Objects - ALV Model - Using Header and Footer|https://wiki.sdn.sap.com/wiki/x/xdw]
    it's explaining how to define the classes and use it for display an ALV with Header and Footer.
    Regards,
    Marcelo Ramos

  • Standard BDC program used for FI

    hi all ,
    i would like to know the standard BDC program used in FI , like for tcode fb01 or somethings else.
    Appreciate for any segguestion.
    thanks and regards.

    hi siddu m 
    thanks for replay ,
    i have anohter question
    provided the transaction A was contianed in the first batch file,
    and also  contained in the second batch file , how the tcode treated as the duplicate posting ?
    many thanks

  • SD Flow program using For all entries.

    using simple ALV grid: I have the urgent requirement of changing the following program using 'For all entries' instead of joins and I should not use 'TABLES' -- For top-of-page I need to get dynamic fields like if I select company code in the selection screen then I need to get 'This report is base on COMPANY CODE'.
    This program is about sales flow where i shud get only those records that have ebeln in vbak, delivery, invoice.
    The original program is as follows:
    *& Report  ZSD_DOCU_FLOW                                               *
    REPORT  zsd_docu_flow  NO STANDARD PAGE HEADING                    .
    * Program     : ZCOS_SALES                                           *
    * Dev. Class  :  ZSD
    * Functional  :
    * Created on  :                                                        *
    * Project     :
    * CR Number   :
    * Transaction :  ZSDCSUT                                               *
    * Description :   * Sales document life cylce for given customer
    *                  to declaired period displaying the sales document
    *                  details ,with relevant del details and corresponding
    *                  Invocie Details
    *-----------     Tables Declaration      -----------*
    TABLES: vbak,vbap,vbfa,kna1,vbrk,vbrp,likp,lips,t001.
    TYPE-POOLS : slis.
    *-----------    Internal Tables Declaration      -----------*
    *      Internal Table for Sales Order data                   *
    DATA: BEGIN OF it_so OCCURS 0,
            vbeln LIKE vbak-vbeln,
            kunnr LIKE vbak-kunnr,
            posnr LIKE vbap-posnr,
            matnr LIKE vbap-matnr,
            kwmeng LIKE vbap-kwmeng,
            netwr LIKE vbap-netwr,
         END OF it_so.
    *      Internal Table for Delivery Order data                   *
    DATA: BEGIN OF it_del OCCURS 0,
            delnum  LIKE likp-vbeln,
            lfdat LIKE likp-lfdat,
            delitem LIKE lips-posnr,
            lfimg LIKE lips-lfimg,
          END OF it_del.
    *      Internal Table for Invoice data                          *
    DATA: BEGIN OF  it_inv OCCURS 0,
            invnum LIKE vbrk-vbeln,
            invitem LIKE vbrp-posnr,
            fkimg LIKE vbrp-fkimg,
            amount LIKE vbrp-netwr,
         END OF it_inv.
    *      Internal Table for Final data                            *
    DATA: BEGIN OF it_final OCCURS 0,
            vbeln LIKE vbak-vbeln,
            posnr LIKE vbap-posnr,
            kunnr LIKE vbak-kunnr,
            name LIKE kna1-name1,
            matnr LIKE vbap-matnr,
            kwmeng LIKE vbap-kwmeng,
            netwr LIKE vbap-netwr,
            delnum  LIKE likp-vbeln,
            lfdat LIKE likp-lfdat,
            delitem LIKE lips-posnr,
            lfimg LIKE lips-lfimg,
            invnum LIKE vbrk-vbeln,
            invitem LIKE vbrp-posnr,
            fkimg LIKE vbrp-fkimg,
            amount LIKE vbrp-netwr,
         END OF it_final.
    *-----------    Variables Declaration      -----------*
    DATA: v_name LIKE kna1-kunnr," variable for customer name
          v_delnum LIKE likp-vbeln," variable for delivery number
          v_invnum LIKE vbrk-vbeln." variable for invoce number
    DATA : ls_layout TYPE slis_layout_alv,
           it_fcat TYPE slis_t_fieldcat_alv ,
           wa_fcat TYPE slis_fieldcat_alv,
           lh TYPE slis_t_listheader,
           ls TYPE slis_listheader,
           it_events TYPE slis_t_event  ,
           ls_event TYPE slis_alv_event ,
           i_sort     TYPE slis_t_sortinfo_alv,
           w_var TYPE i.
    DATA : l_date(10).
    DATA : l_date1(20).
    DATA : l_repid LIKE trdir-name.
    l_repid = 'ZSD_DOCU_FLOW1'.
    *-----------    Select-options & parameters Declaration  ---*
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_bukrs LIKE vbak-bukrs_vf,
                 p_vkorg LIKE vbak-vkorg,
                p_vtweg LIKE vbak-vtweg,
                p_spart LIKE vbak-spart.
    SELECT-OPTIONS: s_kunnr FOR vbak-kunnr,
                    s_audat FOR vbak-audat.
    SELECTION-SCREEN END OF BLOCK b1.
    *----------- AT SELECTION-SCREEN  --------------------------*
    AT SELECTION-SCREEN.
      SELECT SINGLE * FROM  t001 INTO t001
                                WHERE bukrs = p_bukrs.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid Company Code'.
      ENDIF.
      SELECT SINGLE * FROM vbak INTO vbak
                              WHERE vkorg = p_vkorg.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid Sales Organization'.
      ENDIF.
      SELECT SINGLE * FROM vbak INTO vbak
                                WHERE vtweg = p_vtweg.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid distribution channel'.
      ENDIF.
      SELECT SINGLE * FROM vbak INTO vbak
                                WHERE spart = p_spart.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid Division'.
      ENDIF.
      SELECT SINGLE * FROM kna1 INTO kna1
                                WHERE kunnr IN s_kunnr.
      IF sy-subrc <> 0.
        MESSAGE e000(8i) WITH 'Enter a Valid Customer Number'.
      ENDIF.
    *----------- START-OF-SELECTION-----------------------------*
    START-OF-SELECTION.
      ls-typ = 'H'.
      ls-info = 'Sales Document Flow'.
      APPEND ls TO lh.
      ls-typ = 'S'.
      WRITE: sy-datum TO l_date USING EDIT MASK '__/__/____'.
      CONCATENATE 'DATE :' l_date INTO l_date1 SEPARATED BY space.
      ls-info = l_date1.
      APPEND ls TO lh.
      PERFORM field_cat.
      PERFORM t_sort_build USING i_sort.
      PERFORM get-data.
    *----------- END-OF-SELECTION-----------------------------*
    END-OF-SELECTION.
    IF it_final[] IS INITIAL.
        MESSAGE i000(8i) WITH 'No data Found'.
        EXIT.
      ENDIF.
    PERFORM print-data.
    *&      Form  get-data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get-data .
    *  Accesing Sales Data
      SELECT a~vbeln a~kunnr b~posnr b~matnr b~kwmeng b~netwr
       INTO CORRESPONDING FIELDS OF TABLE it_so
       FROM vbak AS a INNER JOIN vbap AS b
                             ON a~vbeln = b~vbeln
                              WHERE a~bukrs_vf = p_bukrs
                                 AND a~vkorg = p_vkorg
                                 AND  a~vtweg = p_vtweg
                                    AND a~spart = p_spart
                                     AND a~kunnr IN s_kunnr
                                          AND a~audat IN s_audat.
      LOOP AT it_so.
        SELECT SINGLE name1 FROM kna1 INTO v_name
                                         WHERE kunnr = it_so-kunnr.
        SELECT SINGLE vbeln FROM vbfa INTO v_delnum
                                          WHERE vbelv = it_so-vbeln
                                            AND  vbtyp_n = 'J'.
        IF sy-subrc = 0.
          SELECT SINGLE  vbeln FROM vbfa INTO v_invnum
                                WHERE vbelv = v_delnum
                                  AND  vbtyp_n = 'M'.
        ENDIF.
        MOVE-CORRESPONDING it_so TO it_final.
        it_final-name = v_name.
        it_final-delnum = v_delnum.
        it_final-invnum = v_invnum.
        APPEND it_final.
        CLEAR it_final.
        CLEAR v_delnum.
        CLEAR v_invnum.
      ENDLOOP.
      LOOP AT it_final.
        IF it_final-delnum NE ' '.
    * Reading Del Data.
          SELECT SINGLE  a~vbeln  a~lfdat b~posnr b~lfimg   INTO
                    (it_del-delnum, it_del-lfdat, it_del-delitem,
                     it_del-lfimg ) FROM
                        likp AS a INNER JOIN lips AS b ON a~vbeln = b~vbeln
                                   WHERE a~vbeln = it_final-delnum
                                   AND b~posnr = it_final-posnr.
          MOVE-CORRESPONDING it_del TO it_final.
          MODIFY it_final.
        ENDIF.
        IF it_final-invnum NE ' '.
    * Reading Invoice Data.
          SELECT SINGLE vbeln posnr fkimg netwr INTO
         (it_inv-invnum, it_inv-invitem, it_inv-fkimg, it_inv-amount )
                       FROM vbrp  WHERE vbeln = it_final-invnum
                                  AND   posnr = it_final-posnr.
          MOVE-CORRESPONDING it_inv TO it_final.
          MODIFY it_final.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " get-data
    *&      Form  print-data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM print-data .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = l_repid
    *     I_CALLBACK_PF_STATUS_SET          = ' '
    *     I_CALLBACK_USER_COMMAND           = ' '
         i_callback_top_of_page            = 'TOP'
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT                         =
         it_fieldcat                       = it_fcat
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
         IT_SORT                           = i_sort[]
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
    *     I_SAVE                            = ' '
    *     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
    *     IT_ALV_GRAPHICS                   =
    *     IT_HYPERLINK                      =
    *     IT_ADD_FIELDCAT                   =
    *     IT_EXCEPT_QINFO                   =
    *     I_HTML_HEIGHT_TOP                 =
    *     I_HTML_HEIGHT_END                 =
    *   IMPORTING
    *     E_EXIT_CAUSED_BY_CALLER           =
    *     ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_final.
    *   EXCEPTIONS
    *     PROGRAM_ERROR                     = 1
    *     OTHERS                            = 2
    *  IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM.                    " print-data
    *&      Form  field_cat
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM field_cat .
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'VBELN'.
      wa_fcat-key = 'X'.
      wa_fcat-ref_fieldname = 'VBELN'.
      wa_fcat-ref_tabname = 'VBAK'.
      wa_fcat-seltext_m = 'Sales Order NO'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'POSNR'.
      wa_fcat-ref_fieldname = 'POSNR'.
      wa_fcat-ref_tabname = 'VBAP'.
      wa_fcat-seltext_m = 'SalesItemNO'.
      wa_fcat-fix_column = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'KUNNR'.
      wa_fcat-seltext_m = 'CUSTNUM'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'NAME'.
      wa_fcat-seltext_m = 'CUSTNAME'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-seltext_m = 'MATNUM'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'KWMENG'.
      wa_fcat-seltext_m = 'Sales Quantity'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'NETWR'.
      wa_fcat-seltext_m = 'Value'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'DELNUM'.
      wa_fcat-seltext_m = 'DeloveryNum'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'DELITEM'.
      wa_fcat-seltext_m = 'DelItemNO'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'LFDAT'.
      wa_fcat-seltext_m = 'DelDate'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'LFIMG'.
      wa_fcat-seltext_m = 'DelQuantity'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'INVNUM'.
      wa_fcat-seltext_m = 'InvoiceNum'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'INVITEM'.
      wa_fcat-seltext_m = 'InvoiceItem'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'FKIMG'.
      wa_fcat-seltext_m = 'INVQuantity'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
      wa_fcat-col_pos = w_var.
      wa_fcat-tabname = 'IT_FINAL'.
      wa_fcat-fieldname = 'AMOUNT'.
      wa_fcat-seltext_m = 'INVvalue'.
      wa_fcat-do_sum = 'X'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      ADD 1 TO w_var.
    ENDFORM.     " field_cat
    *&      Form  top
    *       text
    FORM t_sort_build USING l_sort TYPE slis_t_sortinfo_alv.
      DATA: ls_sort TYPE slis_sortinfo_alv.
      ls_sort-fieldname = 'VBELN'.
      ls_sort-spos      = 1.
      ls_sort-up        = 'X'.
      ls_sort-subtot    = 'X'.
      APPEND ls_sort TO l_sort.
      ls_sort-fieldname = 'KUNNR'.
      ls_sort-spos      = 2.
      ls_sort-up        = 'X'.
      APPEND ls_sort TO l_sort.
    ENDFORM.                    "t_sort_bui
    FORM top.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = lh
    *   I_LOGO                   =
    *   I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP
    ===========================================================================
    I have started the new program but i have trouble with the final internal table. Since i'm using For all entries I have declared internal tables for each table. My incomplete new program is as follows(not sure if the logic is correct till what I have coded):
    *& Report  Z_SDFLOW                                                    *
    REPORT  Z_SDFLOW  NO STANDARD PAGE HEADING.
    ********* TABLES TO BE USED ***********************
    **** VBAK - SALES DOCUMENT HEADER
    * VBAP - SALES ITEM
    * VBFA - SALES DOCUMENT FLOW
    * KNA1- CUSTOMER MASTER
    * VBRK - BILLING DOCUMENT HEADER
    * VBRP - BLLING DOCUMENT ITEM
    * LIKP - DELIVERY HEADER
    * LIPS - DELIVERY ITEM
    * TOO1 - COMPANY CODES
    * SLIS.
    TYPE-POOLS: SLIS.
    ** STRUCTURE DECLARATIONS ********
    **STRUCTURE FOR ENQUIRY.
    **STRUCTURE FOR QUOTATION.
    **STRUCTURE FOR SALES ORDER HEADER- VBAK.
    TYPES: BEGIN OF XT_VBAK,
    VBELN TYPE VBAK-VBELN,     "SALES DOCUMENT NUMBER
    KUNNR TYPE VBAK-KUNNR,     " SOLD-TO-PARTY
    END OF XT_VBAK.
    **STRUCTURE FOR SALES ORDER  ITEM-VBAP
    TYPES: BEGIN OF XT_VBAP,
    POSNR TYPE VBAP-POSNR,     " SALES ITEM NUMBER
    MATNR TYPE VBAP-MATNR,     " MATERIAL NUMBER
    KWMENG TYPE VBAP-KWMENG,   " CUMMULATIVE ORDER QUANTITY IN SALES UNITS
    NETWR TYPE VBAP-NETWR,     " NET VALUE OF THE ORDER ITEM
    END OF XT_VBAP.
    ** STRUCTURE FOR DELIVERY HEADER -LIKP
    TYPES: BEGIN OF XT_LIKP,
    DELVBELN TYPE LIKP-VBELN,           "DELIVERY DOCUMENT NUMBER
    LFDAT TYPE LIKP-LFDAT,           " DELIVERY DATE
    END OF XT_LIKP.
    **STRUCTURE FOR DELIVERY ITEM - LIPS
    TYPES: BEGIN OF XT_LIPS,
    DELPOSNR TYPE LIPS-POSNR,           " DELIVERY ITEM NUMBER
    LFIMG TYPE LIPS-LFIMG,           " ACTUAL QUANTITY DELIVERED
    END OF XT_LIPS.
    **STRUCTURE FOR BILLING DOCUMENT HEADER -VBRK
    TYPES: BEGIN OF XT_VBRK,
    INVVBELN TYPE VBRK-VBELN,          "BILLING DOCUMENT NUMBER
    END OF XT_VBRK.
    **STRUCTURE FOR BILLING DOCUMENT ITEM - VBRP
    TYPES: BEGIN OF XT_VBRP,
    INVPOSNR TYPE VBRP-POSNR,          "BILLING ITEM NUMBER
    FKIMG TYPE VBRP-FKIMG,          "ACTUAL INVOICED QUANTITY
    INVNETWR TYPE VBRP-NETWR,          "NET VALUE OF THE BILLING ITEM
    END OF XT_VBRP.
    **STRUCTURE FOR FINAL INTERNAL TABLE.
    TYPES: BEGIN OF XT_FINAL,
    VBELN TYPE VBAK-VBELN,
    DELVBELN TYPE LIKP-VBELN,
    INVBELN TYPE VBRK-VBELN,
    KUNNR TYPE VBAK-KUNNR,
    POSNR TYPE VBAP-POSNR,
    DELPOSNT TYPE LIPS-POSNR,
    INVPOSNR TYPE VBRP-POSNR,
    MATNR TYPE VBAP-MATNR,
    KWMENG TYPE VBAP-KWMENG,
    NETWR TYPE VBAP-NETWR,
    INVNETWR TYPE VBRP-NETWR,
    LFDAT TYPE LIKP-LFDAT,
    LFIMG TYPE LIPS-LFIMG,
    FKIMG TYPE VBRP-FKIMG,
    NAME1 TYPE KNA1-NAME1,
    END OF XT_FINAL.
    **DATA DECLARATIONS
    DATA: V_NAME1 TYPE KNA1-NAME1,  "#EC *
          V_DELVBELN TYPE LIKP-VBELN,
          V_INVVBELN TYPE VBRK-VBELN,
          V_BUKRS TYPE T001-BUKRS,    "COMPANY CODE "#EC *
          V_AUDAT TYPE VBAK-AUDAT,
          V_VKORG TYPE VBAK-VKORG,
          V_VKGRP TYPE VBAK-VKGRP,
          V_SPART TYPE VBAK-SPART.
    **INTERNAL TABLE DECLARATIONS
    DATA: IT_VBAK TYPE STANDARD TABLE OF XT_VBAK,
          WA_VBAK TYPE XT_VBAK,
          IT_VBAP TYPE STANDARD TABLE OF XT_VBAP,
          WA_VBAP TYPE XT_VBAP,
          IT_LIKP TYPE STANDARD TABLE OF XT_LIKP,
          WA_LIKP TYPE XT_LIKP,
          IT_LIPS TYPE STANDARD TABLE OF XT_LIPS,
          WA_LIPS TYPE XT_LIPS,
          IT_VBRK TYPE STANDARD TABLE OF XT_VBRK,
          WA_VBRK TYPE XT_VBRK,
          IT_VBRP TYPE STANDARD TABLE OF XT_VBRP,
          WA_VBRP TYPE XT_VBRP,
          IT_FINAL TYPE STANDARD TABLE OF XT_FINAL,
          WA_FINAL TYPE XT_FINAL.
    **ALV DECLARATIONS
    DATA: IT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FLDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_LSTHDR TYPE SLIS_T_LISTHEADER,
          WA_LSTHDR TYPE SLIS_LISTHEADER,
          IT_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENTS TYPE SLIS_ALV_EVENT,
          IT_SORT TYPE SLIS_T_SORTINFO_ALV,
          IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: S_BUKRS FOR V_BUKRS NO INTERVALS NO-EXTENSION,
                    S_VBELN FOR WA_VBAK-VBELN,  "SALES DOCUMENT NUMBER
                    S_KUNNR FOR WA_VBAK-KUNNR,  "SOLD-TO-PARTY
                    S_AUDAT FOR V_AUDAT,      "SALES DOCUMENT DATE
                    S_VKORG FOR V_VKORG,      "SALES ORGANISATION
                    S_VKGRP FOR V_VKGRP,      "SALES GROUP
                    S_SPART FOR V_SPART.      "DIVISION
    SELECTION-SCREEN END OF BLOCK b1.
    *****************SCREEN VALIDATION***************
    AT SELECTION-SCREEN.
    SELECT SINGLE BUKRS FROM T001 INTO V_BUKRS WHERE BUKRS IN S_BUKRS."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID COMPANY CODE'.
    ENDIF.
    SELECT SINGLE VBELN FROM VBAK INTO
              CORRESPONDING FIELDS OF WA_VBAK WHERE VBELN IN S_VBELN.
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER VALID SALES DOCUMENT NUMBER'.
    ENDIF.
    SELECT SINGLE KUNNR FROM VBAK INTO
              CORRESPONDING FIELDS OF WA_VBAK WHERE KUNNR IN S_KUNNR. "EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID CUSTOMER NUMBER'.
    ENDIF.
    SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE AUDAT IN S_AUDAT."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DOCUMENT DATE'.
    ENDIF.
    SELECT SINGLE VKORG FROM VBAK INTO V_VKORG WHERE VKORG IN S_VKORG."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES ORGANISATION'.
    ENDIF.
    SELECT SINGLE VKGRP FROM VBAK INTO V_VKGRP WHERE VKGRP IN S_VKGRP."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES GROUP'.
    ENDIF.
    SELECT SINGLE SPART FROM VBAK INTO V_SPART WHERE SPART IN S_SPART."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DIVISION'.
    ENDIF.
    PERFORM GET_DATA.
    *&      Form  GET_DATA
    FORM GET_DATA .
    SELECT VBELN KUNNR
            INTO TABLE IT_VBAK
            FROM VBAK
            WHERE VBELN IN S_VBELN.
    *        BUKRS_VF IN S_BUKRS AND
    *        VKORG IN S_VKORG AND
    *        VKGRP IN S_VKGRP AND
    *        SPART IN S_SPART AND
    *        KUNNR IN S_KUNNR AND
    *        AUDAT IN S_AUDAT.
    IF IT_VBAK[] IS NOT INITIAL.
    SELECT POSNR MATNR KWMENG NETWR
            INTO TABLE IT_VBAP
            FROM VBAP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAK[] IS NOT INITIAL.
    SELECT VBELN LFDAT
            INTO TABLE IT_LIKP
            FROM LIKP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAP[] IS NOT INITIAL.
    SELECT POSNR LFIMG
            INTO TABLE IT_LIPS
            FROM LIPS
            FOR ALL ENTRIES IN IT_VBAP
            WHERE POSNR = IT_VBAP-POSNR.
    ENDIF.
    IF IT_LIKP[] IS NOT INITIAL.
    SELECT VBELN
            INTO TABLE IT_VBRK
            FROM VBRK
            FOR ALL ENTRIES IN IT_LIKP
            WHERE VBELN = IT_LIKP-DELVBELN.
    ENDIF.
    IF IT_LIPS[] IS NOT INITIAL.
    SELECT POSNR FKIMG NETWR
            INTO TABLE IT_VBRP
            FROM VBRP
            FOR ALL ENTRIES IN IT_LIPS
            WHERE POSNR = IT_LIPS-DELPOSNR.
    ENDIF.
    ENDFORM.                    " GET_DATA
    Edited by: srk s on Jan 29, 2008 7:33 PM
    Edited by: Alvaro Tejada Galindo on Jan 29, 2008 9:49 AM

    Hi Satish,
    I have started the new program but i have trouble with the final internal table. Since i'm using For all entries, I have declared internal tables for each table. My incomplete new program is as follows(not sure if the logic is correct till what I have coded):
    *& Report  Z_SDFLOW                                                    *
    REPORT  Z_SDFLOW  NO STANDARD PAGE HEADING.
    ********* TABLES TO BE USED ***********************
    **** VBAK - SALES DOCUMENT HEADER
    * VBAP - SALES ITEM
    * VBFA - SALES DOCUMENT FLOW
    * KNA1- CUSTOMER MASTER
    * VBRK - BILLING DOCUMENT HEADER
    * VBRP - BLLING DOCUMENT ITEM
    * LIKP - DELIVERY HEADER
    * LIPS - DELIVERY ITEM
    * TOO1 - COMPANY CODES
    * SLIS.
    TYPE-POOLS: SLIS.
    ** STRUCTURE DECLARATIONS ********
    **STRUCTURE FOR ENQUIRY.
    **STRUCTURE FOR QUOTATION.
    **STRUCTURE FOR SALES ORDER HEADER- VBAK.
    TYPES: BEGIN OF XT_VBAK,
    VBELN TYPE VBAK-VBELN,     "SALES DOCUMENT NUMBER
    KUNNR TYPE VBAK-KUNNR,     " SOLD-TO-PARTY
    END OF XT_VBAK.
    **STRUCTURE FOR SALES ORDER  ITEM-VBAP
    TYPES: BEGIN OF XT_VBAP,
    POSNR TYPE VBAP-POSNR,     " SALES ITEM NUMBER
    MATNR TYPE VBAP-MATNR,     " MATERIAL NUMBER
    KWMENG TYPE VBAP-KWMENG,   " CUMMULATIVE ORDER QUANTITY IN SALES UNITS
    NETWR TYPE VBAP-NETWR,     " NET VALUE OF THE ORDER ITEM
    END OF XT_VBAP.
    ** STRUCTURE FOR DELIVERY HEADER -LIKP
    TYPES: BEGIN OF XT_LIKP,
    DELVBELN TYPE LIKP-VBELN,           "DELIVERY DOCUMENT NUMBER
    LFDAT TYPE LIKP-LFDAT,           " DELIVERY DATE
    END OF XT_LIKP.
    **STRUCTURE FOR DELIVERY ITEM - LIPS
    TYPES: BEGIN OF XT_LIPS,
    DELPOSNR TYPE LIPS-POSNR,           " DELIVERY ITEM NUMBER
    LFIMG TYPE LIPS-LFIMG,           " ACTUAL QUANTITY DELIVERED
    END OF XT_LIPS.
    **STRUCTURE FOR BILLING DOCUMENT HEADER -VBRK
    TYPES: BEGIN OF XT_VBRK,
    INVVBELN TYPE VBRK-VBELN,          "BILLING DOCUMENT NUMBER
    END OF XT_VBRK.
    **STRUCTURE FOR BILLING DOCUMENT ITEM - VBRP
    TYPES: BEGIN OF XT_VBRP,
    INVPOSNR TYPE VBRP-POSNR,          "BILLING ITEM NUMBER
    FKIMG TYPE VBRP-FKIMG,          "ACTUAL INVOICED QUANTITY
    INVNETWR TYPE VBRP-NETWR,          "NET VALUE OF THE BILLING ITEM
    END OF XT_VBRP.
    **STRUCTURE FOR FINAL INTERNAL TABLE.
    TYPES: BEGIN OF XT_FINAL,
    VBELN TYPE VBAK-VBELN,
    DELVBELN TYPE LIKP-VBELN,
    INVBELN TYPE VBRK-VBELN,
    KUNNR TYPE VBAK-KUNNR,
    POSNR TYPE VBAP-POSNR,
    DELPOSNT TYPE LIPS-POSNR,
    INVPOSNR TYPE VBRP-POSNR,
    MATNR TYPE VBAP-MATNR,
    KWMENG TYPE VBAP-KWMENG,
    NETWR TYPE VBAP-NETWR,
    INVNETWR TYPE VBRP-NETWR,
    LFDAT TYPE LIKP-LFDAT,
    LFIMG TYPE LIPS-LFIMG,
    FKIMG TYPE VBRP-FKIMG,
    NAME1 TYPE KNA1-NAME1,
    END OF XT_FINAL.
    **DATA DECLARATIONS
    DATA: V_NAME1 TYPE KNA1-NAME1,  "#EC *
          V_DELVBELN TYPE LIKP-VBELN,
          V_INVVBELN TYPE VBRK-VBELN,
          V_BUKRS TYPE T001-BUKRS,    "COMPANY CODE "#EC *
          V_AUDAT TYPE VBAK-AUDAT,
          V_VKORG TYPE VBAK-VKORG,
          V_VKGRP TYPE VBAK-VKGRP,
          V_SPART TYPE VBAK-SPART.
    **INTERNAL TABLE DECLARATIONS
    DATA: IT_VBAK TYPE STANDARD TABLE OF XT_VBAK,
          WA_VBAK TYPE XT_VBAK,
          IT_VBAP TYPE STANDARD TABLE OF XT_VBAP,
          WA_VBAP TYPE XT_VBAP,
          IT_LIKP TYPE STANDARD TABLE OF XT_LIKP,
          WA_LIKP TYPE XT_LIKP,
          IT_LIPS TYPE STANDARD TABLE OF XT_LIPS,
          WA_LIPS TYPE XT_LIPS,
          IT_VBRK TYPE STANDARD TABLE OF XT_VBRK,
          WA_VBRK TYPE XT_VBRK,
          IT_VBRP TYPE STANDARD TABLE OF XT_VBRP,
          WA_VBRP TYPE XT_VBRP,
          IT_FINAL TYPE STANDARD TABLE OF XT_FINAL,
          WA_FINAL TYPE XT_FINAL.
    **ALV DECLARATIONS
    DATA: IT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FLDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_LSTHDR TYPE SLIS_T_LISTHEADER,
          WA_LSTHDR TYPE SLIS_LISTHEADER,
          IT_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENTS TYPE SLIS_ALV_EVENT,
          IT_SORT TYPE SLIS_T_SORTINFO_ALV,
          IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: S_BUKRS FOR V_BUKRS NO INTERVALS NO-EXTENSION,
                    S_VBELN FOR WA_VBAK-VBELN,  "SALES DOCUMENT NUMBER
                    S_KUNNR FOR WA_VBAK-KUNNR,  "SOLD-TO-PARTY
                    S_AUDAT FOR V_AUDAT,      "SALES DOCUMENT DATE
                    S_VKORG FOR V_VKORG,      "SALES ORGANISATION
                    S_VKGRP FOR V_VKGRP,      "SALES GROUP
                    S_SPART FOR V_SPART.      "DIVISION
    SELECTION-SCREEN END OF BLOCK b1.
    *****************SCREEN VALIDATION***************
    AT SELECTION-SCREEN.
    SELECT SINGLE BUKRS FROM T001 INTO V_BUKRS WHERE BUKRS IN S_BUKRS."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID COMPANY CODE'.
    ENDIF.
    SELECT SINGLE VBELN FROM VBAK INTO
              CORRESPONDING FIELDS OF WA_VBAK WHERE VBELN IN S_VBELN.
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER VALID SALES DOCUMENT NUMBER'.
    ENDIF.
    SELECT SINGLE KUNNR FROM VBAK INTO
              CORRESPONDING FIELDS OF WA_VBAK WHERE KUNNR IN S_KUNNR. "EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID CUSTOMER NUMBER'.
    ENDIF.
    SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE AUDAT IN S_AUDAT."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DOCUMENT DATE'.
    ENDIF.
    SELECT SINGLE VKORG FROM VBAK INTO V_VKORG WHERE VKORG IN S_VKORG."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES ORGANISATION'.
    ENDIF.
    SELECT SINGLE VKGRP FROM VBAK INTO V_VKGRP WHERE VKGRP IN S_VKGRP."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES GROUP'.
    ENDIF.
    SELECT SINGLE SPART FROM VBAK INTO V_SPART WHERE SPART IN S_SPART."#EC *
    IF SY-SUBRC <> 0.
    MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DIVISION'.
    ENDIF.
    PERFORM GET_DATA.
    *&      Form  GET_DATA
    FORM GET_DATA .
    SELECT VBELN KUNNR
            INTO TABLE IT_VBAK
            FROM VBAK
            WHERE VBELN IN S_VBELN.
    *        BUKRS_VF IN S_BUKRS AND
    *        VKORG IN S_VKORG AND
    *        VKGRP IN S_VKGRP AND
    *        SPART IN S_SPART AND
    *        KUNNR IN S_KUNNR AND
    *        AUDAT IN S_AUDAT.
    IF IT_VBAK[] IS NOT INITIAL.
    SELECT POSNR MATNR KWMENG NETWR
            INTO TABLE IT_VBAP
            FROM VBAP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAK[] IS NOT INITIAL.
    SELECT VBELN LFDAT
            INTO TABLE IT_LIKP
            FROM LIKP
            FOR ALL ENTRIES IN IT_VBAK
            WHERE VBELN = IT_VBAK-VBELN.
    ENDIF.
    IF IT_VBAP[] IS NOT INITIAL.
    SELECT POSNR LFIMG
            INTO TABLE IT_LIPS
            FROM LIPS
            FOR ALL ENTRIES IN IT_VBAP
            WHERE POSNR = IT_VBAP-POSNR.
    ENDIF.
    IF IT_LIKP[] IS NOT INITIAL.
    SELECT VBELN
            INTO TABLE IT_VBRK
            FROM VBRK
            FOR ALL ENTRIES IN IT_LIKP
            WHERE VBELN = IT_LIKP-DELVBELN.
    ENDIF.
    IF IT_LIPS[] IS NOT INITIAL.
    SELECT POSNR FKIMG NETWR
            INTO TABLE IT_VBRP
            FROM VBRP
            FOR ALL ENTRIES IN IT_LIPS
            WHERE POSNR = IT_LIPS-DELPOSNR.
    ENDIF.
    ENDFORM.                    " GET_DATA
    Code Formatted by: Alvaro Tejada Galindo on Jan 29, 2008 9:48 AM

  • How to get data from the called program using SUBMIT in a background job?

    Hi Experts,
    I've a program which creates a background job using JOB_OPEN and JOB_CLOSE function modules.
    Between the above function modules I need to call a program using SUBMIT VIA JOB statement.
    My problem is, How do I fetch some data in an internal table in the called program to the calling program after the SUBMIT statement?
    I tried to EXPORT and IMPORT the data, but they are giving a failed sy-subrc when using this background job.
    Kindly let me know your inputs and valuable suggestions.

    Kumar,
    When we execute a program as a background job then the output will be sent to Spool which needs to be fetched again.I guess we need to use Submit via spool as mentioned by Rajat.
    Check these threads to get some idea
    submit report to spool & import spool id
    Re: Generate Spool for a report
    K.Kiran.

  • How do i open and control other programs using labview?

    I'm presently trying to use labview to try to open and operate another program,but having much difficulty.The external program i'm using is called the Foundation program.
    This Foundation program will use VHDL programming to create a virtual chip and then synthesising it.This program will then simulate the output of this VHDL program to verify that it is working as desired.Then the last stage is to download the whole VHDL program into a FPGA chip using a xilinx cable.
    All this need to be done using a labview program - to open the Foundation program and then extract the saved file and then to execute the download command to cause the VHDL program to be downloaded onto the FPGA chip.How do i go
    about doing all this?What is the first step i must do.Also all this have to be done thru networking..looks like its too difficult..I really need help.
    grays

    I haven't done VHDL so pardon my ignorance.
    LabVIEW can call external DLL via "Call Library Function" or C programs via "Code Interface Node", both located in "Advanced" function.
    If your program is a DOS program, use "System Exec.vi" found in "Communication" function. If you need to format your DOS command prior to sending it, use the "Format Into String" function in "String" function palette.
    Lastly, if you're trying to extract data, assuming it is text, use "File I/O" functions. If the data is binary, use "File I/O -> Binary File VIs".
    Hope that answers most of your questions.
    Shan Pin Koh

  • When I try to open an embedded PDF file I get an error "The program used to create this object is AcroExch.exe.

    When I try to open an embedded PDF file (Word doc) I get an error "The program used to create this object is AcroExch.exe. That program is either not installed on your computer, or is corrupt..."  I've tried  about everything from unchecking
    protected mode at startup to removing & reinstalling Adobe.  Nothing seems to fix this issue.  Any other ideas?
    This is happening on Adobe reader 9, 10 & 11 with MS Word 2010 & 2013.  I've uninstalled, cleaned & reinstalled Reader 9, 10 & 11, as well as Acrobat 10 Pro & 11 Standard.  Removed "Protected mode at startup, and changed
    the default program for viewing from reader to Acrobat.  This will not go away.  It is affecting production at our company.

    " Help > Troubleshooting Information > Profile Directory: Open Containing Folder" . i can't find open containing folder in profile directory. it does give me the option to open the places.sqlite file using graphic converter. when i try that, graphic converter gives me a window saying that it can't be opened because it is corrupted or is not a file type supported by graphic converter.
    i appreciate your help with a workaround to get the old bookmarks. that works. however, the problem has morphed from that concern to why adobe reader [the default app.] won't open firefox .sqlite files. is the problem in adobe reader or firefox? also, how can i tell if the places.sqlite file is corrupt?
    i'm getting in over my head here and do appreciate your help.

  • I am unable to open encrypted emails using webmail and a CAC reader.  It says "content can't be displayed because the S/MIME control isn't available."  I'm using a Macbook Pro with 10.10 OS and have tried both Safari and Chrome.

    I am using a Macbook Pro with OS X Yosemite 10.10.2.  I am unable to open encrypted emails using webmail.  I have verified my certificates are loaded in the keychain for my military common access card while using a CAC reader.  When I try to view the message it gives me the error saying "content can't be displayed because the S/MIME control isn't available." 

    I am using a Macbook Pro with OS X Yosemite 10.10.2.  I am unable to open encrypted emails using webmail.  I have verified my certificates are loaded in the keychain for my military common access card while using a CAC reader.  When I try to view the message it gives me the error saying "content can't be displayed because the S/MIME control isn't available." 

  • How do you use Keywords?

    I'm curious how you use Keywords. I started to go into my pictures today and add them. I went first to the first Event I had and looked for any pictures of my kids. I was going to make my Keywords pretty broad. If they were aged 0 - 5, then that was my Keyword. But, then I had a picture of a brother and a sister, where the brother was 8 and the sister was 4. What to do? Then I changed it from 0-5 to 0-10. I've tagged about 300 of them that way, but now I'm wondering if it's worth the time. I know I can also use multiple Keywords, but that just seems to be a lot of work.
    For reference, I name all my pictures when I input them. I use the following format: name of person - event (if pertinent) - town - year, so that might come out as Chip - Halloween - Golden - '08. That way, I find it pretty easy to find whatever I might be looking for.
    Do you use Keywords? If so, how?
    Thanks.
    Chip

    The BEST system of keywording is the system you will actually execute. So your priority should be figuring out what you are willing and happy to do on a fairly regular basis.
    Since it already sounds like your system is a hassle, I don't know that your keyword needs to reflect the age---you can easily search on KW: Kids and Date Range: (whatever the young years would be) after the fact, and save yourself trouble while tagging. Or set that up as a Smart Album, and then once you've done the "okay when the kid was 0-4 that would be the dates 1990-1994", you don't need to do it again.
    Certainly, though, you should be open to multiple keywords on the same photo--that's the power of keywords, to categorize the same photo in multiple aspects.
    I don't bother naming my photos, but unlike TD, I create a lot of smaller events and name them pretty carefully, similar to your photo names. I use keywords for recurring themes, like Me, Family, Friends, Rivers, Flowers, or places I visit multiple times. Things with a beginning and ending, I lean on the event name to track, eg "Christmas Eve, Christmas--Opening Gifts, Christmas--Dinner, Christmas--Hanging Out".
    I find it very important to use the shortcuts, so that I can skim through 300 pix from a national park and just hit f to apply the Family keyword, m to apply the Me keyword, w for pictures of water, l for pictures of flowers, etc. (The keyword pane must be open to use the shortcuts)
    I tend to set up a smart album based on a keyword about the same time I set up a keyword, so that the list of smart albums helps me remember what I am doing with keywords. Also, thinking in terms of which albums you want to be browsing helps figure out how you need to keyword the photos--when your relatives or friends come over, what do you want to show them?

Maybe you are looking for