How to create Store Procedure for export result select in .txt or .csv

Hello,
I'm using MSSQL Server.
How to export results query  in .txt or .csv?
But
I can not use bcp or SQLCMD.

1) linked server
insert into txtsrv...table1#txt(CustomerNumber,CustomerName,EntryDate)
select orderid, shipname, orderdate
from Northwind..orders
Set up the linked server
Connecting a directory of text files as a linked server is easy.  Here’s how:
In Windows, create a new directory for the linked server.  
For this article, that directory will be E:\txtsvr. 
Add that directory as a linked server with sp_addlinkedserver:
EXEC sp_addlinkedserver txtsrv, 'Jet 4.0',
  'Microsoft.Jet.OLEDB.4.0', 'e:\txtsrv', NULL, 'Text' 
That’s all that’s required to add the linked server txtsrv
 as a connection to the text files in E:\txtsvr, but there are
 no tables in txtsvr yet.  Also missing is a required file, schema.ini, 
which must contain a description of each table’s format.  
You can  learn more about schema.ini from the Microsoft MSDN Library,
 but for now, just use Notepad or your favorite text editor 
to create the file e:\txtsrv\schema.ini as shown in Listing 1. 
 In addition, create an empty text file in e:\txtsrv named table1.txt.
The file e:\txtsrv\table1.txt is now an empty table in the linked server txtsrv.  
We can see that if we list information about all the tables in txtserv with 
the system stored procedure sp_tables_ex:
EXEC sp_addlinkedsrvlogin txtsrv, FALSE, Admin, NULL
EXEC sp_tables_ex txtsrv
Text files are tables
We can’t issue a CREATE TABLE statement against this linked server, 
but we have created a table easily enough.  We can, however, 
run INSERT and SELECT queries, if we use the four-part naming 
convention <server>…<table> (that’s three dots):
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • How to create the request for change of selection text into other language.

    Hi,
    In my object requirement is that when login through Japanese language,  then on selection screen selection text should appear in Japanese language. For that I have maintained the text in Japanese language the program where we define the selection text there from translation I have maintained the text in Japanese but while maintain the text it didn't ask me for REQUEST, because of that I am not able to transport the changes to next system, so I want know how to create the request for this case.
    Thanks

    Hello Chetan,
    You could goto the selection screen texts by goto-> selection texts,
    Then you could again goto -> Translation
    or
    Other-> Translation(Not sure )
    Then double click on the Program you should be able to see the Texts that need translation, now change something save and come back and try to activate, now it should propose for a new Transport Request.
    Either create a new transaport request or give one that you have given for the program.
    Hope the issue is resolved.

  • How to create store procedure using cursor, and looping condition with exce

    Hi,
    I am new in pl/sql development , please help me for follwoing
    1. I have select query by joining few tables which returns lets say 100 records.
    2. I want to insert records into another table(lets say table name is tbl_sale).
    3. If first record is inserted into tbl_sale,and for next record if value is same as first then update into tbl_sale else
    insert new row
    4. I want to achieve this using store procedure.
    Please help me how to do looping,how to use cursor and all other necessary thing to achieve this.

    DECLARE
       b   NUMBER;
    BEGIN
       UPDATE tbl_sale
          SET a = b
        WHERE a = 1;
       IF SQL%ROWCOUNT = 0
       THEN
          INSERT INTO tbl_sale
                      (a
               VALUES (b
       END IF;
    END;note : handle exceptions where ever needed
    Regards,
    friend
    Edited by: most wanted!!!! on Mar 18, 2013 12:06 AM

  • How to create Approval procedures for various departments

    Hi Experts,
    I want to create a approval procedures for sales , purchase, production and finance screens.
    I am going to the Approval stages , there i am giving name, description and selecting authorizer and finally when i want to select the sales module under department , there i can see only general .
    i cldnt see all the departments here. what is the reason?  solution for this. PLease.
    Thanks & Regards,
    Dwarak

    Hi Dwarak,
    Please specify the department in Administration --> Setup --> General --> Users and find the user code and then map the departments.
    In the Approval templates  Originator is where the users can be setup and in the select the required documents and map the create th Approval stage ( The user who authorises the document created by the originators)
    Regards,
    Rakesh N

  • How to create stored procedure for insert update and delete operations with input output paramters?

    I  have the follwing table is called master table contain the follwing fields,
    So here i need to create  three Stored procedures 
    1.Insert operations(1 o/p paramter,and  14 input paramters)              - uspInsert
    2.Update operations(1 o/p paramter,and  14 input paramters)          - uspUpdate
    3.Delete Operations(1 o/p paramter,and  14 input paramters)          
     - uspdelte
    The following is the table ,so using this to make the three sp's ,Here we will use Exception machanism also.
    Location 
    Client Name
    Owner 
    ConfigItemID
    ConfigItemName
    DeploymentID
    IncidentID
    Package Name
    Scope 
    Stage
    Type 
    Start Date
    End Date
    Accountable 
    Comments
    So can u pls help me out for this ,bcz i knew to stored procedure's creation.

    I  have the follwing table is called master table contain the follwing fields,
    So here i need to create  three Stored procedures 
    1.Insert operations(1 o/p paramter,and  14 input paramters)              - uspInsert
    2.Update operations(1 o/p paramter,and  14 input paramters)          - uspUpdate
    3.Delete Operations(1 o/p paramter,and  14 input paramters)            - uspdelte
    The following is the table ,so using this to make the three sp's ,Here we will use Exception machanism also.
    Location 
    Client Name
    Owner 
    ConfigItemID
    ConfigItemName
    DeploymentID
    IncidentID
    Package Name
    Scope 
    Stage
    Type 
    Start Date
    End Date
    Accountable 
    Comments
    So can u pls help me out for this ,bcz i knew to stored procedure's creation.
    Why you have to pass 14 parameters for DELETE and UPDATE? Do you have any Primary Key?  If you do NOT have primary key in your table then in case you have duplicate information, SQL will update both or delete them together. You need to provide DDL of
    you table. What are the data types of fields?
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • Create Store Procedure to Count Number of records in Database for each table

    Hello,
    I have created the code which counts the number of records for each table in database. However, I want create store procedure for this code this code that when ever use execute the Store Procedure can provide the database name to execute it and as a result
    table will display number of records in each table.
    Below you will find the code its working:
    CREATE
    TABLE #TEMPCOUNT
    (TABLENAME
    NVARCHAR(128),
    RECORD_COUNT BIGINT)
    -- Creating a TEMP table
    EXEC
    sp_msforeachtable
    'insert #tempcount select ''?'', count(*) from ? with (nolock)'
    SELECT
    * FROM
    #TEMPCOUNT
    ORDER
    BY TABLENAME
    DROP
    TABLE #TEMPCOUNT
    This code need to be convert in store procedure and user can give database name when execute the procedure in order to count the records.
    Looking forward for your support.
    Thanks.
    SharePoint_Consultant_EMEA

    Something like:
    set quoted_identifier off
    go
    create procedure usp_TableCounts
    @DBName as varchar(1000)
    as
    set nocount on
    declare @SQLToExecute varchar(1000)
    CREATE TABLE #TEMPCOUNT (TABLENAME NVARCHAR(128), RECORD_COUNT BIGINT) -- Creating a TEMP table
    set @SQLToExecute = @DBName + ".dbo.sp_msforeachtable 'insert into #tempcount select ''?'', count(*) from ? with (nolock)'"
    print @SQLToExecute
    exec (@SQLToExecute)
    SELECT * FROM #TEMPCOUNT
    ORDER BY TABLENAME
    DROP TABLE #TEMPCOUNT
    GO
    Satish Kartan www.sqlfood.com

  • Creating a JButton for each line in a txt file

    I need to know how to creating a JButton for each line in a txt file then add an actionListener to the number of buttons (note they are in a JTable). Here is a clipet of code thanx for the help (note that this is one part of a program i am making there are 2 more classes. If u need them just ask) Thanx:
    class Diary extends JFrame implements ActionListener {
         private JTextArea note;
         private JTextField name;
         private JMenuBar menu = new JMenuBar();
         private JMenu file, edit, font, background, tcolor, settings, help;
         private JMenuItem nu, copy, paste, save, exit, b8, b10, b12, b14, b16, b18, b20, b24, b30, bblue, bred, bgreen, bpink, cblue, cred, cgreen, cpink, eset, nver, using, about;
         private String[] columnNames = {
              "File"
         private Vector dat = new Vector();
         private JTable filetable;
         public Diary() {
              setSize(new Dimension(500, 500));
              setTitle("Diary 2.00");
              file = new JMenu("File");
              menu.add(file);
              nu = new JMenuItem("new");
              nu.addActionListener(this);
              file.add(nu);
              file.add(new JSeparator());
              copy = new JMenuItem("copy");
              copy.addActionListener(this);
              file.add(copy);
              paste = new JMenuItem("paste");
              paste.addActionListener(this);
              file.add(paste);
              file.add(new JSeparator());
              save = new JMenuItem("Save");
              save.addActionListener(this);
              file.add(save);
              file.add(new JSeparator());
              exit = new JMenuItem("exit");
              exit.addActionListener(this);
              file.add(exit);
              edit = new JMenu("Edit");
              menu.add(edit);
              font = new JMenu("font");
              edit.add(font);
              b8 = new JMenuItem("8");
              b8.addActionListener(this);
              font.add(b8);
              b10 = new JMenuItem("10");
              b10.addActionListener(this);
              font.add(b10);
              b12 = new JMenuItem("12");
              b12.addActionListener(this);
              font.add(b12);
              b14 = new JMenuItem("14");
              b14.addActionListener(this);
              font.add(b14);
              b16 = new JMenuItem("16");
              b16.addActionListener(this);
              font.add(b16);
              b18 = new JMenuItem("18");
              b18.addActionListener(this);
              font.add(b18);
              b20 = new JMenuItem("20");
              b20.addActionListener(this);
              font.add(b20);
              b24 = new JMenuItem("24");
              b24.addActionListener(this);
              font.add(b24);
              b30 = new JMenuItem("30");
              b30.addActionListener(this);
              font.add(b30);
              background = new JMenu("background");
              edit.add(background);
              bblue = new JMenuItem("blue");
              bblue.addActionListener(this);
              background.add(bblue);
              bred = new JMenuItem("red");
              bred.addActionListener(this);
              background.add(bred);
              bgreen = new JMenuItem("green");
              bgreen.addActionListener(this);
              background.add(bgreen);
              bpink = new JMenuItem("pink");
              bpink.addActionListener(this);
              background.add(bpink);
              tcolor = new JMenu("text color");
              edit.add(tcolor);
              cblue = new JMenuItem("blue");
              cblue.addActionListener(this);
              tcolor.add(cblue);
              cred = new JMenuItem("red");
              cred.addActionListener(this);
              tcolor.add(cred);
              cgreen = new JMenuItem("green");
              cgreen.addActionListener(this);
              tcolor.add(cgreen);
              cpink = new JMenuItem("pink");
              cpink.addActionListener(this);
              tcolor.add(cpink);
              settings = new JMenu("Settings");
              menu.add(settings);
              eset = new JMenuItem("Edit Settings");
              eset.addActionListener(this);
              settings.add(eset);
              help = new JMenu("Help");
              menu.add(help);
              using = new JMenuItem("Using");
              using.addActionListener(this);
              help.add(using);
              about = new JMenuItem("About");
              about.addActionListener(this);
              help.add(about);
              help.add(new JSeparator());
              nver = new JMenuItem("new Versions");
              nver.addActionListener(this);
              help.add(nver);
              note = new JTextArea("");
              try {
                   BufferedReader filein = new BufferedReader(new FileReader("files.txt"));
                   String sfile;
                   while ((sfile = filein.readLine()) != null) {
                        //add buttons per each line of the txt file and show em
              catch (FileNotFoundException ioe) {
                   JOptionPane.showMessageDialog(null, "Iternal Error, contact [email protected] if the error persists", "", JOptionPane.WARNING_MESSAGE);
              catch (IOException ioe) {
                   JOptionPane.showMessageDialog(null, "Iternal Error, contact [email protected] if the error persists", "", JOptionPane.WARNING_MESSAGE);JOptionPane.showMessageDialog(null, "Iternal Error, contact [email protected] if the error persists", "", JOptionPane.WARNING_MESSAGE);
              String[][] data = new String[dat.size()][];
              for (int x = 0; x < dat.size(); x++) {
                   data[x] = (String[])dat.get(x);
              filetable = new JTable(data, columnNames);
              filetable.setPreferredScrollableViewportSize(new Dimension(100, 500));
              JScrollPane scrollpane = new JScrollPane(filetable);
              name = new JTextField("diary");
              JPanel main = new JPanel(new GridLayout(0, 1));
              getContentPane().add(note);
              getContentPane().add(name, BorderLayout.SOUTH);
              getContentPane().add(scrollpane, BorderLayout.WEST);
              setJMenuBar(menu);
         public void actionPerformed(ActionEvent e) {
              if (e.getSource() == nu) {
                   int nuask = JOptionPane.showConfirmDialog(Diary.this, "Are you sure you want to make a new entry?\nThis will erease any unsaved entry's!!");
                   if (nuask == JOptionPane.YES_OPTION) {
                        note.setText("");
                        note.setBackground(Color.WHITE);
                        note.setForeground(Color.BLACK);
              if (e.getSource() == copy) {
                   note.copy();
              if (e.getSource() == paste) {
                   note.paste();
              if (e.getSource() == save) {
                   try {
                        String sn = name.getText();
                    FileWriter outputStream = new FileWriter("saved/" + sn + ".txt");                            
                    setTitle("Diary 1.00 : " + sn);
                    outputStream.write(note.getText());
                    outputStream.close();
                catch(IOException ioe) {
                     System.out.println("IOException");
              if (e.getSource() == exit) {
                   int exitask = JOptionPane.showConfirmDialog(Diary.this, "Are you sure you want to exit? Any unsaved entries will be deleted");
                   if (exitask == JOptionPane.YES_OPTION) {
                        System.exit(0);
              if (e.getSource() == b8) {
                   note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),8));
              if (e.getSource() == b10) {
                   note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),10));
              if (e.getSource() == b12) {
                   note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),12));
              if (e.getSource() == b14) {
                   note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),14));
              if (e.getSource() == b18) {
                   note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),18));
              if (e.getSource() == b20) {
                   note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),20));
              if (e.getSource() == b24) {
                   note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),24));
              if (e.getSource() == b30) {
                   note.setFont(new Font(note.getFont().getName(),note.getFont().getStyle(),30));
              if (e.getSource() == bblue) {
                   note.setBackground(Color.BLUE);
              if (e.getSource() == bred) {
                   note.setBackground(Color.RED);
              if (e.getSource() == bgreen) {
                   note.setBackground(Color.GREEN);
              if (e.getSource() == bpink) {
                   note.setBackground(Color.PINK);
              if (e.getSource() == cblue) {
                   note.setForeground(Color.BLUE);
              if (e.getSource() == cred) {
                   note.setForeground(Color.RED);
              if (e.getSource() == cgreen) {
                   note.setForeground(Color.GREEN);
              if (e.getSource() == cpink) {
                   note.setForeground(Color.PINK);
              if (e.getSource() == eset) {
                   new UserSettings().setVisible(true);
              if (e.getSource() == about) {
                   JOptionPane.showMessageDialog(null, "Created by Collin Doering 2005 in Gr.9\n\nErrors:\n------------------------------------------------------------------\n1. No File Encryption\n2. No user and password Encryption", "", JOptionPane.INFORMATION_MESSAGE );
              if (e.getSource() == nver) {
                   JOptionPane.showMessageDialog(null, "New Version |3.00| expected July, 2005\n\nNew Features\n----------------------------------------------\n1. File Encryption\n2. User File Encryption\n3. Full help dialog\n4. More Text changing features", "", JOptionPane.INFORMATION_MESSAGE);
              if (e.getSource() == using) {
                   JOptionPane.showMessageDialog(null, "Go ask Collin Doering\[email protected]", "", JOptionPane.INFORMATION_MESSAGE );
    THANK YOU

    so i still do not understand how i would create one
    button per each line in a txt flle then read in the
    file that the txt file specified.This assumes you know how many lines there are in the file.
    If not, modify as per my prior post
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Testing extends JFrame
      String[] linesInFile = {"Hello","World","Goodbye","Now"};
      JButton[] btn = new JButton[linesInFile.length];
      public Testing()
        setLocation(200,200);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel jp = new JPanel(new GridLayout(0,1));
        for(int x = 0; x < btn.length; x++)
          btn[x] = new JButton(linesInFile[x]);//<---this would be where file.readLine() goes
          jp.add(btn[x]);
          btn[x].addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent ae){
              JOptionPane.showMessageDialog(getContentPane(),ae.getActionCommand());}});
        getContentPane().add(jp);
        pack();
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • How to create apple id for mac app store without using credit card and there is no any option for payment none. please tell how to download free apps from mac app store

    how to create apple id for mac app store without using credit card and there is no any option for payment none. please tell how to download free apps from mac app store

    my problem solve by me
    first create apple id
    fill credit card details
    and complete your account creating  process.
    than go to app store or itune store
    login your acount
    click right side  - account button
    than again login for account setting
    next go to payment information and click edit button
    when u enter payment infomation
    click none button in payment method and click done button.
    than ur credit card has been removed.
    but rs. 60 will deducted in your account when u doing this process.

  • How to create a procedure in oracle to write the data into file

    Hi All,
    I am just wondered on how to create a procedure which will do following tasks:
    1. Concat the field names
    2. Union all the particular fields
    3. Convert the date field into IST
    4. Prepare the statement
    5. write the data into a file
    Basically what I am trying to achieve is to convert one mysql proc to oracle. MySQL Proc is as follows:
    DELIMITER $$
    USE `jioworld`$$
    DROP PROCEDURE IF EXISTS `usersReport`$$
    CREATE DEFINER=`root`@`%` PROCEDURE `usersReport`(IN pathFile VARCHAR(255),IN startDate TIMESTAMP,IN endDate TIMESTAMP )
    BEGIN
    SET @a= CONCAT("(SELECT 'User ID','Account ID','Gender','Birthdate','Account Registered On') UNION ALL (SELECT IFNULL(a.riluid,''),IFNULL(a.rilaccountid,''),IFNULL(a.gender,''),IFNULL(a.birthdate,''),IFNULL(CONVERT_TZ(a.creationDate,'+0:00','+5:30'),'') INTO OUTFILE '",pathFile,"' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\n' FROM account_ a where a.creationDate>='",startDate,"' and a.creationdate <='",endDate,"')");
    PREPARE stmt FROM @a;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt ;
    END$$
    DELIMITER ;
    Regards,
    Vishal G

    1. Concat the field names
    Double Pipe (||) is the concatenation operator in Oracle. There is also a function CONCAT for this purpose
    2. Union all the particular fields
    Not sure what do you mean by UNION ALL particular fields? UNION ALL is a set operation applied on two different result sets that have the same projection.
    3. Convert the date field into IST
    SQL> select systimestamp "Default Time"
      2       , systimestamp at time zone 'Asia/Calcutta' "IST Time"
      3    from dual;
    Default Time                                       IST Time
    05-05-15 03:14:52.346099 AM -04:00                 05-05-15 12:44:52.346099 PM ASIA/CALCUTTA
    4. Prepare the statement
    What do you mean by prepare the statement?
    5. write the data into a file
    You can use the API UTL_FILE to write to a file.

  • Procedure for Exporting database

    Hi All,
    As i am really bad in coding, i am trying to learn ....so hope you all don't mind.
    I am trying to write a procedure which will take the database export, and schedule it in a job for 9.2.0.8 database.I have created a procedure for 10g using dbms_datapump and its successful.
    In 9i i tried the following
    1. create or replace a directory 'EXP'
    2. Created a text file into the directory containing the exp command (exp_batch.txt)
    3. create a procedure
    CREATE OR REPLACE PROCEDURE EXP
    as
    vInHandle utl_file.file_type;
    vNewLine VARCHAR2(2000);
    BEGIN
    vInHandle := utl_file.fopen('EXP', 'exp_batch.txt', 'R');
    LOOP
        BEGIN
          utl_file.get_line(vInHandle, vNewLine);
    EXCEPTION
    when others then
           raise_application_error(
               -20000, 'Unable to get line because of: '||
               sqlerrm);
    END;
    execute immediate vNewLine;
    UTL_FILE.FCLOSE(vInHandle);
    end loop;
    end;
    Procedure created.The procedure is created , but when i execute it
    21:34:15 ravan >exec exp;
    BEGIN exp; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EXP'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredThe exp_batch.txt contains
    @date /t > E:\oracle\exp\cp.txt
    @for /F "tokens=1,2" %%i in (E:\oracle\exp\cp.txt) DO @echo %%j> E:\oracle\exp\cp.txt
    @for /F "delims=/  tokens=1,2,3" %%i in (E:\oracle\exp\cp.txt) DO @EXP 'sys/xxx@ravan as sysdba'  FILE=E:\oracle\exp\FULL_%%j-%%i-%%k.DMP LOG=E:\oracle\exp\FULL_%%j-%%i-%%k.LOG full=y
    @for /F "delims=/  tokens=1,2,3" %%i in (E:\oracle\exp\cp.txt) DO "C:\Program Files\WinRAR\WinRAR.exe"  E:\oracle\exp\FULL__%%j-%%i-%%k  E:\oracle\exp\FULL_%%j-%%i-%%k.DMPSO, can we do something like this, if yes then how.This is just for testing.
    Thanks & Regards,
    Anand

    Anand,
    Instead of writing a complex procedure you can simply write a batch script ( or shell script and you can use cygwin). I use cygwin to use the shell scripting on windows and it works fien and do wonder.
    Regards

  • How to create transaction code for a Z-table

    How to create transaction code for a Z-table?
    Se93 --> then which radio button to be selected? and what is the program nam e to  be given

    Hi Sam,
    <b>Procedure to create a TCODE for ZTABLE:</b>
    Create a table maintainance/View for the Z* Table.
    Once you create the view goto SE93>Select Parameter transaction and give the short desc.>
    Give the transaction as SM30(Skip the first screen-optional)>Check all check boxes under GUI support>In the default values(grid)section first row give the VIEWNAME as you created initially and the second row UPDATE as X.
    <u><i>Se93 --> then which radio button to be selected</i></u>
    Select the parameter transaction as a radio button.
    <u><i>what is the program nam e to be given</i></u>
    no need to give any program name. Instead you have to give the transaction code name as SM30.
    Pls mark the helpful answers.
    Thanks
    Eswar

  • How to configure release procedure for rate contracts release

    Dear all,
    How to configure release procedure for rate  contract following are the requirements
    they are two release codes c1 & c2 <=100000,>=100000
                    if  c1 is not there c2 has to be approved
         Change in the value of the rate contract contract
         Change in the validity of the rate contract
         Addition of deletion of line items
    While using a non u2013 released rate contract in the PO an error message should shoot out.
    Also the logic should be changed while using the rate contract in the PO.
    The usage of the rate contract should be till the validity of the rate contract. i.e. the measurement should be end date of the rate contract and the PO creation date and not the delivery date of the PO. &
    It should be possible to refer existing valid rate contracts in purchase orders.
    Regards,
    bhaskar

    Hi,
    In SAP rate contract is known as value contract denoted with wk. The release procedure for rate contract is same as that of other contracts and scheduling agreements. The tables  for contracts will vary with SA (Scheduling agreement) .You may try and maintain condition records based on the customer combination and maintian the validity date of condition records as per your requirement.For contract and PO will have the same header/item table as EKKO/EKPO, and the release
    class in standard is the same FRG_EKKO, you can use the same for contract.
    To distinguish if it's a contract or PO, EKKO-BSART can be used.
    For contract EKKO-BSART will be MK or WK, while PO will have NB/UB etc..
    You can restrict the document type to set up the release strategy for only contract.
    Of cause, you can also create your own release class Z* for contract copying standard
    one FRG_EKKO via CL01/Class type 032, and then assign the class Z* to customizing:
    OLME:
    -> contract
    ->Release Procedure for Contracts
    ->Define Release Procedure for Contracts
    ->Release Groups
    If you have already created the PO release class.
    Assign a new chracteristic of Document Category -BSTYP
    Please check below link for detailed release procedure. I hope this wil help you out .Thanking you.
    http://wiki.sdn.sap.com/wiki/display/ERPSCM/RELEASE+PROCEDURE#RELEASEPROCEDURE-TABLESUSEDFORRELEASEPROCEDURES

  • How to create Search Help for a field in Table control !!

    Hello Friends,
                  I like to know - How to create Search Help for a field in Table control. Is it possible, if it is please share ur knowledge, I wud be happy if U provide some source code example for this.
    Thanks,
    Senthil

    Check the sample code:
    *&  Include           ZSRO_MPRN_SEARCH                                 *
    MODULE PSTLZ_F4 INPUT
    MODULE pstlz_f4 INPUT.
    reading post code
      DATA: stepl TYPE systepl,
            stepl_index TYPE systepl.
      CLEAR: stepl, stepl_index.
      CLEAR:   lt_returntab,lt_dynpfields,i_mprn1.
      REFRESH: lt_returntab,lt_dynpfields,i_mprn1.
      lt_dynpfields-fieldname = 'I_MPRN-POST_CODE'.
      lt_dynpfields-stepl     = stepl.
      APPEND lt_dynpfields. CLEAR lt_dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
          translate_to_upper   = c_x
          determine_loop_index = c_x
        TABLES
          dynpfields           = lt_dynpfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc EQ 0.
        READ TABLE lt_dynpfields INDEX 1.
      ENDIF.
      ws_outcode  = lt_dynpfields-fieldvalue.
      stepl_index = lt_dynpfields-stepl.
      REPLACE '*' WITH ' ' INTO lt_dynpfields-fieldvalue.
      IF NOT lt_dynpfields-fieldvalue IS INITIAL.
        MOVE lt_dynpfields-fieldvalue TO ws_outcode.
        ws_len = STRLEN( lt_dynpfields-fieldvalue ).
        IF ws_len GE 7.
          ws_len = ws_len - 3.
         ws_icode = ws_code+ws_len(3).
          lt_dynpfields-fieldvalue = lt_dynpfields-fieldvalue+0(ws_len).
          CONCATENATE lt_dynpfields-fieldvalue '%'
              INTO ws_outcode.
          CONDENSE lt_dynpfields-fieldvalue.
       REPLACE ws_icode WITH ' ' INTO lt_dynpfields-fieldvalue.
        ELSE.
          CONCATENATE lt_dynpfields-fieldvalue+0(4) '%'
            INTO ws_outcode.
        ENDIF.
       ws_ocode = ws_code+0(3).
      ENDIF.
    reading MPRN
      CLEAR:   lt_returntab,lt_dnpfields,i_mprn1.
      REFRESH: lt_returntab,lt_dnpfields,i_mprn1.
      lt_dnpfields-fieldname = 'I_MPRN-MPRN'.
      lt_dnpfields-stepl     = stepl_index.
      APPEND lt_dnpfields. CLEAR lt_dnpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
          translate_to_upper   = 'X'
        TABLES
          dynpfields           = lt_dnpfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc EQ 0.
        READ TABLE lt_dnpfields INDEX 1.
      ENDIF.
    MPRN blank and Post code exist
      IF lt_dnpfields-fieldvalue IS INITIAL.
        IF NOT lt_dynpfields-fieldvalue IS INITIAL.
          SELECT mprn ser_num sub_bud bud_name del_pt_alias
                 bud_num dep_street prin_street dbl_dep_street
                 dep_locty post_town county outcode incode
                 lg_site_ind file_date FROM zspa_mprn INTO
                 CORRESPONDING FIELDS OF TABLE i_mprn1
                 WHERE outcode LIKE ws_outcode.
        ELSE.
    MPRN blank and Post code blank
          SELECT mprn ser_num sub_bud bud_name del_pt_alias
                 bud_num dep_street prin_street dbl_dep_street
                 dep_locty post_town county outcode incode
                 lg_site_ind file_date FROM zspa_mprn INTO
                 CORRESPONDING FIELDS OF TABLE i_mprn1.
        ENDIF.
      ELSE.
    MPRN exist and Post code exist
        IF NOT lt_dynpfields-fieldvalue IS INITIAL.
          SELECT mprn ser_num sub_bud bud_name del_pt_alias
                 bud_num dep_street prin_street dbl_dep_street
                 dep_locty post_town county outcode incode
                 lg_site_ind file_date FROM zspa_mprn INTO
                 CORRESPONDING FIELDS OF TABLE i_mprn1
                 WHERE outcode LIKE ws_outcode AND
                       mprn EQ lt_dnpfields-fieldvalue.
        ELSE.
    MPRN exist and Post code blank
          SELECT mprn ser_num sub_bud bud_name del_pt_alias
                 bud_num dep_street prin_street dbl_dep_street
                 dep_locty post_town county outcode incode
                 lg_site_ind file_date FROM zspa_mprn INTO
                 CORRESPONDING FIELDS OF TABLE i_mprn1
                 WHERE mprn EQ lt_dnpfields-fieldvalue.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'MPRN'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          window_title    = 'Select MPRN'
          value_org       = 'S'
        TABLES
          value_tab       = i_mprn1 "lt_mprn
          return_tab      = lt_returntab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc EQ 0.
        READ TABLE lt_returntab INDEX 1.
        READ TABLE i_mprn1 WITH KEY mprn = lt_returntab-fieldval.
        IF sy-subrc EQ 0.
    Updating post code
          CONCATENATE i_mprn1-outcode  i_mprn1-incode
                        INTO ws_postcode
                             SEPARATED BY space.
          MOVE ws_postcode TO i_mprn-post_code.
          CLEAR   : i_dnpfld,
                    ws_dynpfld.
          REFRESH : i_dnpfld.
          ws_dyname   = 'ZSRO_MASTER_DATA'.
          ws_dynumb   = '0301'.
          ws_dynpfld-fieldname  ='I_MPRN-POST_CODE'.
          ws_dynpfld-fieldvalue = ws_postcode .
          ws_dynpfld-stepl      = stepl_index.
          APPEND ws_dynpfld TO i_dnpfld.
          CALL FUNCTION 'DYNP_VALUES_UPDATE'
            EXPORTING
              dyname               = ws_dyname
              dynumb               = ws_dynumb
            TABLES
              dynpfields           = i_dnpfld
            EXCEPTIONS
              invalid_abapworkarea = 1
              invalid_dynprofield  = 2
              invalid_dynproname   = 3
              invalid_dynpronummer = 4
              invalid_request      = 5
              no_fielddescription  = 6
              undefind_error       = 7
              OTHERS               = 8.
          IF sy-subrc <> 0.
          ENDIF.
    Updating MPRN
          MOVE i_mprn1-mprn TO i_mprn-mprn.
          CLEAR   : i_dnpfld,
                    ws_dynpfld.
          REFRESH : i_dnpfld.
          ws_dyname   = 'ZSRO_MASTER_DATA'.
          ws_dynumb   = '0301'.
          ws_dynpfld-fieldname  ='I_MPRN-MPRN'.
          ws_dynpfld-fieldvalue = i_mprn1-mprn .
          ws_dynpfld-stepl      = stepl_index.
          APPEND ws_dynpfld TO i_dnpfld.
          CALL FUNCTION 'DYNP_VALUES_UPDATE'
            EXPORTING
              dyname               = ws_dyname
              dynumb               = ws_dynumb
            TABLES
              dynpfields           = i_dnpfld
            EXCEPTIONS
              invalid_abapworkarea = 1
              invalid_dynprofield  = 2
              invalid_dynproname   = 3
              invalid_dynpronummer = 4
              invalid_request      = 5
              no_fielddescription  = 6
              undefind_error       = 7
              OTHERS               = 8.
          IF sy-subrc <> 0.
          ENDIF.
        ENDIF.
      ELSEIF sy-subrc EQ 2.
        MESSAGE s005(zspa) WITH ws_postcode .
      ENDIF.
    ENDMODULE.                    "PSTLZ_F4 INPUT
    MODULE MPRN_F4 INPUT
    MODULE mprn_f4 INPUT.
    reading post code
    DATA: stepl TYPE systepl,
           stepl_index TYPE systepl.
      CLEAR: stepl, stepl_index.
      CLEAR:   lt_returntab,lt_dynpfields,i_mprn1.
      REFRESH: lt_returntab,lt_dynpfields,i_mprn1.
      lt_dynpfields-fieldname = 'I_MPRN-POST_CODE'.
      lt_dynpfields-stepl     = stepl.
      APPEND lt_dynpfields. CLEAR lt_dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
          translate_to_upper   = c_x
          determine_loop_index = c_x
        TABLES
          dynpfields           = lt_dynpfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc EQ 0.
        READ TABLE lt_dynpfields INDEX 1.
      ENDIF.
      ws_outcode = lt_dynpfields-fieldvalue.
      stepl_index = lt_dynpfields-stepl.
      REPLACE '*' WITH ' ' INTO lt_dynpfields-fieldvalue.
      IF NOT lt_dynpfields-fieldvalue IS INITIAL.
        MOVE lt_dynpfields-fieldvalue TO ws_outcode.
        ws_len = STRLEN( lt_dynpfields-fieldvalue ).
        IF ws_len GE 7.
          ws_len = ws_len - 3.
         ws_icode = ws_code+ws_len(3).
          lt_dynpfields-fieldvalue = lt_dynpfields-fieldvalue+0(ws_len).
          CONCATENATE lt_dynpfields-fieldvalue '%'
              INTO ws_outcode.
          CONDENSE lt_dynpfields-fieldvalue.
       REPLACE ws_icode WITH ' ' INTO lt_dynpfields-fieldvalue.
        ELSE.
          CONCATENATE lt_dynpfields-fieldvalue+0(4) '%'
            INTO ws_outcode.
        ENDIF.
       ws_ocode = ws_code+0(3).
      ENDIF.
    reading MPRN
      CLEAR:   lt_returntab,lt_dnpfields,i_mprn1.
      REFRESH: lt_returntab,lt_dnpfields,i_mprn1.
      lt_dnpfields-fieldname = 'I_MPRN-MPRN'.
      lt_dnpfields-stepl     = stepl_index.
      APPEND lt_dnpfields. CLEAR lt_dnpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
          translate_to_upper   = 'X'
        TABLES
          dynpfields           = lt_dnpfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc EQ 0.
        READ TABLE lt_dnpfields INDEX 1.
      ENDIF.
    MPRN blank and Post code exist
      IF lt_dnpfields-fieldvalue IS INITIAL.
        IF NOT lt_dynpfields-fieldvalue IS INITIAL.
          SELECT mprn ser_num sub_bud bud_name del_pt_alias
                 bud_num dep_street prin_street dbl_dep_street
                 dep_locty post_town county outcode incode
                 lg_site_ind file_date FROM zspa_mprn INTO
                 CORRESPONDING FIELDS OF TABLE i_mprn1
                 WHERE outcode LIKE ws_outcode.
        ELSE.
    MPRN blank and Post code blank
          SELECT mprn ser_num sub_bud bud_name del_pt_alias
                 bud_num dep_street prin_street dbl_dep_street
                 dep_locty post_town county outcode incode
                 lg_site_ind file_date FROM zspa_mprn INTO
                 CORRESPONDING FIELDS OF TABLE i_mprn1.
        ENDIF.
      ELSE.
    MPRN exist and Post code exist
        IF NOT lt_dynpfields-fieldvalue IS INITIAL.
          SELECT mprn ser_num sub_bud bud_name del_pt_alias
                 bud_num dep_street prin_street dbl_dep_street
                 dep_locty post_town county outcode incode
                 lg_site_ind file_date FROM zspa_mprn INTO
                 CORRESPONDING FIELDS OF TABLE i_mprn1
                 WHERE outcode LIKE ws_outcode AND
                       mprn EQ lt_dnpfields-fieldvalue.
        ELSE.
    MPRN exist and Post code blank
          SELECT mprn ser_num sub_bud bud_name del_pt_alias
                 bud_num dep_street prin_street dbl_dep_street
                 dep_locty post_town county outcode incode
                 lg_site_ind file_date FROM zspa_mprn INTO
                 CORRESPONDING FIELDS OF TABLE i_mprn1
                 WHERE mprn EQ lt_dnpfields-fieldvalue.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'MPRN'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          window_title    = 'Select MPRN'
          value_org       = 'S'
        TABLES
          value_tab       = i_mprn1 "lt_mprn
          return_tab      = lt_returntab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc EQ 0.
        READ TABLE lt_returntab INDEX 1.
        READ TABLE i_mprn1 WITH KEY mprn = lt_returntab-fieldval.
        IF sy-subrc EQ 0.
    Updating MPRN
          MOVE i_mprn1-mprn TO i_mprn-mprn.
          CLEAR   : i_dnpfld,
                    ws_dynpfld.
          REFRESH : i_dnpfld.
          ws_dyname   = 'ZSRO_MASTER_DATA'.
          ws_dynumb   = '0301'.
          ws_dynpfld-fieldname  ='I_MPRN-MPRN'.
          ws_dynpfld-fieldvalue = i_mprn1-mprn .
          ws_dynpfld-stepl      = stepl_index.
          APPEND ws_dynpfld TO i_dnpfld.
    **code changed by laxman 10.08.2005
         ws_dynpfld-stepl  = mprn-current_line.
    **code changed by laxman 10.08.2005
          CALL FUNCTION 'DYNP_VALUES_UPDATE'
            EXPORTING
              dyname               = ws_dyname
              dynumb               = ws_dynumb
            TABLES
              dynpfields           = i_dnpfld
            EXCEPTIONS
              invalid_abapworkarea = 1
              invalid_dynprofield  = 2
              invalid_dynproname   = 3
              invalid_dynpronummer = 4
              invalid_request      = 5
              no_fielddescription  = 6
              undefind_error       = 7
              OTHERS               = 8.
          IF sy-subrc <> 0.
          ENDIF.
    Updating post code
          CONCATENATE i_mprn1-outcode  i_mprn1-incode
                        INTO ws_postcode
                             SEPARATED BY space.
          MOVE ws_postcode TO i_mprn-post_code.
          CLEAR   : i_dnpfld,
                    ws_dynpfld.
          REFRESH : i_dnpfld.
          ws_dyname   = 'ZSRO_MASTER_DATA'.
          ws_dynumb   = '0301'.
          ws_dynpfld-fieldname  ='I_MPRN-POST_CODE'.
          ws_dynpfld-fieldvalue = ws_postcode .
          ws_dynpfld-stepl      = stepl_index.
          APPEND ws_dynpfld TO i_dnpfld.
    **code changed by laxman 10.08.2005
         break gblap0.
         ws_dynpfld-stepl  = mprn-current_line.
         LOOP AT i_mprn.
           MOVE i_mprn1-mprn TO i_mprn-mprn.
           MOVE ws_postcode TO i_mprn-post_code.
           MODIFY i_mprn INDEX
                    mprn-current_line." transporting MPRN POST_CODE.
         ENDLOOP.
    **code changed by laxman 10.08.2005
          CALL FUNCTION 'DYNP_VALUES_UPDATE'
            EXPORTING
              dyname               = ws_dyname
              dynumb               = ws_dynumb
            TABLES
              dynpfields           = i_dnpfld
            EXCEPTIONS
              invalid_abapworkarea = 1
              invalid_dynprofield  = 2
              invalid_dynproname   = 3
              invalid_dynpronummer = 4
              invalid_request      = 5
              no_fielddescription  = 6
              undefind_error       = 7
              OTHERS               = 8.
          IF sy-subrc <> 0.
          ENDIF.
        ENDIF.
      ELSEIF sy-subrc EQ 2.
        MESSAGE s006(zspa) WITH i_mprn1-mprn .
      ENDIF.
    ENDMODULE.                    "MPRN_F4 INPUT
    MODULE GNTC_F4 INPUT
    MODULE gntc_f4 INPUT.
      DATA: BEGIN OF lt_gntc OCCURS 0,
              gntc LIKE iflot-zzgntc,
            END OF lt_gntc.
      CLEAR:   lt_returntab, lt_gntc.
      REFRESH: lt_returntab, lt_gntc.
      lt_gntc-gntc = 'DM'.
      APPEND lt_gntc. CLEAR lt_gntc.
      lt_gntc-gntc = 'NDM'.
      APPEND lt_gntc. CLEAR lt_gntc.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ZZGNTC'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          window_title    = 'Select Gas Nomination Type Code'
          value_org       = 'S'
        TABLES
          value_tab       = lt_gntc
          return_tab      = lt_returntab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc EQ 0.
        READ TABLE lt_returntab INDEX 1.
        i_mprn-dm_ndm = lt_returntab-fieldval.
      ENDIF.
    ENDMODULE.                    "GNTC_F4 INPUT
    *&      Module  mprn1_f4  INPUT
          text
    MODULE mprn1_f4 INPUT.
      DATA: lt_f4          TYPE ddshretval OCCURS 0 WITH HEADER LINE,
            lt_returntab1  LIKE ddshretval OCCURS 0 WITH HEADER LINE,
            lt_dynpfields1 LIKE dynpread OCCURS 0 WITH HEADER LINE,
            lt_dnpfields1  LIKE dynpread OCCURS 0 WITH HEADER LINE.
      DATA: stepl1 TYPE systepl,
            stepl_index1 TYPE systepl.
      DATA : i_dnpfld1      LIKE dynpread OCCURS 0 WITH HEADER LINE,
             ws_dyname1     LIKE d020s-prog,
             ws_dynumb1     LIKE d020s-dnum,
             ws_dynpfld1    LIKE dynpread.
      CLEAR: i_dnpfld1,  ws_dyname1, ws_dynumb1, ws_dynpfld1,
             lt_f4, lt_returntab1,lt_dynpfields1, lt_f4,
             stepl1, stepl_index1.
      REFRESH: i_dnpfld1, lt_returntab1,lt_dynpfields1, lt_f4.
    To Determine Steploop Index
      lt_dynpfields1-fieldname = 'I_MPRN-POST_CODE'.
      lt_dynpfields1-stepl     = stepl1.
      APPEND lt_dynpfields1. CLEAR lt_dynpfields1.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
          translate_to_upper   = 'X'
          determine_loop_index = 'X'
        TABLES
          dynpfields           = lt_dynpfields1
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc EQ 0.
        READ TABLE lt_dynpfields1 INDEX 1.
      ENDIF.
      stepl_index1 = lt_dynpfields1-stepl.
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
        EXPORTING
          tabname           = 'IFLOT'
          fieldname         = 'I_MPRN-MPRN'
          searchhelp        = 'ZS_MPRN_PC'
          dynpprog          = sy-repid
          dynpnr            = sy-dynnr
        TABLES
          return_tab        = lt_f4
        EXCEPTIONS
          field_not_found   = 1
          no_help_for_field = 2
          inconsistent_help = 3
          no_values_found   = 4
          OTHERS            = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Update tablecontrol
      READ TABLE lt_f4 WITH KEY fieldname = 'MPRN'.
      IF sy-subrc = 0.
        MOVE lt_f4-fieldval TO i_mprn-mprn.
        ws_dyname1   = 'ZSRO_MASTER_DATA'.
        ws_dynumb1   = '0301'.
        ws_dynpfld1-fieldname  ='I_MPRN-MPRN'.
        ws_dynpfld1-fieldvalue = i_mprn-mprn.
        ws_dynpfld1-stepl      = stepl_index1.
        APPEND ws_dynpfld1 TO i_dnpfld1.
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname               = ws_dyname1
            dynumb               = ws_dynumb1
          TABLES
            dynpfields           = i_dnpfld1
          EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
      CLEAR  : i_dnpfld1, ws_dynpfld1.
      REFRESH: i_dnpfld1.
      READ TABLE lt_f4 WITH KEY fieldname = 'ZZPSTLZ'.
      IF sy-subrc = 0.
        MOVE lt_f4-fieldval TO i_mprn-post_code.
        ws_dyname1   = 'ZSRO_MASTER_DATA'.
        ws_dynumb1   = '0301'.
        ws_dynpfld1-fieldname  ='I_MPRN-POST_CODE'.
        ws_dynpfld1-fieldvalue = i_mprn-post_code.
        ws_dynpfld1-stepl      = stepl_index1.
        APPEND ws_dynpfld1 TO i_dnpfld1.
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname               = ws_dyname1
            dynumb               = ws_dynumb1
          TABLES
            dynpfields           = i_dnpfld1
          EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " mprn1_f4  INPUT
    *&      Module  pstlz1_f4  INPUT
          text
    MODULE pstlz1_f4 INPUT.
      CLEAR: i_dnpfld1,  ws_dyname1, ws_dynumb1, ws_dynpfld1,
              lt_f4, lt_returntab1,lt_dynpfields1, lt_f4,
              stepl1, stepl_index1.
      REFRESH: i_dnpfld1, lt_returntab1,lt_dynpfields1, lt_f4.
    To Determine Steploop Index
      lt_dynpfields1-fieldname = 'I_MPRN-MPRN'.
      lt_dynpfields1-stepl     = stepl1.
      APPEND lt_dynpfields1. CLEAR lt_dynpfields1.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
          translate_to_upper   = 'X'
          determine_loop_index = 'X'
        TABLES
          dynpfields           = lt_dynpfields1
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc EQ 0.
        READ TABLE lt_dynpfields1 INDEX 1.
      ENDIF.
      stepl_index1 = lt_dynpfields1-stepl.
      CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
        EXPORTING
          tabname           = 'IFLOT'
          fieldname         = 'I_MPRN-POST_CODE'
          searchhelp        = 'ZS_MPRN_PC'
          dynpprog          = sy-repid
          dynpnr            = sy-dynnr
        TABLES
          return_tab        = lt_f4
        EXCEPTIONS
          field_not_found   = 1
          no_help_for_field = 2
          inconsistent_help = 3
          no_values_found   = 4
          OTHERS            = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Update tablecontrol
      READ TABLE lt_f4 WITH KEY fieldname = 'ZZPSTLZ'.
      IF sy-subrc = 0.
        MOVE lt_f4-fieldval TO i_mprn-post_code.
        ws_dyname1   = 'ZSRO_MASTER_DATA'.
        ws_dynumb1   = '0301'.
        ws_dynpfld1-fieldname  ='I_MPRN-POST_CODE'.
        ws_dynpfld1-fieldvalue = i_mprn-post_code.
        ws_dynpfld1-stepl      = stepl_index1.
        APPEND ws_dynpfld1 TO i_dnpfld1.
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname               = ws_dyname1
            dynumb               = ws_dynumb1
          TABLES
            dynpfields           = i_dnpfld1
          EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
      CLEAR  : i_dnpfld1, ws_dynpfld1.
      REFRESH: i_dnpfld1.
      READ TABLE lt_f4 WITH KEY fieldname = 'MPRN'.
      IF sy-subrc = 0.
        MOVE lt_f4-fieldval TO i_mprn-mprn.
        ws_dyname1   = 'ZSRO_MASTER_DATA'.
        ws_dynumb1   = '0301'.
        ws_dynpfld1-fieldname  ='I_MPRN-MPRN'.
        ws_dynpfld1-fieldvalue = i_mprn-mprn.
        ws_dynpfld1-stepl      = stepl_index1.
        APPEND ws_dynpfld1 TO i_dnpfld1.
        CALL FUNCTION 'DYNP_VALUES_UPDATE'
          EXPORTING
            dyname               = ws_dyname1
            dynumb               = ws_dynumb1
          TABLES
            dynpfields           = i_dnpfld1
          EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " pstlz1_f4  INPUT
    Regards,
    Prakash.

  • How to create search path for the file on the desktop..

    hello experts..
          I have used gui_upload module to upload the data from flatfile to the internal table, in that how can i create search path for the file selection in the selection screen, also please help me the code to update the ztable.
    thanks

    HI
      If iam not wrong you want to select a file from a location that you don't know so if this is ur problem then use the function module
    F4_FILENAME
    this FM helps to locate and select the desired file from the system.
    Sample code that you can check is
    How to get windows filename
    PARAMETERS: lv_file LIKE rlgrap-filename.
    Method 1
        CALL FUNCTION u2019KD_GET_FILENAME_ON_F4u2019
        EXPORTING
        MASK = u2019,.txt,.*u2019
        STATIC = u2019Xu2019
        CHANGING
        FILE_NAME = LV_FILE.
    Method 2
    CALL FUNCTION u2019F4_FILENAMEu2019
    EXPORTING
             program_name = syst-cprog
             dynpro_number = syst-dynnr
             field_name  = u2019 u2019
         IMPORTING
             file_name   = LV_FILE.
    Regards
    Pavan

  • Writing a store procedure  for deleting records

    how can i write a store procedure for deleting records from a table.
    i have a table called employees
    empid
    empname
    deptid
    and table department
    deptid
    dept
    floor
    how can i write a store procedure which would delete records of employees from employees table for particular department when i delete that department from department table.
    thanks

    872959 wrote:
    how can i write a store procedure for deleting records from a table.
    i have a table called employees
    empid
    empname
    deptid
    and table department
    deptid
    dept
    floor
    how can i write a store procedure which would delete records of employees from employees table for particular department when i delete that department from department table.
    thanksDoes not seem to be a sound design, to me.
    Employees do not go missing when organization change is made & department is eliminated.
    If you insist such nonsense, write TRIGGER to issue desired DML

Maybe you are looking for

  • How do I access an external hard drive that is plugged into an AirPort Extreme

    I have an external hard drive connected to my AirPort Extreme and I wanted to know how to access the photos and videos on it while using an iPhone or iPad while connected to the network.  When I go to the airport utility app on my phone or iPad I can

  • Smartform in Abap Webdynpro

    Hi Expert, I am new to SmartForm and WDP. I try to follow the below instruction to do, but got lots of error. Could anyone help me on this? http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785 My sma

  • Everytime I sync my iPad 2 to iTunes it gives me the 1651 error. Can I prevent this from happening?

    I have an iPad 2 3G but no sim card inserted as I just use wifi hot spot from my phone (iPad was a gift. Shouldn't have gotten me the 3g version).  Anyway, everytime I connect it to sync I get the error "iTunes could not check for an update to the ca

  • Incident Tracking Packaged Application error

    I installed the "Incident Tracking" prepackaged application that came with my APEX 4.2. Inside the application, I created a new "Assignee" and then proceeded to assign a ticket (via Tickets screen) to the newly created assignee. When I do this, it th

  • I need to specify a "style"

    I am working thru the book that Jono suggested (Thank you Jono) "Creating Dynamic Forms with Adobe LiveCycle Designer" by J.P.Terry and I'm on the second to the last chapter where I need to create a Translation document by linking to a Translation We